Limit a DID to a set number of calls

Is there any way with a current FreePBX/PBXact to limit the incoming calls to a DID number?

I have a PBX at a clients, that has hundreds of DID’s, and a pile of SIP channels/trunks to handle the call volume. At one location (sub-company) they want to only take two calls at once. I thought sure just kick the rest to Voicemail, but they don’t want that, they want two calls to the number, and any additional to get a busy.

I have asked the SIP provider if they could do this, and was informed no. So wondering if anyone knows of a way to do this in the system itself??

At the moment I am thinking, they need to take that DID and put it off on it’s own trunk, that has only two call pathways, but that will be a pain!

Doable with a custom dialplan.

As @PitzKey says doable with custom code, but not exactly easy, particularly if you need to include outbound channels in the caps With a queue you can limit the max number of callers waiting and send extra to hangup. Not the same but might work for you.

1 Like

I did setup a queue, and unless I am missing something, where this falls through is that setting the queue to 2 calls doesn’t actually limit it to two calls, as once an agent takes a call, that queue again will take two more calls. They basically want two calls max inbound on their numbers, not sure they care about outbound, but as we have 50 SIP pathways back to the PBX, they currently get a lot more than two.

Thanks for the reply, are there any examples of doing this custom plan? If I did something like this, would it survive a reload in the GUI of PBXact?

I have done a lot with the systems, but building dialplan like you mention is not part of it…

You would want something like this:

I did not test the below:

[check-concurrent-calls]
exten => s,1,Noop(Checking concurrent calls for DID ${ARG1})
exten => s,n,Set(Set(GROUP(concurrent)=${ARG1})
exten => s,n,GotoIf($["${GROUP_COUNT(${ARG1}@concurrent)}" >= "${ARG2}"]?hangup)
exten => s,n,Return()
exten => s,n(hangup),Hangup(17)

Then you can do send the incoming calls to a custom destination which targets

check-concurrent-calls,s,1(${EXTEN},2)

You could probably use the same thing for outbound calls using the trunk predial hook

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