& freePBX 2.5.1 - choice of CLI but NO asterisk manager or logging, OR the opposite

I have upgraded from asterisk 1.2.13 to Freepbx is 2.5.1 and was not upgraded or reinstalled (as yet!).

Case 1 - as installed. With the sample asterisk 1.4.21 config files, I can connect to freepbx, but freepbx states in the GUI that it cannot connect to the asterisk manager. There is a red warning label under asterisk in the server status section. There are no details avail about version, peers etc in the gui. But I can connect to the CLI (after changing permissions on the /var/run dir to 777…this is prob. not secure!). There is no logging. Extensions are also grey out…ie cannot be created. asterisk.pid and asterisk.ctl are both in /var/run/asterisk

Case 2. I had backed up, so replaced the original asterisk-1.2.13 /etc/asterisk files into the working directory, and renamed the samples directory to /etc/asterisk_1. I found I could then connect to the asterisk manager (no more warning labels!) but this time, not to the CLI via asterisk -rvvvvvv (it questions if /var/run/asterisk.ctl exisits…ie not /var/run/asterisk/asterisk.ctl but /var/run/aterisk.ctl !!
But grep shows that “/var/run/asterisk” (& not /var/run) appears in all of the following:
/etc/asterisk/asterisk.conf:astrundir => /var/run/asterisk
/etc/asterisk/extensions_additional.conf:ASTRUNDIR = /var/run/asterisk
/etc/asterisk_1/asterisk.conf:astrundir => /var/run/asterisk

where the /etc/asterisk_1 dir is the renamed samples dir (ie from /etc/asterisk before restoration), and the current /etc/asterisk dir is a restored backed up one

Also, logging works!

The funny thing is that when using the restored /etc/asterisk/ files

  1. I can see asterisk.pid & asterisk.ctl in /var/run and
  2. in /etc/asterisk.conf, under [directories], we see:
    astetcdir => /etc/asterisk
    astmoddir => /usr/lib/asterisk/modules
    astvarlibdir => /var/lib/asterisk
    astdatadir => /var/lib/asterisk
    astagidir => /var/lib/asterisk/agi-bin
    astspooldir => /var/spool/asterisk
    astrundir => /var/run/asterisk
    astlogdir => /var/log/asterisk

amportal.conf also lists:

so just repeating, with the restored 1.2.13 /etc/asterisk/files, I cannot connect to remote asterisk (ie the CLI ) but can connect to the asterisk manager via the web gui and logging works.

I have tried putting relevant config information into http.conf and manager.conf, but still not luck.

Is there some hard coding there, should freepbx be reinstalled??