GROUP_COUNT not counting correctly

Home » Asterisk Users » GROUP_COUNT not counting correctly
Asterisk Users 1 Comment

Hello,

this is a test to add a channel to multiple GROUPs.

this is my dialplan :

exten => s,n,NoOp(groepcount = ${GROUP_COUNT(40)})
exten => s,n,Set(GROUP(40)=40)
exten => s,n,NoOp(This channel is member of : ${GROUP_LIST()})
exten => s,n,NoOp(groepcount = ${GROUP_COUNT(40)})

exten => s,n,NoOp(groepcount = ${GROUP_COUNT(40L)})
exten => s,n,Set(GROUP(40)=40L)
exten => s,n,NoOp(This channel is member of : ${GROUP_LIST()})
exten => s,n,NoOp(groepcount = ${GROUP_COUNT(40L)})

this is the output on a first call :

[Nov 5 17:17:31] — Executing [s@sub-CheckChannels:17]
NoOp(“SIP/testcorp7-00000036”, “groepcount = 0”) in new stack
[Nov 5 17:17:31] — Executing [s@sub-CheckChannels:18]
Set(“SIP/testcorp7-00000036”, “GROUP(40)=40”) in new stack
[Nov 5 17:17:31] — Executing [s@sub-CheckChannels:19]
NoOp(“SIP/testcorp7-00000036”, “This channel is member of : 40@40”) in
new stack
[Nov 5 17:17:31] — Executing [s@sub-CheckChannels:20]
NoOp(“SIP/testcorp7-00000036”, “groepcount = 1”) in new stack

[Nov 5 17:17:31] — Executing [s@sub-CheckChannels:24]
NoOp(“SIP/testcorp7-00000036”, “groepcount = 0”) in new stack
[Nov 5 17:17:31] — Executing [s@sub-CheckChannels:25]
Set(“SIP/testcorp7-00000036”, “GROUP(40)=40L”) in new stack
[Nov 5 17:17:31] — Executing [s@sub-CheckChannels:26]
NoOp(“SIP/testcorp7-00000036”, “This channel is member of : 40L@40”) in
new stack
[Nov 5 17:17:31] — Executing [s@sub-CheckChannels:27]
NoOp(“SIP/testcorp7-00000036”, “groepcount = 1”) in new stack

this is the output on a second call :

[Nov 5 17:17:43] — Executing [s@sub-CheckChannels:17]
NoOp(“SIP/testcorp6-00000037”, “groepcount = 0”) in new stack
[Nov 5 17:17:43] — Executing [s@sub-CheckChannels:18]
Set(“SIP/testcorp6-00000037”, “GROUP(40)=40”) in new stack
[Nov 5 17:17:43] — Executing [s@sub-CheckChannels:19]
NoOp(“SIP/testcorp6-00000037”, “This channel is member of : 40@40”) in
new stack
[Nov 5 17:17:43] — Executing [s@sub-CheckChannels:20]
NoOp(“SIP/testcorp6-00000037”, “groepcount = 1”) in new stack

[Nov 5 17:17:43] — Executing [s@sub-CheckChannels:24]
NoOp(“SIP/testcorp6-00000037”, “groepcount = 1”) in new stack
[Nov 5 17:17:43] — Executing [s@sub-CheckChannels:25]
Set(“SIP/testcorp6-00000037”, “GROUP(40)=40L”) in new stack
[Nov 5 17:17:43] — Executing [s@sub-CheckChannels:26]
NoOp(“SIP/testcorp6-00000037”, “This channel is member of : 40L@40”) in
new stack
[Nov 5 17:17:43] — Executing [s@sub-CheckChannels:27]
NoOp(“SIP/testcorp6-00000037”, “groepcount = 2”) in new stack

Notice that the GROUP_COUNT for 40@40 in the second call is reset to 0
(zero) to be added by 1 again.
Notice that the GROUP_COUNT for 40L@40 in the second call is added by 1
to result in a total of 2.

Why is the GROUP_COUNT of 40@40 not 2 also ??

Kind regards,
Jonas.

One thought on - GROUP_COUNT not counting correctly

  • On Fri, 05 Nov 2010 15:27:11 +0100
    Jonas Kellens wrote:

    It can’t be done.

    $ sudo asterisk -rx ‘core show function GROUP’

    -= Info about function ‘GROUP’ =-

    [Syntax]
    GROUP([category])

    [Synopsis]
    Gets or sets the channel group.

    [Description]
    Gets or sets the channel group.

    Notice it says “the channel group”–singular… meaning only one group.

    Also, on [1] it says, “A channel may belong to one group per category
    only.”

    [1] http://www.voip-info.org/wiki/index.php?page=Asterisk+func+group