asterisk 笔记

下面的一些笔记看起来会很混乱,因为我是边开发研究,顺手记录的。以后应该会做整理,也许不会233,

  • sudo asterisk -r -vvvvvvvvv 连接到控制台-cli
  • GotoIfTime一个例子是:从上午 9 点到下午5:59,从周一到周五,一个月的任何一天,一年的任何一个月匹配。

GotoIfTime(times,days_of_week,days_of_month,months?label)

Exten =>s,1,GotoIfTime(09:00-17:59, mon-fri, *, *? Open,5,1)

解决freeradius-server安装报错,https://stackoverflow.com/questions/45567078/freeradius-fails-to-install-at-config

  • Feature Code Call Transfers 呼叫转接

官网原文:https://wiki.asterisk.org/wiki/display/AST/Feature+Code+Call+Transfers

两种模式:

Blind transfer

A blind or unsupervised transfer is where the initiating party is blind to what is happening after initiating the transfer. They are removed from the process as soon as they initiate the transfer. It is a sort of "fire and forget" transfer.

Attended transfer

An attended or supervised transfer happens when one party transfers another party to a new location by first dialing the transfer destination and only completing the transfer when ready. The initiating party is attending or supervising the transfer process by contacting the destination before completing the transfer. This is helpful if the transfer initiator wants to make sure someone answers or is ready at the destination.

以下推荐并介绍配置第二种:有人值守的呼叫转接

配置转接需要配置feature.conf和extension.conf

首先配置feature.conf

以下描述均针对被呼叫方
[general]                   
atxferabort = *3                终止有人值守呼叫转移,否则无法终止         
atxfercomplete = *4             完成转接,类似转接员挂断电话,此时呼叫者和第三方接通
atxferthreeway = *5             完成转接,并与其他双方一起进入会话
atxferswap = *6                 在完成呼叫转移前,可以用此切换与其他任一方通话         
                            
atxfernoanswertimeout = 15      转移操作超时限定
atxferdropcall = no             允许您更改默认回调行为。
默认值为“no”,这会导致Asterisk在提前挂断并且有人值守的传输超时时回拨传输的发起者。
如果设置为“是”,则一旦启动器挂断,传输目标通道将立即转移到正在传输的通道
atxferloopdelay = 10            设置回调重试之间等待的秒
atxfercallbackretries = 2       设置Asterisk尝试将失败的有人值守转移发送回发起者的次数
                            
transferdigittimeout => 3       转接呼叫时,按键数字之间等待的秒数

一些另外的选项

;xfersound = beep ; to indicate an attended transfer is complete
;xferfailsound = beeperr ; to indicate a failed transfer
;transferdialattempts = 3 ; Number of times that a transferer may attempt to dial an extension before
; being kicked back to the original call.
;transferretrysound = "beep" ; Sound to play when a transferer fails to dial a valid extension.
;transferinvalidsound = "beeperr" ; Sound to play when a transferer fails to dial a valid extension and is out of retries.

其次 extension.conf

exten => xxx,n,Dial(SIP/XXX,30,t) t:允许被叫方转移呼叫,T:允许主叫方转移呼叫

此外,这是针对dial的转移,可以将此应用到队列queue中。

asterisk gui

我使用的是2.0版本,学习并使用gui配置各种操作会让很快上手理解各种asterisk的操作。

官网原文:https://wiki.asterisk.org/wiki/display/AST/Asterisk+GUI#AsteriskGUI-Download

备注下载方式:svn 下载链接( 即 svn http://svn.asterisk.org/svn/asterisk-gui/branches/2.0/)

  • AMI笔记

manager show commands 在cli输入该命令可以查看ami借口支持的命令等。

SipPeers 获取peer列表

ExtensionState 获取制定用户状态

ExtensionStateList 获取所有用户状态

Status状态代码:

-1 =扩展找不到0 =空闲1 =在使用2 =忙4 =不可用8 =振铃16 =正等待

猜你喜欢

转载自blog.csdn.net/u012853084/article/details/81034285