04-21-2017 02:21 PM
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
Solved! Go to Solution.
04-21-2017 03:17 PM
getUnicodeLabel() Worked! Thank you! Have a great weekend!
04-21-2017 02:30 PM
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.
04-21-2017 02:46 PM
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();
}
04-21-2017 03:02 PM
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();
04-21-2017 03:16 PM
I keep getting null when calling ca.getAsciiLabel(term); Any ideas?
04-21-2017 03:17 PM
getUnicodeLabel() Worked! Thank you! Have a great weekend!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide