【发布时间】:2013-08-01 18:00:48
【问题描述】:
我觉得这是一个简单的问题。也许它是如此简单,以至于以前从未被问过?我似乎无法找到答案或弄明白。
调用者看到的第一个 TwiML 如下所示。
<Response>
<Gather action="handle-extension.php" numDigits="3">
<Play>greatings/maingreating.mp3</Play>
<!-- Hello, if you know your party's 3 digit extenstion, please dial it at any time or press 0 for the directory. Otherwise, pelase hold while we find someone to take your call. -->
</Gather>
<!-- If customer doesn't input anything, prompt and try again. -->
<Redirect>handle-queue-main.php</Redirect>
</Response>
呼叫者应该能够拨打一个 3 位数的分机,并且该信息应该被传递到“handle-extension.php”。这很好用,但是......如果呼叫者为目录拨“0”,那么收集只是继续等待额外的 2 位数字。
在搜索时,我确实发现您可以像这样在 numDigits 中使用“”:
<Gather action="handle-extension.php" numDigits="< 3">
但这给了我与原始代码相同的结果。
我想到的另一个解决方案是使用:
<Gather action="handle-extension.php" numDigits="3" finishOnKey="0">
但这不适用于其中包含零的扩展名(101 将“1”发送到下一个脚本,110 发送“11”等)。
也许简单的解决方案是将目录扩展名更改为#,但坦率地说,这不是我想要的。
有什么建议吗?我正在尝试做的事情是否可能?
感谢您的宝贵时间! :)
【问题讨论】:
标签: twilio twilio-twiml