Categorize call from keypad

Unanswered Question
May 24th, 2007
User Badges:

Hi,

I am trying to make an application that allows to a phone operator to categorize a call. For an example if is a client that have called, he only have to press key 1, if is an claim he will press the keypad 2.


When I was looking for the information about events that can tell me that the key was pressed, I have found something that it looks to work.


The code is as follows:


Address address = provider.getAddress("355");

Terminal terminal = provider.getTerminal("355");


ComponentGroup groups[] = null;

if (terminal instanceof PhoneTerminal) {

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


}


Component components[] = groups[0].getComponents();


System.out.println("Component: "+ components);

for (int i = 0; i < components.length; i++) {


if (components[i] instanceof PhoneButton) {


PhoneButton but = (PhoneButton)components[i];

log.info("Phone Button Info: " + but.getInfo());

log.info("Phone Button Name: " + but.getName());

}

}


} catch (Exception excp) {

excp.printStackTrace();

}


But the problem is that I can't convert the Terminal to a Phone Terminal.

It's necessary to configure something in the device settings of CCM Admin? Or am I going on the rong way to this


Thanks,


Ana Soares


  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
stephan.steiner Fri, 05/25/2007 - 02:10
User Badges:
  • Silver, 250 points or more

PhoneTerminal is a class from the javax.telephony.phone class - the Terminal returned by the provider is a javax.telephony.Terminal class, or more specifically, Cisco's implementation thereof (so a com.cisco.jtapi.extensions.CiscoTerminal). In the JTAPI documentation, you'll also find a list of what Cisco supports of JTAPI (their provider is an incomplete implementation of JTAPI 1.2) - you'll notice that the entire javax.telephony.phone package has not been implemented.


However, it's easy to get digits via JTAPI.. the developer guide even mentions how - if you search for "digit" you'll find


CiscoTerminal Filter and ButtonPressedEvents?Enables applications to

receive the CiscoTermButtonPressedEv when a digit gets pressed on the

phone.


And a whole chapter on


CiscoTerminal Filter and ButtonPressedEvents


Reading that section should help you get started. You just need a terminal listener and process the appropriate terminal event and you'll get your digits.

soares.ana Fri, 05/25/2007 - 08:08
User Badges:

hi, Stefan


Thank you for your answer, it realy helps.


Ana Soares

Actions

This Discussion