mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-27 13:44:16 +00:00
pass originate flags into session_request so we can selectivly skip throttling
This commit is contained in:
1 parent
ab2529d4e1
commit
46c6650a94
18 files changed
+61
-50
No files matched your search
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user