]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4049 try this
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 28 Mar 2012 17:43:13 +0000 (12:43 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 28 Mar 2012 17:43:13 +0000 (12:43 -0500)
src/switch_ivr_originate.c

index 0337f1275b02d77a151e36aa8c45bd4d1ca80513..df34ebf9b955732680ee17433f351be0f4db6d42 100644 (file)
@@ -96,6 +96,7 @@ typedef struct {
 
 typedef struct {
        switch_core_session_t *session;
+       switch_core_session_t *osession;
        int32_t idx;
        uint32_t hups;
        char *file;
@@ -1770,6 +1771,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
        oglobals.error_file = NULL;
        switch_core_new_memory_pool(&oglobals.pool);
 
+       if ((flags & SOF_ENTERPRISE)) {
+               if (session) {
+                       oglobals.osession = session;
+                       session = NULL;
+               }
+       }
+
        if (caller_profile_override) {
                oglobals.caller_profile_override = switch_caller_profile_dup(oglobals.pool, caller_profile_override);
        } else if (session) {
@@ -1780,6 +1788,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                }
        }
 
+
        if (session) {
                const char *to_var, *bypass_media = NULL, *proxy_media = NULL;
                caller_channel = switch_core_session_get_channel(session);
@@ -2452,7 +2461,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                }
                                
                                
-                               reason = switch_core_session_outgoing_channel(oglobals.session, originate_var_event, chan_type,
+                               reason = switch_core_session_outgoing_channel(oglobals.osession, originate_var_event, chan_type,
                                                                                                                          new_profile, &new_session, NULL, myflags, cancel_cause);
 
                                switch_event_destroy(&originate_var_event);
@@ -2711,11 +2720,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                soft_holding = switch_channel_get_variable(caller_channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE);
                        }
 
-                       if ((flags & SOF_ENTERPRISE)) {
-                               session = oglobals.session = NULL;
-                               caller_channel = NULL;
-                       }
-
 
                        while ((!caller_channel || switch_channel_ready(caller_channel) || switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE)) &&
                                   check_channel_status(&oglobals, originate_status, and_argc)) {