GROUP_COUNT() never increments correctly - how to fix?

Hi guys

I want to limit the number of simultaneous outbound calls at my site to 10 using the GROUP_COUNT dialplan app as advised by numerous posts online I found when searching.

After extensive experimentation and searching, I ended up with the following setup in my dialplan when dialing out:

[macro-STDOUT]

exten=>s,n,Set(GROUP(outbound)=voxout)
exten=>s,n,Set(VOXCOUNT=${GROUP_COUNT(voxout@outbound)})
exten=>s,n,NoOp(Voxout count: ${VOXCOUNT})

exten=>s,n,GotoIf($[${VOXCOUNT} > 10]?voxoutfull:continuedial)

exten=>s,n(voxoutfull),NoOp(Vox queue full, cannot dial.)

exten=>s,n,WaitExten(3)
exten=>s,n,PlayBack(pls-try-call-later)
exten=>s,n,WaitExten(1)
exten=>s,n,GoTo(voxoutfullexit)

exten=>s,n(continuedial),NoOp(Vox queue has space left, ok to dial.)
exten=>s,n(dodial),Macro(VCCALLOUT,${ARG1},${ARG2},${ARG3},${ARG4})

exten=>s,dodial+101,Busy()

exten=>s,n(voxoutfullexit),NoOp(Exit STDOUT macro.)
exten=>s,n,Hangup()
exten=>s,n,MacroExit

I’m running the above in a call center with 60 agents, core show calls in the CLI often shows up to 20 or 30 simultaneous calls at peak times.

However, GROUP_COUNT as used above never goes higher than 3, though I can stand in the call center physically and see six or eight people calling out more or less simultaneously (withing about 6 seconds, 8 people are calling out.)

Watching the CLI at the same time, the voxout@outbound group never shows the real number of outgoing calls.

And of course, the logic that prevents more than 10 simultaneous calls never fires.

What am I doing wrong?

Thanks!

You need to provide all the dialplan up to the actual Dial application or Queue application call. Alternatively, take this up with the person, or organisation that wrote dodial.

My best guess is that dodial is changing the group.

What you are definitely doing wrong is posting to the wrong forum. Asterisk General is for discussions not support questions.

Hi

do a " dialplan show macro-STDOUT "
and lets see the actual dialplan, also post teh verbose output of a outbound call

Hi

David, apologies for posting in the wrong forum. I checked and this is the first time I’m using group in my code - there are no references to group anywhere in the macros called that can change the group as far as I can see.

Ian, thanks for responding. Here is the output of my dialplan show. Note that this is the original version without the group code as indicated in my original post.

veridial*CLI> dialplan show macro-STDOUT

[ Context 'macro-STDOUT' created by 'pbx_config' ]

  'h' =>            1. NoOp(Call Hungup MACROSTDOUT)
[pbx_config]

                    2. UserEvent(RecordingToFile,Uniqueid:
${UNIQUEID},Channel: ${CHANNEL},FileName: ${MIXMONITOR_FILENAME})
[pbx_config]

                    3. NoOp(Unique ID is ${CDR(uniqueid)})
[pbx_config]

                    4. NoOp(rec is ${chanrecording})
[pbx_config]

                    5. NoOp(Recorded to ${MIXMONITOR_FILENAME})
[pbx_config]

                    6. NoOp(UserField is ${CDR(userfield)})
[pbx_config]

                    7. GoToIf($["${CDR(userfield)}" != ""]?checkacc)
[pbx_config]

                    8. Set(CDR(userfield)=${MIXMONITOR_FILENAME})
[pbx_config]

                   9. GoToIf($["${CDR(userfield)}" != ""]?checkacc)
[pbx_config]

                    10. Set(CDR(userfield)=${chanrecording})
[pbx_config]

     [checkacc]     11. NoOp(Account code is ${CDR(accountcode)})
[pbx_config]

                    12. NoOp(call link var is ${call_Link})
[pbx_config]

                    13. GotoIf($["${CDR(accountcode)}" != ""]?done)
[pbx_config]

     [setacc]       14. Set(CDR(accountcode)=${call_Link})
[pbx_config]

     [done]         15. noOp(Call Completed)
[pbx_config]

  's' =>            1. Macro(WAITCHANNEL)
[pbx_config]

                    2. Macro(WAITCDR)
[pbx_config]

                    3.
Macro(VCRECORD,${MACRO_CONTEXT}EXT${CALLERID(num)}ACC${CDR(accountcode)},${A
RG2}) [pbx_config]

     [dodial]       4. Macro(VCCALLOUT,${ARG1},${ARG2},${ARG3},${ARG4})
[pbx_config]

                    5. NoOp(Set CDR userfield after call completion STDOUT)
[pbx_config]

                    6. Set(CDR(userfield)=${MIXMONITOR_FILENAME})
[pbx_config]

                    105. Busy()
[pbx_config]

                    106. Hangup()
[pbx_config]

                    107. MacroExit()

Here is CLI output at verbosity 10 for making an outgoing call:

- Executing [3916@internal:2] Dial("Local/3916@local-e177;2",
"Sip/3916,120,tTg") in new stack

  == Using SIP RTP CoS mark 5

    -- Called Sip/3916

    -- SIP/3916-00000b53 is ringing

    -- SIP/3916-00000b53 answered Local/3916@local-e177;2

    -- Local/3916@local-e177;1 requested special control 20, passing it to
SIP/orionsip-out-00000b52

    -- SIP/3916-00000b53 requested special control 20, passing it to
SIP/orionsip-out-00000b52

  == Spawn extension (internal, 3916, 2) exited non-zero on
