cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2702
Views
0
Helpful
5
Replies

How can I get the 'Line Text Label' from a CiscoAddress?

jprovines
Level 1
Level 1

Anyone know how I get the 'Line Text Label' from a CiscoAddress object? I'm monitor incoming calls and getting the CiscoAddress object and want to see the line they called in on. For example, our phones have physical buttons with labels such as Line1, Line2, etc. If the user gets a new call on Line2 (because line1 is on hold), I want to know that Line2 is related to this CiscoAddress object. When I debug in Eclipse and drill into the CiscoAddress object I can find the value I am after.

CiscoAddress.assertvalidState.table[7].key.auxiliaryData

However, I have no idea how to return that in my code or what object that is really in.

Any help would be greatly appreciated!

James

1 Accepted Solution

Accepted Solutions

getUnicodeLabel() Worked! Thank you! Have a great weekend!

View solution in original post

5 Replies 5

mpotluri
Level 5
Level 5

Try getButtonPosition(javax.telephony.Terminal term) API to find out the position of this address (Line) on a terminal (Phone)

getAsciiLabel(javax.telephony.Terminal term) should give the label configured for that line.

Hi Mohan,

I tried doing something like this, but I'm getting null for getAsciiLabel.  Am I getting the terminal correctly?

public void callChangedEvent(CallEv[] arg0) {

  //write call change events

  for (CallEv ce : arg0) {

  //System.out.println(ce.toString());

  if (ce instanceof TermConnRingingEv) {

  TermConnRingingEv cae = (TermConnRingingEv) ce;

  CiscoCall c = (CiscoCall) cae.getCall();

  CiscoAddress caCaller = (CiscoAddress) c.getCurrentCallingAddress();

  CiscoAddress caCallee = (CiscoAddress) c.getCurrentCalledAddress();

  javax.telephony.Terminal t = c.getCurrentCalledTerminal();

  String myLine = null;

  try {

  myLine = caCallee.getAsciiLabel(t);

  } catch (InvalidStateException e) {

  // TODO Auto-generated catch block

  e.printStackTrace();

  } catch (MethodNotSupportedException e) {

  // TODO Auto-generated catch block

  e.printStackTrace();

  } catch (InvalidArgumentException e) {

  // TODO Auto-generated catch block

  e.printStackTrace();

  }

I would try to get all the info from the event and its connection itself:


TermConnRingingEv cae = (TermConnRingingEv) ce;


Terminal term = cae.getTerminalConnection().getTerminal();


CiscoAddress ca = cae.getTerminalConnection().getConnection().getAddress();

I keep getting null when calling ca.getAsciiLabel(term);  Any ideas?

getUnicodeLabel() Worked! Thank you! Have a great weekend!