FreePBX says Asterisk is not running but it is

Hello all,

I am new to Asterisk and FreePBX. Just did a fresh install of both following the next tutorial:

Everything went well, but after everything was running I was trying to add extensions to FreePBX, but unfortunally it is greyed out. I noticed that the system status page is saying that Asterisk is not running.

But when I check the logfile /var/log/asterisk/full for any errors, I can’t find any. It even says:
[Jan 5 21:28:04] VERBOSE[4374] asterisk.c: Asterisk Ready.

Also when I check the running processes it looks like this (ps -ef | grep asterisk):
asterisk 4109 4107 0 21:09 ? 00:00:02 /usr/sbin/httpd
asterisk 4110 4107 0 21:09 ? 00:00:03 /usr/sbin/httpd
asterisk 4111 4107 0 21:09 ? 00:00:03 /usr/sbin/httpd
asterisk 4112 4107 0 21:09 ? 00:00:02 /usr/sbin/httpd
asterisk 4113 4107 0 21:09 ? 00:00:03 /usr/sbin/httpd
asterisk 4114 4107 0 21:09 ? 00:00:03 /usr/sbin/httpd
asterisk 4115 4107 0 21:09 ? 00:00:03 /usr/sbin/httpd
asterisk 4116 4107 0 21:09 ? 00:00:03 /usr/sbin/httpd
root 4369 1 0 21:28 pts/0 00:00:00 /bin/sh /usr/sbin/safe_asterisk -U asterisk -G asterisk
asterisk 4374 4369 0 21:28 pts/0 00:00:00 /usr/sbin/asterisk -f -U asterisk -G asterisk -vvvg -c
asterisk 4440 1 0 21:28 ? 00:00:00 -bash -c cd /var/www/html/panel && /var/www/html/panel/safe_opserver &
asterisk 4441 4440 0 21:28 ? 00:00:00 sh /var/www/html/panel/safe_opserver
asterisk 4443 4441 0 21:28 ? 00:00:00 /usr/bin/perl /var/www/html/panel/
asterisk 5770 4107 0 22:53 ? 00:00:01 /usr/sbin/httpd
root 6447 4026 0 23:50 pts/0 00:00:00 grep asterisk

I can also login into the CLI of Asterisk. I installed the following versions:

Maybe you need some extra information from me to help me solve the problem. If needed please tell.

Thanks in advance.


Critical Error retrieve_conf failed, config not applied
Critical Error Asterisk Manager Connection Failure

both error reflect on freepbx dashboard …never allow me to save any changes or updates in configuration …


[email protected]:/home/andreas# /var/lib/asterisk/bin/retrieve_conf

Checking for PEAR DB…OK
Checking for PEAR Console::Getopt…OK
Checking for /etc/amportal.conf …OK
Bootstrapping /etc/amportal.conf …OK
Parsing /etc/amportal.conf …OK
Parsing /etc/asterisk/asterisk.conf …OK
Connecting to database…OK
Connecting to Asterisk manager interface…Tue, 11 Jan 2011 15:20:49 +0700 - Unable to connect to manager (111): Connection refused
[FATAL] Asterisk Manager Connection Failure Failed to connect to the Asterisk manager through port: 5038

[email protected]:/home/andreas# pico /etc/amportal.conf

This file contains settings for components of the Asterisk Management Portal

Spaces are not allowed!

Run /usr/src/AMP/ after making changes to this file

AMPDBHOST: the host to connect to the database named ‘asterisk’


AMPDBUSER: the user to connect to the database named ‘asterisk’


AMPDBENGINE: the type of database to use


AMPDBPASS: the password for AMPDBUSER


AMPENGINE: the telephony backend engine to use





AMPBIN: where command line scripts live


#AMPSBIN: where (root) command line scripts live

AMPWEBROOT: the path to Apache’s webroot (leave off trailing slash)


AMPCGIBIN: the path to Apache’s cgi-bin dir (leave off trailing slash)


AMPWEBADDRESS: the IP address or host name used to access the AMP web admin


FOPWEBROOT:web root for the Flash Operator Panel


FOPPASSWORD: the secret code for performing transfers and hangups in the Fla$


FOPSORT: FOP should sort extensions by Last Name [lastname] or by Extension $


