我们有一个门户网站,客户端在一个号码上设置最大并发呼叫转发。第一次调用来到我们的IP,然后我们将这些调用转发给某些号码(由客户端为它设置)。我们必须确保转发的呼叫小于或等于数字上并发呼叫的设置最大限制。 我们使用asterisk作为电话软件,使用phpagi作为agi库。
在通过我的agi脚本转发新呼叫之前,如何找到号码上已存在的并发呼叫数。
请建议一个正确的方法。
是否有任何内置方式,当已经达到特定数量的并发呼叫(已经为其设置)时,它会自动限制进一步前进?
答案 0 :(得分:-1)
您可以使用GROUP和GROUP_COUNT个拨号方案功能。
在AGI中,您可以通过
完成此操作 $agi->set_full_variable("new_var",'${GROUP_COUNT(group_name)}')
pro-sip*CLI> core show function GROUP
-= Info about function 'GROUP' =-
[Synopsis]
Gets or sets the channel group.
[Description]
<category> can be employed for more fine grained group management. Each channel
can only be member of exactly one group per <category>.
[Syntax]
GROUP([category])
[Arguments]
category
Category name.
[See Also]
Not available
pro-sip*CLI> core show function GROUP_COUNT
-= Info about function 'GROUP_COUNT' =-
[Synopsis]
Counts the number of channels in the specified group.
[Description]
Calculates the group count for the specified group, or uses the channel's
current group if not specifed (and non-empty).
[Syntax]
GROUP_COUNT([groupname][@category])
[Arguments]
groupname
Group name.
category
Category name
[See Also]
Not available