Purpose of push2web Package
Push2web lets a server "push" information to a browser in real time. That is, when an event occurs on the server, the server can send an update to the web page in the browser, and the display of the web page changes. In addition, the browser can use push2web to send events, e.g., a button push, back to the server.
Push2web was developed as part of Voice Conference Manager and works out of the box to provide the ability to monitor phone calls as well as to mute or drop particular callers. The software itself is modularized and can easily adapted for other uses.
push2web includes two separate but related packages. The first package is a Java servlet, packaged as a WAR file, that runs on a web page server. This servlet serves two main functions. First, it opens a port for communications (one that's different than the main web port). Secondly, it provides an interface that can be used to send data over that socket to a web browser.
As with the Python-based server described in the main documentation page, push2web allows a CCXML server to send data to the Java servlet, which then updates the clerk's web page. The clerk has a real-time view of the state of the conference call.
You can download the package from Sourceforge, and the package includes installation instructions.
The classes in push2web are related as shown in the following figure, which by the way is not in UML or any other known system of graphical notation:
The main applet module is PushServer. This class opens up sockets for browsers to connect to, and uses ListenToConnections to listen for incoming connections. When an incoming connection is made, ListenToConnections calls HandleSocket to handle I/O.
HandleSocket creates an instance of SendToBrowser, used to send information to browsers, e.g., status updates on the state of the call. The SendToBrowser instance is visible to the Internet, including especially the CCXML interpreter, as "send.do." To send information to the browser, the CCXML interpreter uses the "send" element pointed at "send.do" and HTTP GET. SendToBrowser uses SendToBrowserFormat to interpret the output of the CCXML interpreter and reformat it into the our applet-to-browser transmission format.
HandleSocket also creates an instance of ReadFromWeb tied to the socket. ReadFromWeb monitors the socket for incoming data from the browser (e.g., a command to mute a particular leg of the conference call). ReadFromWeb uses ReadFromWebFormat to interpret the incoming data and transform it into an HTTP GET URL. The data is sent to the correct CCXML instance by using CCXML.send on port 9999.
At present, there's no security at all, not so much as a secret token to prevent anyone who can access the servlet's URI from sending data to browsers. After all, it's a demo behind a firewall.