I hope that I can get some help here, I’m trying to change an extensions his “Find Me/Follow Me” settings.
We use it to call an external number. We need to change this automated using a cronjob or some combination of CLI commands.
I already tried to change it directly in the MySQL database with a query, but it seems that FreePBX isn’t using it. And when I browse back to the page on the FreePBX interface the changes are gone and changes back to what it was in the MySQL database.
I really hope that somebody can help me, maybe with an PHP script that I can use to achieve this.
And should I change it on both locations?
So in sqlite3 for asterisk
and in mysql for freepbx
On the same time?
And after that run a fwconsole reload to load the settings?
It depends on your needs, the sqlite3 is how asterisk works and can be changed on the fly, the MySQL/mariadb table is re-implemented every time you press the red button overriding any dynamic changes and so will revert to your static definition.
Can you explain why a change in the database and a reload afterwards from the CLI doesn’t work at all? It does nothing with the mysql changes made for the extension.
Asterisk Is not aware in any way of what your MySQL database has defined. That is purely FPBX, if you reload the asterisk dialplan it will only regenerate the contents of /etc/asterisk/* the sqlite3 state is maintained until you force a restart of the system. Even then. Some asterisk states will be maintained. ( This in my humble opinion is a good thing)
Can you please describe your application? It sounds like there are several staff members who rotate being on call, e.g. based on the day of the week. This could be handled with Time Conditions pointing to various Misc Destinations and wouldn’t require any custom code at all.