提交 5254865c authored 作者: Anthony Minessale's avatar Anthony Minessale

tweak fifo

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8013 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 85b79c08
...@@ -84,7 +84,10 @@ static switch_status_t moh_on_dtmf(switch_core_session_t *session, void *input, ...@@ -84,7 +84,10 @@ static switch_status_t moh_on_dtmf(switch_core_session_t *session, void *input,
case SWITCH_INPUT_TYPE_DTMF: case SWITCH_INPUT_TYPE_DTMF:
{ {
switch_dtmf_t *dtmf = (switch_dtmf_t *) input; switch_dtmf_t *dtmf = (switch_dtmf_t *) input;
if (dtmf->digit == '*') { switch_channel_t *channel = switch_core_session_get_channel(session);
const char *caller_exit_key = switch_channel_get_variable(channel, "fifo_caller_exit_key");
if (caller_exit_key && dtmf->digit == *caller_exit_key) {
char *bp = buf; char *bp = buf;
*bp = dtmf->digit; *bp = dtmf->digit;
return SWITCH_STATUS_BREAK; return SWITCH_STATUS_BREAK;
...@@ -312,6 +315,7 @@ SWITCH_STANDARD_APP(fifo_function) ...@@ -312,6 +315,7 @@ SWITCH_STANDARD_APP(fifo_function)
while(switch_channel_ready(channel)) { while(switch_channel_ready(channel)) {
switch_input_args_t args = { 0 }; switch_input_args_t args = { 0 };
char buf[25] = ""; char buf[25] = "";
const char *caller_exit_key = switch_channel_get_variable(channel, "fifo_caller_exit_key");
args.input_callback = moh_on_dtmf; args.input_callback = moh_on_dtmf;
args.buf = buf; args.buf = buf;
args.buflen = sizeof(buf); args.buflen = sizeof(buf);
...@@ -327,7 +331,7 @@ SWITCH_STANDARD_APP(fifo_function) ...@@ -327,7 +331,7 @@ SWITCH_STANDARD_APP(fifo_function)
switch_ivr_collect_digits_callback(session, &args, 0); switch_ivr_collect_digits_callback(session, &args, 0);
} }
if (*buf == '*') { if (caller_exit_key && *buf == *caller_exit_key) {
aborted = 1; aborted = 1;
goto abort; goto abort;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论