From: Anthony Minessale Date: Tue, 1 Dec 2015 19:21:34 +0000 (-0600) Subject: FS-8588 #resolve [Unreliable digit collection] X-Git-Tag: v1.6.6~1^2~77^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f563760604f2bfa9225e9c8325aa8fca26e53491;p=thirdparty%2Ffreeswitch.git FS-8588 #resolve [Unreliable digit collection] --- diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index eaf68ec636..595ca3517b 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -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; diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index 968c7d031d..89325b2c83 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -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'};