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

Freeswitch SVN anthm at freeswitch.org
Mon Jan 21 15:14:53 EST 2008


Author: anthm
Date: Mon Jan 21 15:14:53 2008
New Revision: 7313

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c

Log:
update

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Mon Jan 21 15:14:53 2008
@@ -1198,6 +1198,7 @@
 			if ((profile = sofia_glue_find_profile(argv[1]))) {
 				stream->write_function(stream, "%s\n", line);
 				stream->write_function(stream, "Name       \t%s\n", switch_str_nil(argv[1]));
+				stream->write_function(stream, "Domain Name\t%s\n", switch_str_nil(profile->domain_name));
 				if (strcasecmp(argv[1], profile->name)) {
 				stream->write_function(stream, "Alias Of   \t%s\n", switch_str_nil(profile->name));
 				}
@@ -1748,11 +1749,11 @@
 		} else if (!strchr(dest, '@')) {
 			char buf[128];
 			tech_pvt->e_dest = switch_core_session_strdup(nsession, dest);
-			if (sofia_reg_find_reg_url(profile, dest, profile->name, buf, sizeof(buf))) {
+			if (sofia_reg_find_reg_url(profile, dest, profile->domain_name, buf, sizeof(buf))) {
 				tech_pvt->dest = switch_core_session_strdup(nsession, buf);
-				tech_pvt->local_url = switch_core_session_sprintf(nsession, "%s@%s", dest, profile->name);
+				tech_pvt->local_url = switch_core_session_sprintf(nsession, "%s@%s", dest, profile->domain_name);
 			} else {
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot locate registered user %s@%s\n", dest, profile->name);
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot locate registered user %s@%s\n", dest, profile->domain_name);
 				cause = SWITCH_CAUSE_NO_ROUTE_DESTINATION;
 				goto error;
 			}

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	Mon Jan 21 15:14:53 2008
@@ -234,6 +234,7 @@
 struct sofia_profile {
 	int debug;
 	char *name;
+	char *domain_name;
 	char *dbname;
 	char *dialplan;
 	char *context;

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Mon Jan 21 15:14:53 2008
@@ -871,6 +871,7 @@
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Settings, check the new config!\n");
 			} else {
 				char *xprofilename = (char *) switch_xml_attr_soft(xprofile, "name");
+				char *xprofiledomain = (char *) switch_xml_attr(xprofile, "domain");
 				switch_memory_pool_t *pool = NULL;
 
 				if (!xprofilename) {
@@ -902,6 +903,12 @@
 				profile->name = switch_core_strdup(profile->pool, xprofilename);
 				switch_snprintf(url, sizeof(url), "sofia_reg_%s", xprofilename);
 
+				if (xprofiledomain) {
+					profile->domain_name = switch_core_strdup(profile->pool, xprofiledomain);
+				} else {
+					profile->domain_name = profile->name;
+				}
+
 				profile->dbname = switch_core_strdup(profile->pool, url);
 				switch_core_hash_init(&profile->chat_hash, profile->pool);
 				switch_core_hash_init(&profile->sub_hash, profile->pool);
@@ -2374,6 +2381,7 @@
 		}
 
 		switch_channel_set_variable(channel, "sofia_profile_name", profile->name);
+		switch_channel_set_variable(channel, "sofia_profile_domain_name", profile->domain_name);
 
 		if (!switch_strlen_zero(sip->sip_from->a_display)) {
 			displayname = sip->sip_from->a_display;



More information about the Freeswitch-svn mailing list