Commit a96cf7e4 authored by Simon Morlat's avatar Simon Morlat

fix a problem in tport lookup.

If port number is not specified, and not obtained via SRV, tport_by_name() will not find a secondary port (it needs the port number information for this).
as a result it will return a primary tport, and new secondary tport will be created to expedite the message.
This creates multiple connections to the same host:port, which is not efficient.
parent f791d97d
......@@ -8008,15 +8008,15 @@ outgoing_prepare_send(nta_outgoing_t *orq)
if (!tpn->tpn_port)
tpn->tpn_port = "";
tp = tport_by_name(sa->sa_tports, tpn);
if (tpn->tpn_port[0] == '\0') {
if (orq->orq_sips || tport_has_tls(tp))
if (su_strcasecmp(tpn->tpn_proto, "tls") == 0)
tpn->tpn_port = "5061";
tpn->tpn_port = "5060";
tp = tport_by_name(sa->sa_tports, tpn);
if (tp) {
outgoing_send_via(orq, tp);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment