« Back to Cisco JTAPI Questions

Onhook.Offhook status

Combination View Flat View Tree View
Threads [ Previous | Next ]
Is it possible to use JTAPI to query the status of a phone to see whether it is onhook or offhook?
 
Thanks,
 
Mike

some snippets from my code:

if (((CiscoTerminalConnection)terminalConnection).getCallControlState() == CiscoTerminalConnection.TALKING) //for the record, "TALKING" includes off-hook

CiscoCallAddressInfo.getNumActiveCalls() vs. CiscoCallAddressInfo.getNumCallsOnHold() - tells you if the user has a call that's not on hold


this should tell you if the user just has the phone off hook (listening to a dial tone or a busy signal):

for (javax.telephony.Connection lineConnection : line.getConnections())
if (lineConnection.getAddress().getName().equals(line.getName())){
CiscoCall call = (CiscoCall)lineConnection.getCall(); // if the number of connections on the call is 1, then that means there is only one
javax.telephony.Connection[] connections = call.getConnections(); // party to the call (most likely the phone is off-hook with either just a dialtone
if (connections==null || connections.length <= 1) // or a busy signal), so return the call object (the call must be returned so that
return (CiscoCall) call; // the call can be dropped before attempting to place an outbound call)
}