Hello all, I am in need of some pointing in the right direction. I have been given a task to allow one of our queues fail over destination to be changed through automation(back-end, server side manipulation not through the GUI). I was wondering if someone could point me in the right direction on how I can make a change to our queues configurable fields through some type of script or file that is read/write.
I have provided an example of what I am talking about below.
In step 1 on the link above I want to be able to change the fail over-destination options
I am also looking on step 3 to change the Timing and Agent Options- Max Wait Time.
I want to be able to change these through a script or CLI. I have not had any luck finding these variables in configuration files to edit. Can anyone please point me in the right direction to automate this fail over destination.
Solution:
I want to thank everyone for their help. I was able to come up with a solution. With our workflow software I was able to have it execute a powershell code using plink over SSH-CLI to change the extensions_custom.conf and have it force copy over preset configs and then force a fwconsole reload. I have it tied to an extension through our inbound route config. Inbound route number gets called, it then passes to an automated extension handler where my custom dial plan is, from there it passes it to the queue. Authorized users can now change queue wait times and re-route to other destinations based on variables in our workflow software. It’s a nice touch for our IT team as we’d always be asked to make changes. Now they can do it.
If you understand the contents of the database.table.field asterisk.queues_config.dest you can directly update that field and reload FreePBX programmatically.
If that route is chosen, I’d go with something that using FreePBX Internals (search the forums) and see if there’s some PHP code that can help you with that. @jfinstrom is pretty good about suggesting code to do this, so look for posts where he’s responded.
Thank you for the input, I like this idea. But I am having trouble understanding how I can use this to automate. I have an external software that I want to send a web request or something along those lines to the pbx server to initiate the fail over change to happen without me having to do anything on the PBX. User submits form, form sends webrequest to PBX, PBX automatically fails over to custom destination and vice versa to turn it back again.
I’ve never written anything in AGI. I do not see where to connect to get the data or even where the data to change is at. I have found an AGI-BIN container that contained some AGI scripts but nothing that seemed to be helpful. Do I need a module attached to see custom dial plans? What are you referring to as the external server?
I want to thank everyone for their help. I was able to come up with a solution. With our workflow software I was able to have it execute a powershell code using plink over SSH-CLI to change the extensions_custom.conf and have it force copy over preset configs and then force a fwconsole reload. I have it tied to an extension through our inbound route config. Inbound route number gets called, it then passes to an automated extension handler where my custom dial plan is, from there it passes it to the queue. Authorized users can now change queue wait times and re-route to other destinations based on variables in our workflow software. It’s a nice touch for our IT team as we’d always be asked to make changes. Now they can do it.