cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2063
Views
0
Helpful
9
Replies

Click a button on the softbutton template using JTAPI

yogeshshanbhag
Level 1
Level 1

Hi Team,

I have modified a softkey template to include the 'Record' button when the call state is 'connected'.

I also see that the 'Record' button is getting displayed when the call is active (Connected).

Is there a way to invoke the Record button via JTAPI? (some way to access the Component groups of a phone?)

We are using CUCM 9x version and I dont seem to access the phoneTerminal.(The below code prints not a phone terminal)

Sample Code:

try {

  Terminal terminal = myprovider.getTerminal("5551212");

  ComponentGroup groups[];

  if (terminal instanceof PhoneTerminal) {

  groups = ((PhoneTerminal)terminal).getComponentGroups();

       }     else{

          System.out.println("Not a PhoneTerminal");

     }

} catch (Exception excp) {

  // Handle exceptions

}

1 Accepted Solution

Accepted Solutions

Hi Yogesh,

Please try follow code,

Address address = this.provider.getAddress("1009");

Terminal[] ter = address.getTerminals();

for (int j = 0; j < ter.length; j ++) {

     if ((ter[j].getName() != null) &&

                  (ter[j].getName().indexOf("SEP") != -1))

     {

                  Terminal ct = (CiscoTerminal)ter[j];

                  if (ct != null)

                  {

                      ct.sendData("<CiscoIPPhoneExecute><ExecuteItem URL='Key:Soft1'/></CiscoIPPhoneExecute>");

                  }

     }

}

I don't debug the codes, so there might be some errors. Please do it by yourself.

View solution in original post

9 Replies 9

Tieying
Level 1
Level 1

Yes, you can send action request from JTAPI client to CUCM, and trigger the softkey. But it's not very safe, for you should know the position of the key in the phone screen. Otherwise you may trigger another incorrect key.

Maybe the better way is to start recording via JTAPI client directly.

Hi Txuan,IPPhone.png

We can ensure the position of the 'record' button, let's assume it is the first button.

Can you provide me the code snippet on how I can send the action request to CUCM?

Attached is the screenshot of the softphone.

Appreciate your help.

THanks

Yogesh

Hi Yogesh,

Please try follow code,

Address address = this.provider.getAddress("1009");

Terminal[] ter = address.getTerminals();

for (int j = 0; j < ter.length; j ++) {

     if ((ter[j].getName() != null) &&

                  (ter[j].getName().indexOf("SEP") != -1))

     {

                  Terminal ct = (CiscoTerminal)ter[j];

                  if (ct != null)

                  {

                      ct.sendData("<CiscoIPPhoneExecute><ExecuteItem URL='Key:Soft1'/></CiscoIPPhoneExecute>");

                  }

     }

}

I don't debug the codes, so there might be some errors. Please do it by yourself.

I tried the following code:

CiscoTerminal terminal = (CiscoTerminal)myProvider.getTerminal("xxxxx");

terminal.sendData("<CiscoIPPhoneExecute><ExecuteItem URL='Key:Soft1'/></CiscoIPPhoneExecute>");

I dont see anything happening after that, no timeout error.. nothing. Tried with the debugger turned on(in eclipse) but nothing happens after executing the "senddata" line of code.

Should there be any additional permissions for the user?

Also tried to mute the call, but did not work.

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

Have you turned on the JTAPI debug trace? Please check the jtapi log for the error details.

Bang on target

Thanks that helped, sendData() works just fine.

Just curious on why the "javax.telephony.phone.*" package was deprecated? is there any alternative?

Thanks

Yogesh

Hi,

 

I tried to mute myself from the call using JTAPI by using sendData(byte[]) and send the following XML to this:

<CiscoIPPhoneExecute><ExecuteItem Priority="0" URL="Key:Mute"/></CiscoIPPhoneExecute>

 

This is working on Cisco IP communicator but not working on Cisco Jabber softphone. Any suggestions on this..?

Unfortunately, control of audio parameters is not supported via JTAPI.  As you discovered, you can use IPPS key presses to do this for physical phones that support IPPS, but unfortunately there is no equivalent for Jabber softphones.

If you really need to do this, you might be able to use OS media APIs to control the microphone (plus things like volume, etc.)  If your app runs on a separate server, I guess you could create a small app/service that runs on the user's PC and connects to your server app via a custom API...

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: