1. h分机:表示hangup,就是挂断后连接的分机。
例子:当建立一个连接后,CONNECTIONS就加1,当挂断一个连接(连接到h分机),CONNECTIONS就减1
[global]
CONNECTIONS=0
[from-internal]
exten => _X.,1,Set(CONNECTIONS=$[${CONNECTIONS} + 1]|g)
exten => _X.,2,Dial(SIP/${EXTEN})
exten => h,1,Set(CONNECTIONS=$[${CONNECTIONS} - 1]|g)
2. i分机:表示invalid分机。
例子:当用户拨打错误的号码时,系统将连接到i分机上,执行对应的应用。
[department-b]
exten => _1XX,1,Dial(${EXTEN})
exten => i,1,NoOp(An invalid number ${INVALID_EXTEN} was dialed.)
exten => i,2,Answer()
exten => i,3,Playback(invalid)
exten => i,4,Hangup()
【注】:当连接到i分机时,取被叫号码使用INVALID-EXTEN系统变量。
3. o和a分机
在/etc/asterisk/voicemail.conf中定义了operator=yes ,则用户拨0就会连接到o分机。
当用户拨*,则会连接到a分机。
4. t和T分机:用于处理上下文超时时连接的分机
当IVR菜单输入超时时,呼叫将连接至t分机,如下例:
[mainmenu]
exten => 10,1,Answer()
exten => 10,n,Background(marryme) ; "Marry me? Press 1 for y
es, 2 for no."
exten => 1,1,Playback(thank-you-cooperation) ; 1 => "Thank you."
exten => 1,n,Hangup()
exten => 2,1,Playback(hangup-try-again) ; 2 => "Hang up and try ag
ain."
exten => 2,n,Hangup()
exten => t,1,Hangup() ; no input => hang up
当绝对超时(absolute time out)到了,就会连接到T分机,绝对超时的设置:Set(TIMEOUT(absolute)=)
注意=号的左右不能有空格。当Set()执行后,absolute就开始倒计时,不管是否已经建立连接。
如果seconds=0表示关闭绝对延时。其使用看下面的实例:
exten => 20,1,Answer()
exten => 20,2,Set(TIMEOUT(absolute)=120)
exten => 20,3,Playback(hello-world)
exten => 20,4,Wait(1)
exten => 20,5,Goto(3)
exten => T,1,Wait(1)
exten => T,2,Playback(thank-you-for-calling)
exten => T,3,Wait(1)
exten => T,4,Hangup()
5. s分机
The first entry in any extension is always the name or number dialed by the caller. When a call comes in from the PSTN, however, Asterisk
doesn't know what was dialed or whom the caller is trying to reach. For
any scenario in which we cannot determine the number dialed, we use the
s extension (不是很明白)
例子:
exten => s,1,Answer()
exten => s,2,Wait(1)
exten => s,3,Play(tt-monkeys)
exten => s,4,Wait(1)
exten => s,5,Hangup()
阅读(1235) | 评论(0) | 转发(0) |