As few calls have a context?

I am developing a dialer and I need to know how many calls have a context X to see if I can pass more calls. I am working with php and AMI.


I think that there is not an specific option for see how my calls are in an x context. You might play with the core show channels command.

I suspect he wants to use group counts. On the other hand, this looks like an outbound call centre, and like most people, I am plagued by these.

Using this exmaple you can limit the amount of call in an specific context
Tested and working :

exten =>_57,1,Noop(Received call to extension ${EXTEN})

exten =>_57,n,Set(GROUP()=${CONTEXT})) ; send all calls coming here to group your context

exten =>_57,n,GotoIf($[ ${GROUP_COUNT()} >3]?maxreached) ; Limit calls to 3

exten =>_57,n,Set(MYTRUNK=voipms)