[Freeswitch-users] how to start dtmf timeout countdown after last digit in javascript

Shabbir abbasi shabbirabbasi92 at gmail.com
Tue Dec 8 17:56:20 MSK 2015


i am trying to make an javascripot ivr  and collecting user input ,
but  during collection   session.collectInput( mycb, dtmf, timeout );
gets timeout and returns



function mycb( session, type, obj, arg ) {
   try {
       if ( type == "dtmf" ) {
         console_log( "info", "digit: "+obj.digit+"\n" );
         if ( obj.digit == "#" ) {
           console_log( "info", "detected pound sign.\n" );
           exit = true;
           return( false );
         }

         dtmf.digits += obj.digit;

         if ( dtmf.digits.length >= digitmaxlength ) {
           exit = true;
           return( false );
         }
       }
   } catch (e) {
       console_log( "err", e+"\n" );
   }
   return( true );
} //end function collect_user_input




i want that timeout gets started countdown after last digit pressed
how to solve this  ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20151208/58c6c371/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list