Queue reload

I’ve got a CRM that generates agent rankings by various statistics. I’ve written code to update the queue in the Asterisk database, but I need Asterisk to reload the queues.

I have a cron job that calls /var/lib/asterisk/bin/module_admin reload every 5 minutes, but reloading everything is causing FOP2 to act up (some extensions go gray, call counts become inaccurate).

Is there any other way to reload just the queues? Maybe something from the CLI? I’ve tried module reload app_queue.so, but that doesn’t seem to work.

I’m on FreePBX 5.211 and Asterisk 11.2.

asterisk -rx ‘queue reload all’

Thank you!!

Does queue reload all differ from issuing the same in the CLI from within FreePBX? I did some testing and seemed that the only way that worked was if I manually edited the queue-additional.conf file as well as the DB.

I’m not sure how the submit and apply changes buttons work in FreePBX. Seems like submit writes to the DB, and Apply recreates the conf file and then does a queue reload.

I just want to make sure I understand well enough so I don’t code myself in to a nightmare.

You have an asynchronous situation and a bit of of a catch22 , Asterisk reads it’s state from the text files in /etc/asterisk on a reload, so "asterisk -rx ‘queue reload all’ will reread those files if they are changed , “amportal admin reload” or it’s variants builds those files largely from the mysql database which wont happen until you change the mysql tables, the third step is that FOP2 gets it’s stuff again from the text files in /etc/asterisk, so you will need to reload FOP2 if they are changed by FreePBX aqnd you want it to follow FreePBX’ configuration. Confusing but true :slight_smile:

Thank you dicko. So would it be safe to say that updating the DB, updating the .conf file, then doing a queue reload all would okay? Not that I relish the idea of parsing the conf file. The amportal admin reload is just killing me. I have 120 agents reporting moments of silence and all think they have broken headsets. :smile:

Apart from the necessary FOP2 reload, that will kill you more, talk to Nicolas :slight_smile:


The problem with Queue reload all is that when used it resets the stats of the queues…
That’s a problem

Instead, i use config reload /etc/asterisk/queues.conf
Ps: Asterisk 13

Did’nt tested on other versions.