[Freeswitch-users] Handling DTMF noinput and nomatch

Yungwei Chen yungwei at resolvity.com
Tue May 24 20:34:00 MSD 2011


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");
   }



More information about the FreeSWITCH-users mailing list