%FEATURE add bypass_media_resume_on_hold and bypass_media_after_hold variables to be set to true to enable these functions on a per channel basis
This commit is contained in:
parent
43733a6166
commit
10a3fa55ef
|
@ -6910,8 +6910,10 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_core_session_message_t *msg;
|
||||
private_object_t *other_tech_pvt;
|
||||
|
||||
if (switch_channel_test_flag(channel, CF_PROXY_MODE) && !is_t38 && (profile->media_options & MEDIA_OPT_MEDIA_ON_HOLD)) {
|
||||
int media_on_hold = switch_true(switch_channel_get_variable_dup(channel, "bypass_media_resume_on_hold", SWITCH_FALSE, -1));
|
||||
|
||||
if (switch_channel_test_flag(channel, CF_PROXY_MODE) && !is_t38 &&
|
||||
((profile->media_options & MEDIA_OPT_MEDIA_ON_HOLD) || media_on_hold)) {
|
||||
if (switch_stristr("sendonly", r_sdp) || switch_stristr("0.0.0.0", r_sdp)) {
|
||||
tech_pvt->mparams.hold_laps = 1;
|
||||
switch_channel_set_variable(channel, SWITCH_R_SDP_VARIABLE, r_sdp);
|
||||
|
|
|
@ -4073,11 +4073,23 @@ SWITCH_DECLARE(int) switch_core_media_toggle_hold(switch_core_session_t *session
|
|||
|
||||
if (switch_channel_test_flag(session->channel, CF_PROTO_HOLD)) {
|
||||
const char *val;
|
||||
int media_on_hold_a = switch_true(switch_channel_get_variable_dup(session->channel, "bypass_media_resume_on_hold", SWITCH_FALSE, -1));
|
||||
int media_on_hold_b = switch_true(switch_channel_get_variable_dup(b_channel, "bypass_media_resume_on_hold", SWITCH_FALSE, -1));
|
||||
int bypass_after_hold_a = 0;
|
||||
int bypass_after_hold_b = 0;
|
||||
|
||||
if (media_on_hold_a) {
|
||||
bypass_after_hold_a = switch_true(switch_channel_get_variable_dup(session->channel, "bypass_media_after_hold", SWITCH_FALSE, -1));
|
||||
}
|
||||
|
||||
if (media_on_hold_b) {
|
||||
bypass_after_hold_b = switch_true(switch_channel_get_variable_dup(b_channel, "bypass_media_after_hold", SWITCH_FALSE, -1));
|
||||
}
|
||||
|
||||
switch_yield(250000);
|
||||
|
||||
if (b_channel && (switch_channel_test_flag(session->channel, CF_BYPASS_MEDIA_AFTER_HOLD) ||
|
||||
switch_channel_test_flag(b_channel, CF_BYPASS_MEDIA_AFTER_HOLD))) {
|
||||
switch_channel_test_flag(b_channel, CF_BYPASS_MEDIA_AFTER_HOLD) || bypass_after_hold_a || bypass_after_hold_b)) {
|
||||
/* try to stay out from media stream */
|
||||
switch_ivr_nomedia(switch_core_session_get_uuid(session), SMF_REBRIDGE);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue