Possible to change the destination of an announcement from cmd line?

Hello -

I have a need to change announcements & messages based on user input. I was going to use BLF and conditional, but I need to select between 4 options.

So, I wrote a script that changes the message (…/recordings/custom) based on user input from a web page.

Is it possible to change the destination of the announcement from the command line so I could integrate that as well?

Thanks!

Sure you can use mysql tool to alter the database directly from the command line.

I was thinking either modify the mysql db directly (if I do that, I need to apply changes/restart??)

or

create the number of announcement/destination combinations I need and a custom dial plan (lookup the choice via a script) and select the required announcement.

Would either solution be better for one reason or another? I’ve figured out how to modify the mysql database, but not a fan of restarting frequently.

FreePBX is a front end to Asterisk, Asterisk get’s all is run-time status from (by default) the files in /etc/asterisk/ and the astdb in /var/lib/asterisk/astdb.sqlite3, you can propagate all changes you properly made in the FreePBX mysql tables ecosystem by running

amportal a r

which will both rebuild the /etc/asterisk/*.conf files and reload asterisk

anything you do to the sqlite3 database or any custom dialplans you modify, with an “rasterisk -x reload”

No restarting necessary, if you know what you are doing you can "rasterisk -x “reload X” where x is your area of interest for more efficiency, just choose your appropriate timing.