[Freeswitch-svn] [commit] r6090 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Tue Oct 30 10:32:00 EDT 2007


Author: anthm
Date: Tue Oct 30 10:32:00 2007
New Revision: 6090

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c

Log:
add lost code

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	Tue Oct 30 10:32:00 2007
@@ -816,6 +816,8 @@
 	switch_xml_t domain, xml = NULL, user, param, xparams;	
 	char hexdigest[2 * SU_MD5_DIGEST_SIZE + 1] = "";
 	char *pbuf = NULL;
+	char *domain_name = NULL;
+
 	username = realm = nonce = uri = qop = cnonce = nc = response = NULL;
 	
 	if (authorization->au_params) {
@@ -884,12 +886,19 @@
 	
 	pbuf = switch_mprintf("profile=%s", profile->name);
 
-	if (switch_xml_locate_user(username, realm, ip, &xml, &domain, &user, pbuf) != SWITCH_STATUS_SUCCESS) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "can't find user [%s@%s]\n", username, realm);
+	
+	if (!switch_strlen_zero(profile->reg_domain)) {
+		domain_name = profile->reg_domain;
+	} else {
+		domain_name = realm;
+	}
+	
+	if (switch_xml_locate_user(username, domain_name, ip, &xml, &domain, &user, pbuf) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "can't find user [%s@%s]\n", username, domain_name);
 		ret = AUTH_FORBIDDEN;
 		goto end;
 	}
-		
+
 	if (!(xparams = switch_xml_child(user, "params"))) {
 		ret = AUTH_OK;
 		goto end;



More information about the Freeswitch-svn mailing list