[asterisk-dev] [Code Review] SIP: port configuration

David Vossel dvossel at digium.com
Mon Sep 21 14:52:20 CDT 2009


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



/trunk/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/357/#comment2611>

    If there is an error parsing the port value, portnum is set to -1.  This would bypass this statement resulting in no default port being set.  Perhaps on an error, the port should remain unset allowing the default port to be set just as if it was never specified to begin with.


- David


On 2009-09-21 14:33:57, David Vossel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/357/
> -----------------------------------------------------------
> 
> (Updated 2009-09-21 14:33:57)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> In chan_sip.c, build_peer() was built with the assumption that the default port for a peer would always be 5060.  This is not the case when transport=tls.  Now in build_peer() instead of setting the default port at the beginning of the function, the port is cleared until after option parsing is complete.  This allows the correct default port to be set at the end of the function according to what transport type is specified.  If a peer is registered, the peer's port will not be cleared or overridden during a reload.  I also changed the "port" option parsing to check for errors by using sscanf() rather than atoi().
> 
> 
> This addresses bug 15854.
>     https://issues.asterisk.org/view.php?id=15854
> 
> 
> Diffs
> -----
> 
>   /trunk/channels/chan_sip.c 219749 
> 
> Diff: https://reviewboard.asterisk.org/r/357/diff
> 
> 
> Testing
> -------
> 
> made a test call via tls, verified port 5061 is used by default rather than 5060
> 
> 
> Thanks,
> 
> David
> 
>




More information about the asterisk-dev mailing list