Java Telephony API
Call Center Extension Package


------------------陈开源

Introduction


This document is an overview of the Call Center Extension Package to the Java Telephony API. The Call Center Package extends the Core API by supporting the following key Call Center features: Routing , Automatic Call Distribution (ACD) , Predictive Calling , Application Data .More detailed information on the Call Center Extension Package can be found in The Java Telephony Call Center Package Specification.

Routing


Routing is a call center feature that gives applications the ability to route calls to their final destinations. It gives applications the power to apply routing heuristics unique to their domains.

Before performing any routing functions, an application must first register with the switching domain to route calls for a specific Address. The switching domain may perform security checks to verify that the application has permission to route calls for that Address. An application can indicate that it wants to route calls for all Addresses within the Provider's domain by invoking registration methods on a RouteAddress created with a special valid Address "AllRouteAddress". The RouteAddress call center interface extends the core Address interface with methods for routing registration.

When a call is made to an Address, the switching domain sends an event (or request) to the application, which then should respond with a destination Address or with a "no destination". Application can choose among alternate destinations based on, for example, origin of the call (calling number), number dialed to place the call (called number), hour of day or availability of agents to handle the call. This is the basic request/response scenario for routing.

If the switch gets a response from the application, tries the Address returned and fails, it could ask the application for another destination. The application must know that this is not a new route request, but a request for a new destination from a previous request. Multiple calls may be placed to the same Address at the same time. Thus, applications must track each request/response session. This tracking is facilitated by a route session. The first route request for a new call to the Address starts a new route session. All further communication between the application and the switch for this call (re-routes, route ended, etc) is done within this session. A new RouteSession object represents an outstanding route request.

The RouteCallback interface provides an interface to handle routing events. An application implements the RouteCallback interface in order to get called back when its provider wants the application to route a call. The getRouteableAddresss method on CallCenterProvider returns the list of Addresss that an application on this provider can register to route calls for.

The RouteSession object is at the heart of all routing. Below is a state diagram that illustrates the transitions possible on RouteSession.


RouteSession Object States

ROUTE: The RouteSession object enters the ROUTE state when the provider requests the application to route a call

ROUTE_USED: The RouteSession object enters the ROUTE_USED state when the provider gives the application the destination for a successfully completed route request.

ROUTE_END: The RouteSession object enters the ROUTE_END state when the provider informs the application that a route session has ended.

RE_ROUTE: The RouteSession object enters the REROUTE state when the provider requests the application to choose another call route. 
ROUTE_CALLBACK_ENDED: The RouteSession object enters the ROUTE_CALLBACK_ENDED state when the provider informs the application of the termination of a previously registered route callback.


Routing Code Examples

RouteTest Java Source

import java.applet.*;
import java.lang.*;
import java.util.*;
import java.telephony.*;
import java.telephony.callcenter.*;
import java.telephony.callcenter.events.*;
public class RouteTest extends Applet {
Provider myProvider;
Address myAddress;
RouteAddress myRouteAddress;
MyRouteCallback myRouteCallback;
public void init() {
/*
* Create a provider by first obtaining the default implementation of
* JTAPI and then the default provider of that implementation.
*/
Provider myprovider = null;
try {
JtapiPeer peer = JtapiPeerFactory.getJtapiPeer(null);
myprovider = peer.getProvider(null);
} catch (Exception excp) {
System.out.println("Can't get Provider: " + excp.toString());
System.exit(0);
}
}
public void start() {
// if Device returned does not implement RouteDN return
if (!(myAddress instanceof RouteAddress))
return;
myRouteAddress = (RouteAddress)myAddress;
try {
// register callback to route calls for myRouteAddress
myRouteAddress.registerRouteCallback(myRouteCallback);
}
catch (Exception e) {
System.out.println("exception occured");
return;
}
}
public void stop() {
if (myRouteAddress != null)
{
// cancel previous registration to route calls for
try {
// myRouteAddress
myRouteAddress.cancelRouteCallback(myRouteCallback);
}
catch (Exception e) {
System.out.println("exception occured");
return;
}
}
}
}
class MyRouteCallback implements RouteCallback
{
// for simplification this code is in the callback thread
// probably we should spawn off one thread per session
public void routeEvent(RouteEvent event)
{
// call function todetermine a destination
String[] routeSelected = new String[1];
routeSelected[0] = new String(getRoute((Terminal)event.getCallingTerminal(),
(Address)event.getCurrentRouteAddress()));
try {
event.getRouteSession().selectRoute(routeSelected);
}
catch (Exception e) {
System.out.println("exception occured");
return;
}
return;
}
public void reRouteEvent(RouteSessionEvent event)
{
// previous routeSelected did not work, ok
// just pick some default route, audix "77777"
String[] routeSelected = new String[1];
routeSelected[0] = new String("77777");
try {
event.getRouteSession().selectRoute(routeSelected);
}
catch (Exception e) {
System.out.println("exception occured");
return;
}
}
public void routeUsedEvent(RouteUsedEvent event)
{
// do something
}
public void routeEndEvent(RouteEndEvent event)
{
// session is over, clear up any objects, data, threads
// associated with this session
}
public void routeCallbackEndedEvent(RouteCallbackEndedEvent event)
{
// callback has been terminated, clear up any objects, data,
// threads associated with this callback
}
public String getRoute(Terminal callingTerminal, Address currentRouteAddress)
{
// look up some database to determine a destination
// based on callingTerminal and currentRouteAddress
// for now return a default "12345"
return ("12345");
}
}

