[asterisk-dev] [Code Review] Don't keep the STUN socket open between STUN monitor checks.

rmudgett reviewboard at asterisk.org
Tue Nov 29 19:15:34 CST 2011


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

(Updated Nov. 29, 2011, 7:15 p.m.)


Review request for Asterisk Developers.


Changes
-------

* Remove check for literal IP address in setup_stunaddr().
* Reduce ast_stun_request() error messages to debug output.
* No longer pass in the destination address to ast_stun_request() if the socket is already bound or connected to the destination.


Summary
-------

Don't keep the STUN socket open between STUN monitor checks.

Keeping the STUN socket always open will cause the STUN monitor to fail if 
the STUN server address or our own address changes.  

* Fix the reverse problem of the STUN server address changing after the 
initial DNS resolution by using the dnsmgr to refresh the DNS resolution.  
However, refreshing the DNS resolution may not be desireable for all 
cases, as a result the stunservermonitor option is added to enable this.  

* Fix ast_stun_request() return value consistency.


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


Diffs (updated)
-----

  /branches/1.8/configs/res_stun_monitor.conf.sample 346465 
  /branches/1.8/include/asterisk/stun.h 346465 
  /branches/1.8/main/stun.c 346465 
  /branches/1.8/res/res_stun_monitor.c 346465 

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


Testing
-------

The STUN request still goes out periodically.
The STUN server DNS address is refreshed periodically if the new stunservermonitor option is enabled.


Thanks,

rmudgett

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20111130/bfbf12a1/attachment-0001.htm>


More information about the asterisk-dev mailing list