2010-11-29 2 views

답변

4

twilio : redirect() 또는 twill : gather_start() 액션을 사용할 때 제공하는 URL은 상대 URL입니다.

모든 twilio webhooks provided by Kynetx

http://webhooks.kynetxapps.net/t/appid/eventname이에 상대 URL에 전달하면

의 전체 URL을 가지고,이를 기준으로 해결됩니다. 예 :이 동일한 응용 프로그램에 새로운 이벤트에 보내드립니다

http://webhooks.kynetxapps.net/t/myappid/sayhellohttp://webhooks.kynetxapps.net/t/myappid/callstart의 기본 URL로

는 작업 twilio:redirect("sayhello")가 해결됩니다. http://webhooks.kynetxapps.net/t/newappid/sayhello : twilio:redirect("../newappid/sayhello")가 해결 조치를 http://webhooks.kynetxapps.net/t/myappid/callstart : 당신이 애플 리케이션을 전환하려면

, 새 APPID 포함한 전체 URL을 제공하거나, 다음과 같이 상대 URL을 사용할 수 있습니다 : 기본 URL로

다음은 메뉴 선택에 다른 앱을 사용하는 앱의 예입니다.

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

그리고 메뉴 선택을받는 앱. twilio:redirect('../firstappid/givemenu') 대신 twilio:hangup()의 작용을 이용하여

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

,이 규칙은 다시 처음으로 응용 프로그램을 재 지정 할 수있다.

+0

전체 규칙 집합의 예를 좋아합니다! –

+1

전체 앱을 계속 표시하면서 가능한 한 간단하게 만들려고했습니다. – TelegramSam

관련 문제