提交 7920630c authored 作者: Travis Cross's avatar Travis Cross

mod_fifo: Refactor DTMF exit key matching

上级 c34ad2c0
...@@ -470,10 +470,8 @@ static switch_status_t on_dtmf(switch_core_session_t *session, void *input, swit ...@@ -470,10 +470,8 @@ static switch_status_t on_dtmf(switch_core_session_t *session, void *input, swit
if (switch_channel_test_flag(switch_core_session_get_channel(session), CF_BRIDGE_ORIGINATOR)) { if (switch_channel_test_flag(switch_core_session_get_channel(session), CF_BRIDGE_ORIGINATOR)) {
const char *consumer_exit_key = switch_channel_get_variable(channel, "fifo_consumer_exit_key"); const char *consumer_exit_key = switch_channel_get_variable(channel, "fifo_consumer_exit_key");
if (consumer_exit_key && dtmf->digit == *consumer_exit_key) { if (!consumer_exit_key) consumer_exit_key = "*";
switch_channel_hangup(bchan, SWITCH_CAUSE_NORMAL_CLEARING); if (dtmf->digit == *consumer_exit_key) {
return SWITCH_STATUS_BREAK;
} else if (!consumer_exit_key && dtmf->digit == '*') {
switch_channel_hangup(bchan, SWITCH_CAUSE_NORMAL_CLEARING); switch_channel_hangup(bchan, SWITCH_CAUSE_NORMAL_CLEARING);
return SWITCH_STATUS_BREAK; return SWITCH_STATUS_BREAK;
} else if (dtmf->digit == '0') { } else if (dtmf->digit == '0') {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论