Hi again!
Well, it seems that the previous problem was related to the way in which Asterisk version is identified. It seems that FreePBX 2.11.0.43 is not able to identify this type of identification of Asterisk:
[email protected]:~# asterisk -V
Asterisk certified/11.6-cert13
So I added the following lines in /var/www/freepbx/admin/functions.inc.php
:
} elseif (preg_match('/Asterisk certified\/(\d+(\.\d+)*)(-?(\S*))/', $verinfo, $matches)) {
$engine_info = array('engine'=>'asterisk', 'version' => $matches[1], 'additional' => $matches[4],
'raw' => $verinfo);
$gotinfo = true;
After applying the change and reload the website, the Server Status for Asterisk changed to “OK”. So it’s great! It’s weird because I did not do any update to FreePBX; I just updated the version of Asterisk. So it seems that Certified Asterisk 11.6-cert1 (the version I was using before updating) would be identified so that FreePBX could recognize it.
However, although the Asterisk Server Status changed to “OK” on the website, when manually run the command retrieve_conf
, I keep getting an error:
[email protected]:~# /var/lib/asterisk/bin/retrieve_conf --debug
Checking for PEAR Console::Getopt..OK
found language dir fr for directory, not installed on system, skipping
[FATAL] retreive_conf failed to get engine information and cannot configure up a softwitch with out it. Error: asterisk
Before to fix the error on the Server Status of Asterisk, I had tried to install on FreePBX the “FreePBX Upgrader” module to upgrade to a newer version of FreePBX assuming that this was prepared to deal with this identification problem I was having. But although the module was downloaded, the installation of it was not effective given that was pending press on the “Apply Config” button. The issue is that when I tried to do it, it failed.
Now that I do not get the Server Status error, I tried again by pressing the “Apply Config” button but I get the following error:
Reload failed because retrieve_conf encountered an error: 1
exit: 1
found language dir fr for directory, not installed on system, skipping
[FATAL] retreive_conf failed to get engine information and cannot configure up a softwitch with out it. Error: asterisk
1 error(s) occurred, you should view the notification log on the dashboard or main screen to check for more details.
That is, the same error I mentioned above, when manually run the script. Reviewing in /var/log/asterisk/freepbx.log
, I found something like this after to press on “Apply Config”:
[2016-Mar-07 19:41:34] [INFO] (bin/retrieve_conf:110) - found language dir fr for directory, not installed on system, skipping
[2016-Mar-07 19:41:34] [FATAL] (libraries/utility.functions.php:443) - retreive_conf failed to get engine information and cannot configure up a softwitch with out it. Error: asterisk
[2016-Mar-07 19:41:35] [CRITICAL] (admin/functions.inc.php:386) - [NOTIFICATION]-[freepbx]-[RCONFFAIL] - retrieve_conf failed, config not applied (Reload failed because retrieve_conf encountered an error: 1)
So I was watching what we have in the mentioned lines for FATAL and CRITICAL type errors. This is what I found:
For admin/functions.inc.php
(I copy a few more lines, to get an idea from where comes that exit_val
).
360 $exit_val = null;
361
362 if ($setting_pre_reload) {
363 exec( $setting_pre_reload, $output, $exit_val );
364
365 if ($exit_val != 0) {
366 $desc = sprintf(_("Exit code was %s and output was: %s"), $exit_val, "\n\n".implode("\n",$output));
367 $notify->add_error('freepbx','reload_pre_script', sprintf(_('Could not run %s script.'), $setting_pre_reload), $desc);
368
369 $return['num_errors']++;
370 } else {
371 $notify->delete('freepbx', 'reload_pre_script');
372 }
373 }
374
375 $retrieve = $setting_ampbin . '/retrieve_conf 2>&1';
376 //exec($retrieve.'&>'.$asterisk_conf['astlogdir'].'/freepbx-retrieve.log', $output, $exit_val);
377 exec($retrieve, $output, $exit_val);
378
379 // retrieve_conf html output
380 $return['retrieve_conf'] = 'exit: '.$exit_val.'<br/>'.implode('<br/>',$output);
381
382 if ($exit_val != 0) {
383 $return['status'] = false;
384 $return['message'] = sprintf(_('Reload failed because retrieve_conf encountered an error: %s'),$exit_val);
385 $return['num_errors']++;
386 $notify->add_critical('freepbx','RCONFFAIL', _("retrieve_conf failed, config not applied"), $return['message']);
387 return $return;
388 }
The line 443 on the admin/libraries/utility.functions.php
file does not say much. It appears to be a function to record on a log:
440 function fatal($text,$log=true) {
441 echo "[FATAL] ".$text.EOL;
442 if ($log) {
443 freepbx_log(FPBX_LOG_FATAL,$text);
444 }
445 exit(1);
446 }
I appreciate if someone could help me with this.
Thanks in advance.
Kind regards,
Daniel