Module: kamailio Branch: master Commit: 181308465ac54ca4a1404eb3f3f189fcf32e0982 URL: https://github.com/kamailio/kamailio/commit/181308465ac54ca4a1404eb3f3f189fc...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: GitHub noreply@github.com Date: 2016-08-02T19:05:27+02:00
Merge pull request #731 from adubovikov/master
core: added more flexible processing for nonsip_hook messages
---
Modified: parser/parse_fline.c Modified: receive.c
---
Diff: https://github.com/kamailio/kamailio/commit/181308465ac54ca4a1404eb3f3f189fc... Patch: https://github.com/kamailio/kamailio/commit/181308465ac54ca4a1404eb3f3f189fc...
---
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");