From: Joshua Colp Date: Wed, 12 Mar 2014 12:50:46 +0000 (+0000) Subject: res_pjsip_multihomed: Fix a bug where outgoing messages for TCP would go out using... X-Git-Tag: 12.2.0-rc1~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ece1671625aac0fef3885deb7bc0b60a946ee767;p=thirdparty%2Fasterisk.git res_pjsip_multihomed: Fix a bug where outgoing messages for TCP would go out using UDP. This change fixes a bug where the code which changes the transport did not check whether the message is going out over UDP or not before changing it. For TCP and TLS transports we don't need to change the transport as the correct one is already chosen. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410471 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_pjsip_multihomed.c b/res/res_pjsip_multihomed.c index c959fa7777..75ab6058cb 100644 --- a/res/res_pjsip_multihomed.c +++ b/res/res_pjsip_multihomed.c @@ -102,9 +102,12 @@ static pj_status_t multihomed_on_tx_message(pjsip_tx_data *tdata) } /* If the transport it is going out on is different reflect it in the message */ - transport = multihomed_get_udp_transport(&prm.ret_addr, prm.ret_port); - if (transport && (tdata->tp_info.transport != transport)) { - tdata->tp_info.transport = transport; + if (tdata->tp_info.transport->key.type == PJSIP_TRANSPORT_UDP || + tdata->tp_info.transport->key.type == PJSIP_TRANSPORT_UDP6) { + transport = multihomed_get_udp_transport(&prm.ret_addr, prm.ret_port); + if (transport && (tdata->tp_info.transport != transport)) { + tdata->tp_info.transport = transport; + } } /* If the message needs to be updated with new address do so */