summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2014-03-12 12:51:34 +0000
committerJoshua Colp <jcolp@digium.com>2014-03-12 12:51:34 +0000
commitd00c1ac23ec615d2b9b808c39675d2a02c57142d (patch)
tree33c9b4c6ed000cac22a8b98bec6b92b49cbca1f5
parent2fa1ff6e756ce0062f506d5ccb4e872d22b9e8fd (diff)
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. ........ Merged revisions 410471 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410472 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--res/res_pjsip_multihomed.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/res/res_pjsip_multihomed.c b/res/res_pjsip_multihomed.c
index c959fa777..75ab6058c 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 */