[Freeswitch-svn] [commit] r7225 - freeswitch/trunk/src/mod/applications/mod_dptools

Freeswitch SVN mikej at freeswitch.org
Mon Jan 14 16:58:36 EST 2008


Author: mikej
Date: Mon Jan 14 16:58:36 2008
New Revision: 7225

Modified:
   freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c

Log:
user endpoint shouldn't need an a leg.

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	Mon Jan 14 16:58:36 2008
@@ -1419,7 +1419,7 @@
 		goto done;
 	}
 
-	user = switch_core_session_strdup(session, outbound_profile->destination_number);
+	user = strdup(outbound_profile->destination_number);
 
 	if (!(domain = strchr(user, '@'))) {
 		goto done;
@@ -1464,15 +1464,20 @@
 		switch_channel_t *channel;
 		switch_originate_flag_t myflags = SOF_NONE;
 
-		channel = switch_core_session_get_channel(session);
-		if ((var = switch_channel_get_variable(channel, "call_timeout"))) {
-			timelimit = atoi(var);
-		}
-		
-		switch_channel_set_variable(channel, "dialed_user", user);
-		switch_channel_set_variable(channel, "dialed_domain", domain);
+		if (session) {
+			channel = switch_core_session_get_channel(session);
+			if ((var = switch_channel_get_variable(channel, "call_timeout"))) {
+				timelimit = atoi(var);
+			}
+			
+			switch_channel_set_variable(channel, "dialed_user", user);
+			switch_channel_set_variable(channel, "dialed_domain", domain);
+
+			d_dest = switch_channel_expand_variables(channel, dest);
 
-		d_dest = switch_channel_expand_variables(channel, dest);
+		} else {
+			d_dest = strdup(dest);
+		}
 		
 		if ((flags & SOF_FORKED_DIAL)) {
 			myflags |= SOF_NOBLOCK;
@@ -1519,6 +1524,7 @@
 		switch_xml_free(xml);
 	}
 	
+	switch_safe_free(user);
 
 	return cause;
 }



More information about the Freeswitch-svn mailing list