如何在星号的extensions.conf中为添加工作站创建自定义conf文件? [英] How to create custom conf file for add stations in extensions.conf, asterisk?

查看:268
本文介绍了如何在星号的extensions.conf中为添加工作站创建自定义conf文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用Java& Java编写的项目.处理星号. 通过Java程序,我选择了站号,例如最大编号为90、900或9000. 对于添加星号,我处理了3个文件 sip.conf queues.conf extensions.conf 在extensions.conf中,我专门进行了以下设置以快速添加工作站. extenpatternmatchnew =是

I am working project which written in java & handle asterisk. By java program i select station numbers like max no 90 or 900 or 9000. For adding in asterisk i handle 3 files sip.conf queues.conf extensions.conf In extensions.conf i done following setting specifically for adding stations quick. extenpatternmatchnew=yes

通过这种方式,我可以在20-30秒内在extensions.conf中输入90个电台 8-9分钟内900个车站 & 9000历经5个小时 但是我得到的信息 我们可以根据需要包含任意数量的conf文件. #include另一个拨号计划-星号 但我的问题是 如果我想在extensions.conf文件中添加9000个站,通过#include的技术 我可以放置temp1.conf,0到1000个工作站 temp2.​​conf,1001至2000个工作站

By this i can enter 90 stations within 20-30sec in extensions.conf 900 stations within 8-9 min & 9000 withing 5 hours But i got info that we can include as many conf files as we want. #include another dialplan - asterisk but my question is If i want to add 9000 stations in extensions.conf file & by technique of #include Can i put temp1.conf, 0 to 1000 stations temp2.conf, 1001 to 2000 stations

tempN.conf,N个到最后一个无站 如果我可以,那么temp.conf的格式是什么? 这样可以减少在extensions.conf,sip.cof,queues.conf中添加大量工作站的时间吗? 请需要帮助!

tempN.conf, N to last-No stations If i can then what is format of temp.conf? By doing this can i reduce time to adding large number of stations in extensions.conf,sip.cof, queues.conf? Need help please!

推荐答案

The #include statement doesn't affect performance, but the dial plan may be easier to maintain.

包含文件的格式

#include语句替换拨号计划中该文件的内容. 必须像编写Dialplan一样编写它. #include语句适用于所有星号配置文件. 如果您#底部的文件名,也可以覆盖Dialplan部分.

The #include statement replaces the Content of that File in the Dialplan. It has to be written like you would write the Dialplan. The #include statement works in all Asterisk configuration files. You could also overwrite Dialplan Sections, if you #include the File on the bottom.

示例

#include "headquarter_extensions_custom.conf"

[globals]
; ...

[default]
exten => s,1,Answer
exten => s,2,Playback(welcome-message)
; go to context defined in included file
exten => s,3,Goto(headquarter,s,1)    

在编辑包含文件后,您必须重新加载配置,即. reload.

After editing the include file, you have to reload the Configuration, ie. reload.

替代

您还可以在包含声明中包含上下文.在Dialplan中. 这允许编写标准上下文并使用Context扩展它们.
在自定义配置文件中定义(通过#include).

You could also include Contexts, with the include Statement in the Dialplan. This allows to write standard Contexts and extend them with Contexts
defined in a Custom Configuration File (via #include).

include => NameOfContext

示例

"extensions.conf"的内容

Content of "extensions.conf"

#include "headquarter_extensions_custom.conf"
#include "localoffice_extensions_custom.conf"

[general]

[support]
include => localoffice
include => headquarter

"headquarter_extensions_custom.conf"的内容:

Content of "headquarter_extensions_custom.conf":

[headquarter]
exten => 012345678,1,Dial(SIP/012345678)

"localoffice_extensions_custom.conf"的内容:

Content of "localoffice_extensions_custom.conf":

[localoffice]
exten => 1234,1,Dial(SIP/2001)

模式

如果您可以用模式替换成百上千的扩展名,则将数字块路由到目的地. _123XX LocalOffice,_5[1-3]XX HeadQuarterOffice.

If you can replace hundreds of Extensions with Patterns, route Blocks of Numbers to Destinations, ie. _123XX LocalOffice, _5[1-3]XX HeadQuarterOffice.

可扩展性

您还可以在多个服务器上拆分Asterisk配置. 这意味着确定您的硬件和软件限制,并通过DNS,SIP代理进行扩展或切换到星号实时实施.

You could also split your Asterisk Configurations on more than one Servers. That means determining limits of your Hard- and Software and scale through DNS, SIP-Proxy or switch to a asterisk Realtime Implemetation.

这篇关于如何在星号的extensions.conf中为添加工作站创建自定义conf文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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