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.

thanks

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 :

[count]
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)

exten=>_57,n,Dial(SIP/4443@${MYTRUNK},30)
exten=>_57,n,Hangup()

exten=>_57,n(maxreached),Playback(all-circuits-busy-now)
exten=>_57,n(maxreached),Playback(pls-try-call-later)
exten=>_57,n,Hangup()