How can we help you?

Installing FOP2 in ELASTIX 4
Posted by: Agustín Gudiño Posted on: Dec-6th, 2016 15:41

Installing FOP2 in Elastix 4

Login to the system as root, from command line please type the following commands:

cd /usr/src
wget -O fop2.tgz
tar zxvf fop2.tgz
cd fop2
make install
/usr/local/fop2/ -w

That will get FOP2 installed in the system. But now you should disable FOP1 that comes into Elastix 4 by default, as they cannot run at the same time. To do that, edit the file /etc/rc.d/rc.local and comment the line that starts the old FOP1 by prepending the # sign at the line /usr/sbin/amportal start_fop. It will show as this:

# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/usr/local/sbin/ > /etc/motd
/usr/sbin/fxotune -s
#/usr/sbin/amportal start_fop

After that, edit the file safe_opserver that use to reside at /var/www/html/admin/modules/fw_fop/safe_opserver

In that file you must insert a new line that says "exit" just at the beggining of the second line, like the following:

#!/usr/bin/env sh
. /etc/amportal.conf

while true; do
sleep 4

Finally you should stop FOP1 that it is running with the command:

/usr/sbin/amportal stop_fop

Now you must configure the manager user at Asterisk in order to get FOP2 working. At /etc/asterisk/manager_custom.conf add the fop2 user as this:

secret = fop222
deny =
permit =
read = all
write = all
writetimeout = 1000
eventfilter=!Event: RTCP*
eventfilter=!Event: VarSet
eventfilter=!Event: Cdr
eventfilter=!Event: DTMF
eventfilter=!Event: AGIExec
eventfilter=!Event: ExtensionStatus
eventfilter=!Event: ChannelUpdate
eventfilter=!Event: ChallengeSent
eventfilter=!Event: SuccessfulAuth

Once you added the user, you must reload the manager configuration:

asterisk -rx "manager reload"

And then edit the file /usr/local/fop2/fop2.cfg y use the same user and pass you added in the manager.conf file


Once you saved the changes, you can test the connection between FOP2 and the Asterisk manager by executing:

/usr/local/fop2/fop2_server --test

The answer should be : Manager connection OK

Finally you can login to the FOP2 Manager (the FOP2 admin section) with your browser:


By default you can login to FOP2 Manager with the same Elastix/FreePBX credentials. At first visit, configuration tables will be created and populated. By now you can select the Users tab and configure a user or a password for a already created user. After that you can restart the service:

service fop2 restart

Finally you can login to the panel with your browser.