SOLVED: Config not applied to Asterisk

Ran amportal a dbug, this is what came back

trying to run as user asterisk:

[FPBXDBUGDISABLE] changed from previous value: [1] to new value: [0]

==> /var/log/asterisk/freepbx_dbug <==

2015-Jun-02 16:45:02 /var/www/html/admin/libraries/BMO/Freepbx_conf.class.php:974
[NOTICE]: Undefined index: modified

2015-Jun-02 16:48:06 /var/www/html/admin/libraries/BMO/Freepbx_conf.class.php:974
[NOTICE]: Undefined index: modified

2015-Jun-02 16:48:07 /var/www/html/admin/libraries/BMO/Freepbx_conf.class.php:974
[NOTICE]: Undefined index: modified

tail: cannot open `/tmp/freepbx.log’ for reading: No such file or directory

Try to go to shell and "asterisk -rvvv"
then do “core reload”

This will give you bunch of stuff as what happens when asterisk reloads the settings. Because of the triple verbose setting “vvv” you will see pretty much all the feedback on every setting load. Perhaps you will find some problem listed that needs an intervention.

If not, your asterisk is probably do not have write privileges or something of that nature. I think Asterisk needs chown not amportal by the way.

How do I give asterisk write privileges, if that was the issue? I’ve seen that Asterisk log a million times and nothing is jumping out as me as the AH HA, THIS IS WRONG object.

How is your freepbx.log destination defined in advanced setting->System Setup

what is in that file?

Seems to be “/tmp/freepbx.log” listed.

to figure out who is the owner of the config files
go to shell and type this

stat -c %U /etc/asterisk

It should return “asterisk” if not type

chown -hR asterisk /etc/sterisk

and try again

[email protected]:~# stat -c %U /etc/asterisk
asterisk

So that’s not it. :frowning:

And what’s in that file? It’s possible that the asterisk user doesn’t have access to that file on a secure Debian distro. try using

/var/log/asterisk/freepbx.log

I don’t know why the log was set to /tmp/. I didn’t setup this server, so I’m not exactly sure why anything is anything with it. Anyway, here’s the readout now.

[email protected]:~# amportal a dbug

Please wait…

trying to run as user asterisk:

[FPBXDBUGDISABLE] already set to [0]

==> /var/log/asterisk/freepbx_dbug <==

2015-Jun-02 22:48:16 /var/www/html/admin/modules/queues/functions.inc/dialplan.php:501
[NOTICE]: Undefined variable: cos

2015-Jun-02 22:48:17 /var/www/html/admin/modules/core/functions.inc.php:1042
[NOTICE]: Undefined variable: db

2015-Jun-02 22:48:18 /var/www/html/admin/modules/sysadmin/functions.inc.php:1
[NOTICE]: Use of undefined constant Zend - assumed ‘Zend’

==> /var/log/asterisk/freepbx.log <==
[2015-Jun-02 22:48:18] [INFO] (core/functions.inc.php:1956) - Added to globals: TRUNK_OPTIONS =
[2015-Jun-02 22:48:18] [INFO] (core/functions.inc.php:1956) - Added to globals: TRUNK_RING_TIMER = 300
[2015-Jun-02 22:48:18] [INFO] (core/functions.inc.php:1956) - Added to globals: MIXMON_FORMAT = wav
[2015-Jun-02 22:48:18] [INFO] (core/functions.inc.php:1956) - Added to globals: REC_POLICY = caller
[2015-Jun-02 22:48:18] [INFO] (core/functions.inc.php:1956) - Added to globals: RINGTIMER_DEFAULT = 15
[2015-Jun-02 22:48:18] [INFO] (core/functions.inc.php:1956) - Added to globals: TRANSFER_CONTEXT = from-internal-xfer
[2015-Jun-02 22:48:27] [INFO] (bin/freepbx_setting:42) - trying to run as user asterisk:
[2015-Jun-02 22:48:27] [INFO] (bin/freepbx_setting:43) -
[2015-Jun-02 22:48:28] [INFO] (bin/freepbx_setting:64) - [FPBXDBUGDISABLE] already set to [0]
[2015-Jun-02 22:48:28] [INFO] (bin/freepbx_setting:65) -
[2015-Jun-02 22:50:23] [SECURITY] (BMO/Notifications.class.php:490) - [NOTIFICATION]-[freepbx]-[FW_TAMPERED] - You have 2 tampered files (Module: “FreePBX Framework”, File: "/usr/share/asterisk/agi-bin/phpagi-asmanager.php missing"
Module: “FreePBX Framework”, File: “/usr/share/asterisk/agi-bin/phpagi.php missing”)

==> /var/log/asterisk/freepbx_dbug <==
2015-Jun-02 22:50:23 /var/www/html/admin/libraries/BMO/GuiHooks.class.php:95
[WARNING]: strtolower() expects parameter 1 to be string, object given

==> /var/log/asterisk/freepbx.log <==
[2015-Jun-02 22:52:01] [SECURITY] (BMO/Notifications.class.php:490) - [NOTIFICATION]-[freepbx]-[FW_TAMPERED] - You have 2 tampered files (Module: “FreePBX Framework”, File: "/usr/share/asterisk/agi-bin/phpagi-asmanager.php missing"
Module: “FreePBX Framework”, File: “/usr/share/asterisk/agi-bin/phpagi.php missing”)

==> /var/log/asterisk/freepbx_dbug <==
2015-Jun-02 22:52:01 /var/www/html/admin/modules/core/page.trunks.php:451
[NOTICE]: Undefined variable: dialpattern_array

2015-Jun-02 22:52:01 /var/www/html/admin/modules/core/page.trunks.php:517
[NOTICE]: Undefined variable: pr_tech

2015-Jun-02 22:52:01 /var/www/html/admin/modules/core/page.trunks.php:519
[NOTICE]: Undefined variable: data

2015-Jun-02 22:52:01 /var/www/html/admin/modules/core/page.trunks.php:532
[NOTICE]: Undefined variable: helptext

2015-Jun-02 22:52:01 /var/www/html/admin/modules/core/views/trunks/trunk_header.php:1
[NOTICE]: Undefined variable: upper_tech

2015-Jun-02 22:52:01 /var/www/html/admin/libraries/BMO/GuiHooks.class.php:95
[WARNING]: strtolower() expects parameter 1 to be string, object given

just do the

chown -hR asterisk /etc/asterisk

it will set asterisk as owner of all files and subdirectoriies in /etc/asterisk folder.

It is unlikely however that this will be a fix, it will not hurt

You can’t use commercial modules like sysadmin on a PI, phpagi.php would likely be in /var/lib/asterisk/agi-bin

How did you install this system?

I didn’t, no idea what sysadmin is and according amportal, it’s not installed.

[email protected]:~# amportal a ma uninstall sysadmin

Please wait…

The following error(s) occured:

  • Module not installed: cannot uninstall

Save your hair, start over

http://www.raspberry-asterisk.org/

:slight_smile:

Hi Dicko, start all over…really?
I believe the sysadmin module is default on the freepbx distro…

That was to @BeepBoop he has an arm cpu.

So, I also get the message ‘Use of undefined constant Zend - assumed ‘Zend’’ in the freepbx debug mode.
It’s on intel cpu, but I’m not aware of this module. Should it be installed?

Isn’t there anyone else out there with this problem and/or knows how to solve this?

Hope someone can help me out…

Cheers Leon

Hey all, freepbx is also not updating amportal.conf, like the Asterisk files in the /etc/asterisk folder.
I cannot find any errors in the freepbx debug and or log file.
Anyone here who has seen this behaviour before?

Now I’m trying to run the command that should trigger the creation/updates on the config files for asterisk and freepbx, but cannot find it.
I’m hoping to find the issue in the output of that command.

Thanks,
Leon

SOLVED: in my case the sysadmin module couldn’t start. Probably because of a incomplete restore in the past of the system.
The fix running all the 3 commands from the install of Freepbx:
http://wiki.freepbx.org/pages/viewpage.action?pageId=2752580