com.orderlysoftware.orderlycalls.examples
Class ExampleProcessor

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

public class ExampleProcessor
extends java.lang.Object
implements AGIReusableProcessor

Gives best-practice guidelines.

You must have configured a ManagerClient, and an AGIServer to use this example.

The example interacts with the caller, and calls them back after 10 seconds and plays a message.

This example assumes you have entries in your extensions.conf as follows:

 
        exten => orderlycalls,1,agi(agi://192.168.0.1)
        exten => orderlycalls,2,Hangup
        exten => orderlycalls,3,Playback(OrderlyCalls/pitch)
        exten => orderlycalls,4,Hangup
 
 

Author:
Matt King, M.A. Oxon.

Constructor Summary
ExampleProcessor()
           
 
Method Summary
static int getCallerCount()
          This method gets the number of callers received.
static void nextCaller()
          This method increases the number of callers received.
 void processCall(AGIConnection newCall)
          Interacts with the caller, and calls them back after 10 seconds with a message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExampleProcessor

public ExampleProcessor()
Method Detail

nextCaller

public static void nextCaller()
This method increases the number of callers received.
It's synchronized in case other calls are happening at the same time.


getCallerCount

public static int getCallerCount()
This method gets the number of callers received.
It's synchronized in case other calls are happening at the same time.


processCall

public void processCall(AGIConnection newCall)
                 throws java.io.IOException
Interacts with the caller, and calls them back after 10 seconds with a message.

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