FreePBX 2.10.0 not applying changes on Asterisk configuration

Hello everyone,

I’ve compiled/installed the following:
Asterisk 1.8.3.3
Addons 1.6.2.4
libpri 1.4.12
FreePBX 2.10.0
Webmin 1.590
on a Debian 6 Squeeze fresh machine.

Problem is that FreePBX starts, logs in the panel, make and save editings like normal but doesn’t apply configurations to Asterisk, that is: Asterisk configuration files are not edited on “Apply Config”.

DEBUG:
All files are correctly asterisk:asterisk owned and even a full 777 doesn’t solve. Ok, debug-time.
I went to “/etc/asterisk” and “extensions.conf”, “sip.conf” and few others where the original Asterisk files, not those with “AUTO-GENERATED FILE…”, while all the “_additional” and “_custom” where correctly there.
I digged into it for long and I arrived to /var/lib/asterisk/bin/retrieve_conf (the one called on “Apply Config”) trying to find out the code that substitutes these files (since if I remove i.e. “extensions.conf” and apply, it gets created correctly this time).
Found, it was around line 131, the method “do_symlink(…)” and debuged it.
This is the method:

 // stripped comments for the sake of clearity
 function do_symlink($src, $dest, $subdir, $moduledir) {
    if (file_exists_wrapper($dest)) {
      if ((!is_link($dest) || readlink($dest) != $src) && (md5_file($src) == md5_file($dest))) {
        // nothing.
      } else if (!is_link($dest)) {
        // ### passes here: finds original files (not links) and leaves them there as are
        freepbx_log(FPBX_LOG_ERROR, $dest.' already exists, and is not a symlink!');
        $this->symlink_error_modules .= "<br />&nbsp;&nbsp;&nbsp;".$dest." from ".basename($moduledir)."/".$subdir." (Already exists, not a link)";
      } else if (readlink($dest) != $src) {
        freepbx_log(FPBX_LOG_ERROR, $dest.' already exists, and is linked to something else!');
        $this->symlink_error_modules .= "<br />&nbsp;&nbsp;&nbsp;".$dest." from ".basename($moduledir)."/".$subdir." (Already exists, linked to something else)";
      }
    } else {
//    // symlink, unlike copy, doesn't overwrite - have to delete first
//    if (is_link($dest) || file_exists($dest)) {
//      unlink($dest);
//    }
      if (!symlink($src, $dest)) {
        freepbx_log(FPBX_LOG_ERROR, 'Cannot symlink '.$src.' to '.$dest.'. Check Permissions?');
      }
    }
  }

So from the code sounds like those file should alredy be substituted at this time, so I could also remove manually original “.conf” files and let FreePBX create them back (I got the exact list), or force in code this substitution, but i don’t know what this could determine so I fear to mess something somewhere else.
Sounds like some step was miss during installation (those original files shouldn’t be there, right?): at what point of FreePBX installation Asterisk configuration files get substituted?

What’s your thoughts so far?
Thank you in advance.

If you used the debisan squeeze packages, I suggest you try over again and compile Asterisk from source, the .deb’s put a lot of things in “non-standard” places (Asterisk 1.8 does not need addons, they are in the source) and you need to move the apache2 docroot to /var/www/html as this is hard coded in a couple of places in FreePBX still.

Yes, sorry, sure FreePBX is not compiled, I forgot to mention that.
Anyway I already went through install_amp.sh and I got to the function quoted in the thread question.

You are using Debian & FreePBX problems free right? You don’t do anything “special” while installing FreePBX right? So do I. Why do I have this problem then…can’t figure it out.

In very short:
-Asterisk compiling
-Download FreePBX
-extract in /usr/src
-edit for hardcode /var/www/html
-[db stuff…anyway no problem on this]
-launch install_amp
-/usr/src/freepbx-2.10.0/apply_conf.sh

that’s it.
FreePBX 2.9.0 never gave me this kind of problem by pretty much the same procedure…

Well actually I downloaded and compiled Asterisk from sources, but in make step it starts to download lot of packages by himself.
So addons are no more needed in Asterisk 1.8? I see.

Anyway I followed your steps (beside those already done), but FreePBX seems still to get stuck with that…I don’t understand: I did nothing special but download and compile!
Could it be Debian fault? I mean, FreePBX is tested on CentOS as far as I know.

FereePBX is not compiled, it is installed with a bash script install_amp.sh so it’s intention is clear, just read it.

There are no “packages” involved, Dahdi will get some firnwares and Asterisk will download any extra sound files you choose in the make menuselect bit, you will need to pre-get the mp3 stuff with the script included.

Definitaley not Debian, I use it all the time. You have to read through install_amp.sh and do a little manual symlinking etc. I start off with an basic /etc/amportal.conf also to help the script along, but it basically works.