[asterisk-commits] oej: trunk r125385 - in /trunk: ./ channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jun 26 11:54:22 CDT 2008
Author: oej
Date: Thu Jun 26 11:54:22 2008
New Revision: 125385
URL: http://svn.digium.com/view/asterisk?view=rev&rev=125385
Log:
Merged revisions 125384 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r125384 | oej | 2008-06-26 18:32:08 +0200 (Tor, 26 Jun 2008) | 3 lines
Add support for peer realm based auth (a few missing lines, the rest is well documented but never worked)
........
Modified:
trunk/ (props changed)
trunk/channels/chan_sip.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=125385&r1=125384&r2=125385
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Jun 26 11:54:22 2008
@@ -4284,6 +4284,7 @@
dialog->allowtransfer = peer->allowtransfer;
dialog->jointnoncodeccapability = dialog->noncodeccapability;
dialog->rtptimeout = peer->rtptimeout;
+ dialog->peerauth = peer->auth;
dialog->maxcallbitrate = peer->maxcallbitrate;
if (ast_strlen_zero(dialog->tohost))
ast_string_field_set(dialog, tohost, ast_inet_ntoa(dialog->sa.sin_addr));
@@ -4306,7 +4307,6 @@
ast_string_field_set(dialog, fromuser, peer->fromuser);
if (!ast_strlen_zero(peer->language))
ast_string_field_set(dialog, language, peer->language);
-
/* Set timer T1 to RTT for this peer (if known by qualify=) */
/* Minimum is settable or default to 100 ms */
/* If there is a maxms and lastms from a qualify use that over a manual T1
@@ -15317,9 +15317,11 @@
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;
More information about the asterisk-commits
mailing list