FS-8588 #resolve [Unreliable digit collection]

This commit is contained in:
Anthony Minessale 2015-12-01 13:21:34 -06:00
parent 079040e4e7
commit f563760604
2 changed files with 13 additions and 1 deletions

View File

@ -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;

View File

@ -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'};