[asterisk-users] Using AMI to determine PRI Channels Used

Richard Lyman pchammer at dynx.net
Mon Nov 10 10:45:48 CST 2008


Godson Gera wrote:
> On Mon, Nov 10, 2008 at 7:41 PM, David Budny <dbudny at visiblecustomer.com>wrote:
>
>   
>>  What is the AMI command to see how many PRI channels are being used /
>> available?
>>
>>
>>
>> Thanks
>>
>>     
> There is no direct command in AMI which will give you used channels number.
> But you can easily keep track of the active zap channels, by catching the
> respective events (events Link, Ringing,Hangup,Unlink etc etc ), on zap
> channels, and storing them in a variable in your program.
>
> When you receive a Connecting kind of event like Link,Ringing increase the
> variable value, and when you receive Hangup or Unlink events decrease the
> variable value.
>
> Happy Hacking,
> Godson Gera.
> http://godson.in
>   
Action: Status       (this will show only active channels, parse out the 
Zap ones)

and

Action: ZapShowChannels      (this will list all Zaps, parse out what 
you are looking for (PRI ones will have 'Signalling: PRI...'))







More information about the asterisk-users mailing list