Merge pull request #1492 in FS/freeswitch from ~HUNYI/freeswitch:bugfix/FS-8579-broadcast-hold-bleg to master

* commit '554387c8dc53b0e3a8b9d530a799d681cef5e6e6':
  Skip holding b leg only if it is on hold
This commit is contained in:
Mike Jerris 2018-09-05 22:35:31 +00:00
commit 99df402921
2 changed files with 5 additions and 1 deletions

View File

@ -1366,6 +1366,7 @@ CF_ACCEPT_CNG - Channel will accept CNG frames
CF_REDIRECT - Channel is being redirected
CF_BRIDGED - Channel in a bridge
CF_HOLD - Channel is on hold
CF_HOLD_BLEG - B leg is on hold
CF_SERVICE - Channel has a service thread
CF_TAGGED - Channel is tagged
CF_WINNER - Channel is the winner
@ -1417,6 +1418,7 @@ typedef enum {
CF_REDIRECT,
CF_BRIDGED,
CF_HOLD,
CF_HOLD_BLEG,
CF_SERVICE,
CF_TAGGED,
CF_WINNER,

View File

@ -572,7 +572,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
switch_channel_clear_flag(channel, CF_STOP_BROADCAST);
if (!switch_channel_test_flag(channel, CF_BRIDGED) || switch_channel_test_flag(channel, CF_BROADCAST)) {
if (!switch_channel_test_flag(channel, CF_BRIDGED) || switch_channel_test_flag(channel, CF_HOLD_BLEG)) {
inner++;
hold_bleg = NULL;
}
@ -597,6 +597,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
if ((b_session = switch_core_session_locate(b_uuid))) {
switch_channel_t *b_channel = switch_core_session_get_channel(b_session);
switch_status_t st;
switch_channel_set_flag(channel, CF_HOLD_BLEG);
switch_ivr_broadcast(b_uuid, stream, SMF_ECHO_ALEG | SMF_LOOP);
st = switch_channel_wait_for_flag(b_channel, CF_BROADCAST, SWITCH_TRUE, 5000, NULL);
@ -649,6 +650,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
if (b_uuid) {
if ((b_session = switch_core_session_locate(b_uuid))) {
switch_channel_t *b_channel = switch_core_session_get_channel(b_session);
switch_channel_clear_flag(channel, CF_HOLD_BLEG);
switch_channel_stop_broadcast(b_channel);
switch_channel_wait_for_flag(b_channel, CF_BROADCAST, SWITCH_FALSE, 5000, NULL);
switch_core_session_rwunlock(b_session);