How to limit number inbound calls per extension in context asterisk or freepbx

How to limit number inbound calls per extension in context asterisk or freepbx

exemple did number point to queue , and inside queue they are extension ( 1000 - 2000 - 3000 ) and i want just 1000 can answer 5 call throw the did or the queue per days ?
it’s there and solution or suggestion.

i do not speak about simultaneous call per extension i want limit per received call or answered call per extension inside queue , please any help

This is not something that exists today.

You could:

  1. Code something to keep track of calls per agent and route accordingly.
  2. Have the agent log out of the queue after 5 calls.

any way to 1. Have the agent log out of the queue after 5 calls. ?
any code exemple or contex that i can try ?

I would start with an mysql query where the queue is 5556 and the agent is at 1020 much like

SELECT   dstchannel  FROM cdr WHERE `lastapp`='Queue' AND  `dst`=5556 AND `dstchannel` LIKE '%1020%' AND `calldate` >= CURRENT_DATE()  HAVING COUNT(*) > 5;

You could then remove or pause the agent.

Maybe but i don’t think the query need count the number of anwsered call per agent

then leave out the HAVING clause

Did you have any ready exemple

Not really, write your query and having found the culprit I would

rasterisk -x 'queue pause member  LOCAL/1020@from-queue'

unpause when you want.

Great but this will be manual work :blush:

Not if you script it and make a cronjob

Emm great idea too with crontab and script not bad , but how can count call in real time for each agent

So after i can pause and unpause

By using AMI but that’s not trivial as it wont tell you directly how many calls taken today

a template for a cronjob

rasterisk -x "queue pause member $(mysql asteriskcdrdb -bsNe '<YOUR QUERY THAT RETURNS ONE  DSTCHANNEL like Local/1020@from-queue-000004a4;1>'|grep -v "$^"|sed 's/;1.*//'|cut -d '/' -f2|cut -d '-' -f1,2)"
1 Like

Thank you , you have put me on road
I will try to do same thing with that

1 Like

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