[asterisk-dev] [Code Review] SIP set outbound transport type from Registration

Russell Bryant russell at digium.com
Fri May 22 11:36:06 CDT 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/249/#review793
-----------------------------------------------------------

Ship it!


This looks like an excellent improvement to me.  Nice work, David!


/trunk/channels/chan_sip.c
<http://reviewboard.digium.com/r/249/#comment1977>

    You're not actually returning a value that is guaranteed to be in the enum if you're combining them together.  So, I would declare this return value as an int, and document that it is an a bit field of transport types from the enum.


- Russell


On 2009-05-21 12:04:58, David Vossel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/249/
> -----------------------------------------------------------
> 
> (Updated 2009-05-21 12:04:58)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> In sip.conf the transport option allows for the configuration of what transport types (udp, tcp, and tls) a peer will accept, but only the first type listed is used for outbound connections.
> 
> Example:
> transport = tcp, udp (peer will accept tcp or udp inbound, but will only make outbound requests using tcp)
> 
> If the peer registers using UDP and specifies UDP in the Contact header, Asterisk currently forces all outbound requests to that peer to use TCP.
> 
> This patch fixes this.  Now the default transport type is only used until the peer registers.  When registration takes place the transport type is parsed out of the Contact header.  If the Contact header's transport type is equal to one that the peer supports, the peer's default transport type for outbound connections is set to match the Contact header's type.  If the Contact header's transport type is not present, then the peer's default transport type is set to match the one the peer registered with.
> 
> 
> This addresses bug 0014727.
>     https://issues.asterisk.org/view.php?id=0014727
> 
> 
> Diffs
> -----
> 
>   /trunk/channels/chan_sip.c 195948 
>   /trunk/configs/sip.conf.sample 195948 
> 
> Diff: http://reviewboard.digium.com/r/249/diff
> 
> 
> Testing
> -------
> 
> tested using qualify and transport = tcp,udp.  Asterisk sends Options requests to a peer using tcp before the peer registers.  Once the peer registers using UDP Asterisk starts sending the Option requests using UDP.  Tested invites after registration as well, Asterisk uses UDP instead of TCP.
> 
> 
> Thanks,
> 
> David
> 
>




More information about the asterisk-dev mailing list