]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
user endpoint shouldn't need an a leg.
authorMichael Jerris <mike@jerris.com>
Mon, 14 Jan 2008 21:58:36 +0000 (21:58 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 14 Jan 2008 21:58:36 +0000 (21:58 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7225 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_dptools/mod_dptools.c

index cba33e39f269a9930ef8104f3b1b39e750abab26..ec70df73e46b14659eda939280b39da0315e1544 100644 (file)
@@ -1419,7 +1419,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
                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 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
                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 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
                switch_xml_free(xml);
        }
        
+       switch_safe_free(user);
 
        return cause;
 }