I setup the latest FreePBX distro for our office, and the programmers want an API to tie into. Specifically, they want to add extensions to a queue when they sign into a custom employee dashboard. And when they logout of the dashboard, it will remove that user extension from the queue,
Would I give them the Asterisk API for this?
We also plan to use iSymphony as well, and I know there is a FreePBX API. Just want to make sure I give them the right information.
The newest versions of FreePBX (and there are several running along side-by-side) have several interfaces that can be used. One of them is “more or less” an API, but it is under construction and I’m not sure it will give you exactly what you’re looking for anyway.
In the past, we’ve recommended that developers use the “rasterisk command options” syntax as a pseudo-API. This works well for almost anything that a typical API could be used for, and is (since it’s a “system()” call) largely language agnostic.
The ‘rasterisk’ program is an alias to the ‘asterisk’ program that assumes a ‘-r’ option, so it gives you the ability to interact with the system without having to “log in” to Asterisk.
If you can’t do it directly from the Asterisk command-line (which I’m almost certain you can), you could also use the ASTDB database, which can be programmed using direct calls to the astdb, or can be modified (once again) through the ‘rasterisk database set …’ (or similar) program call.
There is a REST API being built into the newer (I think 14+) versions of FreePBX that you may be able to access, but IIRC the REST interface is managed on a ‘per module’ basis, so if the queue module (for example) doesn’t have a specific API, you’ll have to use one of the other, older methods.
I appreciate the reply, but I think I am more confused now then I was
Are you saying that we can’t or shouldn’t use the Asterisk Rest API’s? I also see an ARI and AMI
It sounds like there may be different ways to accomplish my goal, but which way would be ideal with simplicity in mind? We use API’s all the time, I just want to offer my programmers the most ideal way, whether it be an API, rasterisk CLI or ASTDB database scripts.
I guess I should add, that we plan on doing more development moving forward, like grabbing callerID on incoming calls to populate information in our dashboard etc. I am sure there will be other needs moving forward.
When you get to that point, AMI is your friend. If all you want to do is fire off a call and you already have the code there’s no reason to stop doing what you’re doing. Now, if you start adding new requirement, then AMI, ARI, and REST are all options moving forward. Note, however, that AMI looks just like a call file, so that might be the first candidate to look at what you’re doing.
There are a crazy number of ways to do what you want to do, including all of the above and more we haven’t even talked about, like the Sangoma CRM Commercial Module and adding hooks to the CID Superfecta. Seriously. this cat isn’t big enough to skin all the ways it can be done.
None of these solutions is inherently better or worse than any other, If they meet your needs, they are good enough and life is good.