From: Terry Wilson Date: Thu, 24 Feb 2011 03:38:22 +0000 (+0000) Subject: Use remotesecret to authenticate with a remote party X-Git-Tag: 1.6.2.19-rc1~3^2~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c140ca0b5c39ac640b63dc837f0beb958b8c161;p=thirdparty%2Fasterisk.git 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.6.2@308678 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 96e8d1c621..85ffa1a5a3 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -17599,7 +17599,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 */ diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample index f11e053f59..edc8500dee 100644 --- a/configs/sip.conf.sample +++ b/configs/sip.conf.sample @@ -847,6 +847,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