Error after importing settings from physical server in VM

I just virtualized one FPBX on Hyper-V 2016 and imported the settings from a physical server. Everything ran (more or less) without bigger errors.

One thing is voicemail-notification are not delivered / stored properly. Calls are always shown in the calls list in UCP, but voicemails sometimes are shown with attachments, sometimes neither they nor the attachements are shown in vm-list (and are not delivered via email).

In “voicemail settings”, if I try to change something and apply it, I get the followinig error:

exit: 255
Unable to continue. SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘hooks-noid’ for key ‘uniqueindex’ in /var/www/html/admin/libraries/BMO/DB_Helper.class.php on line 268
#0 /var/www/html/admin/libraries/BMO/DB_Helper.class.php(268): PDOStatement->execute(Array)
#1 /var/www/html/admin/libraries/BMO/Hooks.class.php(117): FreePBX\DB_Helper->setConfig(‘hooks’, Array)
#2 /var/www/html/admin/libraries/BMO/Hooks.class.php(27): FreePBX\Hooks->updateBMOHooks()
#3 /var/www/html/admin/libraries/BMO/DialplanHooks.class.php(159): FreePBX\Hooks->getAllHooks()
#4 /var/www/html/admin/libraries/BMO/DialplanHooks.class.php(27): FreePBX\DialplanHooks->getBMOHooks()
#5 /var/lib/asterisk/bin/retrieve_conf(854): FreePBX\DialplanHooks->getAllHooks(Array)
#6 {main}


besides importing settings, I installed German sounds via:

mkdir /var/lib/asterisk/sounds/de
cd /var/lib/asterisk/sounds/de
wget -O
wget -O
chown -R asterisk.asterisk /var/lib/asterisk/sounds/de
find /var/lib/asterisk/sounds/de -type d -exec chmod 0775 {} ;´

(don´t really know why FreePBX does not support German sounds by default)

So maybe this is a permission problem?

MIght have been a permission issue, because

chmod 777 -R /var/spool/asterisk/voicemail/default/

solved it by now, e.g. voice mail messages are stored now.

Are these changes permantent or will they be overwritten by next updates?

I believe the correct method to restore permissions is: fwconsole chown

Yep, already knew and tried that, but thanks.

Nevertheless I think this has to be a permission issue: both if I reset the permissiions via “chown -R…” and reboot and “fwconsole chown” I run in errors with voice mail.

I have no idea anymore :unamused:


Voicemails and calls ONLY are stored if I do a “chmod 777 -R /var/spool/asterisk/voicemail/default/”, which is not permanent and gets lost after reboot.

“fwconsole chown” does not help anything.


The solution was completely different than I thought: after reading the log files again, I saw there were some missing “thank you. good by”-files in the en-language-folder, while they ought to be fetched from the de-folder, e.g. with the German-language-files.

So I did the following:

mkdir /var/lib/asterisk/sounds/en/backup/
mv /var/lib/asterisk/sounds/en/auth-thankyou.* /var/lib/asterisk/sounds/en/backup/
mv /var/lib/asterisk/sounds/en/goodbye.* /var/lib/asterisk/sounds/en/backup/
cp /var/lib/asterisk/sounds/de/auth-thankyou.* /var/lib/asterisk/sounds/en/
chown asterisk:asterisk /var/lib/asterisk/sounds/en/auth-t*

Everything runs smooth now.

P.S.: maybe there will come a time when Sangoma puts the German soundfiles to FreePBX