I do a lot of work on the Voxeo Prophecy platform. Pretty regularly, I have a need to check and see how many ports are in use, or how many active sessions are currently running on a Prophecy machine.
Prophecy has some nice features that make checking these stats pretty easy. You can get a view of currently running sessions by pointing your browser at sessions_10 on either the CCXML or VoiceXML control port — for example, if you want to check CCXML sessions you would point to http://prophecy_ip:9999/sessions_10. There is also another utility that provides a wealth of information on what is happening on your Prophecy server — stats_10.
This utility is particularly useful because you can pass in query string parameters and customize the information that is returned, as well as the format that it is rendered in. Pointing your browser to http://prophecy_ip:9999/stats_10?type=counters&format=xml gets you a list of currently utilized ports and running CCXML sessions in a compact XML document. As handy as this is, because its browser-based, you have to keep hitting refresh to get updated stats from your server. Since this can be inconvenient, I decided to whip up a small AJAX-powered stats monitor for Voxeo Prophecy.
Requirements / Considerations:
You’ll need to download the xajax PHP class library to use this utility. I downloaded 0.5 RC 2 Full — you can do this by entering the following at the Linux command line: wget http://xajaxproject.org/download/0.5_rc2/xajax_0.5_rc2_full.zip. Extract these files to a folder where PHP scripts can be executed.
Before running this monitor, you’ll want to make sure that you can run xajax applications — do this by testing out the helloworld.php sample in the xajax/examples directory. I developed this app on Ubuntu 8.10. It should run just fine on Windows — if you want to run this on the same machine as Prophecy you should use a separate PHP installation, not the one that comes bundled with Prophecy.
Get the Source Code:
When downloaded, extract the files to the same directory where you placed your xajax files. Open up the file called voxeo.php in an editor and modify the configuration options as needed. The value of $interval determines how frequently an AJAX callback will be made to your Prophecy server to check stats. You will want to change the value of $prophecyHost to the IP address of your Prophecy server. You can add stats items to the $counterNames array if you want to check more than the basic level of stats. Save and close this file when finished.
Open up the voxeo.php file in your web browser. When the page loads, the stats monitor is not yet started — click “Start Monitor” to engage. When you make a test phone call to your Prophecy server, you will see the numbers change for ports and sessions.
Prophecy 9 is on the horizon, and the good folks at Voxeo will likely be adding all sorts of eye candy that will make monitoring your Prophecy server a snap. Still, it is nice to know that the Prophecy platform is open enough to support custom utilities that can help manage your server.