cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
916
Views
0
Helpful
4
Replies
Highlighted
Beginner

How to mute a phone via JTAPI

Hi All,

I want to simulate the "mute" button actions as bellow:

String muteDataString = "<CiscoIPPhoneExecute><ExecuteItem Priority=\"0\"   URL=\"Key:Mute\"/></CiscoIPPhoneExecute>";

  byte[] muteDataBytes = muteDataString.getBytes();

  for (Call call : callArray) {

  CiscoCallID id = ((CallImpl) call).getCallID(); //((CallControlCall)call).drop();

  int gid = id.getGlobalCallID();

  int mid = id.getCallManagerID();

  System.out.println("Call " + index + ": " + gid + "/" + mid);

  Connection[] connections = call.getConnections();

  if (connections != null && connections.length > 0) {

  Connection conn = connections[0];

  TerminalConnection[] terminalConnections = conn.getTerminalConnections();

  if (terminalConnections != null && terminalConnections.length >0) {

  TerminalConnection terminalConn = terminalConnections[0];

  CiscoTerminal ternimal = (CiscoTerminal) terminalConn.getTerminal();

  ternimal.sendData(muteDataBytes);

  }

  }

  }

but it does not work, it always throws following errors when it executes the line "....sendData(muteDataBytes);":

  Call 1: 1059/1

  com.cisco.jtapi.PlatformExceptionImpl: Cti request timed out

        at com.cisco.jtapi.TerminalImpl.sendData(TerminalImpl.java:1175)

Any suggestion is appreciated.

Thanks in advance!

Simon.

Everyone's tags (1)
4 REPLIES 4
Highlighted
Cisco Employee

Re: How to mute a phone via JTAPI

All I can suggest is to read the XSI Object Pass Through section of the developer guide at https://developer.cisco.com/fileMedia/download/456df613-07bd-4bce-8904-f3bd0b415e53 and be sure you're meeting the requirements cited there.

Also, note this caveat from the guide: IfJTAPI applications make simultaneous back to back requests for sendData() API on the same CiscoTerminal, without any delay between requests, then some of these requests may fail. Applications cannot determine whether a request wassuccessful or not, as Cisco JTAPI API returnssuccessfully assoon asthe phone receives data and does not wait for a response from the phone. Also, the IP phone might display a blank screen on sending simultaneous requests to send data. To avoid these issues, JTAPI applications should ensure some time delay between two successive sendData() requests while pushing XSI data to the IP phones via Cisco JTAPI.

Highlighted
Beginner

Re: How to mute a phone via JTAPI

Hi Nicholas,

Thanks for your reply.

The XSI Object Pass Through" has little information for me, but it says that "CiscoTerminal must be in the <CODE>CiscoTerminal.REGISTERED</CODE> state", while when I invoke CiscoTerminal.getState(), it returns "IN_SERVICE", CiscoTerminal.getDeviceState(), it returns DEVICEDTATE_IDLE,  I'm not sure it is in the sate "REGISTERED", could you give more details about that?

And I debug the code, in fact, the root cause error is "com.cisco.cti.client.CCNException: deviceDataPassThrough request failed"

Simon

Highlighted
Beginner

Re: How to mute a phone via JTAPI

Hi Simon,

Did this work for you later..?

Highlighted
Beginner

Re: How to mute a phone via JTAPI

Hi Simon,

I was facing the same issue when I was working with Cisco Jabber phone. But when I tried to work it on a Cisco IP Communicator, it worked.

This widget could not be displayed.