[asterisk-commits] dvossel: trunk r206280 - /trunk/channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jul 13 18:26:57 CDT 2009
Author: dvossel
Date: Mon Jul 13 18:26:51 2009
New Revision: 206280
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=206280
Log:
dns lookup of peername rather than peer's host in transmit_register()
(closes issue #15052)
Reported by: fsantulli
Patches:
chan_sip_bug_15052_[20090626204511].patch uploaded by fsantulli (license 818)
Tested by: fsantulli
Modified:
trunk/channels/chan_sip.c
Modified: trunk/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=206280&r1=206279&r2=206280
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Jul 13 18:26:51 2009
@@ -11532,6 +11532,7 @@
char tmp[80];
char addr[80];
struct sip_pvt *p;
+ struct sip_peer *peer;
int res;
char *fromdomain;
char *domainport = NULL;
@@ -11546,8 +11547,12 @@
if (r->dnsmgr == NULL) {
char transport[MAXHOSTNAMELEN];
+ peer = find_peer(r->hostname, NULL, TRUE, FINDPEERS, FALSE);
snprintf(transport, sizeof(transport), "_sip._%s", get_transport(r->transport)); /* have to use static get_transport function */
- ast_dnsmgr_lookup(r->hostname, &r->us, &r->dnsmgr, sip_cfg.srvlookup ? transport : NULL);
+ ast_dnsmgr_lookup(peer ? peer->tohost : r->hostname, &r->us, &r->dnsmgr, sip_cfg.srvlookup ? transport : NULL);
+ if (peer) {
+ unref_peer(peer, "removing peer ref for dnsmgr_lookup");
+ }
}
if (r->call) { /* We have a registration */
More information about the asterisk-commits
mailing list