从命令行执行Dialplan上下文 [英] Execute dialplan context from command line

查看:112
本文介绍了从命令行执行Dialplan上下文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在上下文中通过命令行执行扩展(通过星号-rx命令"),该上下文使基于AGI的查询确定需要拨打的扩展(这些扩展在数据库上进行了更新)

I'm trying to execute an extension from the command line (via asterisk -rx "command") on a context that makes a AGI based query to determine which extension needs to be dialed (these extensions are updated on the DB).

是这样的:

[autodialer]
exten => 2,1,Answer()
exten => 2,n,AGI(database_query.php); Makes a database query and generates vars
exten => 2,n,Set(CALLERID(name)=${db_customer_name}); Sets callerid from DB data
exten => 2,n,Dial(SIP/${db_customer_extension}); Also, extensions are stored on DB
exten => 2,n,Playback(custom/important_message)
exten => 2,n,SayDigits(${important_numbers}); The message, stored on DB too.
exten => h,1,Hangup()

在这里,我需要从命令行执行上下文,而不必从任何扩展名拨打它(应该每隔X次使用crontab执行一次).

Here, I need that context executed from command line, without having to dial it from any extension (it is supposed to be executed with a crontab every X time).

我尝试过使用 originate 命令,但是我认为我误解了该命令的语法,因此无法正常工作.

I tried with originate command, but I think I misunderstood the command syntax and didn't work.

我认为应该是这样的: asterisk -rx"channel origin 2 @ autodialer" 然后Asterisk执行该上下文,我们都对我们的重要数字感到满意.

I think that it should be something like: asterisk -rx "channel originate 2@autodialer" and then Asterisk executes that context and we're all happy with our important numbers.

我知道这不是正确的语法,只是试图解释我认为它如何工作.

I know that's not the right syntax, just trying to explain how I imagine it could work.

感谢您的帮助.

推荐答案

没有办法只产生一条腿.您提供了第二个参数(其他频道目标)

There are no way do originate only one leg. You have supply second argument(other channel dest)

如果您不需要其他频道,请创建这样的上下文

if you not need other channel, create context like this

[wait]

exten =>s,1,Wait(10000)

并使用

asterisk -rx "channel originate 2@autodialer s@wait" 

阅读本文:

http://www.voip-info.org/Wiki/view/Asterisk +自动拨号+退出

注意:不建议为拥有不到5年专门星号经验的人使用Diallout应用程序.如果需要,请使用vicidial.org或其他拨号程序.

NOTE: it is not recommended do diallout apps for people with less then 5 years dedicated asterisk experience. If you want one, use vicidial.org or other dialler.

这篇关于从命令行执行Dialplan上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