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

Freeswitch SVN anthm at freeswitch.org
Wed Jun 4 19:18:59 EDT 2008


Author: anthm
Date: Wed Jun  4 19:18:59 2008
New Revision: 8758

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

Log:
blank username will trigger a lookup for user "nobody"

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	Wed Jun  4 19:18:59 2008
@@ -1033,14 +1033,15 @@
 		domain_name = realm;
 	}
 
-	if (switch_xml_locate_user("id", username, domain_name, ip, &xml, &domain, &user, params) != SWITCH_STATUS_SUCCESS) {
+	if (switch_xml_locate_user("id", switch_strlen_zero(username) ? "nobody" : username, 
+							   domain_name, ip, &xml, &domain, &user, params) != 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 (!(mailbox = (char *) switch_xml_attr(user, "mailbox"))) {
-		mailbox = username;
+		mailbox = switch_strlen_zero(username) ? "nobody" : username;
 	}
 
 	dparams = switch_xml_child(domain, "params");



More information about the Freeswitch-svn mailing list