RouteTest Application Objects


ACD


ACD Address

Automatic Call Distribution (ACD) is a Call Center feature that defines an ACD Group as zero or more Agent extensions that service calls coming to the Group. An incoming call can, for example, either sent to an available Agent or queued when no Agents are available.

The primary interface for the ACD feature is the ACD Address which is an extension of the CallCenterAddress. This is a specialization of Address that distributes calls to a dynamic set of Terminals. In addition, ACD Address is not directly associated with a Terminal because it is a logical entity within the Provider and as such does not have any physical attributes.


ACD Address Model


Calls that are presented to an ACD Address may be processed in several different ways. For example, the call may be queued at the ACD Address before being distributed, the call may be delivered to one of the available Agent Terminals, or the call may be redirected to another ACD Address. The Connection interface which represents the relationship between the ACD Address and the Call is known as ACD Connection.

The dynamic association between the ACD Address and a given Terminal is represent by the Agent class. The Agent object represents an AgentTerminal's relationship to an ACDAddress. You can think of the Agent object as representing a person acting as an agent in the simplest case where the person is logged into only one ACD Address. If the person were logged into several ACD Addresses these scenarios would be represented as several Agent objects. This Agent has a set of state transitions to represent its association. For example, when a Terminal creates an association with a given ACD Address (i.e.Agent Logged In), or when the Terminal is associated with a given ACD Address and is ready to process a call from the ACD Address (i.e. Agent Ready). For more details, on the states, see the Agent State Diagram below. A Terminal that can be associated with ACD Addresses is represented by the AgentTerminal which is an extension of the Terminal interface.


Agent Terminal States

UNKNOWN: The AgentTerminal object enters the UNKNOWN state when the provider is unable to determine the state of the AgentTerminal.

LOG_IN: The AgentTerminal object enters the LOG_IN state when the AgentTerminal is logged into an ACDAddress.

LOG_OUT: The AgentTerminal object enters the LOG_OUT state when the AgentTerminal has logged out of an ACDAddress.

NOT_READY: The AgentTerminal object enters the NOT_READY state when it is busy with tasks other than servicing calls.

READY: The AgentTerminal object enters the READY state when it is ready to service calls.

WORK_NOT_READY: The AgentTerminal object enters the WORK_NOT_READY state when it is disconnected from a call and is busy with tasks associated with a call.

WORK_READY: The AgentTerminal object enters the WORK_READY state when it is ready to resume the tasks associated with a call.

BUSY: The AgentTerminal object enters the BUSY state when is is engaged in a call and cannot handle other ACD calls.


ACD Sample Code

AgentTest Java Source

import java.applet.*;
import java.lang.*;
import java.util.*;
import java.telephony.*;
import java.telephony.callcenter.*;
public class AgentTest extends Applet {
Provider myProvider;
Terminal myTerminal;
Address myAddress;
AgentTerminal myAgentTerminal;
ACDAddress myACDAddress;
String agentID="";
String agent_passwd = "";
Agent[] myAgents = new Agent[1];
public void init() {
/*
* Create a provider by first obtaining the default implementation of
* JTAPI and then the default provider of that implementation.
*/
Provider myprovider = null;
try {
JtapiPeer peer = JtapiPeerFactory.getJtapiPeer(null);
myprovider = peer.getProvider(null);
} catch (Exception excp) {
System.out.println("Can't get Provider: " + excp.toString());
System.exit(0);
}
}
public void start() {
// if Terminal returned does not implement AgentTerminal return
if (!(myTerminal instanceof AgentTerminal))
return;
// else cast it to AgentTerminal
myAgentTerminal = (AgentTerminal)myTerminal;
Address myAddress;
try {
myAddress = myProvider.getAddress("74444");
// if Address is not an instance of ACDAddress return
if (!(myAddress instanceof ACDAddress))
return;
// else cast it to ACDAddress
myACDAddress = (ACDAddress)myAddress;
// prompt Agent for agent_passwd and agentID
// log in to ACD group
myAgents[0] = new Agent(Agent.LOG_IN,
agentID, myACDAddress,
myAddress, agent_passwd);
myAgentTerminal.setAgents(myAgents);
} catch (Exception e) {
System.out.println("exception occured");
return;
}
}
public void stop() {
if (myAgentTerminal != null)
{
try {
// log out of ACD group
myAgents[0].setState(Agent.LOG_OUT);
myAgentTerminal.setAgents(myAgents);
} catch (Exception e) {
System.out.println("exception occured");
return;
}
}
}
}

