I want to limit concurrent calls on external number. I tried Group and GROUP_COUNT. But its not grouping the data according to dst field in cdr. And I am not able to get value of AMI member variable using AGI.
In above code$ sign is missing in front of variable due to editor issue. But I tried $ variable. The above code work in case of Inbound Route and extension. But the problem is with outside number(static agent of queue).
2nd solution, I tried is using PHP AGI script. But in case of agi $agi->get_variable(“CDR(dst)”) is not working.
When I can’t get asterisk to easily do what I want I use shell scripts. In this instance if you had a shell script counting the number of calls and decrementing the count when a call finishes you could stop a fresh one going out and you can even play a message explaining why.