我正在尝试制作一个脚本,使 Asterisk 执行的调用文件,但是我希望调用文件中的扩展名与我的扩展名模式相匹配。
调用文件:
Channel: trunk/10
Context: call-file
Extension: 123
Priority: 1
扩展.conf:
[call-file]
exten = _XXX,1,NoOp(it works)
123 应该能够与 _XXX 匹配,但是只有当我在我的 extensions.conf 中明确写入 123 时它才有效。使用该模式我收到以下错误:
sent to invalid extension but no invalid handler: context,exten,priority=call-file,123,1
答案1
请注意,它首先尝试呼叫 trunk/10。
你的例子对我有用
Asterisk 1.8.32.2
[call-file]
exten = _XXX,1,NoOp(it works)
exten = _XXX,n,Wait(100)
exten => s,1,Answer
exten => s,2,Wait(10)
Channel: Local/s@call-file/n
Context: call-file
Extension: 123
Priority: 1
结果:
-- Executing [s@call-file:1] Answer("Local/s@call-file-00000000;2", "") in new stack
-- Executing [123@call-file:1] NoOp("Local/s@call-file-00000000;1", "it works") in new stack
-- Executing [123@call-file:2] Wait("Local/s@call-file-00000000;1", "100") in new stack
-- Remote UNIX connection
-- Executing [s@call-file:2] Wait("Local/s@call-file-00000000;2", "10") in new stack
也许它无法呼叫中继或者您需要更新您的星号。