AgentTest Application Objects


ACDTest Java Source

import java.applet.*;
import java.lang.*;
import java.util.*;
import java.telephony.*;
import java.telephony.events.AddressEvent;
import java.telephony.callcenter.*;
import java.telephony.callcenter.events.*;
public class ACDTest extends Applet {
Provider myProvider;
Address myAddress;
ACDAddress myACDAddress;
MyACDObserver myACDObserver;
public void init() {
/*
* Create a provider by first obtaining the default implementation of
* JTAPI and then the default provider of that implementation.
*/
Provider myprovider = null;
try {
JtapiPeer peer = JtapiPeerFactory.getJtapiPeer(null);
myprovider = peer.getProvider(null);
} catch (Exception excp) {
System.out.println("Can't get Provider: " + excp.toString());
System.exit(0);
}
}
public void start() {
// if Address returned does not implement ACDAddress return
if (!(myAddress instanceof ACDAddress))
return;
myACDAddress = (ACDAddress)myAddress;
try {
// add observer on my ACD Address
myAddress.addObserver(myACDObserver);
}
catch (Exception e) {
System.out.println("exception occured");
return;
}
}
public void stop() {
if (myACDAddress != null)
{
// delete observer on my ACD Address
try {
myAddress.removeObserver(myACDObserver);
}
catch (Exception e) {
System.out.println("exception occured");
return;
}
}
}
}
class MyACDObserver implements ACDAddressObserver
{
public void addressChangedEvent(AddressEvent[] event)
{
if(!(event[0] instanceof CallCenterEvent))
return;
CallCenterEvent ccEvent = (CallCenterEvent) event[0];
int eventType = ccEvent.getCallCenterType();
switch(eventType)
{
case ACDEvent.ACD_LOGGEDON_EVENT:
case ACDEvent.ACD_LOGGEDOFF_EVENT:
case ACDEvent.ACD_NOTREADY_EVENT:
case ACDEvent.ACD_READY_EVENT:
case ACDEvent.ACD_WORKNOTREADY_EVENT:
case ACDEvent.ACD_WORKREADY_EVENT:
case ACDEvent.ACD_UNKNOWN_EVENT:
// call a routine which tracks ACD Agents
ACDAddressEvent aaEvent = (ACDAddressEvent) ccEvent;
trackACDAgents((ACDAddress)aaEvent.getAddress(),
aaEvent.getAgentTerminal(),
aaEvent.getAgentID());
return;
default:
return;
}
}
public void trackACDAgents(ACDAddress acdGroup,
AgentTerminal agentTerminal,
String agentID)
{
// store information in global tables
// use in a routing app to figure out destination
return;
}
}

ACDTest Application Objects

 

ACD Manager

Some Provider implementations have a more complex ACD feature in which a group of ACD Address can be managed logically as one Address. In order to support this function, the Call Center model has included another Address interface to handle this ACD Address group management. This interface is known as an ACDManagerAddress. It is an extension of an Address. Calls that are presented to an ACD Manager Address may be processed in several different ways. For example, the call may be queued at several different ACD Addresses before being distributed to an Agent Terminal, the call may be delivered immediately to one of the available Terminals associated with a given ACD Address in the group, or the call may be redirected to another ACD Manager Address or individual ACD Address.The Connection interface which represents the relationship between the ACD Manager Address and the Call is known as ACDManagerConnection.

ACD Manager Address Model



Predictive Call


Predictive Call is a key cornerstone of Call Center feature. An application uses it when it wants to launch a call where the destination is connected to the call first and the originator is connected only after the connection to the destination is successful.

A typical application is one where an application wants to contact a list of potential customers, about for example a newspaper subscription promotion. The application has a list of telephone numbers that correspond to the customers. The application picks one number at a time from this list and makes a predictive call. If no one answers, the call is dropped. If a customer answers, an attempt is made to connect the originating device. The originating device may be an ACD group, in which case an ACD agent anwers for the originating device. After this call is established the application moves on to the next telephone number on the list and repeats its actions.

