[asterisk-commits] oej: branch 1.6.0 r125388 - in /branches/1.6.0: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 26 12:07:48 CDT 2008


Author: oej
Date: Thu Jun 26 12:07:47 2008
New Revision: 125388

URL: http://svn.digium.com/view/asterisk?view=rev&rev=125388
Log:
Merged revisions 125385 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r125385 | oej | 2008-06-26 18:54:22 +0200 (Tor, 26 Jun 2008) | 12 lines


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:
    branches/1.6.0/   (props changed)
    branches/1.6.0/channels/chan_sip.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_sip.c?view=diff&rev=125388&r1=125387&r2=125388
==============================================================================
--- branches/1.6.0/channels/chan_sip.c (original)
+++ branches/1.6.0/channels/chan_sip.c Thu Jun 26 12:07:47 2008
@@ -3988,6 +3988,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));
@@ -4008,7 +4009,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
@@ -14127,9 +14127,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