'Local/3916@local-e177;2'

    -- Executing [h@internal:1] NoOp("Local/3916@local-e177;2", "Call Hungup
INTERNAL") in new stack

    -- Executing [h@internal:2] UserEvent("Local/3916@local-e177;2",
"RecordingToFile,Uniqueid: 1371814891.5261,Channel:
Local/3916@local-e177;2,FileName:
/var/spool/asterisk/monitor/1306/21/2106138282711428007.gsm") in new stack

    -- Executing [h@internal:3] NoOp("Local/3916@local-e177;2", "Unique ID
is 1371814891.5261") in new stack

    -- Executing [h@internal:4] NoOp("Local/3916@local-e177;2", "rec is
/var/spool/asterisk/monitor/1306/21/2106138282711428007.gsm") in new stack

    -- Executing [h@internal:5] NoOp("Local/3916@local-e177;2", "Recorded to
/var/spool/asterisk/monitor/1306/21/2106138282711428007.gsm") in new stack

    -- Executing [h@internal:6] NoOp("Local/3916@local-e177;2", "UserField
is /var/spool/asterisk/monitor/1306/21/2106138282711428007.gsm") in new
stack

    -- Executing [h@internal:7] GotoIf("Local/3916@local-e177;2",
"1?checkacc") in new stack

    -- Goto (internal,h,11)

    -- Executing [h@internal:11] NoOp("Local/3916@local-e177;2", "Account
code is 2106138282711428007") in new stack

    -- Executing [h@internal:12] NoOp("Local/3916@local-e177;2", "call link
var is 2106138282711428007") in new stack

    -- Executing [h@internal:13] GotoIf("Local/3916@local-e177;2", "1?done")
in new stack

    -- Goto (internal,h,15)

    -- Executing [h@internal:15] NoOp("Local/3916@local-e177;2", "Call
Completed") in new stack

  == Spawn extension (macro-VCCALLOUT, s, 30) exited non-zero on
'SIP/3916-00000b53' in macro 'VCCALLOUT'

  == Spawn extension (macro-STDOUT, s, 4) exited non-zero on
'SIP/3916-00000b53' in macro 'STDOUT'

  == Spawn extension (local, 0834060854, 1) exited non-zero on
'SIP/3916-00000b53'

    -- Executing [h@local:1] NoOp("SIP/3916-00000b53", "Call Hungup LOCAL")
in new stack

    -- Executing [h@local:2] UserEvent("SIP/3916-00000b53",
"RecordingToFile,Uniqueid: 1371814891.5260,Channel:
SIP/3916-00000b53,FileName:
/var/spool/asterisk/monitor/1306/21/2106138282711428007.gsm") in new stack

    -- Executing [h@local:3] NoOp("SIP/3916-00000b53", "Unique ID is
1371814891.5263") in new stack

    -- Executing [h@local:4] NoOp("SIP/3916-00000b53", "rec is
/var/spool/asterisk/monitor/1306/21/2106138282711428007.gsm") in new stack

    -- Executing [h@local:5] NoOp("SIP/3916-00000b53", "Recorded to
/var/spool/asterisk/monitor/1306/21/2106138282711428007.gsm") in new stack

    -- Executing [h@local:6] NoOp("SIP/3916-00000b53", "UserField is ") in
new stack

    -- Executing [h@local:7] GotoIf("SIP/3916-00000b53", "0?checkacc") in
new stack

    -- Executing [h@local:8] Set("SIP/3916-00000b53",
"CDR(userfield)=/var/spool/asterisk/monitor/1306/21/2106138282711428007.gsm"
) in new stack

    -- Executing [h@local:9] GotoIf("SIP/3916-00000b53", "1?checkacc") in
new stack

    -- Goto (local,h,11)

    -- Executing [h@local:11] NoOp("SIP/3916-00000b53", "Account code is
2106138282711428007") in new stack

    -- Executing [h@local:12] NoOp("SIP/3916-00000b53", "call link var is
2106138282711428007") in new stack

    -- Executing [h@local:13] GotoIf("SIP/3916-00000b53", "1?done") in new
stack

    -- Goto (local,h,15)

    -- Executing [h@local:15] NoOp("SIP/3916-00000b53", "Call Completed") in
new stack

  == MixMonitor close filestream

  == End MixMonitor Recording Local/3916@local-e177;2

  == End MixMonitor Recording Local/3916@local-e177;1

I’ve tested again and got the same behaviour, moving the group counting code into the VCCALLOUT macro - where I actually call Dial() - (viz a viz David’s suggestion that I was corrupting the group count in intevening code) but the counts stay the same - I’ve got 20 to 25 people dialing, but assigning a group and category never counts that there are any more than 3 active calls.

Thank you very much for your reply!

Kind regards,

Your logging output starts at the point where it ceases to be useful!

Looks like you have an issue with your dialplan as whats loaded doesnt match whats in the file…

Hi guys

Thanks for taking the time to reply.

Ok, I’m clearly barking up the wrong tree with my entire setup.

I’ll try and look for some other way to refactor my requirement and try and do it without using GROUP() - did try it on older and newer versions as well before posting, same behaviour - but as you point out I’ve apparently got a completely corrupt / broken dialplan anyway.

Thanks for the assistance & time taken.

Kind regards,

Hi
Groupcount will do what you want , you need to work out whats screwed with your dialplan,

one thing is that there is no 1st priority
try changing exten=>s,n,Set(GROUP(outbound)=voxout) to exten=>s,1,Set(GROUP(outbound)=voxout)
reload and see what happens