core: execute callback functions for event SREV_RCV_NOSIP
authorDaniel-Constantin Mierla <miconda@gmail.com>
Fri, 18 Jul 2014 14:03:40 +0000 (16:03 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Fri, 18 Jul 2014 15:00:53 +0000 (17:00 +0200)
- it is done only if parsing sip message fails
- reminder that the log level for core parsing error can be controlled
  with corelog global parameter

receive.c

index 322c5f5..62ad047 100644 (file)
--- a/receive.c
+++ b/receive.c
@@ -142,11 +142,13 @@ 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){
-               LOG(cfg_get(core, core_cfg, corelog),
+               if(sr_event_exec(SREV_RCV_NOSIP, (void*)msg)!=0) {
+                       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);
+                       sr_core_ert_run(msg, SR_CORE_ERT_RECEIVE_PARSE_ERROR);
+               }
                goto error02;
        }
        DBG("After parse_msg...\n");