在Nexmo中,如何通过NCCO输入动作传递参数

时间:2017-11-08 21:22:43

标签: events parameters action ivr nexmo

我正在使用laravel 5.2而我正试图从https://developer.nexmo.com/tutorials/interactive-voice-response#receive-user-input-webhook进行“路由呼入呼叫”。

所以我知道我可以将'input'用作'action'并路由为'eventUrl'。 https://developer.nexmo.com/api/voice/ncco#input

例如,根据该页面,我可以这样使用。

[
  {
    "action": "talk",
    "text": "Please enter a digit"
  },
  {
    "action": "input",
    "eventUrl": ["https://example.com/ivr"]
  }
]

问题出在这里。

我想将一些参数传递给该路线 - “https://example.com/ivr”。例如来自下面的电话号码。

[
  {
    "action": "talk",
    "text": "Please enter a digit"
  },
  {
    "action": "input",
    "eventUrl": ["https://example.com/ivr"],
    "from": $fromPhoneNumber,
  }
]

但似乎没有办法将参数传递给'eventUrl'。

它说现在只有下面的东西。

timeOut The result of the callee's activity is sent to the eventUrl webhook endpoint timeOut seconds after the last action. The default value is 3. No
maxDigits   The number of digits the user can press. The maximum value is 20.   No
submitOnHash    Set to true so the callee's activity is sent to your webhook endpoint at eventUrl after he or she presses #. If # is not pressed the result is submitted after timeOut seconds. The default value is false. That is, the result is sent to your webhook endpoint after timeOut seconds. No
eventUrl    Nexmo sends the digits pressed by the callee to this URL after timeOut pause in activity or when # is pressed.  No
eventMethod The HTTP method used to send event information to event_url The default value is POST.  No

如何通过NCCO传递参数?请告诉我。

1 个答案:

答案 0 :(得分:2)

您可以将参数作为查询字符串的一部分添加到eventUrl。

萨姆 开发者倡导者 - Nexmo