I am using AMI from Python. I guess the same can be achieved from the Asterisk CLI. I want to be able to get details about every extension in the PBX. More specifically, for every extension I want to know:
- If the extension is in a call, what is the unique ID of that call, what is the caller id, what phone number was called (incoming line)
- If the extension is ringing, what incoming line is ringing right now.
The system currently has a number of custom contexts that will first hunt and then ring all available extensions and I want to know who and where is ringing and talking. I looked through almost all calls of AMI I could find, but couldn't figure out where to get that information.
Best Answer
Digium has somewhat complete documentation for all AMI Actions and AMI Events on their wiki. I say "somewhat" because it lists all available actions and events, and how to use them, but some of it is a little sparse when it comes to the output you should expect to see.
Actions you might find useful:
core show channels
, which shows channel names and associated caller-id infoEvents you might find useful:
Of the actions, I'd think Status will be most useful, and the Newchannel and Newstate events will tell you when channels are ringing or get answered.