[Freeswitch-users] Handling DTMF noinput and nomatch

Boris Kovalenko boris at tagnet.ru
Tue May 24 20:40:05 MSD 2011


Hello!

     And what is the problem to check length of dtmf_digits variable? 
This is string variable, so You may use dtmf_digits.length .
> Hi,
>
> The following javascript file asks callers to enter their 4 digit PINs.
> I am wondering if an event will be fired when a caller doesn't enter anything or enter just 3 digits.
> If not, what is the recommended way of handling those cases? Thanks.
>
>     function on_dtmf(session, type, digits, arg)
>     {
>         dtmf_digits += digits.digit;
>         return(false);
>     }
>
>     session.answer();
>
>     while (session.ready()) {
>         dtmf_digits = "";
>         session.flushDigits();
>         session.speak("flite", "kal", 'please enter your 4 digit pin', on_dtmf);
>         dtmf_digits = session.getDigits(4, "", 5000, 1000, 10000);
>         console_log("pin=" + dtmf_digits + "\n");
>     }
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org


-- 
Regards,
Boris





More information about the FreeSWITCH-users mailing list