[asterisk-dev] [Code Review] Properly route responses according to the Via headers in the request
Olle E. Johansson
oej at edvina.net
Thu Dec 30 11:31:28 UTC 2010
30 dec 2010 kl. 11.51 skrev Alex Hermann:
> On Thursday 30 December 2010, Olle E. Johansson wrote:
>> 30 dec 2010 kl. 09.56 skrev Alex Hermann:
>>> 2) get_header does not automatically find the first via if the first via
>>> is in compact form. If the incoming request has 2 via header, of which
>>> the first is in compact form (v:) and the second in standard form
>>> (Via:), get_header will return the second Via header instead of the
>>> first, breaking your logic.
>>
>> get_header has a support function called find_alias it use to find compact
>> versions of the headers.
>
> But only _after_ finding the non-compact version has failed, thus not in the
> described scenario.
That's a separate bug. Thanks for pointing that out. Please open a bug report.
This applies to all of those headers with short names.
Cheers,
/O
>
> Consider the following SIP fragment:
>
> REGISTER sip:mydomain SIP/2.0
> v: SIP/2.0/UDP 172.16.1.40:5060;branch=z9hG4bK-123;rport
> Via: SIP/2.0/UDP 172.16.1.55:5060;branch=z9hG4bK-456;rport;maddr=1.2.3.4
>
> get_header(... "via"...) will return the second via header and use its maddr
> parameter.
>
> --
> Greetings,
>
> Alex Hermann
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
---
* Olle E Johansson - oej at edvina.net
* Cell phone +46 70 593 68 51, Office +46 8 96 40 20, Sweden
More information about the asterisk-dev
mailing list