Limit simultaneous calls via group count of incoming and outgoing call totals

Want to be able to limit simultaneous calls coming in and give busy signal.
Currently are using extensions_custom.conf and have it working to limit incoming calls via this bit of code:

exten => s,1,NoOp(Define max channels and destination here)
exten => s,n,ExecIf($["${CALLERID(dnid)}" = “+15555556397”]?Set(MAXCHANS=1))
exten => s,n,ExecIf($["${CALLERID(dnid)}" = “+15555556397”]?Set(LINEGROUP=6397))
exten => s,n,ExecIf($["${CALLERID(dnid)}" = “+15555554090”]?Set(MAXCHANS=2))
exten => s,n,ExecIf($["${CALLERID(dnid)}" = “+15555554090”]?Set(LINEGROUP=4090))
exten => s,n,Set(GROUP(line)=${LINEGROUP})
exten => s,n,Macro(call-limiter-routing,${MAXCHANS},${LINEGROUP})

exten => s,1,NoOp(Checking limits and routing to destinations)
exten => s,n,NoOp(Incoming DID is ${CALLERID(dnid)} for Line(${ARG2}))
exten => s,n,Set(MAXCHANNELS=${ARG1})
exten => s,n,Set(ACTUALCHANNELS=${GROUP_COUNT(${ARG2}@line)});
exten => s,n,GotoIf($["${MAXCHANNELS}" = “”]?proceed)
exten => s,n,GotoIf($["${MAXCHANNELS}" >= “${ACTUALCHANNELS}”]?proceed)
exten => s,n,GotoIf($["${ACTUALCHANNELS}" > “${MAXCHANNELS}”]?hangup)
exten => s,n,Answer
exten => s,n,Playtones(busy)
exten => s,n,Wait(8)
exten => s,n,Hangup
exten => s,n(proceed),Goto(from-did-direct,${ARG2},1)
exten => s,n,Hangup()
exten => s,n(hangup),Answer
exten => s,n,Playtones(busy)
exten => s,n,Wait(8)
exten => s,n,Hangup

The above takes incoming DIDs and if they match, it will limit it to a number you set and give a busy signal if it goes over the max number.

We want to be able to add totals for extensions dialing out to the total number of calls in a DID group so it will be busy if too many agents are on outgoing lines.

I’ve tried the code below, but it will not continue dial out for the extension. Also we need to be able to dial extension to extension and with this code in place that will not work either.

Is there something like the below NON WORKING code that can be put in place that will add extensions calling out to the group totals?

