From f39b4237781e21e4a241acf555c7070d6d169a50 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 9 May 2008 17:42:46 +0000 Subject: [PATCH] Wed May 7 09:10:28 EDT 2008 Pekka Pessi * nta.c: do not replace host:port in user-specified Via header Note that port for UDP is replaced if request is stateful and there is no rport. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8332 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/nta/nta.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 1c3f3f8db1..4381f69034 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Wed May 7 08:28:38 EDT 2008 +Fri May 9 13:42:29 EDT 2008 diff --git a/libs/sofia-sip/libsofia-sip-ua/nta/nta.c b/libs/sofia-sip/libsofia-sip-ua/nta/nta.c index 13d79538e0..c3cf55255a 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nta/nta.c +++ b/libs/sofia-sip/libsofia-sip-ua/nta/nta.c @@ -2063,11 +2063,16 @@ int outgoing_insert_via(nta_outgoing_t *orq, clear = 1, v->v_protocol = via->v_protocol; /* XXX - should we do this? */ - if (via->v_host != v->v_host && + if (!user_via && + via->v_host != v->v_host && str0cmp(via->v_host, v->v_host)) clear = 1, v->v_host = via->v_host; - if (via->v_port != v->v_port && + if ((!user_via || + /* Replace port in user Via only if we use udp and no rport */ + (v->v_protocol == sip_transport_udp && !v->v_rport && + !orq->orq_stateless)) && + via->v_port != v->v_port && str0cmp(via->v_port, v->v_port)) clear = 1, v->v_port = via->v_port;