ChannelRedirect及多方实例

 

ChannelRedirect: Redirect an existing channel to the dialplan. (1.4)

功能:

让指定的通道重定向拨号方案中指定的目标位置,在1.4版本时被引进的,同时也可以代接(偷取)一个正在振玲的来电.

描述:

ChannelRedirect(channel|[[context|]extension|]priority) 
发送指定通道到指定的拨号方案中的目标位置
(Sends the specified channel to the specified extension priority)

 

下面有一个示例:

实现Asterisk多方通话

这里面我将试图描述如果从二方通话创建多方通话。(Here I will attempt to describe how to make n-way calls from 2-way calls.)

实现此功能要用到二个命令函数:MeetMe和ChannelRedirect,你需要 Dahdi/Zaptel timing 驱动让MeetMe工作。(All work done by two applications: MeetMe and ChannelRedirect. You need the Dahdi/Zaptel timing driver to have MeetMe working. )

问题: For Asterisk 1.4 do wee need to replace 'ChannelRedirect' as used below with 'ManagerRedirect' as in bug/patch 6508

这里有一个示例拨号方案脚本: 

[default] 
exten => _XXX,1,Set(DYNAMIC_FEATURES=nway-start) 
exten => _XXX,n,Dial(SIP/${EXTEN}) 

[dynamic-nway] 
exten => _XXX,1,Answer 
exten => _XXX,n,Set(CONFNO=${EXTEN}) 
exten => _XXX,n,Set(MEETME_EXIT_CONTEXT=dynamic-nway-invite) 
exten => _XXX,n,Set(DYNAMIC_FEATURES=) 
exten => _XXX,n,MeetMe(${CONFNO},pdMX) 
exten => _XXX,n,Hangup 

[dynamic-nway-invite] 
exten => 0,1,Read(DEST,dial,,i) 
exten => 0,n,Set(DYNAMIC_FEATURES=nway-inv#nway-noinv) 
exten => 0,n,Dial(Local/${DEST}@dynamic-nway-dest,,g) 
exten => 0,n,Set(DYNAMIC_FEATURES=) 
exten => 0,n,Goto(dynamic-nway,${CONFNO},1) 
exten => i,1,Goto(dynamic-nway,${CONFNO},1) 

[dynamic-nway-dest] 
exten => _XXX,1,Dial(SIP/${EXTEN}) 

[macro-nway-start] 
exten => s,1,Set(CONFNO=${FindFreeConf()}) 
exten => s,n,ChannelRedirect(${BRIDGEPEER},dynamic-nway,${CONFNO},1) 
exten => s,n,Read(DEST,dial,,i) 
exten => s,n,Set(DYNAMIC_FEATURES=nway-inv#nway-noinv) 
exten => s,n,Dial(Local/${DEST}@dynamic-nway-dest,,g) 
exten => s,n,Set(DYNAMIC_FEATURES=) 
exten => s,n,Goto(dynamic-nway,${CONFNO},1) 

[macro-nway-ok] 
exten => s,1,ChannelRedirect(${BRIDGEPEER},dynamic-nway,${CONFNO},1) 

[macro-nway-notok] 
exten => s,1,SoftHangup(${BRIDGEPEER}) 
 
Note, You need to provide FindFreeConf() function (or any other way) to get free Conference number. 

要使得这些生效要在features.conf做如下工作:

首先
[applicationmap] 
nway-start => *0,caller,Macro,nway-start 
nway-inv => **,caller,Macro,nway-ok 
nway-noinv => *#,caller,Macro,nway-notok 

再次在执行前必须对通道变量DYNAMIC_FEATURES进行赋值。
 

看看它怎么工作的:

 当你和别人通话的时候,按*0 (执行宏 nway-start)。 被叫马上被传递到一个空闲的会议室,而你将听到拨号音,等待你输入你要邀请的电话号码。当被邀请方接通后,你在和这个第三方通话的过程中,可以按 ** (在features.conf可以定义)加入会议,按 *# 挂掉他然后返回会议。

 

在示例所遇问题及解决方法:

1.Function FindFreeConf not registered

你可能感兴趣的:(redirect)