exten => _X.,1,NoOp(########## LIMIT CALLS STUFF ############)
same => n,ExecIf($["${CALLERID(number)}" = “10”]?Set(LINEGROUP=4090))
same => n,ExecIf($["${CALLERID(number)}" = “11”]?Set(LINEGROUP=4090))
same => n,ExecIf($["${CALLERID(number)}" = “100”]?Set(LINEGROUP=4090))
same => n,ExecIf($["${CALLERID(number)}" = “101”]?Set(LINEGROUP=4090))
same => n,ExecIf($["${CALLERID(number)}" = “102”]?Set(LINEGROUP=4090))
same => n,ExecIf($["${CALLERID(number)}" = “103”]?Set(LINEGROUP=4090))
same => n,ExecIf($["${CALLERID(number)}" = “104”]?Set(LINEGROUP=4090))
same => n,ExecIf($["${CALLERID(number)}" = “105”]?Set(LINEGROUP=6397))
same => n,NoOp(Linegroup ${LINEGROUP}.)
same => n,Set(GROUP(line)=${LINEGROUP})
same => n,Set(COUNT=${GROUP_COUNT(${LINEGROUP}@line)})
same => n,NoOp(There is ${COUNT} concurent call(s) for Line(${LINEGROUP}).)
same => n,Macro(dial)

Also tried it with the below versions of executing a dial.
#same => n,Macro(user-callerid)
#same => n,Dial(SIP/${EXTEN})
#exten => _X.,n,Macro(user-callerid)
#exten => _X.,n,Dial(${ARG1},20)

Any ideas?
Thanks for any help!

Is there any reason that you are not using the channel value in the trunk?

They use some 2-line analog cordless phones and I want them to always have just the right amount of lines (2 exactly) to account for someone dialing out on the cordless where they will be able to answer any new calls on the cordless.

I don’t want the people to be denied any outgoing lines, just have them taken into account for incoming call limits so the analog phones will have available channels.

They also have some desktop phones, and I want those to always allow outgoing calls. So even if the 2 simultaneous slots are being used via cordless I want someone to still be able to pick up the desktop phone and be allowed to dial out, just account for them line on any future incoming calls.

Basically they are getting swamped with calls. Say two people are calling out on the 2-line cordless. Since we aren’t accounting for outgoing calls, we can still get 2 incoming calls using the incoming limit code I’m using.

I just figured it would be easier to do. Everything seems to work as far as the accounting of simultaneous calls, I just can’t get it to continue the dialing after the accounting. Very frustrating.

So what you are trying to achieve is to allow only 2 incoming calls? What do you want to do if a third incoming call comes in?

When the 3rd call come in, the caller gets an 8 second busy then then hangup via this:
exten => s,n,Answer
exten => s,n,Playtones(busy)
exten => s,n,Wait(8)

I have the 2 incoming calls limit already working, if I could just account for the outgoing calls in the total it would be perfect. Basically I want it to work like a 2 line analog phone, with extra outgoing lines available when needed.

This is somewhat off topic, but IMHO playing a busy signal to a customer or potential customer is not a good idea. Some millennials have never even heard one before. If the caller has to retry more than once or twice, they may go to a competitor.

If you have more calls than agents to field them, consider one or more of the following:

  1. Ask callers to wait in a queue.
  2. Send them to voicemail, where they can leave a message and be called back.
  3. An automatic callback system (reads their caller ID number, allows them to specify a different number if desired).
  4. An announcement, e.g. “We’re sorry, but due to heavy call volume, we can’t take your call now. Please leave a message and we will return the call ASAP, or call back during our less busy hours between X and Y.”

IMO most callers would rather wait up to 3 minutes in a queue than have to retry or leave a message. If the wait is likely to be longer, offer the caller an appropriate alternative.

If you have enough agents but they can’t all take calls because of hardware limitations, fix that. The cost to upgrade is cheap, compared to lost productivity or lost business.

These are some good ideas and if it was my business, I would do one of your ideas Stewart1.

The biggest problem with this business is the lack of desk personnel to answer phones efficiently. It’s a tire/auto-repair place and they have times where one person is at the desk talking with 3 live customers on the floor, be placing a call to get parts, and get 2 more calls coming in. I’ve been there and seen it several times.

Them wanting the cordless phones to take around makes it hard to park calls so they know there are people waiting on hold. Having the cordless phone, though, they can take a phone out to the shop and walk around with it and have it available to answer.

What would be real nice is if there was a cordless VOIP phone that had available programmable BLF button lights for call parking and the like.

I guess I’ll just give up on the Asterix programming. Looks like nobody knows how to make the outgoing calls add to the simultaneous totals like I’d like it to work. It’s so close to working too, as I have it doing the incoming accounting already via groups, and the outgoing is being added to the groups, just not able to continue on routing the call. It’s got to be something really simple and hoped somebody would be like oh yeah, it’s super simple, just do this! :slight_smile:

So, I’ve basically just threw a bunch more desk phones at the problem. There are now lots of phones they can use for outgoing and leave the cordless for the already limited incoming calls.

I hate shilling for Sangoma (but I love our corporate overlords) but the DECT phone they sell might not be a bad choice to look at.

I am not aware of any cordless phone with BLF buttons. Sounds like a product idea for you @cynjut, the first BLF sidecar for a SIP DECT handset. You could mimic the form factor of portable phones from the 80’s for a retro look.

Send me one and I’ll see what I can do. :slight_smile:

Has all the ‘bits’ needed, just add brainstorming :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.