[asterisk-commits] dvossel: branch 1.6.1 r223209 - in /branches/1.6.1: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 9 12:56:30 CDT 2009


Author: dvossel
Date: Fri Oct  9 12:56:26 2009
New Revision: 223209

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=223209
Log:
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
    
    (closes issue #14954)
    Reported by: tornblad
    Tested by: mmichelson, tornblad, dvossel
    fixes sip registration using authuser in user.conf
    
    (closes issue #14954)
    Reported by: tornblad
    Tested by: mmichelson, tornblad, dvossel
  ........
................

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/channels/chan_sip.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.1/channels/chan_sip.c?view=diff&rev=223209&r1=223208&r2=223209
==============================================================================
--- branches/1.6.1/channels/chan_sip.c (original)
+++ branches/1.6.1/channels/chan_sip.c Fri Oct  9 12:56:26 2009
@@ -23358,6 +23358,7 @@
 					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 @@
 					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++;
 					}




More information about the asterisk-commits mailing list