[asterisk-dev] [Code Review] Properly route responses according to the Via headers in the request
Matthew Nicholson
reviewboard at asterisk.org
Wed Dec 29 19:06:34 UTC 2010
> On 2010-12-23 02:11:36, Olle E Johansson wrote:
> > THis is wrong and not according to the RFC. Please re-read the section I referred you to. A UAC should always respond to the sender's IP address and port. If you make the nat=yes behaviour for SIP the default, you are right on. Via headers are used for proxies, since a proxy do not have to keep state and remember the sender. The proxy handling the response might not even be the same as the one processing the request. Via headers is not for UA's unless you have a transport machine that adds an Via header when receiving the packet and delivers it up to the the transaction layer. If that's the case, the transaction layer routes the response to the top via header, added by the incoming transport. Since we have none of that, we just respond to the sender. Period.
>
> Olle E Johansson wrote:
> I haven't figured out from your e-mails whether or not you had a route set. If you had a route set from the initial transaction and get the INFO from another address, we need to figure out what to do.
>
> If there's no route set (no proxy added a record-route header to request to stay in the signalling path) then only the initial transaction goes through the proxy and we should respond directly to the device.
In the latest patch, responses are routed to the address they were received from except if maddr is set in the via header.
- Matthew
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1059/#review3066
-----------------------------------------------------------
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/20101229/01e402e2/attachment-0001.htm>
More information about the asterisk-dev
mailing list