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 http://www.fop2.com/download/centos64 -O fop2.tgz
tar zxvf fop2.tgz
cd fop2
make install
/usr/local/fop2/generate_override_contexts.pl -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:


#!/bin/sh
#
# 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/motd.sh > /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
exit
. /etc/amportal.conf

while true; do
$FOPWEBROOT/op_server.pl
sleep 4
done

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:


[fop2]
secret = fop222
deny = 0.0.0.0/0.0.0.0
permit = 127.0.0.1/255.255.255.0
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


manager_user=fop2
manager_secret=fop222

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:


http://your.server/fop2/admin

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.


http://su.servidor/fop2