0 like 0 dislike
175 views
asked Dec 2, 2014 in Education & Reference by Sam (1,370 points) | 175 views
    

1 Answer

0 like 0 dislike

Under asterisk, from your dialplan or an agi script you canput your calls (that has the same purpose)
in the same group.
This can be done using the GROUP* functions under asterisk.
- With GROUP() you can retrieve or set a group for the current channel
- With GROUPCOUNT() you can retrieve the total of live channel in that group
- With GROUP
LIST, you will get a list of group where the current channel is. So you can set put the same channel in multiple group to classify them.
- With GROUPMATCHCOUNT, you can retrieve the number of live channels in that group matching the specifed regular expression.
Example :

A nice application for this is, if you have multiple inbound DIDs that reach a same context and want to limit calls to DID 8800 to 10 for example. Your dialplan should go like this :

[Call-Limit]
exten => 8800,1,Noop(Recd call to ${EXTEN})
exten => 8800,n,Set(GROUP()=trunk1)
exten => 8800,n,NoOP(Group Count = ${GROUP_COUNT(trunk1)} for Group = trunk1)
exten => 8800,n,GotoIf($[${GROUP_COUNT(trunk1)}<11]?Dial1,999,1:Dial2,999,1)
exten => 8800,n,Wait(120)
exten => 8800,n,Hangup


[Dial1]
exten => 999,1,Wait(120)
exten => h,n,hangup()

[Dial2]
exten => 999,1,Wait(120)
exten => h,n,hangup()

-= Info about function 'GROUP' =-

[Synopsis]
Gets or sets the channel group.

[Description]
can be employed for more fine grained group management. Each channel
can only be member of exactly one group per .

[Syntax]
GROUP([category])

[Arguments]
category
Category name.

-= 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

answered Dec 2, 2014 by Yonus

Related questions

1 like 0 dislike
1 answer
1 like 0 dislike
1 answer
1 like 0 dislike
1 answer
asked Jan 21, 2016 in Education & Reference by Sam (1,370 points) | 96 views
0 like 0 dislike
1 answer
1 like 0 dislike
2 answers
2 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

Mathe Forum Schule und Studenten
1,171 questions
1,311 answers
276 comments
1,602 users