Application Data


Application Data allows application to associate application specific data with a call. Methods on the CallCenterCall interface support setting and getting application data. In addition an event, ApplicationDataEvent, is sent when the set method is used or the provider associates data with the call from another source.

Java Telephony相关推荐

  1. java telephony jar,android – 修改framework.jar中的java代码

    我手机上的手机存在与MVNO(移动虚拟网络操作符)的问题.基本上这意味着我的数据连接仅在漫游时有效.这是一个已经在几个roms上修复的已知问题(但不是我的). 为了解决这个问题,我想修改framewo ...

  2. java telephony jar_编译错误解决方法

    首页板块列表刷机技术阅读帖子 编译错误解决方法 发布时间:2015-05-19 18:153回复.2072阅读 前言:关于Android4.4/CM11编译中遇到的一些错误,本人进行了整理.有需要的童 ...

  3. java telephony jar_java – 不支持的类:com.mediatek.common.telephony.IOnlyOwnerSimSupport

    更新依赖关系后,我在应用程序运行后没有响应 我在logcat中遇到了这个错误 E/MPlugin: Unsupported class: com.mediatek.common.telephony.I ...

  4. Android Telephony分析(四) ---- TelephonyManager详解

    前言 TelephonyManager主要提供Telephony相关信息的查询/修改功能,以及Phone状态监听功能,封装的方法主要是提供给APP上层使用.  TelephonyManager.jav ...

  5. Android Telephony

    Telephony提供的功能: Voice, SMS, SIM, Data Connection, STK and etc 这个模块特殊的地方: 1. 在Phone应用中,注册了Service.这样P ...

  6. Android Telephony纲要

    Telephony提供的功能: Voice, SMS, SIM, Data Connection, STK and etc 这个模块特殊的地方: 1. 在Phone应用中,注册了Service.这样P ...

  7. java协议标准与规范

    本栏目提供了大量的 Java 技术标准与规范的简介.官方网址以及 developerWorks 网站上相关的技术资源.通过本栏目,您不但可以了解当前 Java 社区主要的技术标准和规范,还可以通过查看 ...

  8. Java 标准与规范

    A Advanced Multimedia Supplements 一个提供了先进的多媒体功能的可选包,用于在 Java ME/CLDC 环境中为 Mobile Media API 提供附加功能. A ...

  9. 使用java技术实现IBM VIAVOICE 语音朗读技术

    http://java.sun.com/products/java-media/speech/ Java Speech API 允许开发人员将语音技术整合到 Java applet 和应用程序的用户界 ...

最新文章

  1. 《因果学习周刊》第6期:因果推荐系统
  2. 特征筛选(随机森林)
  3. 图解CMS垃圾回收机制,你值得拥有
  4. 什么是单点登录(SSO)
  5. 基于Struts2的供求信息网设计(三)
  6. unity 4种实现动态障碍方法
  7. CentOS LVS安装配置
  8. laravel迁移文件
  9. c# mysql 链接池溢出_C#MySQL连接池限制,并清理连接
  10. 知名应用背后的第三方开源项目
  11. EM最大期望算法与jensen不等式
  12. android电话通讯录导入iphone6,怎么把小米手机通讯录导入iphone6?
  13. JAVA-ApplicationContext的使用
  14. Inventory 物料库存 mtl_transactions_interface 开发[转]
  15. ARC122E Increasing LCMs
  16. Mybatis-Plus动态表名插件实现数据库分表查询
  17. mac 上php不可用,Mac_Mac蓝牙不可用怎么办?苹果电脑Mac蓝牙连不上iphone现象的解决办法介绍,Mac蓝牙不可用怎么办?有很多 - phpStudy...
  18. PPT技术干货1(下)——数据图表分析、逻辑梳理、高效办公
  19. Android TV下NFS和Samba挂载
  20. 90页PPT讲懂开源分布式流处理平台Kafka

热门文章

  1. python删除指定字符串之间所有行_python:删除包含字符串的pandas数据帧中的所有行...
  2. 音频处理 windows10下python三方库librosa安装
  3. 导入另一个 Git库到现有的Git库并保留提交记录
  4. 汇编语言--test和cmp区别
  5. 众人给诺基亚支招 Android提议何时了?
  6. 工具nmap常用命令总结
  7. 虚幻——动画蓝图、状态机制作人物走跑跳动作
  8. “富强“, “民主“, “文明“, “和谐“, “自由“, “平等“, “公正“, “法治“, “爱国“, “敬业“, “诚信“, “友善“
  9. 【RPO技巧拓展】————3、IIS和.Net应用程序中的非根相对路径覆盖(RPO)
  10. Shell/Linux使用Jq操作Json