Q. Building a JTAPI enterprise service that queries a provider for all it's addresses and terminals to add CallObserververs, AddressObservers and TerminalObservers for each address and terminal once the service startups up (usually before users start using their Cisco phones before start of day).
I notice that once calls are on the phones, I don't get the complete CallCtrl[...] events e.g. CallCtlConnInitiatedEv, CallCtlTermConnTalkingEv etc.
Other events like Conn[...] e.g. ConnCreatedEvent, ConnConnectedEvent etc are received alongside the TermConn events all on the CallObserver's callChangedEvent(CallEv callevs) method.
When I add the call observers just before the call is created via JTAPI i.e. before call.connect method, all the events seem to come through.
Is this the intended behavior? i.e is it not possible to add call observers to the source and destination addresses irrespective of whether the application is about to make a call or not?
I am able to get the events if I follow the JTAP Actor design pattern i.e. Originator/Receiver both extending the Actor class. If I have standalone CallObserver class for both originator and receiver, it doesn't seem to work! Any help will be appreciated.
If the call is answered before call observer is added, the state of the call is 'CONNECTED' and corresponding events indicating the current state is received by observer. No prior state events will be seen and this is expected. After adding call observer if there is a state change, call observers will see the corresponding events.
A. To the question: is it not possible to add call observers to the source and destination addresses irrespective of whether the application is about to make a call or not?, the answer is yes.
Application can add call observers at any time. Events it receives will depend on the state of the call (if there is a call when call observers are added) or if call is created after adding observers. It will see different set of events for those 2 scenarios.
On another note - quick question: Is there a way to detect the direction of a call? i.e. is the call and INCOMING or OUTGOING call?
I understand the terminal connection states for Outgoing Call goes from IDLE -> ACTIVE/PASSIVE -> DROPPED and Incoming goes from IDLE -> RINGING -> ACTIVE/PASSIVE. Once in ACTIVE/PASSIVE state, as the terminal connection moves to DROPPED, is there a way to know if that was for an Outgoing/Offhook call or Incoming Call?
If i have to use terminal connection to find out the calling/called parties I would use CallControlTerminalConnection states (and their corresponding events). On the calling side as soon the user goes offhook and starts dialing, the Call Control terminal connection will go to talking state.
A. Called party can be identified by the CallControlTerminalConnection.RINGING state. Call info as in call.getCallingAddress() and call.getCalledAddress() can be used to find the same info. HTH