FOPRUN: set to true if you want FOP started by freepbx_engine (amportal_star$


AUTHTYPE: authentication type to use for web admin

If type set to ‘database’, the primary AMP admin credentials will be the AMP$

valid: none, database


AMPADMINLOGO: Defines the logo that is to be displayed at the TOP RIGHT of t$

This enables you to customize the look of the administration s$

NOTE: images need to be saved in the …/admin/images directory of your AMP$

This image should be 55px in height


USECATEGORIES: Controls if the menu items in the admin interface are sorted $

or sorted alphebetically with no categories shown (false). De$


AMPEXTENSIONS: the type of view for extensions admin

If set to ‘deviceanduser’ Devices and Users will be administered seperately, a$

If set to ‘extensions’ Devices and Users will me administered in a single scre$


ENABLECW: Enable call waiting by default when an extension is created (DEFAULT$

Set to ‘no’ to if you don’t want phones to be commissioned with call waiting a$

enabled. The user would then be required to dial the CW feature code (*70 defa$

enable their phone. Most installations should leave this alone. It allows mult$

phones to receive multiple calls on their line appearances.


#CWINUSEBUSY: Set to yes for extensions that have CW enabled to report as busy if

they don’t answer (resulting in busy voicemail greeting). Otherwise they simply

report as no-answer (e.g. busy greeting servers no purpose


AMPBADNUMBER: Set to false if you do not want the bad-number context generated which

traps any bogus number or freature code and plays a message to the effect. If you use

the Early Dial feature on some Grandstream phones, you will want to set this to false


The following are used to optionally have the freepbx backup program optionally

send the generated backup to an ftp server



FTPSUBDIR is an optional subdirectory at the ftp server, it will cause ftp to do a cd

There is no error checking so you should check to make sure these are set correctly. The

ftp is saved after the backup, so it will not cause the local backup file to be effected



SSH BACKUP INFO: must have a valid SSHRSAKEY file and server, only supported through

ssh. SUBDIR is optional and will be created if it does not exist.

If SSHUSER is not set, it will default to the current user which is asterisk in any

standard configuration.


AMPPROVROOT=/var/ftp /tftpboot


a list of files to exclude, to be used in tar’s --exclude-from argument


If CUSTOMASERROR is set to false, then the Destination Registry will not report unknow destinations as err$

this should be left to the default true and custom destinations should be moved into the new custom apps r$


if DYNAMICHINTS is set to true, Core will not statically generate hints. Instead it will make a call to the

AMPBIN php script, generate_hints.php, through an Asteirsk’s #exec call. This requires Asterisk.conf to be

configured with “execincludes=yes” set in the [options] section.



setting either of these to true will result in retrieve_conf aborting during a reload if an extension

conflict is detected or a destination is detected. It is usually better to allow the reload to go

through and then correct the problem but these can be set if a more strict behavior is desired

both default to false if not set


SERVERINTITLE if set to true, the browser title will be preceded with the server name. default false


USEDEVSTATE = true|false # DEFAULT VALUE false



Module Admin normally tries to get its online information through direct file open type calls to URLs that

go back to the server. If it fails, typically because of content filters in firewalls that don$

like the way PHP formats the requests, the code will fall back and try a wget to pull the information.

This will often solve the problem. However, in such environemnts there can be a significant timeout before

the failed file open calls to the URLs return and there are often 2-3 of these that occur. Setting this va$

will force FreePBX to avoid the attempt to open the URL and go straight to the wget calls.



Whether or not to invoke the freepbx log facility


Where to log if enabled, SQL, LOG_SQL logs to old MySQL table, others are passed to syslog system to deter$


Whether or not to include log messages marked as ‘devel-debug’ in the log system

AMPMPG123=true|false # DEFAULT VALUE true

When set to false, the old MoH behavior is adopted where MP3 files can be loaded and WAV files converted t$

The new default behavior assumes you have mpg123 loaded as well as sox and will convert MP3 files to WAV. $

highly recommended as MP3 files heavily tax the system and can cause instability on a busy phone system.

CDR DB Settings: Only used if you dont use the default values provided by freepbx.

CDRDBHOST: hostname of db server if not the same as AMPDBHOST

CDRDBPORT: Port number for db host

CDRDBUSER: username to connect to db with if its not the same as AMPDBUSER

CDRDBPASS: password for connecting to db if its not the same as AMPDBPASS

CDRDBNAME: name of database used for cdr records

CDRDBTYPE: mysql or postgres mysql is default

CDRDBTABLENAME: Name of the table in the db where the cdr is stored cdr is default

AMPVMUMASK: defaults to 077 allowing only the asterisk user to have any permissions on VM files. If set to$

like 007, it would allow the group to have permissions. This can be used if setting apache to $

user then asterisk, so that the apache user (and thus ARI) can have access to read/write/delet$

voicemail files. If changed, some of the voicemail directory strucuters may have to be manuall$





These can be used to change the refresh rate of the System Status Panel. Most of

the stats are updated based on the STATS interval but a few items are checked

less frequently (such as Astersisk Uptime) based on the INFO value


Disables FOP in interface and retrieve_conf. Usefull for sqlite3 or if you don’t want FOP.



If set to true, FreePBX will check if you have chan_dadhi installed. If so, it will

automatically use all your ZAP configuration settings (devices and trunks) and

silently convert them, under the covers, to DAHDI so no changes are needed. The

GUI will continue to refer to these as ZAP but it will use the proper DAHDI channels.

This will also keep Zap Channel DIDs working.


silently convert them, under the covers, to DAHDI so no changes are needed. The

GUI will continue to refer to these as ZAP but it will use the proper DAHDI channels.

This will also keep Zap Channel DIDs working.


did i missed something or incorrect setting??

Thank you, then I won’t give it a try :slight_smile:

Unfortunally the install didn’t give me this error. Maybe because of the installation guide I used? I used the guide as mentioned in my first post.


That should have been caught when you installed FreePBX:

The following is part of the install script:


<?php // **** Make sure selinux isn't enabled outn("Checking for selinux.."); $tmpoutput; $tmpout = exec("getenforce", $tmpoutput, $sereturn); if (strtolower($tmpoutput[0]) === "enabled") { // this method seems better because disabled and permissive are the same // if a user installs and realizes selinux is running the other method // requires a reboot to get selinuxenabled to work after editing the selinux config // this will allow you to use setenforce 0 which turns selinux into permissive mode which // doesnt enforce, it just warns. fatal("selinux is ENABLED. This is not supported. Please disable selinux before using FreePBX"); } out("OK"); [/php] I would recommend not burning too many cycles to try to get it to work under SELinux, you will likely end up getting a lot of grief running into issues.

Hi all,

I solved the problem by simply disabling SELinux. So I disabled it for now, but I am going to search how asterisk and freepbx can work with SELinux.


Maybe this info would help also:

[[email protected] ~]# /var/lib/asterisk/bin/retrieve_conf
Checking for PEAR DB…OK
Checking for PEAR Console::Getopt…OK
Checking for /etc/amportal.conf …OK
Bootstrapping /etc/amportal.conf …OK
Parsing /etc/amportal.conf …OK
Parsing /etc/asterisk/asterisk.conf …OK
Connecting to database…OK
Connecting to Asterisk manager interface…OK
Thu, 06 Jan 2011 17:53:29 +0100 - Got event… fullybooted
Thu, 06 Jan 2011 17:53:29 +0100 - No event handler for event 'fullybooted’
Added to globals: ASTETCDIR = /etc/asterisk
Added to globals: ASTMODDIR = /usr/lib/asterisk/modules
Added to globals: ASTVARLIBDIR = /var/lib/asterisk
Added to globals: ASTAGIDIR = /var/lib/asterisk/agi-bin
Added to globals: ASTSPOOLDIR = /var/spool/asterisk
Added to globals: ASTRUNDIR = /var/run/asterisk
Added to globals: ASTLOGDIR = /var/log/asterisk
Added to globals: CWINUSEBUSY = true
Added to globals: AMPMGRUSER = admin
Added to globals: AMPMGRPASS = pass
Added to globals: AMPDBENGINE = mysql
Added to globals: AMPDBHOST = localhost
Added to globals: AMPDBNAME = asterisk
Added to globals: AMPDBUSER = asteriskuser
Added to globals: AMPDBPASS = pass*
Notice: no Devices defined
Notice: no Queues defined
Notice: no Conferences defined
Notice: no Parking Lots defined
Notice: no sip trunks defined
Notice: no iax trunks defined
Notice: no AMP Users defined
Please update your modules and reload Asterisk by browsing to your server.

if it can’t get to Asterisk through the manager then it is going to think Asterisk is not running.

Check your manager.conf settings and make sure that they work and that the amportal.conf settings for the manager connection are consistent.


I looked into both config files and to me it looks like no problem. I also checked the asterisks admin password in both files and they are the same. I can also telnet to localhost at port 5038.

I posted my configuration files on pastebin:
/etc/asterisk/manager.conf (
/etc/amportal.conf (

When I restart amportal I see the following message appears:
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)

But when the restart is finished I check the file and it exists and is also of the user and group asterisk

I check all ERROR messages in /var/log/asterisks/full and found that some config files are missing. Find it a bit strange because I installed Asterisk & FreePBX frsh yesterday. Here an output:

Am I missing something then?

Thanks for the help.