Change Find Me/Follow me in extension from CLI

Hello,

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.

Version info:
FreePBX 14.0.11
Asterisk 13.26.0

Thank you for the help.

That can only be done in real time within the sqlite3 database asteriskdb, you will need to adjust the FMFM value for the user.

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?

Thank you

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)

Here is a start on such a script, but it needs work to do what you need: lgaetz-fmfm.php · GitHub

Look for public functions in:

/var/www/html/admin/modules/findmefollow/Findmefollow.class.php

for the remainder.

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.

If this is the case, we discussed a solution to this at some length last week:

Thanks, I have it solved now.
Update the sqlite3 database with a query.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.