How can we help you?

Cannot connect to FOP2 from browser
Posted by: Nicolás Gudiño Posted on: Aug-2nd, 2016 17:18

When opening up your browser and going to http://your.server/fop2 you see this with the counter counting:

After a long while it finally display a message "Service Unavailable".

What you have seen is the browser attempting a websocket/xmlsocket connection to the FOP2 server and failing. That connection is needed so the FOP2 page can retrieve and show status in real time. It is a connection between your browser and the FOP2 server, using a different connection route than the browser has with your web server, and totally unrelated to Asterisk or the Asterisk Manager connection.

That connection is done by default using TCP port number 4445. So, in order for a successful connection between your browser and your FOP2 server, that port must be open/redirected at any router or firewall that might lie between your desktop computer and the FOP2 server itself.

Besides that, in the server the port is opened by the FOP2 daemon process. It is also used by the old FOP1 daemon. So, you also need to check that the FOP2 service is running and binding to that port (and that you do not have the old FOP1 running instead).

So for the first check, log into your server via ssh or similar, and ask yourself the question:

Is FOP2 running?

To find that out, you must run the following command:

pgrep fop2

That command should print out a number on screen (the process id number). If there is no output, it means FOP2 service is not running. And if the service is not running, then it is obvious that the browser won't be able to connect to it.

One possible reason FOP2 is not running is because it started but soon stopped because the old FOP1 is binding to the TCP/4445 port, you can quickly check with this command:

netstat -lnp | grep 444

If the output from this command returns a line that ends up with the string "perl", then that is a 100% indication that FOP1 is running and must be stopped/disabled. Here is an article describing how to do that.

If the output from the netstat command returns empty, it means FOP2 is not running, try starting it:

service fop2 start

If the output from netstats returns a line ending with "fop2_server", then it means the FOP2 daemon is running and binding to the port. If your browser is not connecting, it most probably means there is a firewall somewhere in the network path restricting that connection.

You should check firewall rules on your server. You can do so with this command:

iptables -vnL

If you see a lot of output, it means you do have firewall rules, and you will have to modify and be sure you allow INPUT connections to port TCP/4445.

How to do that is beyond this article, you will have to refer to your distribution manual in or firewall script/software to see how to add that rule.

Alternatively, you might have firewall in the network, or in the desktop computer itself, you should review all of them and asure you have a clear patch between your desktop computer and port TCP/4445 on the FOP2 server.

Leave a comment