提交 c423e209 authored 作者: Anthony Minessale's avatar Anthony Minessale

pass indication when in app mode on mod_loopback

上级 cf5c1d21
......@@ -53,7 +53,8 @@ typedef enum {
TFLAG_BOWOUT = (1 << 5),
TFLAG_BLEG = (1 << 6),
TFLAG_APP = (1 << 7),
TFLAG_BOWOUT_USED = (1 << 8)
TFLAG_RUNNING_APP = (1 << 8),
TFLAG_BOWOUT_USED = (1 << 9)
} TFLAGS;
struct private_object {
......@@ -321,11 +322,16 @@ static switch_status_t channel_on_routing(switch_core_session_t *session)
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n", switch_channel_get_name(channel));
if (switch_test_flag(tech_pvt, TFLAG_RUNNING_APP)) {
switch_clear_flag(tech_pvt, TFLAG_RUNNING_APP);
}
if (switch_test_flag(tech_pvt, TFLAG_APP) && !switch_test_flag(tech_pvt, TFLAG_OUTBOUND) &&
(app = switch_channel_get_variable(channel, "loopback_app"))) {
switch_caller_extension_t *extension = NULL;
switch_clear_flag(tech_pvt, TFLAG_APP);
switch_set_flag(tech_pvt, TFLAG_RUNNING_APP);
arg = switch_channel_get_variable(channel, "loopback_app_arg");
extension = switch_caller_extension_new(session, app, app);
......@@ -718,6 +724,18 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
tech_pvt = switch_core_session_get_private(session);
switch_assert(tech_pvt != NULL);
if (switch_test_flag(tech_pvt, TFLAG_RUNNING_APP)) {
switch_status_t r = SWITCH_STATUS_FALSE;
switch_core_session_t *other_session;
if (switch_core_session_get_partner(session, &other_session)) {
r = switch_core_session_receive_message(other_session, msg);
switch_core_session_rwunlock(other_session);
}
return r;
}
switch (msg->message_id) {
case SWITCH_MESSAGE_INDICATE_ANSWER:
if (tech_pvt->other_channel && !switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论