如何通过 asterisk 的 AMI API 执行拨号计划?
找不到这个问题的具体答案。我是 asterisk 和 AMI 的新手。我需要使用星号自动生成调用并将参数传递给 AGI 程序。使用调用文件似乎会首先生成不需要的调用。那么,如何使用 asterisk AMI API (PHP) 通过向其中传递所有参数来执行包含 AGI 的拨号计划?因此,AGI 将接管并做出决定。
Couldn't find a specific answer for this. I'm a newbie to asterisk and AMI. I need to auto generate calls using asterisk and pass parameters to an AGI program. Using a call file seems to generate the call first which is not wanted. So, how do I use asterisk AMI API (PHP) to execute a dialplan with AGI in it, by passing all parameters to it? So, the AGI will take over and make the call.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为在你的情况下,使用调用文件实际上会更简单。原因如下:
下面是使用调用文件执行此操作的简单方法的完整示例。我已尽力在相关评论中对其进行解释。
首先,我们假设您有一些使用变量的拨号计划代码,并调用 AGI 脚本(我假设您根据您的问题正在执行此操作)。这意味着您的
extensions.conf
文件中将包含如下所示的代码:下面是一个调用文件,该文件将:
需要在某个临时目录中创建(可能是
/ tmp/
)。保存后,您可以将其移动到
/var/spool/asterisk/outgoing/
来运行它(例如:mv /tmp/blah.call /var/spool /星号/传出/
)。呼叫文件将立即拨打电话号码 818-222-3333。
一旦 818-222-3333 的人员接听电话,Asterisk 将立即开始执行您的 [test_stuff] dialplan 代码,并且可以使用您的呼叫文件中设置的变量。
通话文件:
希望有帮助!
I think in your case, using call files would actually be simpler. Here's why:
Below is a full example of a simple way to do it using call files. I've tried my best to explain it in the associated comments.
Firstly, let's assume you have some dialplan code that uses variables, and calls an AGI script (which is what I assume you're doing based on your question). That means you'll have code in your
extensions.conf
file that looks something like:Below is a call file that will:
Need to be created in some temporary directory (maybe
/tmp/
).Once it has been saved, you can run it by moving it to
/var/spool/asterisk/outgoing/
(eg:mv /tmp/blah.call /var/spool/asterisk/outgoing/
).The call file will the immediately dial outbound to the phone number 818-222-3333.
Once the person at 818-222-3333 picks up the call, Asterisk will immediately start executing your [test_stuff] dialplan code, and will have the variables set in your call file available to it.
Call file:
Hope that helps!
您的问题可以借助本地通道来解决,例如
在调用文件中使用
Local/1812222222@test_stuff
作为通道,同时使用以下拨号方案您可以将此方法与接口 AMI 或 .call 文件一起使用
Your problem can be solved with the help of local channel for example
In call file use
Local/1812222222@test_stuff
as channels while using following dialplanYou can use this method with both interfaces AMI or .call file