mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-28 06:04:20 +00:00
%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:
1 parent
43733a6166
commit
10a3fa55ef
2 files changed
+17
-3
No files matched your search
+13
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user