[asterisk-dev] [Code Review] 3369: res_pjsip_multihomed: Be less aggressive when changing address

Joshua Colp reviewboard at asterisk.org
Mon Mar 17 17:46:17 CDT 2014


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

(Updated March 17, 2014, 5:46 p.m.)


Status
------

This change has been marked as submitted.


Review request for Asterisk Developers.


Changes
-------

Committed in revision 410793


Repository: Asterisk


Description
-------

The res_pjsip_multihomed module aggressively changes messages to contain the address information of the interface they will be going out on. In reality this is a good thing because it has the right address but in practice it upsets the testsuite. Why? Stuff in the testsuite likes to bind Asterisk to multiple loopback addresses. Since there is only one loopback interface with 127.0.0.1 the code which determines the source deduces it to always be 127.0.0.1 which can mean Asterisk will talk to itself and hilarity.

The attached code makes things a bit less aggressive. First if the transport a message is going out on is bound to any (0.0.0.0) it will always modify the message. Second if the source address and the transport local address match then the message will always be modified (note that the transport may have changed from the original during this process if the source told us to). If none of these happen then the message will not be modified. This happens if PJSIP is explicitly bound to something but tells us our source will be something different. We now side with the transport instead of the system.


Diffs
-----

  /branches/12/res/res_pjsip_multihomed.c 410669 

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


Testing
-------

Ran tests that were failing because of this, they now pass!
Ran normal calls which should trigger rewriting, and stuff got rewritten.


Thanks,

Joshua Colp

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140317/2640aeb4/attachment.html>


More information about the asterisk-dev mailing list