[Asterisk-Users] Has anybody experience with SetGroup /
CheckGroupcommands?
Matthew Boehm
mboehm at cytelcom.com
Mon Mar 14 13:38:33 MST 2005
ROFL, that was awesome Matt. I took the liberty of putting that here:
http://www.voip-info.org/tiki-index.php?page=Asterisk+cmd+SetGroup
Your example was so nice and simple, it merrited being "wiki'd"
-Matthew
Matt Riddell wrote:
> Ronald Wiplinger wrote:
>> SetGroup(moh) can be moh anything as I like? Usually moh stands for
>> "music on hold"
>> CheckGroup(1) checks if somebody in in group "moh". Does it mean I
>> can only have one SetGroup(xxx) ??
>
> The idea is that when you do setgroup you are putting this caller
> into a group. I.E. you could have
>
> exten => s,1,SetGroup(People_With_Short_Hair)
>
> That would put anyone who visits this extension into the
> People_With_Short_Hair group.
>
> then if you do:
>
> exten => s,2,CheckGroup(678)
>
> You can make sure that there are not more than 678 people already in
> the People_With_Short_Hair group.
>
> If there are more than 678 people in the group then the application
> will go to the priority x+101 where x is the current priority.
>
> See the ,2, on the checkgroup line? That's the current priority. So,
> 2+101=103.
>
> So you could have a line
>
> exten => s,103,Playback(more_than_678_short_hair)
>
> which would only be played if there are more than 678 people in the
> group.
>
> If however there are less than or equal to the number inside the
> brackets for checkgroup (say for example there are 500 people who have
> short hair), then it will continue to the next priority.
>
> As above, the current priority is 2 when you do the checkgroup, so the
> next priority is 3. This means that you can have the line:
>
> exten => s,3,Playback(less_than 678_short_hair)
>
> Now, if we put them all together you'd end up with:
>
> exten => s,1,SetGroup(People_With_Short_Hair)
> exten => s,2,CheckGroup(678)
> exten => s,3,Playback(less_than_or_equal_to_678_short_hair)
> exten => s,103,Playback(more_than_678_short_hair)
>
> Hope this helps!
More information about the asterisk-users
mailing list