以下代码实现基于avaya的Tsapi环境,实现了转接是传递UUI(随录数据)
package com.av.demo;
import javax.telephony.Connection;
import javax.telephony.Provider;
import javax.telephony.TerminalConnection;
import javax.telephony.callcontrol.CallControlCall;
import javax.telephony.callcontrol.CallControlTerminal;
import javax.telephony.callcontrol.CallControlTerminalConnection;
import com.av.util.MyProvider;
import com.avaya.jtapi.tsapi.LucentAddress;
import com.avaya.jtapi.tsapi.LucentCall;
import com.avaya.jtapi.tsapi.LucentTerminal;
import com.avaya.jtapi.tsapi.UserToUserInfo;
/**
* @author chengjianqiang
* @date 2018年12月6日
*/
public class UuiTest2 {
public static void main(String[] args) {
Provider p=MyProvider.getProvider();
try {
/**
* (场景:分机号5380的坐席已经在和客户通话,现要将客户转到满意度 VDN4995并随带UUI)
* 用Transfer传递UUI的思路:
* 1、发起一个新的呼叫,把要传递的UUI放进去
* 2、将新呼叫并入原呼叫
*/
//通过分机号或Agent号获取当前通话的Terminal、call对象
CallControlTerminal terminal5380 = (CallControlTerminal)p.getTerminal(\"5380\");
//当前通话的TermConn对象ctrTmCnA5380
CallControlTerminalConnection ctrTmCnA5380=(CallControlTerminalConnection) terminal5380.getTerminalConnections()[0];
//当前通话的呼叫对象callA
CallControlCall callA = (CallControlCall) ctrTmCnA5380.getConnection().getCall();
//先把当前通话保持住,释放资源后才能发起新的呼叫;
ctrTmCnA5380.hold();
//创建新的呼叫callB,并传入UUI
LucentCall callB = (LucentCall) terminal5380.getProvider().createCall();
UserToUserInfo uui=new UserToUserInfo(\"grp=cheng,stp=jianqiang \");
Connection[] connectArrB = callB.connect((LucentTerminal)terminal5380, (LucentAddress)terminal5380.getAddresses()[0], \"4995\", false, uui);
//设置转接控制器(转接控制器:即在callA中,又在callB中,比如现在callB中的5380.而且转接成功后,它将自动挂断,不参与任何呼叫);
TerminalConnection termConnB5380 = connectArrB[0].getTerminalConnections()[0];
callB.setTransferController(termConnB5380);
//发起转接
callB.transfer(callA);
Thread.sleep(2000);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.exit(0);
}
}
继续阅读与本文标签相同的文章
-
阿里云开发者社区问答栏目提问规范
2026-05-18栏目: 教程
-
小伙上演“无人驾驶”手舞足蹈,女网友拍视频发朋友圈结果“悲剧了”……
2026-05-18栏目: 教程
-
迎来“无后门协议”!持续压制无效?5G建设选择在于技术问题
2026-05-18栏目: 教程
-
Pepper Metrics - Spring/Spring Boot应用性能监控利器
2026-05-18栏目: 教程
-
ZKEYS:数字化时代,IDC云化解决方案的探索实践
2026-05-18栏目: 教程
