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 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@206280 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
d8bf363015
commit
b8e52a3435
|
@ -11532,6 +11532,7 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
|
|||
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 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
|
|||
|
||||
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 */
|
||||
|
|
Reference in New Issue