Foniva Contact Center Software
Asterisk Experts Support

Agi : check channel status

When using an agi, you may run into situations where neither AGI or DeadAGI command fills your needs.

You may want to continue running your scripts no matter what happened.

At the same time, you may also want to check the channel status to know if the user already hanged up and take decisions based on the channel status then.

You can run the agi command :

Usage: CHANNEL STATUS [<channelname>]
If channelname is not provide, you will get the current channel status.
Here are the returns :
failure: 200 result=-1
success: 200 result=<status>

<status> values:
0 Channel is down and available
1 Channel is down, but reserved
2 Channel is off hook
3 Digits (or equivalent) have been dialed
4 Line is ringing
5 Remote end is ringing
6 Line is up
7 Line is busy


Our sponsors


Asterisk Experts Support