]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 308678 via svnmerge from
authorTerry Wilson <twilson@digium.com>
Thu, 24 Feb 2011 03:41:34 +0000 (03:41 +0000)
committerTerry Wilson <twilson@digium.com>
Thu, 24 Feb 2011 03:41:34 +0000 (03:41 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r308678 | twilson | 2011-02-23 21:38:22 -0600 (Wed, 23 Feb 2011) | 8 lines

  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.

  Review: https://reviewboard.asterisk.org/r/1107/
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@308679 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c
configs/sip.conf.sample

index 0465cfc4ea1f2e773380f50523b0d08f1ed80dfa..75df29961f0e14cc940043ed0ca81b665276785b 100644 (file)
@@ -18225,7 +18225,9 @@ static int build_reply_digest(struct sip_pvt *p, int method, char* digest, int d
        } 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 */
index 91276288227e795e016768e49ccc418fdf6fec50..92e41e4403ae54da8150c769acec7c1d5752006a 100644 (file)
@@ -1014,6 +1014,10 @@ srvlookup=yes                   ; Enable DNS SRV lookups on outbound 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
 ;
 ; For local phones, type=friend works most of the time