Author Message
jtapi_dev
Joined: Dec 6, 2016
Messages: 2
Offline
Hi,

We use the Avaya Java Telephony API ( JTAPI) to perform various telephony-related operations like connecting to a Call , answering and disconnecting a call using the SDK.

I'm facing the following issues, first one when I'm making a simple Call, and then we make a second call , the connection don't etablish correctly .

Please ,can you explain me ?

1.Which SDK classes to use to open the connection ( ie JtapiPeer ... ) ?
2. How close connection with safety ?

Here is the code use

[code]

// init Step

// init JtapiPeeer

JtapiPeer jtapiPeer = JtapiPeerFactory.getJtapiPeer(null);

// create provider

Provider provider = jtapiPeer.getProvider(null);

// create Terminal

Terminal terminalOfficer = provider.getTerminal(TelNumber); ...



private void holdAndConnect(String number) throws Exception {



try {

CallControlCall secondCall = (CallControlCall) provider.createCall();

TerminalConnection[] cons = terminalOfficer.getTerminalConnections();

officerTerminalConnection = null;

String calledAddr;


for (TerminalConnection c : cons) {

officerTerminalConnection = (CallControlTerminalConnection) c;


calledAddr = c.getTerminal().getName();

if (calledAddr.compareTo(terminalOfficier.getName()) == 0) {

break;

}

}


// we place officer connexion in hold state

officerTerminalConnection.hold();



// Waiting

Thread.sleep(tempo);

secondCall = (CallControlCall) provider.createCall();

secondCall.addCallListener(new CallControlConnectionListener(this));


if (secondCall instanceof LucentCall && userInfo != null) {



((LucentCall) secondCall).connect((LucentTerminal)

terminalOfficier, (LucentAddress) addressOfficier, number, false, userInfo);

} else {



secondCall.connect(terminalOfficier, addressOfficier, number);

}

} catch (ResourceUnavailableException | InvalidStateException | PrivilegeViolationException | MethodNotSupportedException | InvalidPartyException | InvalidArgumentException te) {



if (secondCall != null && secondCall.getState() == Call.ACTIVE) {

secondCall.drop();

}

secondCall = null;



if (officierTerminalConnection != null &&

officerTerminalConnection.getCallControlState() ==

CallControlTerminalConnection.HELD) {

officierTerminalConnection.unhold();

}





}



[code]



Best regards
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
I think your query is more complex than can be handled on the forum. You should open a technical support ticket and one of my colleagues can take a look. Please note, for non-paid members, there may be a fee for this service.

Briefly, for your questions on connecting to & disconnecting from AE Services - there are several sample application included in the SDK and on the Devconnect website. Any of these should give you the answer to this question.

Martin
Go to:   
Mobile view