Skip to content

Commit

Permalink
pv: use global tcp connection callback for event route on $conid
Browse files Browse the repository at this point in the history
(cherry picked from commit f5c05a6)
  • Loading branch information
miconda committed Apr 25, 2024
1 parent 069de99 commit 7e987d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/modules/pv/pv_core.c
Expand Up @@ -2939,6 +2939,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);

Expand Down
1 change: 1 addition & 0 deletions src/modules/tcpops/tcpops.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 7e987d8

Please sign in to comment.