Jtapi开发之转接二 传递uui

原文网址:https://blog.csdn.net/cjqhut/article/details/85070954

以下代码实现基于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);

      

      

    }  

}  
--------------------- 
作者:cjqhut 
来源:CSDN 
原文:https://blog.csdn.net/cjqhut/article/details/85070954 
版权声明:本文为博主原创文章,转载请附上博文链接!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值