[asterisk-users] Question on AMI and ChanIsAvail

Aldo Bergamini aaberga at gmail.com
Thu Oct 18 11:21:23 CDT 2012


On 18 Oct 2012, at 17:58, Jerry Geis wrote:

> I was wanting to call ChanIsAvail from AMI.
> 
> I logged in and issues command,
> 
> Action: Command
> Command: ChanIsAvail DAHDI/1
> 
> my response was this:
> event_list=0 ret=158 Response: Follows[CR ][LF ]Privilege: Command[CR ][LF ]No such command 'ChanIsAvail DAHDI/1'
> 
> Is there any way to tell if a channel is available through AMI?
> Did I format my request wrong?
> I am on 1.4.43.
> 
> Thanks,
> 
> Jerry


You can get (on the CLI) the list of AMI commands supported by your Asterisk installation issuing "manager show commands".

The AMI command that tells you what a terminal is doing at any time is "ExtensionState" (I guess it's available on 1.4..). But if you add hints to your dialplan, then Asterisk will send an AMI event whenever a terminal in the list of hints is changing state.

You would need to listen to all such events and keep track of each line/extension; issuing a list of ExtensionState events only when you launch your tracking process.

Cheers,
Aldo




More information about the asterisk-users mailing list