aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-09 15:49:30 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-09 15:49:30 +0000
commit5e43f2f50c37208355a1b8f92bd3737ba354c5c6 (patch)
tree3103e0c90870c9721dbcb2c3be3048dc73a18a21 /channels
parent48eb03209fc0df538502c6fcf43bc2cb4c7f12e9 (diff)
p->peerauth is always empty in transmit_register()
When using callbackextension or specifing the peer name in a registration string, the peer's specific auth settings set by the "auth=" strings within the peer definition are not used by the registration. Thanks to ebroad for reporting the issue and providing the patch. (closes issue #15955) Reported by: ebroad Patches: regauthfix.patch uploaded by ebroad (license 878) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223088 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 624ab61ca..8fb7e5139 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11796,7 +11796,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;
+ struct sip_peer *peer = NULL;
int res;
/* exit if we are already in process with this registrar ?*/
@@ -11813,7 +11813,7 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
snprintf(transport, sizeof(transport), "_sip._%s", get_transport(r->transport)); /* have to use static get_transport function */
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");
+ peer = unref_peer(peer, "removing peer ref for dnsmgr_lookup");
}
}
@@ -11828,8 +11828,6 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
}
} else {
/* Build callid for registration if we haven't registered before */
- struct sip_peer *peer = NULL;
-
if (!r->callid_valid) {
build_callid_registry(r, internip.sin_addr, default_fromdomain);
r->callid_valid = TRUE;
@@ -11846,6 +11844,8 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
if (!ast_strlen_zero(r->peername)) {
if (!(peer = find_peer(r->peername, NULL, 1, FINDPEERS, FALSE, 0))) {
ast_log(LOG_WARNING, "Could not find peer %s in transmit_register\n", r->peername);
+ } else {
+ p->peerauth = peer->auth;
}
}
ref_proxy(p, obproxy_get(p, peer)); /* it is ok to pass a NULL peer into obproxy_get() */