How to configure FOP2 to work with FreeSWITCH
Since FOP2 version 2.3 there is alpha support for freeswitch using ESL. Installation process is similar to an Asterisk install, but it will require some manual work for adding your extensions/conference and queues buttons.
Prerequisites
You must have all the LAMP components on the server, that is you must install MySQL, PHP and Apache or a compatible web server.
Installation
FOP2 must be installed on the same server as FreeSWITCH. Download the corresponding tarball for your distro, extract it and run "make", as any regular installation.
Server configuration
Once the software is installed, you will have to configure it. In /usr/local/fop2/fop2.cfg you will have to comment the following lines by prefixing them with a semicolon:
;manager_user=localhost
;manager_secret=amp111
;manager_port=5038
;manager_host=localhost
You will have to add the FreeSWITCH connetion counterparts:
freeswitch_secret=ClueCon
freeswitch_host=localhost
freeswitch_port=8021
You can test the configuration and ESL connection with the command:
/usr/local/fop2/fop2_server --test
You will also need to create a MySQL database:
mysqladmin -u root -p create fop2
And be sure to create a MySQL user that has all privileges over that database:
mysql -u root -p -e "GRANT all ON fop2.* TO fop2@localhost identified by 'fop2pw'"
Once you have that created, be sure the MySQL credentials in configuration files match the user and password you selected on the GRANT line above, look for the files /var/www/html/fop2/config.php and /var/www/html/fop2/admin/config.php and set the credentials in both of them:
$DBHOST = 'localhost';
$DBNAME = 'fop2';
$DBUSER = 'fop2';
$DBPASS = 'fop2pw';
Finally run this script to create all required tables:
php /var/www/html/fop2/admin/update_conf.php 1 1
The server configuration part is done, now you will need to configure your buttons.
Button configuration
As FreeSWITCH is so vast and open, there is no way to 'detect' your button configuration automatically in a universal way.
The FOP2 Manager can be modified to read your button configuration from whatever store you might use, by changing the functions-custom.php file. You will have to read it to have a basic understanding on the modifications you might need to perform.
A simpler way, without programming involved, is to configure your buttons manually. You can do so by editing the file /usr/local/fop2/buttons_custom.cfg. Here is an example of some button definitions that will work with FreeSWITCH:
[SOFIA/INTERNAL/1000]
type=extension
label=Maria
extension=1000
context=192.168.1.1
originatechannel=sofia/internal/1000%192.168.1.1
queuechannel=Maria@192.168.1.1
[CONFERENCE/6000]
type=conference
label=Conference
extension=6000
context=internal
[QUEUE/Support@192.168.1.1]
type=queue
label=Support
extension=5000
context=internal
Supported queue buttons are for the use by mod_callcenter only.
User and preferences configuration
For doing that you will have to log into the FOP2 Manager. Point your browser to http://your.server/fop2/admin to bring the manager login page. The default user and password is 'fop2admin/fop2admin' (that can be changed in fop2/admin/config.php file to whatever you like, go ahead and change it as you do not want to leave the defaults.
Once there you will be able to check the Buttons tab and see the buttons you configured in the buttons_custom.cfg file, and no users. So go to the Users tab and create some. Try to match the user extension with the one you have for FreeSWITCH, if you follow this same button example, the user to create would be 1000 (for device SOFIA/INTERNAL/1000). Set a password, give "all" permissions, and be sure to leave no groups checked (so it does not have any kind of group filtering).
After that, save the user and reload FOP2. For now the only way to reload FOP2 is via the command line with the command:
service fop2 reload
Then go to http://your.server/fop2 and login with the newly created user.
Enjoy!