Blacklist not restoring via FreePBX backup and restore

I’m testing restoring our FreePBX backup to another system and have noticed that the contents of the blacklist is not being restored to the new system.

The backup was created on a Freepbx system using freepbx Backup and restore. System is running Asterisk 1.4.17 (Trixbox 2.4)

the restore is going to Freepbx on Asterisk (Trixbox removed the trixbox packages and installed freepbx via tarball.

If anyone else is doing anything similar, can you check if your blacklisted numbers are being restored?

I can’t find a table where the numbers are being restored, or I’d manually move them across to the new system.

Blacklisted numbers are stored in astdb. If you do a restore you need to do an amportal stop followed by an amportal start to read back the new astdb.

Test that and report the outcome.

ahh - I’m not getting an astdb.dump file in the backup tarball. This is new.

This is with Freepbx 2.6.0

Attempting to copy the astdb from the original server to the new - after running the entire freepbx restore.

Edit: the copy of the astdb file worked.

Onto fixing my backups-

How does freepbx dump the astdb? (is there a command line I can fire off and watch for errors?)

Edit - found /var/lib/asterisk/bin/dumpastdb.php
attempted to run via php -q /var/lib/asterisk/bin/dumpastdb.php and result is:

PHP Fatal error: Call to undefined function parse_asterisk_conf() in /var/www/html/admin/common/php-asmanager.php on line 33

Could this be related to?:

I can’t find any reference to in the php-asmanager.php file. There is a asterisk_conf = parse_asterisk_conf($amp_conf[‘ASTETCDIR’]."/asterisk.conf"); in the php-asmanager.php file.

I am running 2.6.0 and my backup contains the astdb.dump.

The correct syntax for running the script is

php -q /var/lib/asterisk/bin/dumpastdb.php test

When run it will create a directory in /tmp called ampbackup.test, in that directory there will be a file called astdb.dump.

Check your Backup module, it should be at version Your dumpastdb.php should be 2432 bytes file.

The file is actually in /var/www/html/admin/modules/backup/bin, the file in /var/lib/asterisk/bin is just a link to the file in the backup module.

I checked the file size of dumpastdb.php, it’s 2432 bytes.
Module admin is showing the version as

attempting to run php -q /var/lib/asterisk/bin/dumpastdb.php test results in:
Fatal error: Call to undefined function parse_asterisk_conf() in /var/www/html/admin/common/php-asmanager.php on line 33

I don’t have PHPAGI Config installed in my modules - could that be affecting this?

Edit - I installed PHPAGI Config and the prerequisite Asterisk API from the modules admin, and now the dumpastdb.php works on the older machine. (Trix 2.4 w/freebpx 2.6.0) The newer machine (trix 2.8 w/freepbx 2.6.0) is still throwing the php-asmanager.php on line 33 error when trying to run the same thing.

I’ll keep looking at my setup - it could be the result of mashing freepbx 2.6 onto trixbox 2.8.


The function function parse_asterisk_conf is in /var/www/html/admin/ so I suggest that you check if that file was upgraded.

Did you tweak the database before the upgrade to 2.6? trixbox 2.8 sets the version to 5.5 for core

UPDATE modules SET version = '2.5.0' WHERE modulename IN (
  SELECT modulename FROM `modules` WHERE version >= '5.5'

parse_asterisk_conf is in the Yes, I changed all the 5.5 module versions back to 2.5.0 as guided from one of your other posts to someone else. (also had to remove file module.xml under /var/www/html/admin/modules/fw_ari/)
Grasping at straws here but could this post be related?

I guess backing up, does dumpastdb.php work for you with asterisk 1.6?

Thanks again for the help.


Just tested it on my Asterisk on current 2.6. (thanks to VMware)

Module              Version           Status
------------------- ----------------- -------------------
backup               Enabled
core                 Enabled
framework            Enabled

I did run php -q /var/lib/asterisk/bin/dumpastdb.php test from /root, no errors in output, backup created with correct content.

Have you checked for correct permissions?

When you removed the trixbox package, did you empty the /var/www/html/admin directory before you installed 2.6.0.RC2?

I got this working on the new system by editing dumpastdb.php

added the line:


above the:


pilfered this from the following:

Thank you.

Well, if your version of backup is the fix is included in that version. I just downloaded the module and checked it. Seems that something went wrong when you install the backup module.

I am glad that you got it working.