Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/304.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用cBarge(驳船)创建与JTApi的会议_Java_Cisco_Conference_Jtapi_Cisco Jtapi - Fatal编程技术网

Java 如何使用cBarge(驳船)创建与JTApi的会议

Java 如何使用cBarge(驳船)创建与JTApi的会议,java,cisco,conference,jtapi,cisco-jtapi,Java,Cisco,Conference,Jtapi,Cisco Jtapi,我们有两部思科手机:一部给电话经理,另一部给他的主管 我们需要在经理接听并将主管的电话静音时创建一个会议。我们正在尝试使用JTApi实现它:等待事件termconnactiev,然后尝试创建会议 下面是代码示例 if (callEv instanceof TermConnActiveEv) { CiscoCall thisCall = (CiscoCall) callEv.getCall(); TerminalConnection connection = ((TermConnActiveEv)

我们有两部思科手机:一部给电话经理,另一部给他的主管

我们需要在经理接听并将主管的电话静音时创建一个会议。我们正在尝试使用JTApi实现它:等待事件
termconnactiev
,然后尝试创建会议

下面是代码示例

if (callEv instanceof TermConnActiveEv) {
CiscoCall thisCall = (CiscoCall) callEv.getCall();
TerminalConnection connection = ((TermConnActiveEv) callEv).getTerminalConnection();

if (thisCall.getState() != Call.ACTIVE)
{
    System.out.println("call is not active");
    return;
}
try {
    CiscoCall newCall = (CiscoCall) provider.createCall();
    newCall.consult(connection);
    newCall.conference(thisCall);

    ....

但是,会引发异常。我们做错了什么?

您不需要使用驳船创建会议

您可以尝试这样做:

if (callEv instanceof TermConnActiveEv) {
    CiscoCall thisCall = (CiscoCall) callEv.getCall();
    TerminalConnection tc = thisCall.getConferenceController();
    Connection[] connections = thisCall.getConnections();

    TerminalConnection[] tcs = connections[0].getTerminalConnections();
    if (tcs.length > 0 && tc == null) {
        tc = tcs[0];
    }

    if (tc == null) {
        System.out.println("Conference controller is null.");
    } else {
        try {
            Call call = provider.createCall();
            call.connect(thisAddress.getTerminals()[0], thisAddress, superVisorAddress);
            thisCall.conference(call);
        } catch (Exception ex) {
            System.out.println("Exception " + ex);
            ex.printStackTrace();
        }
    }
}
要设置静音,可以使用:

((CiscoTerminal)termConnections[i].getTerminal().sendData("<CiscoIPPhoneExecute><ExecuteItem Priority=\"0\"URL=\"Key:Mute\"/></CiscoIPPhoneExecute>");
((CiscoTerminal)termConnections[i].getTerminal().sendData(“”);
应用程序必须在终端上添加
TerminalObserver
,才能使用此功能