diff options
author | David Vossel <dvossel@digium.com> | 2009-10-09 17:53:37 +0000 |
---|---|---|
committer | David Vossel <dvossel@digium.com> | 2009-10-09 17:53:37 +0000 |
commit | fc27da108de5cebf19debc8c8a6cd242c2eb2397 (patch) | |
tree | d71cea703aea14034fd233ef8a2ac056f91e4c36 /channels | |
parent | 7e16ec62250e99655bd2c75624d019431f634daf (diff) |
Merged revisions 223205 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r223205 | dvossel | 2009-10-09 12:52:35 -0500 (Fri, 09 Oct 2009) | 10 lines
fixes sip registration using authuser in user.conf
(closes issue #14954)
Reported by: tornblad
Tested by: mmichelson, tornblad, dvossel
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@223206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 63be58887..ce1fc23bf 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -25561,6 +25561,7 @@ static int reload_config(enum channelreloadreason reason) const char *username = ast_variable_retrieve(ucfg, cat, "username"); const char *secret = ast_variable_retrieve(ucfg, cat, "secret"); const char *contact = ast_variable_retrieve(ucfg, cat, "contact"); + const char *authuser = ast_variable_retrieve(ucfg, cat, "authuser"); if (!host) host = ast_variable_retrieve(ucfg, "general", "host"); if (!username) @@ -25570,10 +25571,17 @@ static int reload_config(enum channelreloadreason reason) if (!contact) contact = "s"; if (!ast_strlen_zero(username) && !ast_strlen_zero(host)) { - if (!ast_strlen_zero(secret)) - snprintf(tmp, sizeof(tmp), "%s:%s@%s/%s", username, secret, host, contact); - else + if (!ast_strlen_zero(secret)) { + if (!ast_strlen_zero(authuser)) { + snprintf(tmp, sizeof(tmp), "%s:%s:%s@%s/%s", username, secret, authuser, host, contact); + } else { + snprintf(tmp, sizeof(tmp), "%s:%s@%s/%s", username, secret, host, contact); + } + } else if (!ast_strlen_zero(authuser)) { + snprintf(tmp, sizeof(tmp), "%s::%s@%s/%s", username, authuser, host, contact); + } else { snprintf(tmp, sizeof(tmp), "%s@%s/%s", username, host, contact); + } if (sip_register(tmp, 0) == 0) registry_count++; } |