场景:
8007发启了一个会议,会议室已经创建好,允许8007通过通过DYNAMIC_FEATURES中的按键来将被叫方加入到会议室,被叫不允许使用DYNAMIC_FEATURES中定义的按键功能。
我写的拨号脚本如下:
[dynamic-nway-start] exten => _X.,1,NoOp(dynamic-nway-start) exten => _X.,n,Set(CONFNO=9999) exten => _X.,n,Set(MEETME_EXIT_CONTEXT=dynamic-nway-invite) exten => _X.,n,MeetMe(${CONFNO},pdMX) [dynamic-nway-invite] exten => *,1,NoOp(dynamic-nway-invite) exten => *,n,Read(DEST,dial,,i) exten => *,n,Set(DYNAMIC_FEATURES=threeway-inv#threeway-noinv) exten => *,n,Dial(Local/${DEST}@dynamic-nway-invite-dest,,g) exten => *,n,Set(MEETME_EXIT_CONTEXT=dynamic-nway-invite) exten => *,n,Set(DYNAMIC_FEATURES=) exten => *,n,MeetMe(9999,pdMX1) [dynamic-nway-invite-dest] exten => _X.,1,NoOp(dynamic-nway-invite-dest) exten => _X.,n,Set(DYNAMIC_FEATURES=) exten => _X.,n,Dial(SIP/${EXTEN},,M(nway-join,9999,1)) [macro-nway-join] exten => s,1,NoOp(dynamic-nway-join) exten => s,n,Set(DYNAMIC_FEATURES=) ;exten => s,n,ChannelRedirect(${BRIDGEPEER},dynamic-threeway,9999)
我想在拨号脚本中通过 Set(DYNAMIC_FEATURES=)来取消被叫使用DYNAMIC_FEATURES中定义的按键功能。尝试了下,发现行不通,设置没有任何效果,被叫依然可以使用DYNAMIC_FEATURES中设置的按键。
解决方法:
仔细研究了下DYNAMIC_FEATURES,其格式定义说明如下:
; The syntax for declaring a dynamic feature is any of the following: ; ;<FeatureName> => <DTMF_sequence>,<ActivateOn>[/<ActivatedBy>],<Application>[,<AppArguments>[,MOH_Class]] ;<FeatureName> => <DTMF_sequence>,<ActivateOn>[/<ActivatedBy>],<Application>[,"<AppArguments>"[,MOH_Class]] ;<FeatureName> => <DTMF_sequence>,<ActivateOn>[/<ActivatedBy>],<Application>([<AppArguments>])[,MOH_Class] ; FeatureName -> This is the name of the feature used when setting the ; DYNAMIC_FEATURES variable to enable usage of this feature. ; DTMF_sequence -> This is the key sequence used to activate this feature. ; ActivateOn -> This is the channel of the call that the application will be executed ; on. Valid values are "self" and "peer". "self" means run the ; application on the same channel that activated the feature. "peer" ; means run the application on the opposite channel from the one that ; has activated the feature. ; ActivatedBy -> This is which channel is allowed to activate this feature. Valid ; values are "caller", "callee", and "both". "both" is the default. ; The "caller" is the channel that executed the Dial application, while ; the "callee" is the channel called by the Dial application. ; Application -> This is the application to execute. ; AppArguments -> These are the arguments to be passed into the application. If you need ; commas in your arguments, you should use either the second or third ; syntax, above. ; MOH_Class -> This is the music on hold class to play while the idle ; channel waits for the feature to complete. If left blank, ; no music will be played.
在格式定义说明中,我看到了ActivatedBy这个写法可以解决我这个问题,尝试了一把,问题解决了,applicationmap定义如下:
threeway-start => *0,callee/caller,Macro,threeway-start threeway-inv => **,caller/caller,Macro,threeway-ok threeway-noinv => *#,callee/caller,Macro,threeway-notok