How to use several Kynetx applications in one telephone conversation with Twilio?

I want to be able to use several Kynetx applications (rule sets) in one phone call. Say the first application is a phone menu, and the second application provides functionality for a menu option. How to redirect from one to another?

+5
source share
1 answer

When you use the twilio: redirect () or twill: gather_start () action, the URL you specify is the relative URL.

All twilio webhooks provided by Kynetx have full URLshttp://webhooks.kynetxapps.net/t/appid/eventname

URL- , . :

URL- http://webhooks.kynetxapps.net/t/myappid/callstart twilio:redirect("sayhello") http://webhooks.kynetxapps.net/t/myappid/sayhello

.

, URL-, , URL-, :

URL: http://webhooks.kynetxapps.net/t/myappid/callstart twilio:redirect("../newappid/sayhello") : http://webhooks.kynetxapps.net/t/newappid/sayhello

, .

ruleset firstappid {
  meta {
    name "Phone Menu App"
    description <<
      Provides the Phone Menu
    >>
    author "Sam Curren"
    logging off
  }
  dispatch {}
  global {}

  rule menu {
    select when twilio givemenu
    {
      twill:gather_start("../secondappid/menuchoice") with numDigits = 1;
        twilio:say("Press 1 to speak do whatever.");
      twilio:gather_stop();
    }
  }
      
}

, .

ruleset secondappid {
  meta {
    name "Phone Menu Option"
    description <<
      Provides the menu functionality
    >>
    author "Sam Curren"
    logging off
  }
  dispatch {}
  global {}

  rule speak {
    select when twilio menuchoice Digits "1"
    {
      twilio:say("This is what you get when you press 1.");
      twilio:hangup();
    }
  }
}

twilio:redirect('../firstappid/givemenu') twilio:hangup(), .

+4

All Articles