diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-10-09 17:56:26 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-10-09 17:56:26 +0000 |
commit | 3a48a5a137bd99d4e1781da7068d7360620802ba (patch) | |
tree | e592673a57525be0309918e85a3b1e0e6df8d74e /channels | |
parent | 321a9b20cf85f2b9a28d02e60ef97cec56c14ba6 (diff) |
Merged revisions 223206 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r223206 | dvossel | 2009-10-09 12:53:37 -0500 (Fri, 09 Oct 2009) | 16 lines
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: http://svn.digium.com/svn/asterisk/branches/1.6.1@223209 f38db490-d61c-443f-a65b-d21fe96a405b
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 46843885e..98b05ae18 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -23358,6 +23358,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) @@ -23367,10 +23368,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++; } |