[sr-dev] git:master:4fc96976: core: execute SREV_NET_DATA_RECV event

Daniel-Constantin Mierla miconda at gmail.com
Mon Jan 11 22:50:55 CET 2016


Module: kamailio
Branch: master
Commit: 4fc969760d8eec6355ce661ccd3c5fd9ad2a36f0
URL: https://github.com/kamailio/kamailio/commit/4fc969760d8eec6355ce661ccd3c5fd9ad2a36f0

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-01-11T22:24:28+01:00

core: execute SREV_NET_DATA_RECV event

---

Modified: receive.c

---

Diff:  https://github.com/kamailio/kamailio/commit/4fc969760d8eec6355ce661ccd3c5fd9ad2a36f0.diff
Patch: https://github.com/kamailio/kamailio/commit/4fc969760d8eec6355ce661ccd3c5fd9ad2a36f0.patch

---

diff --git a/receive.c b/receive.c
index 8a633cd..a9e1fc3 100644
--- a/receive.c
+++ b/receive.c
@@ -91,6 +91,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
 	unsigned int diff;
 #endif
 	str inb;
+	sr_net_info_t netinfo;
 
 	inb.s = buf;
 	inb.len = len;
@@ -139,6 +140,14 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
 	/* ... clear branches from previous message */
 	clear_branches();
 
+	if(sr_event_enabled(SREV_NET_DATA_RECV)) {
+		memset(&netinfo, 0, sizeof(sr_net_info_t));
+		netinfo.data.s = msg->buf;
+		netinfo.data.len = msg->len;
+		netinfo.rcv = rcv_info;
+		sr_event_exec(SREV_NET_DATA_RECV, (void*)&netinfo);
+	}
+
 	if (msg->first_line.type==SIP_REQUEST){
 		ruri_mark_new(); /* ruri is usable for forking (not consumed yet) */
 		if (!IS_SIP(msg)){




More information about the sr-dev mailing list