[sr-dev] git:master:46436cf8: tcp: checks for event route index on close

Daniel-Constantin Mierla miconda at gmail.com
Tue Dec 10 12:39:47 CET 2019


Module: kamailio
Branch: master
Commit: 46436cf8ef7d337c255b2fd9115544a6971f9741
URL: https://github.com/kamailio/kamailio/commit/46436cf8ef7d337c255b2fd9115544a6971f9741

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-12-10T12:38:30+01:00

tcp: checks for event route index on close

---

Modified: src/modules/tcpops/tcpops.c

---

Diff:  https://github.com/kamailio/kamailio/commit/46436cf8ef7d337c255b2fd9115544a6971f9741.diff
Patch: https://github.com/kamailio/kamailio/commit/46436cf8ef7d337c255b2fd9115544a6971f9741.patch

---

diff --git a/src/modules/tcpops/tcpops.c b/src/modules/tcpops/tcpops.c
index 3f66958b6c..cb1728390c 100644
--- a/src/modules/tcpops/tcpops.c
+++ b/src/modules/tcpops/tcpops.c
@@ -239,6 +239,7 @@ static void tcpops_tcp_closed_run_route(tcp_closed_event_info_t *tev)
 	str *evname;
 
 	if(tcpops_event_callback.len > 0) {
+		rt = -1;
 		keng = sr_kemi_eng_get();
 		if(keng == NULL) {
 			LM_DBG("even callback set, but no kemi engine\n");
@@ -261,7 +262,11 @@ static void tcpops_tcp_closed_run_route(tcp_closed_event_info_t *tev)
 	set_route_type(EVENT_ROUTE);
 	init_run_actions_ctx(&ctx);
 	if(keng == NULL) {
-		run_top_route(event_rt.rlist[rt], fmsg, 0);
+		if(rt>=0) {
+			run_top_route(event_rt.rlist[rt], fmsg, 0);
+		} else {
+			LM_DBG("no event route block to execute\n");
+		}
 	} else {
 		if(tev->reason==TCP_CLOSED_TIMEOUT) {
 			evname = &tcpops_evrt_timeout;




More information about the sr-dev mailing list