[asterisk-dev] [Code Review] Properly route responses according to the Via headers in the request
Matthew Nicholson
reviewboard at asterisk.org
Fri Dec 17 15:26:33 UTC 2010
> On 2010-12-16 13:41:05, schmidts wrote:
> > i dont know the rfc part of via headers itself, but i think its a good way at all.
> >
> > what happens if there is a record route and a via header in one sip message? I dont know if this could happens but IMHO record route overrules a via.
> >
>
> Matthew Nicholson wrote:
> Hmm, it looks like asterisk does not respect the Record-Route header on responses either. I will consult the RFC to see if Via or Record-Route takes precedence.
>
> Mark Michelson wrote:
> Not sure if you've already done this or not Matt, but you definitely need to follow the Via headers and not Record-Route for responses. The important thing is that the response goes through all SIP proxies that the request did.
>
> Matthew Nicholson wrote:
> So should Via take precedence over Record-Route then?
>
> schmidts wrote:
> i was thinking about a situation which is not allowed from the RFC so it would not be a problem:
> he URI placed in the Record-Route header field MUST resolve to
> the element inserting it (or a suitable stand-in) when the
> server location procedures of [4] are applied to it, so that
> subsequent requests reach the same SIP element.
>
> so it could not happens that a record route header differs from a via cause they have to point to the same adress/domain.
>
> Mark Michelson wrote:
> @Matt: Yes, as a UAS, you should never attempt to route responses based on Record-Route headers. Thus, you could say that Via has an infinite amount of precedence over Record-Route. Record-Route is used so that user agents can build a route set to be used for future transactions within the dialog. It's not used as a method of determining where messages during the initial transaction of dialog creation should be sent.
Ok, I'll update the patch.
- Matthew
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1059/#review3036
-----------------------------------------------------------
On 2010-12-16 14:36:19, Matthew Nicholson wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1059/
> -----------------------------------------------------------
>
> (Updated 2010-12-16 14:36:19)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> This patch makes asterisk respect the Via headers in a request when responding to it. This is necessary in the even that a stateless proxy is in between asterisk and the requester. Without this patch, the response is simply routed back to the address we received the initial request from (unless nat=yes is set).
>
>
> Diffs
> -----
>
> /branches/1.4/channels/chan_sip.c 294163
>
> Diff: https://reviewboard.asterisk.org/r/1059/diff
>
>
> Testing
> -------
>
> Briefly tested using openser as a stateless 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. I also briefly tested with openser configured to use the Record-Route header as a stateful proxy.
>
>
> Thanks,
>
> Matthew
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20101217/8dc66412/attachment.htm>
More information about the asterisk-dev
mailing list