com.orderlysoftware.orderlycalls.examples
Class OrderlyQExample

java.lang.Object
  extended by com.orderlysoftware.orderlycalls.examples.OrderlyQExample
All Implemented Interfaces:
AGIProcessor, AGIReusableProcessor

public class OrderlyQExample
extends java.lang.Object
implements AGIReusableProcessor

OrderlyQ - Advanced, Caller Friendly Queue Control

50% of all callers hang up after just 45 seconds of waiting on hold. (Source: Avaya)

OrderlyQ is a revolutionary call queuing system that lets your callers hang up and call back without losing their place in the queue.

This example application of OrderlyQ makes all callers wait for five mintues. The full version is available from Orderly Software (http://www.orderlyq.com), and does not have this limitation.

This class is an Example, for Demonstration purposes ONLY.

You MAY NOT use this file or compiled classes derived from this file for anything other than your own personal demonstration purposes.

This file IS NOT distributed under the terms of the GNU Lesser General Public License.

Please see the accompanying documentation for usage restrictions with OrderlyCalls and queuing.


Constructor Summary
OrderlyQExample()
           
 
Method Summary
 java.lang.String enterNumber(java.lang.String message)
          Ask caller to enter a number.
static OrderlyQExampleSettings getSettings(AGIServer server)
          Gets settings associated with a particular AGIServer.
 int peopleAheadOf(com.orderlysoftware.orderlycalls.examples.OrderlyQExample.Caller caller)
           
 void processCall(AGIConnection agi)
          Implement this method to handle incoming calls.
 boolean processPress(int result)
          Handles interrupt from caller to enter data.
 void setSecondsLeft(com.orderlysoftware.orderlycalls.examples.OrderlyQExample.Caller caller)
           
static void setSettings(AGIServer server, OrderlyQExampleSettings settings)
          Store a settings object for a particular AGIServer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderlyQExample

public OrderlyQExample()
Method Detail

getSettings

public static OrderlyQExampleSettings getSettings(AGIServer server)
Gets settings associated with a particular AGIServer. Settings are extracted from XML if none can be found.

Parameters:
server - The server in which to look for the settings.
Returns:
The settings. Default values are used if none can be found.

setSettings

public static void setSettings(AGIServer server,
                               OrderlyQExampleSettings settings)
Store a settings object for a particular AGIServer.

Parameters:
server - The server corresponding to the settings
settings - the settings to store.

enterNumber

public java.lang.String enterNumber(java.lang.String message)
                             throws java.io.IOException
Ask caller to enter a number.

Parameters:
message - The request message to play
Returns:
the number entered.
Throws:
java.io.IOException

processPress

public boolean processPress(int result)
                     throws java.io.IOException
Handles interrupt from caller to enter data.

Parameters:
result - the number pressed (ASCII).
Returns:
true if anything was played, false otherwise.
Throws:
java.io.IOException

peopleAheadOf

public int peopleAheadOf(com.orderlysoftware.orderlycalls.examples.OrderlyQExample.Caller caller)

setSecondsLeft

public void setSecondsLeft(com.orderlysoftware.orderlycalls.examples.OrderlyQExample.Caller caller)

processCall

public void processCall(AGIConnection agi)
                 throws java.io.IOException
Description copied from interface: AGIProcessor
Implement this method to handle incoming calls.

If you find you need a variety of processors, for instance to handle calls differently depending on contexts, create one 'master' processor, which delegates to more specific instance implementations depending on call context information.

If the caller hangs up during the processing, an IOException is thrown. You can catch this yourself if you need to do any other cleanup, otherwise the AGIServer will close the connection for you.

Specified by:
processCall in interface AGIProcessor
Parameters:
agi - An object representing the data and methods available for processing this call.
Throws:
java.io.IOException - if the caller hangs up.