[svn-commits] twilson: branch 1.6.2 r308678 - in /branches/1.6.2: channels/ configs/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Feb 23 21:38:26 CST 2011


Author: twilson
Date: Wed Feb 23 21:38:22 2011
New Revision: 308678

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=308678
Log:
Use remotesecret to authenticate with a remote party

The remotesecret option was only being used for outbound registration
and not for placing calls. This patch uses remotesecret on outbound
calls if it is set, otherwise secret is still used.

Modified:
    branches/1.6.2/channels/chan_sip.c
    branches/1.6.2/configs/sip.conf.sample

Modified: branches/1.6.2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_sip.c?view=diff&rev=308678&r1=308677&r2=308678
==============================================================================
--- branches/1.6.2/channels/chan_sip.c (original)
+++ branches/1.6.2/channels/chan_sip.c Wed Feb 23 21:38:22 2011
@@ -17599,7 +17599,9 @@
  	} else {
  		/* No authentication, use peer or register= config */
  		username = p->authname;
- 		secret =  p->peersecret;
+ 		secret = p->relatedpeer 
+			&& !ast_strlen_zero(p->relatedpeer->remotesecret)
+			? p->relatedpeer->remotesecret : p->peersecret;
  		md5secret = p->peermd5secret;
  	}
 	if (ast_strlen_zero(username))	/* We have no authentication */

Modified: branches/1.6.2/configs/sip.conf.sample
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/configs/sip.conf.sample?view=diff&rev=308678&r1=308677&r2=308678
==============================================================================
--- branches/1.6.2/configs/sip.conf.sample (original)
+++ branches/1.6.2/configs/sip.conf.sample Wed Feb 23 21:38:22 2011
@@ -846,6 +846,10 @@
 ; * The type=peer also handles both incoming and outbound calls. On inbound calls,
 ;   Asterisk only matches on IP/port, not on names. This is mostly used for SIP
 ;   trunks.
+;
+; Use remotesecret for outbound authentication, and secret for authenticating
+; inbound requests. For historical reasons, if no remotesecret is supplied for an
+; outbound registration or call, the secret will be used. 
 ;
 ; For device names, we recommend using only a-z, numerics (0-9) and underscore
 ; 




More information about the svn-commits mailing list