Limit cc on external number


#1

Hi everyone!

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.

Thank you in advance.
With regards, Sophia.


#2

Post what have you done please


#3

exten => xxxxx,1,Set(GROUP()= {CDR(dst)}) exten => xxxxx,n,GotoIf([{GROUP_COUNT({CDR(dst)})}>3]?busy)
exten => xxxxx,n,Set(OUTBOUND_GROUP=${CDR(dst)})
exten => xxxxx,n,Dial(SIP/xxxx)
exten => xxxxx,n(busy),Hangup

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.


#4

I dont understand this part, do you want to use group count to limit calls sent to queue members ?


#5

Use the </> in the forum edit tools to have dialplan show up accurately.


#6

It means queue member is Local/xxxxxxxxxx@from-queue/n. I means queue member is external number instead of extension.

limit number of cc according to xxxxxxxxxx.


#7

Thank you so much :slight_smile:


#8

Put the group cont code in extension xxxxxxxxx in context from-queue, using ${EXTEN} as the group name.


#9

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.


#10

group count is extremely easy method to complete this task

[count]
exten =>_X.,1,Noop(Received call to extension ${EXTEN})

exten =>_X.,n,Set(GROUP()=${EXTEN})) ;create the group

exten =>_X.,n,GotoIf([ {GROUP_COUNT()} >1]?maxreached) ; verify max calls

exten =>_X.,n,Set(MYTRUNK=voipms)

exten=>_X.,n,Dial(SIP/{EXTEN}@{MYTRUNK},30)

exten=>_x.,n(maxreached),Playback(all-outgoing-lines-unavailable)

exten=>_X.,n(maxreached1),Playback(pls-try-call-later)

exten=>_X.,n,Hangup()

Forum removing $ on the highlighted line doesnt matter if used p reformatted text option