Prophecy 9.0 Development Guide Home  |  Frameset Home

  Process Management  |  TOC  |  Prophecy Designer  

Monitoring API's


People are often looking for ways to integrate monitoring Prophecy in a Production deployment with their own tools. Currently there are a few ways to do this.


The Stats_10 interface

The Stats_10 interface provides the following information:

You can add the following tags to the stats_10 URL:

When type is counters or cooked then the following parameters also apply:

Some examples:

http://127.0.0.1:9999/stats_10?format=value&type=counters&value=ccxml/10/sessions

This URL will return a blank page with a single value listing the number of CCXML 1.0 sessions in use. In this example the page would only display a "9."

http://127.0.0.1:9999/stats_10?format=xml&type=counters

This URL will return information about all session/ports in use.

It is important to note that if you are trying to determine how many active ports you are using you will want to check against CT/Licensed/Ports.

You will want to avoid hitting the normal stats_10 in any sort of Production environment as it can bog down your system if you are under even a moderate load.


The Sessions_10 interface

There are currently two ways to use the Sessions_10 interface. You can hit the simple or full version. The simple URL is http://127.0.0.1:9999/sessions_10 while the full URL is http://127.0.0.1:9999/sessions_10?full=true

Please keep in mind that you do not want to hit the full URL in a production environment as it can tax your system if you are under heavy load.  This URL is used to find hanging sessions if you are unable to restart the Prophecy services and they are not clearing after the preset max in your code.

Below is a clip from sessions_10 and session_10?full=true to compare what each URL will offer.



Here you can see how many active CallXML, CCXML and CCXML1.0 session you are currently in use. Compare this with the following full URL.



As you can see this URL includes a considerably larger amount of information, specifically giving you session IDs, uptime for each call, CalledID and much more. As mentioned above this will allow you to see if you have any hanging sessions, or as we love to call them here, "Zombies."  We currently have a way to kill individual sessions, if you are unable to resolve the hung sessions at the code level.

http://<server IP>:9999/ctrl1_0?cmd=stop&sessionid=<sessionID you wish to kill>
This should only be used in extreme cases and needs to be used with caution as it will abruptly end the call which can negatively impact the customer if they happen to be on the line at that time.


Sample Port Checking Script

The script below is a simple CCXML 1.0 script that will check Prophecy's stats_10 page for the currently used telephony ports and compare that against a hard-coded port count - <var name="licensedPorts" expr="2"/>. If the port count is equal to or less than the desired available minimum ports, we will inform our caller that all lines are busy or this can be modified to record a message to call the customer back. If we have enough available ports, we start the standard VoiceXML dialog.

<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0" xmlns:voxeo="http://community.voxeo.com/xmlns/ccxml">

<var name="portCheck"/>
<var name="portsInUse"/>
<var name="licensedPorts" expr="2"/>
<var name="minFreePorts" expr="1"/>
<var name="availPorts"/>
<var name="connID"/>

  <eventprocessor>
      <transition event="connection.alerting">
          <accept/>
      </transition>

      <transition event="connection.connected">
          <log expr="'**** Call Accepted - checking ports'"/>
          <fetch type="'text/xml+e4x'" next="'http://127.0.0.1:9999/stats_10?format=xml&amp;type=counters'"/>
            <assign name="connID" expr="event$.connectionid"/>
      </transition>

      <transition event="fetch.done">
          <log expr="'Port Report : ' + event$.data.toString()"/>
          <assign name="portsInUse" expr="event$.data.item.(@name == 'CT/Licensed/Ports')"/>
          <assign name="availPorts" expr="licensedPorts - portsInUse"/>
          <log expr="'**** Ports In Use: ' + portsInUse"/>
          <log expr="'**** Available Ports: ' + availPorts"/>
            <if cond="availPorts <= minFreePorts">
              <log expr="'**** ONLY ' + availPorts + ' AVAILABLE TELEPHONY PORT(S). PLAYING BUSY MESSAGE'"/>
            <dialogstart src="'null://?text=Sorry. All lines are currently busy. Please try again later.&amp;termdigits=*'" type="'application/x-texttospeech'"/>
            <else/>
                <log expr="'**** STARTING VOICEXML DIALOG '"/>
              <dialogstart src="'vxml-home.xml'" type="'application/xml+vxml'" connectionid="connID"/>
            </if>
      </transition>

      <transition event="error.fetch">
        <log expr="Error during fetch. Reason: ' + event$.reason"/>
          <exit/>
      </transition>

      <transition event="connection.disconnected">
          <exit/>
      </transition>

      <transition event="error.*">
          <log expr="Unspecified Error. Reason: ' + event$.reason"/>
          <exit/>
      </transition>
  </eventprocessor>

</ccxml>




  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login
  Process Management  |  TOC  |  Prophecy Designer  

© 2011 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site