asterisk/channels
Terry Wilson de57235ac6 Re-link peers by IP when dnsmgr changes the IP
Asterisk's dnsmgr currently takes a pointer to an ast_sockaddr and updates it
anytime an address resolves to something different. There are a couple of
issues with this. First, the ast_sockaddr is usually the address of an
ast_sockaddr inside a refcounted struct and we never bump the refcount of those
structs when using dnsmgr. This makes it possible that a refresh could happen
after the destructor for that object is called (despite ast_dnsmgr_release
being called in that destructor). Second, the module using dnsmgr cannot be
aware of an address changing without polling for it in the code. If an action
needs to be taken on address update (like re-linking a SIP peer in the
peers_by_ip table), then polling for this change negates many of the benefits
of having dnsmgr in the first place.

This patch adds a function to the dnsmgr API that calls an update callback
instead of blindly updating the address itself. It also moves calls to
ast_dnsmgr_release outside of the destructor functions and into cleanup
functions that are called when we no longer need the objects and increments the
refcount of the objects using dnsmgr since those objects are stored on the
ast_dnsmgr_entry struct. A helper function for returning the proper default SIP
port (non-tls vs tls) is also added and used.

This patch also incorporates changes from a patch posted by Timo Teräs to
ASTERISK-19106 for related dnsmgr issues.

(closes issue ASTERISK-19106)

Review: https://reviewboard.asterisk.org/r/1691/
........

Merged revisions 353371 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 353397 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 23:58:51 +00:00
..
h323 Asterisk media architecture conversion - no more format bitfields 2011-02-03 16:22:10 +00:00
misdn Merged revisions 319469 via svnmerge from 2011-05-17 22:04:59 +00:00
sip Merged revisions 353321 via svnmerge from 2012-01-30 22:28:37 +00:00
xpmr AST-2009-005 2009-08-10 19:20:57 +00:00
Makefile Extract sig_ss7 out of chan_dahdi. 2010-06-07 20:04:42 +00:00
chan_agent.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_alsa.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_bridge.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_console.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_dahdi.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_gtalk.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_h323.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_iax2.c Audit of ao2_iterator_init() usage for v1.8. 2012-01-27 18:47:16 +00:00
chan_jingle.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_local.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_mgcp.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_misdn.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_multicast_rtp.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_nbs.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_oss.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_phone.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_phone.h rename DialTone.h to chan_phone.h because chan_phone.c is the only file using it 2008-05-28 20:00:21 +00:00
chan_sip.c Re-link peers by IP when dnsmgr changes the IP 2012-01-30 23:58:51 +00:00
chan_skinny.c Allow softkey reject while device onhook. 2012-01-29 22:33:08 +00:00
chan_unistim.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_usbradio.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
chan_vpb.cc Fix channel opaquification of stringfields for chan_vpb 2012-01-25 01:21:23 +00:00
console_board.c import the recent additions for video console into trunk, 2008-06-29 21:17:14 +00:00
console_gui.c Const-ify the world (or at least a good part of it) 2009-05-21 21:13:09 +00:00
console_video.c Replace direct access to channel name with accessor functions 2012-01-09 22:15:50 +00:00
console_video.h implement the 'freeze' function for incoming frames; 2008-06-30 15:45:15 +00:00
iax2-parser.c Asterisk media architecture conversion - no more format bitfields 2011-02-03 16:22:10 +00:00
iax2-parser.h Asterisk media architecture conversion - no more format bitfields 2011-02-03 16:22:10 +00:00
iax2-provision.c Merged revisions 317474 via svnmerge from 2011-05-05 22:44:52 +00:00
iax2-provision.h Don't reload a configuration file if nothing has changed. 2007-08-16 21:09:46 +00:00
iax2.h Media Project Phase2: SILK 8khz-24khz, SLINEAR 8khz-192khz, SPEEX 32khz, hd audio ConfBridge, and other stuff 2011-02-22 23:04:49 +00:00
misdn_config.c Merged revisions 317478 via svnmerge from 2011-05-05 22:55:09 +00:00
sig_analog.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
sig_analog.h Restore call progress code for analog ports. 2011-12-05 17:44:15 +00:00
sig_pri.c Opaquify channel stringfields 2012-01-24 20:12:09 +00:00
sig_pri.h Merged revisions 332265 via svnmerge from 2011-08-17 16:18:27 +00:00
sig_ss7.c Replace direct access to channel name with accessor functions 2012-01-09 22:15:50 +00:00
sig_ss7.h Add protection for SS7 channel allocation and better glare handling. 2011-10-11 21:06:55 +00:00
vcodecs.c Const-ify the world (or at least a good part of it) 2009-05-21 21:13:09 +00:00
vgrabbers.c free memory used by the x11 grabber when closing it. 2008-07-14 16:50:54 +00:00