FS-8588 #resolve [Unreliable digit collection]
This commit is contained in:
parent
079040e4e7
commit
f563760604
|
@ -79,6 +79,7 @@ struct switch_ivr_dmachine {
|
||||||
void *user_data;
|
void *user_data;
|
||||||
switch_mutex_t *mutex;
|
switch_mutex_t *mutex;
|
||||||
switch_status_t last_return;
|
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;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dmachine->pinging) {
|
||||||
|
printf("doh\n");
|
||||||
|
return SWITCH_STATUS_BREAK;
|
||||||
|
}
|
||||||
|
|
||||||
|
dmachine->pinging = 1;
|
||||||
|
|
||||||
if (zstr(dmachine->digits) && !is_timeout) {
|
if (zstr(dmachine->digits) && !is_timeout) {
|
||||||
r = SWITCH_STATUS_SUCCESS;
|
r = SWITCH_STATUS_SUCCESS;
|
||||||
} else if (dmachine->cur_digit_len > dmachine->max_digit_len) {
|
} 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->last_return = r;
|
||||||
|
|
||||||
|
dmachine->pinging = 0;
|
||||||
|
|
||||||
switch_mutex_unlock(dmachine->mutex);
|
switch_mutex_unlock(dmachine->mutex);
|
||||||
|
|
||||||
return r;
|
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 you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
|
||||||
*/
|
*/
|
||||||
if (switch_channel_has_dtmf(channel)) {
|
if (switch_channel_has_dtmf(channel)) {
|
||||||
|
switch_channel_dequeue_dtmf(channel, &dtmf);
|
||||||
|
|
||||||
if (!args->input_callback && !args->buf && !args->dmachine) {
|
if (!args->input_callback && !args->buf && !args->dmachine) {
|
||||||
status = SWITCH_STATUS_BREAK;
|
status = SWITCH_STATUS_BREAK;
|
||||||
done = 1;
|
done = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch_channel_dequeue_dtmf(channel, &dtmf);
|
|
||||||
|
|
||||||
if (args->dmachine) {
|
if (args->dmachine) {
|
||||||
char ds[2] = {dtmf.digit, '\0'};
|
char ds[2] = {dtmf.digit, '\0'};
|
||||||
|
|
Loading…
Reference in New Issue