[asterisk-dev] [Code Review] possible fix for broken SIP/peer/exten/IPorHost dial syntax

wdoekes reviewboard at asterisk.org
Mon Apr 9 07:26:17 CDT 2012


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

Review request for Asterisk Developers.


Summary
-------

As you can see in the bug report, I have trouble using the //IPorHost syntax in the SIP dial string.

This is an attempt at fixing it: I create a temporary outboundproxy for the dialog instead of just setting p->sa once.

Unfortunately I had to touch (remove) a call to set_destination(). That's where it gets hairy, because other proxy bugs were created and fixed in the vicinity. 

I left some debug code in that you might find useful if you're going to play with this.

Things this patch does:
* Revert parts of r256485.
* Make IPorHost work by using a temporary outboundproxy instead.
* Replace thread-unsafe usage of strtok with strtok_r when parsing outboundproxy.
* Remove duplicate code for parsing outboundproxy.
* Fix memory leak that would occur when discarding an unparsable peer-specific outboundproxy.
* Consistently pass TRUE and FALSE as create_addr newdialog argument.
* Update the documentation above sip_request_call about all the possible SIP dial strings.


This addresses bug ASTERISK-19677.
    https://issues.asterisk.org/jira/browse/ASTERISK-19677


Diffs
-----

  /trunk/channels/chan_sip.c 361654 
  /trunk/channels/sip/config_parser.c 361654 
  /trunk/channels/sip/include/sip.h 361654 

Diff: https://reviewboard.asterisk.org/r/1859/diff


Testing
-------

My test calls work fine now, with and without the //IPorHost proxy. But I suspect that removing the set_destination must cause a problem for someone somewhere.

NOTE: my patch was actually against 10.3.0-rc3. But looking through the SVN log (for the 10 branch) did not reveal any related fixes.


Thanks,

wdoekes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120409/702aeba8/attachment.htm>


More information about the asterisk-dev mailing list