I am fairly new to Asterisk 13 and am working on a project to dynamically update a queue. Because the queue will change each day, I want to find a way to do this with the API instead of the CLI.
From what I have found this can be achieved by the following:
Create an exten in extensions.conf: exten => 7777,1,AddQueueMember(support, SIP/18)
Add this extension in the sip.conf.
Use the post request: POST https://{IP/Servername}:{Port}/ari/channels?endpoint=“SIP/7777”
Im able to use this application with console dial 7777@context, but if I try to use this post request in the API, I get the following message: {“message”: “Application or extension must be specified”}
It seems to me that there is something wrong in the configuration of the endpoint.
If I add an extension and context parameter to the post request, I receive an error:
{“error”: “Allocation failed”}
There is nothing wrong in the configuration. Your request is just incomplete or improper. You’d need to show the precise HTTP request you are doing when you get the “Allocation failed”. As well it’s documented on the wiki[1] the specific options.
Mabye I need to explain my Use Case furhter. We have a Google Calendar for the Support Team. For each day there are two calendar entries (two support roles + assignees). We collect this data every morning using the Google API and are now looking for a way to alter the queues based on this information. Atm we manually do this with the CLI but we want to change that. The Assignees are subject to change on weekly or daily basis.
Is this possible to do with AMI? Or am I right in thinking that we need to use the ARI?
I have looked into AMI and during the research I found the Asterisk Call Files. This method would be perfect for our setup. From what I gathered, it is possible to add / remove queue members with this method.
Here the example form the documentation:
To execute an application:
Application: <appname> - The application to execute
Data: <args> - The application arguments
I wasnt able to get it to work yet. I want to do this application: AddQueueMember(support,SIP/24)