Get current available channels

Is there an easy way, from the CLI, to get a list of current active channels (or current free channels)? We have a PRI and several conference calls getting booked at the same time so I think we are running out of available channels.

Also, is there a way to setup asterisk to automatically email me if an active channel threshold is surpassed? Like a warning email if 21 channels become used simultaneously?

Okay, looks like ‘show channels’ is the command I want. Now all I need is a script that runs this command in the CLI and outputs to a file.

Any ideas?

Hi for what you are trying to acheive , groupcount would be the best, this will track the channels in use and you can handle the dialplan based on teh number.

exten => s,n, Set(GROUP()=INBOUND_GROUP) ;
exten => s,n, Noop(${GROUP_COUNT(INBOUND_GROUP)});

this snippit will set you on your way