freeswitch
freeswitch copied to clipboard
SIP Via Header on 100 Trying
Hi all,
following behaviour on freeswitch 1.10.1 - when getting an inbound call from a system behind a sip proxy - then the invite does have 2 Via Headers (Top Via Header from Proxy, second Via Header from system behind proxy). Freeswitch does send a 100 Trying - with only the Top Via Header set. This does cause the proxy to not forward the via header - so we get a second invite and so on.
If freeswitch does answer the call - then it will send a 200 Ok with all Via Headers.
Why does it not send the Via headers in 100 Trying ? Is there a config option for it (i did not found one) ?
In the RFC3261 - 8.2.6.2 is the following: "The Via header field values in the response MUST equal the Via header field values in the request and MUST maintain the same ordering."
So i think freeswitch (libsofia) is acting wrong here...
Please attach a complete sip trace with debug log.
maybe this is relevant 100 responses are not forwarded by proxies, so only include the topmost Via header from this https://github.com/signalwire/freeswitch/commit/6ed86abf9f6ab1116a39b28c651dec1d4f6cf89f
@lazedo Yep - this could be the cause for the problem - i will test tomorrow by disabling this part:
if (sip->sip_status && sip->sip_status->st_status == 100)
sip->sip_via = (sip_via_t *)msg_header_copy_one(home, (msg_header_t const *)irq->irq_via);
else
sip->sip_via = sip_via_copy(home, irq->irq_via);
only using sip->sip_via = sip_via_copy(home, irq->irq_via);
@armenfirespotter This part is the nta_incoming_reponse_headers function - so this is in a response to a proxy which did already forwarded the Via Headers - or which inserted the via headers. Why should it here be necessary to remove a Via Header ?
@lazedo @wpichler this was awhile ago, but the point of FS-9300 was to introduce the acknowledge_call app. At the time, IIRC freeswitch/sofia did not follow the RFC spec re the quoted bit above: it only copied one Via header in a 100 Trying, not the whole Via stack as RFC-compliant implementation should. w.r.t this implementation, I wanted to preserve existing on-the-wire behavior of freeswitch/sofia for compatibility with existing (possibly-non-rfc-compliant) implementations. In retrospect, my comment kinda sucks and doesn't tell this story.
FWIW, I have no objection with bringing this implementation in-line with RFC compliance, perhaps by deleting lines 6465 to 6468, inclusive.
I've disabled this part - but still the problem exists. So there must be an other point where the sip via headers gets set. In this function it does only work on the via header if it is not already set.
In which part of the code does the SIP Via header for a 100 Trying response are getting set ?
Any progress on this matter? Or perhaps a workaround?
Is it possible to enable some flag in the profile to keep the 2 headers via in Trying?
Is there any update on this ticket? The stripping of the Via headers impacts the ability to integrate with stateless proxies that rely on the Via headers.
is there any update on this at all?
We have same issue. Proxy keep sending invite
Bumping thread, any update on this? https://github.com/freeswitch/sofia-sip/pull/41 looks good to merge? If not tell me if not and I will try to make a fix.