FSCORE-452
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15028 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
160535da6d
commit
d9fb89d285
|
@ -2102,28 +2102,6 @@ SWITCH_STANDARD_APP(audio_bridge_function)
|
|||
continue_on_fail = switch_channel_get_variable(caller_channel, "continue_on_fail");
|
||||
failure_causes = switch_channel_get_variable(caller_channel, "failure_causes");
|
||||
|
||||
if ((var = switch_channel_get_variable(caller_channel, SWITCH_PROXY_MEDIA_VARIABLE)) && switch_true(var)) {
|
||||
switch_channel_set_flag(caller_channel, CF_PROXY_MEDIA);
|
||||
}
|
||||
|
||||
if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)
|
||||
|| ((var = switch_channel_get_variable(caller_channel, SWITCH_BYPASS_MEDIA_VARIABLE)) && switch_true(var))) {
|
||||
if (!switch_channel_test_flag(caller_channel, CF_ANSWERED)
|
||||
&& !switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA)) {
|
||||
switch_channel_set_flag(caller_channel, CF_PROXY_MODE);
|
||||
} else {
|
||||
if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)) {
|
||||
switch_ivr_media(switch_core_session_get_uuid(session), SMF_REBRIDGE);
|
||||
switch_channel_set_flag(caller_channel, CF_PROXY_MODE);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Channel is already up, delaying proxy mode 'till both legs are answered.\n");
|
||||
switch_channel_set_variable(caller_channel, "bypass_media_after_bridge", "true");
|
||||
switch_channel_set_variable(caller_channel, SWITCH_BYPASS_MEDIA_VARIABLE, NULL);
|
||||
switch_channel_clear_flag(caller_channel, CF_PROXY_MODE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Originate Failed. Cause: %s\n", switch_channel_cause2str(cause));
|
||||
|
||||
|
|
|
@ -112,6 +112,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
|
|||
|
||||
if (!(session->read_codec && session->read_codec->implementation && switch_core_codec_ready(session->read_codec))) {
|
||||
if (switch_channel_test_flag(session->channel, CF_PROXY_MODE) || switch_channel_get_state(session->channel) == CS_HIBERNATE) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "%s reading on a session with no media!\n", switch_channel_get_name(session->channel));
|
||||
switch_cond_next();
|
||||
*frame = &runtime.dummy_cng_frame;
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -815,6 +815,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
|
|||
const char *var;
|
||||
switch_call_cause_t cause;
|
||||
|
||||
if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Call has no media... Redirecting to signal bridge.\n");
|
||||
return switch_ivr_signal_bridge(session, peer_session);
|
||||
}
|
||||
|
||||
switch_channel_set_flag(caller_channel, CF_ORIGINATOR);
|
||||
|
||||
b_leg->session = peer_session;
|
||||
|
|
|
@ -999,9 +999,37 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||
int local_clobber = 0;
|
||||
const char *cancel_key = NULL;
|
||||
|
||||
if (session) {
|
||||
caller_channel = switch_core_session_get_channel(session);
|
||||
oglobals.session = session;
|
||||
|
||||
if (switch_true(switch_channel_get_variable(caller_channel, SWITCH_PROXY_MEDIA_VARIABLE))) {
|
||||
switch_channel_set_flag(caller_channel, CF_PROXY_MEDIA);
|
||||
}
|
||||
|
||||
if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)
|
||||
|| (switch_true(switch_channel_get_variable(caller_channel, SWITCH_BYPASS_MEDIA_VARIABLE)))) {
|
||||
if (!switch_channel_test_flag(caller_channel, CF_ANSWERED)
|
||||
&& !switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA)) {
|
||||
switch_channel_set_flag(caller_channel, CF_PROXY_MODE);
|
||||
} else {
|
||||
if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)) {
|
||||
switch_ivr_media(switch_core_session_get_uuid(session), SMF_REBRIDGE);
|
||||
switch_channel_set_flag(caller_channel, CF_PROXY_MODE);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Channel is already up, delaying proxy mode 'till both legs are answered.\n");
|
||||
switch_channel_set_variable(caller_channel, "bypass_media_after_bridge", "true");
|
||||
switch_channel_set_variable(caller_channel, SWITCH_BYPASS_MEDIA_VARIABLE, NULL);
|
||||
switch_channel_clear_flag(caller_channel, CF_PROXY_MODE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
oglobals.idx = IDX_NADA;
|
||||
oglobals.early_ok = 1;
|
||||
oglobals.session = session;
|
||||
|
||||
|
||||
|
||||
*bleg = NULL;
|
||||
|
@ -1107,8 +1135,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||
switch_event_header_t *hi;
|
||||
const char *cdr_total_var;
|
||||
|
||||
caller_channel = switch_core_session_get_channel(oglobals.session);
|
||||
|
||||
if ((cdr_total_var = switch_channel_get_variable(caller_channel, "failed_xml_cdr_total"))) {
|
||||
int tmp = atoi(cdr_total_var);
|
||||
if (tmp > 0) {
|
||||
|
|
Loading…
Reference in New Issue