星号预占和通道中的来电者

时间:2014-12-24 18:39:00

标签: asterisk voip

我想在Asterisk进行抢占。我认为没有Asterisk支持这个功能所以我试图按照这个线程中显示的simliar算法来实现它:Asterisk - Pre-emption calls

所以我在这一步中遇到了问题:

  • 检查B是否使用优先级较低的调用者(ASTDB或REALTIME或fastagi脚本)进行调用。

我知道如何使用例如DEVICE_STATE(设备)cmd检查B是否在通话中,但我无法知道谁是另一个来电者以便查看其优先级。

那么,我如何知道一个用户是否在通话中以及该呼叫中的另一个呼叫者是谁?

非常感谢。

1 个答案:

答案 0 :(得分: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年*的丰富经验的人。