我想在调用号码挂断后将调用者重定向到 IVR。我进行了研究,发现了一个名为 deadAGI
的东西,但我无法让它发挥作用。您可以在下面找到我的 extensions_custom.conf
文件。
[from-internal-custom]
exten => 80,1,AGI(custom/agi.php)
exten => 80,2,MixMonitor(${FILE}.WAV)
exten => 80,3,Dial(SIP/custom/${NUMBER})
exten => 80,4,Hangup()
exten => h,1,deadAGI(custom/finish)
我确信我的 AGI 文件是正确的。我只需要正确地在 hangup 命令后运行。
提前致谢。
最佳答案
“core show application Dial”指出:
g: Proceed with dialplan execution at the next priority in the current
extension if the destination channel hangs up.
因此将您的代码更改为:
[from-internal-custom]
exten => 80,1,AGI(custom/agi.php)
exten => 80,2,MixMonitor(${FILE}.WAV)
exten => 80,3,Dial(SIP/custom/${NUMBER},,g)
exten => 80,4,deadAGI(custom/finish)
exten => 80,5,Hangup()
如果您想在调用者或被调用者挂断电话后立即运行您的脚本:
e: Execute the 'h' extension for peer after the call ends
所以:
[from-internal-custom]
exten => 80,1,AGI(custom/agi.php)
exten => 80,2,MixMonitor(${FILE}.WAV)
exten => 80,3,Dial(SIP/custom/${NUMBER},,ge)
exten => 80,4,deadAGI(custom/finish)
exten => 80,5,Hangup()
exten => h,1,deadAGI(custom/finish)
您的想法几乎可以。 'h' 是一个扩展名,而不是一个优先级。
关于挂机后的 Asterisk IVR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34960506/