fix bug in mod_loopback where bowout=false

This commit is contained in:
Anthony Minessale 2010-09-29 10:21:14 -05:00
parent 7577b8aae8
commit e9ab5368f1
1 changed files with 6 additions and 2 deletions

View File

@ -52,7 +52,8 @@ typedef enum {
TFLAG_BRIDGE = (1 << 4), TFLAG_BRIDGE = (1 << 4),
TFLAG_BOWOUT = (1 << 5), TFLAG_BOWOUT = (1 << 5),
TFLAG_BLEG = (1 << 6), TFLAG_BLEG = (1 << 6),
TFLAG_APP = (1 << 7) TFLAG_APP = (1 << 7),
TFLAG_BOWOUT_USED = (1 << 8)
} TFLAGS; } TFLAGS;
struct private_object { struct private_object {
@ -635,7 +636,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
tech_pvt = switch_core_session_get_private(session); tech_pvt = switch_core_session_get_private(session);
switch_assert(tech_pvt != NULL); switch_assert(tech_pvt != NULL);
if (switch_test_flag(frame, SFF_CNG) || switch_test_flag(tech_pvt, TFLAG_CNG) || switch_test_flag(tech_pvt, TFLAG_BOWOUT)) { if (switch_test_flag(frame, SFF_CNG) || switch_test_flag(tech_pvt, TFLAG_CNG) || (switch_test_flag(tech_pvt, TFLAG_BOWOUT) && switch_test_flag(tech_pvt, TFLAG_BOWOUT_USED))) {
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
@ -662,6 +663,9 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
switch_clear_flag_locked(tech_pvt, TFLAG_WRITE); switch_clear_flag_locked(tech_pvt, TFLAG_WRITE);
switch_clear_flag_locked(tech_pvt->other_tech_pvt, TFLAG_WRITE); switch_clear_flag_locked(tech_pvt->other_tech_pvt, TFLAG_WRITE);
switch_set_flag_locked(tech_pvt, TFLAG_BOWOUT_USED);
switch_set_flag_locked(tech_pvt->other_tech_pvt, TFLAG_BOWOUT_USED);
if (a_uuid && b_uuid) { if (a_uuid && b_uuid) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,
"%s detected bridge on both ends, attempting direct connection.\n", switch_channel_get_name(channel)); "%s detected bridge on both ends, attempting direct connection.\n", switch_channel_get_name(channel));