Author Topic: Javascript + DTMF  (Read 11963 times)

asymetrixs

  • Administrator
  • Newbie
  • *****
  • Posts: 47
    • View Profile
Javascript + DTMF
« on: January 10, 2013, 07:53:10 PM »
Hi all,

is it possible to use DTMF in Javascript routing?

Can someone provide an example script?

Thanks!

ximik777

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Javascript + DTMF
« Reply #1 on: February 06, 2013, 07:01:54 AM »
a simple example


function CallRoute(msg)
{
        msg.retValue("dumb/");
        var ca = new Message('call.answered');
        ca['id'] = msg['id'];
        ca['targetid'] = msg['id'];
        ca.enqueue();

        function ChanDtmf(dmsg)
       {
            if(dmsg.text == 5)
            {
               // your code
            }

       }
        Message.install(ChanDtmf, "chan.dtmf", 90);
}
Message.install(CallRoute, 'call.route', 100);