I wanted to know how to get the status of a phone using Jtapi. I am familiar with the addressChangedEvent and terminalChangedEvent methods of address and terminal observers. However, I am having a hard time trying to get the status of an address (phone). Any help would be greatly appreciated.
You may use javax.telephony.callcontrol.CallControlTerminal
This provides functions like : getAdresses, and getTerminalConnections
From an Address you can get a Conncetions and a connection is bound to a call and this provides a state.
A TerminalConnection also provides a state
Address adr[] = terminal.getAddresses();
int callState = adr[0].getConnections()[0].getCall().getState();
TerminalConnection tcs[] = terminal.getTerminalConnections();
int conState = tcs[0].getState();
getConnections and getTerminalConnection may retun null!