Ron Buchanan | 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) } |
| Please sign in to flag this as inappropriate. |