GROUP(), GROUP_COUNT and transferred calls

We have a dialplan that we have been using for a long time in which we are limiting inbound calls using the GROUP() and GROUP_COUNT() functions to prevent more then the allowed calls to reach the phone. Straight in and out calls work without issue, however we have recently noticed that when a call is transferred this Dialplan does not work.

Any thoughts on how to correct?

3 phones extensions 3201, 3202 and 3203.

  • If 3201 calls 3202, group count gets set for both 3201 and 3202, this is as expected.
  • If then 3202 transfers the call to 3203 and then 3202 drops off the call the group count for 3202 is still set along with 3201 and 3203.

Now 3202 can not receive and new calls (go directly to VM) until the call between 3201 and 3203 is completed.

Note: Conferenced calls work as expected if 3202 does the conference then drops out.


Output of group show channels after the transfer has happened.

SIP/3201-0004f521 OUTBOUND_GROUP 3201
SIP/3201-0004f521 OUTBOUND_GROUP 3202
SIP/3201-0004f521 OUTBOUND_GROUP 3203

My Dialplan…
[macro-voicemail]
; ${ARG1} - Extension Called
; ${ARG2} - Extension Calling
; ${ARG3} - VoiceMail Mailbox Number (usually ARG1=ARG3)
; ${ARG4} - Number of Calls Allowed
exten => s,1,NoOp(“MACRO VOICEMAIL: Call for ${ARG1}”)
exten => s,2,Set(ORIGINAL=${ARG1})
exten => s,3,Set(GROUP(${ARG1})=OUTBOUND_GROUP)
exten => s,4,Set(GROUP(${ARG2})=OUTBOUND_GROUP)
exten => s,5,GotoIf($[${GROUP_COUNT(OUTBOUND_GROUP@${ARG1})}} > ${ARG4}]?105:10)
exten => s,10,NoOp(“Dial Phone”)
exten => s,11,Dial(SIP/${ARG1},20)
exten => s,12,VoiceMail(${ARG3}@default,u)
exten => s,13,Hangup()
exten => s,105,VoiceMail(${ARG3}@default,b)
exten => s,106,Hangup()