diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-26 16:32:08 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-26 16:32:08 +0000 |
commit | 22c6a0961baf7db6c00c59ce8512c2d317eb062e (patch) | |
tree | dd9e2ebd8652c4037c70931a835206d0e5e4aa2e /channels | |
parent | e6c408853b01b7d53edf3dddda9f3c8b1f73e58d (diff) |
Add support for peer realm based auth (a few missing lines, the rest is well documented but never worked)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@125384 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 70014f2d0..20560afc2 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2863,6 +2863,7 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer) dialog->maxtime = peer->maxms; dialog->callgroup = peer->callgroup; dialog->pickupgroup = peer->pickupgroup; + dialog->peerauth = peer->auth; dialog->allowtransfer = peer->allowtransfer; /* Set timer T1 to RTT for this peer (if known by qualify=) */ /* Minimum is settable or default to 100 ms */ @@ -11649,9 +11650,11 @@ static int build_reply_digest(struct sip_pvt *p, int method, char* digest, int d snprintf(cnonce, sizeof(cnonce), "%08lx", ast_random()); /* Check if we have separate auth credentials */ - if ((auth = find_realm_authentication(authl, p->realm))) { - ast_log(LOG_WARNING, "use realm [%s] from peer [%s][%s]\n", - auth->username, p->peername, p->username); + if(!(auth = find_realm_authentication(p->peerauth, p->realm))) /* Start with peer list */ + auth = find_realm_authentication(authl, p->realm); /* If not, global list */ + + if (auth) { + ast_log(LOG_DEBUG, "use realm [%s] from peer [%s][%s]\n", auth->username, p->peername, p->username); username = auth->username; secret = auth->secret; md5secret = auth->md5secret; |