在1.4 当中,feature的定义比1.2新增了些功能。
定义格式:
<FeatureName> => <DTMF_sequence>,<ActivateOn>[/<ActivatedBy>],<Application>[,<AppArguments>[,MOH_Class]]
feature 命名 => DTMF 按键,执行application方/激活feature 的通道,执行的application,application参数,在按feature完成之前播放的音乐。
ActivateOn:合法的选项有:
self ------在激活feature 的通道上执行application
peer -----在激活feature 的对端通道上执行application
ActivatedBy:合法的选项有:
caller-----主叫可以激活
callee-----被叫可以激活
both-------两个通道都可以激活。
dialplan 中dynamic参数变量的设定:
Set(DYNAMIC_FEATURES=myfeature1#myfeature2#myfeature3)
定义没有两个下横向,那么获取的变量始终都为feature 执行的通道上的变量。
Set(__DYNAMIC_FEATURES=myfeature1#myfeature2#myfeature3)
可以根据设置可以获取outbound通道的变量,详细解释原文如下:
The two leading underscores allow these feature settings to be set on the outbound channels, as well. Otherwise, only the original channel will have access to these features。
定义的例子:
feature.conf
nway-in => *2,peer/caller,macro,nway-in
extensions.conf
[OUTBOUND_TEST]
exten =>_X.,1,Noop
exten =>_X.,n,set(DYNAMIC_FEATURES=nway-in )
exten =>_X.,n,NOOP(uniqueid=${UNIQUEID})
exten =>_X.,n,dial(SIP/${EXTEN},60,Tt)
exten =>_X.,n,Hangup
[macro-nway-in ]
exten =>s,1,Noop
exten =>s,n,NOOP(uniqueid=${UNIQUEID})
exten =>s,n,playback(beep)
exten =>s,n,wait(2)
exten =>s,n,playback(beep)
exten =>s,n,Hangup
注册两个分机,即可实现相关的测试工作。
Good Lunck!