cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2346
Views
0
Helpful
4
Replies

How to mute a phone via JTAPI

Simon_New1
Level 1
Level 1

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.

4 Replies 4

npetrele
Cisco Employee
Cisco Employee

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.

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

Hi Simon,

Did this work for you later..?

YouTee
Level 1
Level 1

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.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: