Module: kamailio
Branch: master
Commit: 6291db5522f152d65b95e828f14655c2235d2103
URL:
https://github.com/kamailio/kamailio/commit/6291db5522f152d65b95e828f14655c…
Author: Alexandr Dubovikov <alexandr.dubovikov(a)gmail.com>
Committer: Alexandr Dubovikov <alexandr.dubovikov(a)gmail.com>
Date: 2016-08-01T17:39:03+02:00
core: added more flexible processing for nonsip_hook messages
---
Modified: parser/parse_fline.c
Modified: receive.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6291db5522f152d65b95e828f14655c…
Patch:
https://github.com/kamailio/kamailio/commit/6291db5522f152d65b95e828f14655c…
---
diff --git a/parser/parse_fline.c b/parser/parse_fline.c
index ac0b461..5b2d346 100644
--- a/parser/parse_fline.c
+++ b/parser/parse_fline.c
@@ -254,7 +254,7 @@ char* parse_first_line(char* buffer, unsigned int len, struct
msg_start* fl)
};
error1:
fl->type=SIP_INVALID;
- LOG(L_ERR, "parse_first_line: bad message (offset: %d)\n", offset);
+ LOG(cfg_get(core, core_cfg, corelog), "parse_first_line: bad message (offset:
%d)\n", offset);
/* skip line */
nl=eat_line(buffer,len);
return nl;
diff --git a/receive.c b/receive.c
index b94b921..8ddf3e9 100644
--- a/receive.c
+++ b/receive.c
@@ -172,14 +172,14 @@ int receive_msg(char* buf, unsigned int len, struct receive_info*
rcv_info)
if(likely(sr_msg_time==1)) msg_set_time(msg);
if (parse_msg(buf,len, msg)!=0){
- if(sr_event_exec(SREV_RCV_NOSIP, (void*)msg)!=0) {
+ if((ret=sr_event_exec(SREV_RCV_NOSIP, (void*)msg))<NONSIP_MSG_DROP) {
LOG(cfg_get(core, core_cfg, corelog),
"core parsing of SIP message failed (%s:%d/%d)\n",
ip_addr2a(&msg->rcv.src_ip), (int)msg->rcv.src_port,
(int)msg->rcv.proto);
sr_core_ert_run(msg, SR_CORE_ERT_RECEIVE_PARSE_ERROR);
- }
- goto error02;
+ }
+ else if(ret == NONSIP_MSG_DROP) goto error02;
}
LM_DBG("After parse_msg...\n");