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

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

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

Everyone's tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Beginner

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

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

5 REPLIES 5
Contributor

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

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.

Beginner

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

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();

  }

Contributor

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

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();

Beginner

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

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

Beginner

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

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

CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards