]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4049 try this
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 27 Mar 2012 18:08:49 +0000 (13:08 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 27 Mar 2012 18:08:49 +0000 (13:08 -0500)
src/include/switch_types.h
src/switch_ivr_originate.c

index 004b67c727fd51b8f8664cca6c167a30167f6895..5fd3a43a27b3da9913ef9901fec8290e9acfb6b7 100644 (file)
@@ -272,7 +272,8 @@ typedef enum {
        SOF_FORKED_DIAL = (1 << 1),
        SOF_NO_EFFECTIVE_CID_NUM = (1 << 2),
        SOF_NO_EFFECTIVE_CID_NAME = (1 << 3),
-       SOF_NO_LIMITS = (1 << 4)
+       SOF_NO_LIMITS = (1 << 4),
+       SOF_ENTERPRISE = (1 << 5)
 } switch_originate_flag_enum_t;
 typedef uint32_t switch_originate_flag_t;
 
index 6f5752641af5eb2e2202bb62d65ea179fe700910..5e715f0ab2caee3994925ca352a30a86e207e034 100644 (file)
@@ -1280,7 +1280,9 @@ static void *SWITCH_THREAD_FUNC enterprise_originate_thread(switch_thread_t *thr
        enterprise_originate_handle_t *handle = (enterprise_originate_handle_t *) obj;
 
        handle->done = 0;
-       handle->status = switch_ivr_originate(NULL, &handle->bleg, &handle->cause,
+       handle->flags |= SOF_ENTERPRISE;
+
+       handle->status = switch_ivr_originate(handle->session, &handle->bleg, &handle->cause,
                                                                                  handle->bridgeto, handle->timelimit_sec,
                                                                                  handle->table,
                                                                                  handle->cid_name_override,
@@ -2709,6 +2711,12 @@ 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)) {
                                time_t elapsed = switch_epoch_time_now(NULL) - start;