[Asterisk-code-review] res_pjsip/pjsip_message_filter: set preferred transport in pjsip_mess... (asterisk[master])

Florian Floimair asteriskteam at digium.com
Wed Mar 17 04:24:01 CDT 2021


Florian Floimair has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15620 )


Change subject: res_pjsip/pjsip_message_filter: set preferred transport in pjsip_message_filter
......................................................................

res_pjsip/pjsip_message_filter: set preferred transport in pjsip_message_filter

Set preferred transport when querying the local address to use in
filter_on_tx_messages(). This prevents the module to erroneously select
the wrong transport if more than one transports of the same type (TCP or
TLS) are configured.

ASTERISK-29241

Change-Id: I598e60257a7f92b29efce1fb3e9a2fc06f1439b6
---
M res/res_pjsip/pjsip_message_filter.c
1 file changed, 5 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/20/15620/1

diff --git a/res/res_pjsip/pjsip_message_filter.c b/res/res_pjsip/pjsip_message_filter.c
index 7c91ba8..5d23737 100644
--- a/res/res_pjsip/pjsip_message_filter.c
+++ b/res/res_pjsip/pjsip_message_filter.c
@@ -239,6 +239,11 @@
 	pj_strset2(&prm.dst_host, tdata->tp_info.dst_name);
 	prm.local_if = PJ_TRUE;
 
+	pjsip_tpselector sel;
+	sel.type = PJSIP_TPSELECTOR_TRANSPORT;
+	sel.u.transport = tdata->tp_info.transport;
+	prm.tp_sel = &sel;
+
 	/* If we can't get the local address use best effort and let it pass */
 	if (pjsip_tpmgr_find_local_addr2(pjsip_endpt_get_tpmgr(ast_sip_get_pjsip_endpoint()), tdata->pool, &prm) != PJ_SUCCESS) {
 		return PJ_SUCCESS;

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15620
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I598e60257a7f92b29efce1fb3e9a2fc06f1439b6
Gerrit-Change-Number: 15620
Gerrit-PatchSet: 1
Gerrit-Owner: Florian Floimair <f.floimair at commend.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210317/86516927/attachment.html>


More information about the asterisk-code-review mailing list