[asterisk-dev] [Code Review] Properly route responses according to the Via headers in the request

schmidts reviewboard at asterisk.org
Thu Dec 16 19:41:05 UTC 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1059/#review3036
-----------------------------------------------------------


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.



/branches/1.4/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/1059/#comment6251>

    via could not be zero here cause you allready check this 5 rows aboth without changing via in between.



/branches/1.4/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/1059/#comment6252>

    Maybe it would be better to check the response of get_header before. its not necessary to call this function on every sip message if there is no via header. 
    ast_strdupa in function calls could cause some strange issues. there was something about this some weeks ago.



best regards

- schmidts


On 2010-12-16 11:39:59, Matthew Nicholson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1059/
> -----------------------------------------------------------
> 
> (Updated 2010-12-16 11:39:59)
> 
> 
> 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/20101216/405135f8/attachment-0001.htm>


More information about the asterisk-dev mailing list