asterisk 呼叫文件(.call)简单说明

    技术2022-05-19  29

    刚弄了下了 asterisk 的 .call 文件,意思就是自动去执行拨号。。

     

     如建立 text.call 文件,必须放在 "/var/spool/asterisk/outgoing"下面,然后系统会自动去执行。当然如果里面的参数不正常,将不会去执行。

     

       先说下参数:

     

     


     

     Channel: <channel>

             The channel upon which to initiate the call.  ..................我理解为什么什么通道,就是给哪个号码发起呼叫,想当于 DIAL()..

     

     

    Callerid: <callerid>         The caller ID to be used for the call..................... 显示的号码,或名称 WaitTime: <number>         Number of seconds the system waits for the call to be answered. If not specified, defaults to 45              seconds................等待回答的时间,在这时间,如果没有回答,就进行下一轮呼叫,没有指定,默认为45秒 MaxRetries: <number>           Maximum number of dial retries (if an attempt fails because the device is busy or not reachable). If not specified, defaults to 0 (only one attempt is made). ..............最大失败后重试数.如设置为2 RetryTime: <number>         Number of seconds to wait until the next dial attempt. If not specified, defaults to 300 seconds. ......... 等待的秒数直到下一次拨号尝试。  如果没有指定,默认为300秒。 Account: <account>          The account code for the CDR.......计费方面的东东。。 Context: <context>         The destination context. ......指定拨号方案 Extension: <exten>         The destination extension, in which dialplan execution begins if the device is answered. ....额。报号方案中的开始执行的地,如x.a 100,上面拨号方案相关 Priority: <priority>          The destination priority. If not specified, defaults to 1. ............ 目标优先级。  如果没有指定,默认为1 Setvar: <var=value>       Setvar: lets you set one or more channel variables..............设置一个或多个通道变量 Archive: <yes|no>            By default, call files are deleted immediately upon execution. If Archive: yes is set, they are copied into        /var/spool/asterisk/outgoing_done/ instead. Asterisk adds a line to the call file which describes the result:.......................是否存档。因为.call文件执行后会被删除,所以我们有必要这里选择存档,选择yes后,原理我们建立的.call文件会呗村在 “/var/spool/asterisk/outgoing_done/”目录下

    简单实例:

    首先建立一个普通的拨号规则:

    [jh] exten => 10,1,Answer() exten => 10,n,Dial(SIP/8100) exten => 10,n,Hangup() 

     

    然后我们在 “/var/spool/asterisk/outgoing/” 目录下建立 一个 .call 文件 (文件名不重要),代码如下:

     

    channel: SIP/8111 //呼叫8111 Callerid: <haozi> //来的名称haozi MaxRetries: 2 //未接执行2次 RetryTime: 60 //60秒后发起下次呼叫 WaitTime: 30 //应答时间为30s 也就是响铃时间 Context: jh //指定拨号规则 Extension: 10 //对应拨号规则中的10 Archive:yes //存档 Setvar:<var=1> //意思就是设置变量值为1,在context可以使用该变量的值 

     

    保存后,asterisk 后立即发起呼叫。

    www.asterisk-help.com

     


    最新回复(0)