Module: kamailio
Branch: master
Commit: f5c05a68ae72881ab0691bb8488112356fc67c79
URL:
https://github.com/kamailio/kamailio/commit/f5c05a68ae72881ab0691bb84881123…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-04-23T10:42:02+02:00
pv: use global tcp connection callback for event route on $conid
---
Modified: src/modules/pv/pv_core.c
Modified: src/modules/tcpops/tcpops.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f5c05a68ae72881ab0691bb84881123…
Patch:
https://github.com/kamailio/kamailio/commit/f5c05a68ae72881ab0691bb84881123…
---
diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index 40557ba4628..b10b7513a6f 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -2927,6 +2927,13 @@ int pv_get_tcpconn_id(struct sip_msg *msg, pv_param_t *param,
pv_value_t *res)
if(msg == NULL)
return -1;
+ /* use first the connection set for event_route[tcp:...] */
+ con = ksr_tcpcon_evcb_get();
+ if(con != NULL) {
+ return pv_get_sintval(msg, param, res, con->id);
+ }
+
+ /* find connection from sip message structure */
if((con = tcpconn_get(msg->rcv.proto_reserved1, 0, 0, 0, 0)) == NULL)
return pv_get_null(msg, param, res);
diff --git a/src/modules/tcpops/tcpops.c b/src/modules/tcpops/tcpops.c
index 97068c627bb..9c648c1f2a3 100644
--- a/src/modules/tcpops/tcpops.c
+++ b/src/modules/tcpops/tcpops.c
@@ -248,6 +248,7 @@ static void tcpops_tcp_closed_run_route(tcp_closed_event_info_t *tev)
sip_msg_t *fmsg;
sr_kemi_eng_t *keng = NULL;
str *evname;
+ int bkconid = -1;
LM_DBG("event reason id: %d\n", tev->reason);
if(tcpops_event_callback.len > 0) {