[asterisk-dev] [Code Review] Properly route responses according to the Via headers in the request
Olle E Johansson
reviewboard at asterisk.org
Thu Dec 30 09:35:32 UTC 2010
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1059/#review3074
-----------------------------------------------------------
/branches/1.4/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/1059/#comment6319>
For reference, we might want to quote a few via headers here that we can also use in testing.
Via: SIP/2.0/UDP 192.168.2.100:5060;branch=z9hG4bK-ast-06b0c99f75746b0764fc777e470fb7db;rport;received=192.168.2.100
Via: SIP/2.0/UDP 192.168.21.111:5060;rport=5060;received=192.168.21.111;branch=z9hG4bK090fae34
I have no examples of maddr, but here's the one from the RFC:
Via: SIP / 2.0 / UDP first.example.com: 4000;ttl=16;maddr=224.2.0.1 ;branch=z9hG4bKa7c6a8dlze.1
Since this has a ttl value, the maddr is supposed to be multicast.
/branches/1.4/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/1059/#comment6318>
You are assuming there's only one via in the header field. You might have multiple Vias. You need to separate retrieving the header from processing the header value.
/branches/1.4/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/1059/#comment6320>
This doesn't really belong in process_via since it has nothing to do with via processing...
/branches/1.4/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/1059/#comment6321>
You need to check for a ttl header as well here.
/branches/1.4/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/1059/#comment6322>
I suggest that you add the setting of the address here.
- Olle E
On 2010-12-29 13:06:27, Matthew Nicholson wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1059/
> -----------------------------------------------------------
>
> (Updated 2010-12-29 13:06:27)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> This patch makes asterisk respect the Via headers in a request when responding to the request. Without this patch, the request is always routed back to the address the initial request was received from (unless nat=yes). This can cause problems if the initial request comes through a proxy and additional requests (such as INFO dtmf tones) come from a different proxy.
>
>
> Diffs
> -----
>
> /branches/1.4/channels/chan_sip.c 299447
>
> Diff: https://reviewboard.asterisk.org/r/1059/diff
>
>
> Testing
> -------
>
> Briefly tested using openser as a proxy and another asterisk machine as the requester. I sent and invite, then some INFO DTMF messages. Without the patch, our asterisk machine sends all responses to the INFO requests to the proxy, with the patch they are properly routed to the requesting asterisk machine.
>
>
> Thanks,
>
> Matthew
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20101230/9aaa3d90/attachment-0001.htm>
More information about the asterisk-dev
mailing list