gpt4 book ai didi

php - 如何在拨号方案中获取 dtmf 值

转载 作者:可可西里 更新时间:2023-10-31 23:07:59 27 4
gpt4 key购买 nike

我有一个拨号方案,我想要的是,如果用户按任意键然后再次播放文件,但我不明白如何在拨号方案中获取dtmf 值。这是我的拨号方案:

[callme]  
exten => s,1,Answer
exten => s,n,Playback(demo/${FILENAME1})

首先如何获取 DTMF 值,如果用户按任意键,则播放应执行 2 次。但我想使用 dialplan 管理所有这些事情。

最佳答案

您可以使用 WaitExten [1] 来完成:

[callme]  
exten => s,1,Answer
exten => s,n,Playback(demo/${FILENAME1})
exten => s,n,WaitExten(3)
exten => s,n,Goto(s,1)
exten => 1,1,Noop(user pressed 1)
exten => 1,n,Goto(however-shall-go-to-when-pressed-1)
exten => 2,1,Noop(user pressed 2)
exten => 2,n,Goto(however-shall-go-to-when-pressed-2)

使用扩展模式 [2]:

[callme]  
exten => s,1,Answer
exten => s,n,Playback(demo/${FILENAME1})
exten => s,n,WaitExten(3)
exten => s,n,Goto(s,1)
exten => X,1,Noop(user pressed ${EXTEN})
exten => X,n,Goto(however-shall-go-to-when-pressed-${EXTEN})

这正是您所要求的:

[callme]  
exten => s,1,Answer
exten => s,n,Playback(demo/${FILENAME1})
exten => s,n,WaitExten(3)
exten => s,n,NoOp(going on - no dtmf detectd)
exten => X,1,Noop(user pressed ${EXTEN})
exten => X,n,Goto(s,1)

另请查看背景 Asterisk 应用程序 [3]。

引用资料:

[1] http://www.voip-info.org/wiki/view/Asterisk+cmd+WaitExten

[2] http://www.voip-info.org/wiki/view/Asterisk+Dialplan+Patterns

[3] http://www.voip-info.org/wiki/view/Asterisk+cmd+BackGround

关于php - 如何在拨号方案中获取 dtmf 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12328460/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com