mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-13 13:40:44 +00:00
fix switch_ivr_collect_digits_callback to allow an args pointer with null callback to work like other apis
This commit is contained in:
parent
9fc6b2087a
commit
89d99a9196
@ -876,7 +876,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_callback(switch_core_s
|
|||||||
switch_time_t abs_started = 0, digit_started = 0;
|
switch_time_t abs_started = 0, digit_started = 0;
|
||||||
uint32_t abs_elapsed = 0, digit_elapsed = 0;
|
uint32_t abs_elapsed = 0, digit_elapsed = 0;
|
||||||
|
|
||||||
if (!args || !args->input_callback) {
|
if (!args) {
|
||||||
return SWITCH_STATUS_GENERR;
|
return SWITCH_STATUS_GENERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -917,6 +917,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_callback(switch_core_s
|
|||||||
|
|
||||||
|
|
||||||
if (switch_channel_has_dtmf(channel)) {
|
if (switch_channel_has_dtmf(channel)) {
|
||||||
|
if (!args->input_callback && !args->buf) {
|
||||||
|
status = SWITCH_STATUS_BREAK;
|
||||||
|
break;
|
||||||
|
}
|
||||||
switch_channel_dequeue_dtmf(channel, &dtmf);
|
switch_channel_dequeue_dtmf(channel, &dtmf);
|
||||||
status = args->input_callback(session, (void *) &dtmf, SWITCH_INPUT_TYPE_DTMF, args->buf, args->buflen);
|
status = args->input_callback(session, (void *) &dtmf, SWITCH_INPUT_TYPE_DTMF, args->buf, args->buflen);
|
||||||
if (digit_timeout) {
|
if (digit_timeout) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user