Module: kamailio Branch: master Commit: cc4644ea306f1f8abf9d0f69eb452ae8cabeb4b9 URL: https://github.com/kamailio/kamailio/commit/cc4644ea306f1f8abf9d0f69eb452ae8...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2021-02-16T16:36:10+01:00
tm: uac - use new send socket only if set in event route local request
- GH #2639
---
Modified: src/modules/tm/uac.c
---
Diff: https://github.com/kamailio/kamailio/commit/cc4644ea306f1f8abf9d0f69eb452ae8... Patch: https://github.com/kamailio/kamailio/commit/cc4644ea306f1f8abf9d0f69eb452ae8...
---
diff --git a/src/modules/tm/uac.c b/src/modules/tm/uac.c index d01c722844..40d333b7db 100644 --- a/src/modules/tm/uac.c +++ b/src/modules/tm/uac.c @@ -315,10 +315,10 @@ static inline int t_run_local_req( if((lreq.force_send_socket != uac_r->dialog->send_sock) || (lreq.msg_flags&(FL_ADD_LOCAL_RPORT|FL_ADD_SRVID |FL_ADD_XAVP_VIA_PARAMS|FL_USE_XAVP_VIA_FIELDS))) { - LM_DBG("local Via update - socket: [%.*s] - msg-flags: %u", - lreq.force_send_socket->address_str.len, - lreq.force_send_socket->address_str.s, - lreq.msg_flags); + LM_DBG("local Via update - new socket: [%.*s] - msg-flags: %u", + (lreq.force_send_socket)?lreq.force_send_socket->address_str.len:4, + (lreq.force_send_socket)?lreq.force_send_socket->address_str.s:"none", + lreq.msg_flags);
/* rebuild local Via - remove previous value * and add the one for the new send socket */ @@ -335,9 +335,11 @@ static inline int t_run_local_req( lreq.add_to_branch_len = lreq.via1->branch->value.len;
/* update also info about new destination and send sock */ - uac_r->dialog->send_sock=lreq.force_send_socket; - request->dst.send_sock = lreq.force_send_socket; - request->dst.proto = lreq.force_send_socket->proto; + if(lreq.force_send_socket) { + uac_r->dialog->send_sock=lreq.force_send_socket; + request->dst.send_sock = lreq.force_send_socket; + request->dst.proto = lreq.force_send_socket->proto; + }
LM_DBG("apply new updates with Via to sip msg\n"); buf1 = build_req_buf_from_sip_req(&lreq,