2014-12-24 46 views
0

我想在Asterisk中拥有抢占呼叫。我认为有此功能目前没有Asterisk的支持,所以我正在努力实现它simliar算法如下喜欢在这个线程表明一个:Asterisk - Pre-emption calls星号抢占和通道中的呼叫者

所以我有问题,在此步骤:

  • 检查B调用较低优先级的调用方(ASTDB或REALTIME或fastagi脚本)。

我知道如何使用例如DEVICE_STATE(device)cmd检查B是否处于呼叫状态,但我无法知道谁是另一个呼叫者以查看其优先级。

那么,如何知道一个用户是否在通话中,以及这个通话中的另一个用户是谁?

非常感谢。

回答

0

可以使用

SHARED(varname[,channel]) 
    -= Info about function 'SHARED' =- 

[Synopsis] 
Gets or sets the shared variable specified. 

[Description] 
Implements a shared variable area, in which you may share variables between 
channels. 
The variables used in this space are separate from the general namespace 
of the channel and thus ${SHARED(foo)} and ${foo} represent two completely 
different variables, despite sharing the same name. 
Finally, realize that there is an inherent race between channels operating 
at the same time, fiddling with each others' internal variables, which is 
why this special variable namespace exists; it is to remind you that variables 
in the SHARED namespace may change at any time, without warning. You should 
therefore take special care to ensure that when using the SHARED namespace, 
you retrieve the variable and store it in a regular channel variable before 
using it in a set of calculations (or you might be surprised by the 
result). 

确保您已设置变量的第一次读到任何通道的变量。 您可以使用通话中的宏设置变量或当前通话频道的ASTDB名称

您想要的任何解决方案的一般复杂度高于平均水平,需要具有至少1 - 2年丰富的*年经验的人。

+0

其他选项 - 像FOP面板一样,只听所有事件并“记住” – arheops