-2

We have a portal where client sets maximum concurrent call forwarding on a number. First calls come to our IP, we then forward that calls to some numbers(set by client for it). We have to make sure, the forwarded calls are less than or equal to the set maximum limit of concurrent calls on a number. We are using asterisk as telephony software and phpagi as agi library.

How can I find count of concurrent calls already there on a number, before I forward a new call on it via my agi script.

Please suggest a proper way of doing this.

Is there any built-in way, which will automatically restrict further forward when a particular number of concurrent calls (already set for it) is already reached?

Purvik Dhorajiya
  • 4,662
  • 3
  • 34
  • 43
Anup_Tripathi
  • 2,817
  • 3
  • 26
  • 37

1 Answers1

-1

You can use GROUP and GROUP_COUNT dialplan functions.

In AGI you can do that via

$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

https://www.voip-info.org/wiki/view/Asterisk+func+group

arheops
  • 15,544
  • 1
  • 21
  • 27