]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
pass originate flags into session_request so we can selectivly skip throttling
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 26 Aug 2010 17:19:49 +0000 (12:19 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 26 Aug 2010 17:19:49 +0000 (12:19 -0500)
18 files changed:
src/include/switch_core.h
src/include/switch_types.h
src/mod/applications/mod_conference/mod_conference.c
src/mod/applications/mod_dptools/mod_dptools.c
src/mod/endpoints/mod_alsa/mod_alsa.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp
src/mod/endpoints/mod_loopback/mod_loopback.c
src/mod/endpoints/mod_portaudio/mod_portaudio.c
src/mod/endpoints/mod_reference/mod_reference.c
src/mod/endpoints/mod_skinny/mod_skinny.c
src/mod/endpoints/mod_skypopen/asterisk/chan_skypiax.c
src/mod/endpoints/mod_skypopen/mod_skypopen.c
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_unicall/mod_unicall.c
src/switch_core_session.c
src/switch_ivr_originate.c

index 650ffc15fbbfb027d0ba883b26533399a54da63e..7275f263196cf9b335e8bd6c25c7beb99746d4da 100644 (file)
@@ -614,8 +614,10 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_xml(switch_e
 */
 SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_uuid(_In_ switch_endpoint_interface_t *endpoint_interface,
                                                                                                                                                 _In_ switch_call_direction_t direction,
-                                                                                                                                                _Inout_opt_ switch_memory_pool_t **pool, _In_opt_z_ const char *use_uuid);
-#define switch_core_session_request(_ep, _d, _p) switch_core_session_request_uuid(_ep, _d, _p, NULL)
+                                                                                                                                                switch_originate_flag_t originate_flags,
+                                                                                                                                                _Inout_opt_ switch_memory_pool_t **pool, 
+                                                                                                                                                _In_opt_z_ const char *use_uuid);
+#define switch_core_session_request(_ep, _d, _f, _p) switch_core_session_request_uuid(_ep, _d, _f, _p, NULL)
 
 SWITCH_DECLARE(switch_status_t) switch_core_session_set_uuid(_In_ switch_core_session_t *session, _In_z_ const char *use_uuid);
 
index 70ae155fe6d5cf07df56d2e80545453f88779616..dacf2ddddaffa4315fe80560143b1220ff3dfe64 100644 (file)
@@ -220,7 +220,8 @@ typedef enum {
        SOF_NOBLOCK = (1 << 0),
        SOF_FORKED_DIAL = (1 << 1),
        SOF_NO_EFFECTIVE_CID_NUM = (1 << 2),
-       SOF_NO_EFFECTIVE_CID_NAME = (1 << 3)
+       SOF_NO_EFFECTIVE_CID_NAME = (1 << 3),
+       SOF_NO_LIMITS = (1 << 4)
 } switch_originate_flag_enum_t;
 typedef uint32_t switch_originate_flag_t;
 
index 3a1863cb6e20f5edfe0fe557578e5be4619402e5..5128e3baed06407a0fdc9321c23c7a4f7a93de83 100644 (file)
@@ -4771,7 +4771,7 @@ static switch_status_t conference_outcall(conference_obj_t *conference,
 
        if (conference == NULL) {
                char *dialstr = switch_mprintf("{ignore_early_media=true}%s", bridgeto);
-               status = switch_ivr_originate(NULL, &peer_session, cause, dialstr, 60, NULL, cid_name, cid_num, NULL, NULL, SOF_NONE, NULL);
+               status = switch_ivr_originate(NULL, &peer_session, cause, dialstr, 60, NULL, cid_name, cid_num, NULL, NULL, SOF_NO_LIMITS, NULL);
                switch_safe_free(dialstr);
 
                if (status != SWITCH_STATUS_SUCCESS) {
@@ -4804,7 +4804,7 @@ static switch_status_t conference_outcall(conference_obj_t *conference,
 
        /* establish an outbound call leg */
 
-       if (switch_ivr_originate(session, &peer_session, cause, bridgeto, timeout, NULL, cid_name, cid_num, NULL, NULL, SOF_NONE, NULL) !=
+       if (switch_ivr_originate(session, &peer_session, cause, bridgeto, timeout, NULL, cid_name, cid_num, NULL, NULL, SOF_NO_LIMITS, NULL) !=
                SWITCH_STATUS_SUCCESS) {
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot create outgoing channel, cause: %s\n",
                                                  switch_channel_cause2str(*cause));
index 5a1b8c5d14b2fd407d713e4a7733544dc07d39f2..55429275dd3f88add9e8e379d81056e67fe135ad 100755 (executable)
@@ -2814,6 +2814,10 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
                        switch_event_destroy(&event);
                }
 
+               if ((flags & SOF_NO_LIMITS)) {
+                       myflags |= SOF_NO_LIMITS;
+               }
+
                if ((flags & SOF_FORKED_DIAL)) {
                        myflags |= SOF_NOBLOCK;
                }
index b9ab1b27ad67a555afd1e2fe1c77748d06f59b02..065386bc9f2799e4857ed8d64b69c577c39fb785 100644 (file)
@@ -766,7 +766,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
                                                                                                        switch_call_cause_t *cancel_cause)
 {
 
-       if ((*new_session = switch_core_session_request(&channel_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
+       if ((*new_session = switch_core_session_request(&channel_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) != 0) {
                private_t *tech_pvt;
                switch_channel_t *channel;
                switch_caller_profile_t *caller_profile;
@@ -1437,7 +1437,7 @@ static switch_status_t place_call(char **argv, int argc, switch_stream_handle_t
        }
        dest = argv[0];
 
-       if ((session = switch_core_session_request(&channel_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL)) != 0) {
+       if ((session = switch_core_session_request(&channel_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL)) != 0) {
                private_t *tech_pvt;
                switch_channel_t *channel;
                char *dialplan = globals.dialplan;
index 27cf1cf005652e112033c1e6c7d9dcd8cede7393..bb88ac5b1ae683e555589219eab74f06493c4438 100644 (file)
@@ -1628,7 +1628,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags,
                                                                                                        switch_call_cause_t *cancel_cause)
 {
-       if ((*new_session = switch_core_session_request(dingaling_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
+       if ((*new_session = switch_core_session_request(dingaling_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) != 0) {
                struct private_object *tech_pvt;
                switch_channel_t *channel;
                switch_caller_profile_t *caller_profile = NULL;
@@ -2948,7 +2948,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
                        goto done;
                }
 
-               if ((session = switch_core_session_request(dingaling_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL)) != 0) {
+               if ((session = switch_core_session_request(dingaling_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL)) != 0) {
                        switch_core_session_add_stream(session, NULL);
 
                        if ((tech_pvt = (struct private_object *) switch_core_session_alloc(session, sizeof(struct private_object))) != 0) {
index 02d031f289c651a0171b0073fd9b46a7e415539a..40a716671dd69f7856bf16f2fef225e428d765bf 100644 (file)
@@ -2274,7 +2274,7 @@ int new_inbound_channel(private_t * tech_pvt)
 
        switch_assert(tech_pvt != NULL);
        tech_pvt->ib_calls++;
-       if ((session = switch_core_session_request(gsmopen_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL)) != 0) {
+       if ((session = switch_core_session_request(gsmopen_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL)) != 0) {
                DEBUGA_GSMOPEN("2 SESSION_REQUEST %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(session));
                switch_core_session_add_stream(session, NULL);
                channel = switch_core_session_get_channel(session);
index c87f2258edfdce55a5deadc5052daad9319f188c..8275893be885f026d9e4607c367ee182e657718e 100644 (file)
@@ -211,7 +211,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
 
        if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND) && !switch_test_flag(tech_pvt, TFLAG_BLEG)) {
 
-               if (!(b_session = switch_core_session_request(loopback_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL))) {
+               if (!(b_session = switch_core_session_request(loopback_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL))) {
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Failure.\n");
                        goto end;
                }
@@ -834,7 +834,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
                switch_channel_pre_answer(channel);
        }
 
-       if ((*new_session = switch_core_session_request(loopback_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
+       if ((*new_session = switch_core_session_request(loopback_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) != 0) {
                private_t *tech_pvt;
                switch_channel_t *channel;
                switch_caller_profile_t *caller_profile;
index 9ff135823b855d28ec4c6365bc175631048e4094..a4a380d74e42e64200738fe63e4255cad3d59340 100644 (file)
@@ -735,7 +735,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
                                                                                                        switch_call_cause_t *cancel_cause)
 {
 
-       if ((*new_session = switch_core_session_request(portaudio_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
+       if ((*new_session = switch_core_session_request(portaudio_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) != 0) {
                private_t *tech_pvt;
                switch_channel_t *channel;
                switch_caller_profile_t *caller_profile;
@@ -1750,7 +1750,7 @@ static switch_status_t place_call(char **argv, int argc, switch_stream_handle_t
        }
        dest = argv[0];
 
-       if ((session = switch_core_session_request(portaudio_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL)) != 0) {
+       if ((session = switch_core_session_request(portaudio_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL)) != 0) {
                private_t *tech_pvt;
                switch_channel_t *channel;
                char *dialplan = globals.dialplan;
index d6bb1700faa3a126eeda599f27ee050eb3935cfa..385e29321f68293b3a3566fbc8155eb1eafa7cbc 100644 (file)
@@ -418,7 +418,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags,
                                                                                                        switch_call_cause_t *cancel_cause)
 {
-       if ((*new_session = switch_core_session_request(reference_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
+       if ((*new_session = switch_core_session_request(reference_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) != 0) {
                private_t *tech_pvt;
                switch_channel_t *channel;
                switch_caller_profile_t *caller_profile;
index 64b354dc36fd255c31a316bf38c808ff756461f3..3f48d6690d979f573f8a26b7f4edb70893c3a7ec 100644 (file)
@@ -1039,7 +1039,7 @@ switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, swi
                goto error;
        }
 
-       if (!(nsession = switch_core_session_request(skinny_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool))) {
+       if (!(nsession = switch_core_session_request(skinny_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool))) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error Creating Session\n");
                goto error;
        }
index 1759ab01858fd6639baeb11d0b56c98b325fa61e..af30080ce2d41170ca00ab2e1e785f82b48fb9f9 100644 (file)
@@ -1806,7 +1806,7 @@ int new_inbound_channel(private_t * p)
        switch_core_session_t *session = NULL;
        switch_channel_t *channel = NULL;
 
-       if ((session = switch_core_session_request(skypiax_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL)) != 0) {
+       if ((session = switch_core_session_request(skypiax_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL)) != 0) {
                switch_core_session_add_stream(session, NULL);
                channel = switch_core_session_get_channel(session);
                skypiax_tech_init(tech_pvt, session);
index 134e24ce32478793c1cc64e25b9619df2085aeb2..513a557553b449563c6099975a625ea9503d9d18 100644 (file)
@@ -1056,7 +1056,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
                                                                                                        switch_call_cause_t *cancel_cause)
 {
        private_t *tech_pvt = NULL;
-       if ((*new_session = switch_core_session_request(skypopen_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
+       if ((*new_session = switch_core_session_request(skypopen_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) != 0) {
                switch_channel_t *channel = NULL;
                switch_caller_profile_t *caller_profile;
                char *rdest;
@@ -1964,7 +1964,7 @@ int new_inbound_channel(private_t * tech_pvt)
        switch_core_session_t *session = NULL;
        switch_channel_t *channel = NULL;
 
-       if ((session = switch_core_session_request(skypopen_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL)) != 0) {
+       if ((session = switch_core_session_request(skypopen_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL)) != 0) {
                DEBUGA_SKYPE("2 SESSION_REQUEST %s\n", SKYPOPEN_P_LOG, switch_core_session_get_uuid(session));
                switch_core_session_add_stream(session, NULL);
                channel = switch_core_session_get_channel(session);
index 0868d9353d9868b5c1044f3852bf140190d2565f..6fcb06cfb6eb33cb9f47d1b79eb728d0582c0bd5 100644 (file)
@@ -3544,13 +3544,6 @@ SWITCH_STANDARD_API(sofia_function)
                        sofia_glue_recover(SWITCH_TRUE);
                        stream->write_function(stream, "Flushing recovery database.\n");
                } else {
-                       int32_t old = 0, x = 0;
-
-                       switch_core_session_ctl(SCSC_SPS, &old);
-
-                       x = 10000000;
-                       switch_core_session_ctl(SCSC_SPS, &x);
-                       
                        x = sofia_glue_recover(SWITCH_FALSE);
 
                        if (x) {
@@ -3558,8 +3551,6 @@ SWITCH_STANDARD_API(sofia_function)
                        } else {
                                stream->write_function(stream, "No calls to recover.\n");
                        }
-
-                       switch_core_session_ctl(SCSC_SPS, &old);
                }
 
                goto done;
@@ -3632,7 +3623,7 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
                goto error;
        }
 
-       if (!(nsession = switch_core_session_request(sofia_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool))) {
+       if (!(nsession = switch_core_session_request(sofia_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool))) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error Creating Session\n");
                goto error;
        }
index 49ddd2a27345515a65a330e69e86d8ca816aef35..943813bd05a7bcd7cc8dc66fd3029ddc0cab9cbc 100644 (file)
@@ -6119,9 +6119,9 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
 
        if (sofia_endpoint_interface) {
                if (sofia_test_pflag(profile, PFLAG_CALLID_AS_UUID)) {
-                       session = switch_core_session_request_uuid(sofia_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL, sip->sip_call_id->i_id);
+                       session = switch_core_session_request_uuid(sofia_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL, sip->sip_call_id->i_id);
                } else {
-                       session = switch_core_session_request(sofia_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL);
+                       session = switch_core_session_request(sofia_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL);
                }
        }
 
index 676b73686de74fe9f5b89e8bb3909d747dade536..e8356473852b845dc646f8c71494826cd0ec3dd0 100644 (file)
@@ -197,7 +197,7 @@ static switch_call_cause_t unicall_incoming_channel(zap_sigmsg_t *sigmsg, switch
 
        *sp = NULL;
 
-       if (!(session = switch_core_session_request(openzap_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL))) {
+       if (!(session = switch_core_session_request(openzap_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL))) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Initialization Error!\n");
                return ZAP_FAIL;
        }
@@ -1513,7 +1513,7 @@ static switch_call_cause_t unicall_outgoing_channel(switch_core_session_t *sessi
 
        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "unicall_outgoing_channel(%p)\n", (void *) session);
 
-       if ((*new_session = switch_core_session_request(unicall_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) == NULL) {
+       if ((*new_session = switch_core_session_request(unicall_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) == NULL) {
                return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
        }
 
index 45c83de3201379f4b631bb2f908ea7802e1a3885..74131644f925ee69a6fd2deaab87c9ffd0378abe 100644 (file)
@@ -1382,7 +1382,7 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_xml(switch_e
        parse_array(flag_str, flags, CF_FLAG_MAX);
        parse_array(cap_str, caps, CC_FLAG_MAX);
 
-       if (!(session = switch_core_session_request_uuid(endpoint_interface, direction, pool, uuid))) {
+       if (!(session = switch_core_session_request_uuid(endpoint_interface, direction, SOF_NO_LIMITS, pool, uuid))) {
                return NULL;
        }
 
@@ -1517,6 +1517,7 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_xml(switch_e
 SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_uuid(switch_endpoint_interface_t
                                                                                                                                                 *endpoint_interface,
                                                                                                                                                 switch_call_direction_t direction,
+                                                                                                                                                switch_originate_flag_t originate_flags,
                                                                                                                                                 switch_memory_pool_t **pool, const char *use_uuid)
 {
        switch_memory_pool_t *usepool;
@@ -1542,22 +1543,25 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_uuid(switch_
 
        PROTECT_INTERFACE(endpoint_interface);
 
-       switch_mutex_lock(runtime.throttle_mutex);
-       count = session_manager.session_count;
-       sps = --runtime.sps;
-       switch_mutex_unlock(runtime.throttle_mutex);
+       if (!(originate_flags & SOF_NO_LIMITS)) {
+               switch_mutex_lock(runtime.throttle_mutex);
+               count = session_manager.session_count;
+               sps = --runtime.sps;
+               switch_mutex_unlock(runtime.throttle_mutex);
+               
+               if (sps <= 0) {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Throttle Error! %d\n", session_manager.session_count);
+                       UNPROTECT_INTERFACE(endpoint_interface);
+                       return NULL;
+               }
 
-       if (sps <= 0) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Throttle Error! %d\n", session_manager.session_count);
-               UNPROTECT_INTERFACE(endpoint_interface);
-               return NULL;
+               if ((count + 1) > session_manager.session_limit) {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Over Session Limit! %d\n", session_manager.session_limit);
+                       UNPROTECT_INTERFACE(endpoint_interface);
+                       return NULL;
+               }
        }
 
-       if ((count + 1) > session_manager.session_limit) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Over Session Limit! %d\n", session_manager.session_limit);
-               UNPROTECT_INTERFACE(endpoint_interface);
-               return NULL;
-       }
 
        if (pool && *pool) {
                usepool = *pool;
@@ -1654,7 +1658,7 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_by_name(cons
                return NULL;
        }
 
-       session = switch_core_session_request(endpoint_interface, direction, pool);
+       session = switch_core_session_request(endpoint_interface, direction, SOF_NONE, pool);
 
        UNPROTECT_INTERFACE(endpoint_interface);
 
index f54639d883f18830c69dfe74737e328b3c24b45a..22b26eb4e0e5de1e1fde6b6e6fcce96d3561eb32 100644 (file)
@@ -2244,10 +2244,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                cid_num_override = switch_event_get_header(var_event, "origination_caller_id_number");
        }
 
+       if (flags & SOF_NO_LIMITS) {
+               dftflags |= SOF_NO_LIMITS;
+       }
+
        if (cid_num_override) {
                dftflags |= SOF_NO_EFFECTIVE_CID_NUM;
        }
-
+       
        if (cid_name_override) {
                dftflags |= SOF_NO_EFFECTIVE_CID_NAME;
        }
@@ -2450,11 +2454,16 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
 
                                if (and_argc > 1 || or_argc > 1) {
                                        myflags |= SOF_FORKED_DIAL;
-                               } else if (var_event) {
+                               } 
+
+                               if (var_event) {
                                        const char *vvar;
                                        if ((vvar = switch_event_get_header(var_event, "forked_dial")) && switch_true(vvar)) {
                                                myflags |= SOF_FORKED_DIAL;
                                        }
+                                       if ((vvar = switch_event_get_header(var_event, "no_throttle_limits")) && switch_true(vvar)) {
+                                               myflags |= SOF_NO_LIMITS;
+                                       }
                                }
 
                                /* only valid in [] since it's unique to each channel leg */