Hints and Call Flow Control toggles via AMI

Hi guys,

Apologies if this is a little off-topic but I’d like to get input from people here regards something I am working on, whether I am going in the right direction or whether there are better ways of going about this.

I’d like to put together a portal of sorts, and starting with something simple - seeing extension state and call flow control toggle states, and toggling that CFC state.

Starting with the CFC toggle, which I’d ultimately like to be able to toggle via a web page. First, I am trying to find out a method of toggling and checking state from an external program (probably python to begin with, but that’s completely off-topic and I don’t need to cover that here).

I am looking at the Asterisk Manager Interface to achieve this - and this is where I get a little stuck.

  1. There doesn’t seem to be a way to check dialplan hints from the AMI interface? Unless, this is the correct way of doing it;
    Action: Command
    Command: core show hint *280
    This will give me a result that could be parsed with some Regex.
  2. How about toggling the CFC state? Getting stuck here. Was mucking around with Action: SetVar but I don’t think this is right? When I watch a handset toggle the code in AMI, then yeah, this is where I saw the VarSet Event, leading me to investigate SetVar Action as a method.
  3. And finally - am I just going about this wrong? Ideally, when I’ve worked out the method for the above, then I will start writing something to do said method, and language of choice will be Python currently. I believe there are modules/libraries that will ease all of this (StarPy) - but if there is something completely different then maybe I should be on that path.

Apologies if this was vague or doesn’t make sense. I am by no means any sort of developer so there is a bit of a learning curve involved for me…

Thanks for any help!

You might want to check out ARI instead of AMI.

If you look back a couple of weeks, there was a FreePBX Video about using it. It offers a lot of advantages, specifically that it’s more of an API than AMI.

Not saying AMI is the wrong tool, just that this new interface might get you closer faster.

Also, look for “asterisk php agi” for another way to access Asterisk stuff from an external program.

You should check out FOP2. Yes, you have to pay for it, but does everything you’ll want and more.

I use it on all my installs, and is invaluable to me since I am not capable of writing anything functional myself.

I am all for developing something from scratch that meets your needs, but this could potentially save you some time.

Thanks, cynjut. I will look into ARI, and yes I’ve heard of phpagi. I am just a complete idiot with regards development. The idea would’ve been that I made a rough proof of concept, and pass it to an app developer to polish. Will keep playing around.

Yes, used FOP2 before and don’t want to offer a reception console in place of a simple portal. At this point, I just want to toggle and get status for a Call Flow Control toggle. Think of it as a web interface to turn on and off a night switch.