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

FS-8588 #resolve [Unreliable digit collection]

上级 079040e4
......@@ -79,6 +79,7 @@ struct switch_ivr_dmachine {
void *user_data;
switch_mutex_t *mutex;
switch_status_t last_return;
uint8_t pinging;
};
......@@ -487,6 +488,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
return SWITCH_STATUS_SUCCESS;
}
if (dmachine->pinging) {
printf("doh\n");
return SWITCH_STATUS_BREAK;
}
dmachine->pinging = 1;
if (zstr(dmachine->digits) && !is_timeout) {
r = SWITCH_STATUS_SUCCESS;
} else if (dmachine->cur_digit_len > dmachine->max_digit_len) {
......@@ -579,6 +587,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
dmachine->last_return = r;
dmachine->pinging = 0;
switch_mutex_unlock(dmachine->mutex);
return r;
......
......@@ -1490,12 +1490,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
*/
if (switch_channel_has_dtmf(channel)) {
switch_channel_dequeue_dtmf(channel, &dtmf);
if (!args->input_callback && !args->buf && !args->dmachine) {
status = SWITCH_STATUS_BREAK;
done = 1;
break;
}
switch_channel_dequeue_dtmf(channel, &dtmf);
if (args->dmachine) {
char ds[2] = {dtmf.digit, '\0'};
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论