play_and_get_digits no input vs wrong input

Status
Not open for further replies.

ewdpb

Member
Oct 3, 2019
151
19
18
I am writing a LUA script using freeswitch play_and_get_digits. The code is quite simple:

Code:
    local caller_input = session:playAndGetDigits(min_digits_allowed, max_digits_allowed, max_tries, timeout, terminators, audio, audio_on_invalid_input, pattern, caller_input, interdigit_timeout);

It works well. My only problem is when the caller does not enter anything. By default it play the audio defined in audio_on_invalid_input which I use to inform the caller the value they entered is not valid. I would like to be able to differentiate between wrong input (e.g. digit 5 when only 1 or 2 are allowed) and no input at all.

What would the best way to do this be?

Thanks!
 
Status
Not open for further replies.