cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
660
Views
0
Helpful
2
Replies

Answering call without adding callobserver

ashish.nijai
Level 1
Level 1

Hi,

Can we answer a call without adding call observer to terminal or address?

Please find my code below:

CiscoTerminal terminal = provider

  .createTerminal("SEP101F740EEA25");

TerminalConnection[] terminalConnections = terminal.getTerminalConnections();

  if (terminalConnections!=null){

  for (TerminalConnection tc : terminalConnections){

  tc.answer();

  }

  }

I am unable to answer the call using above mentioned logic.

At same time I can answer the call when I add an empty call observer to terminal.

Empty call observer means empty callchanged method like below:

public synchronized void callChangedEvent(CallEv[] eventList) {

}

For answering call , I have to give sleep of 100 milliseconds to make code run.

If i don't put sleep in my code, the code is not answering the call.

So my code with  observer will be like:

CiscoTerminal terminal = provider

  .createTerminal("SEP101F740EEA25");

terminal.addCallObserver(callObserver);

Thread.sleep(100);

TerminalConnection[] terminalConnections = terminal.getTerminalConnections();

  if (terminalConnections!=null){

  for (TerminalConnection tc : terminalConnections){

  tc.answer();

  }

  }

I don't know how to solve this.
Can we answer call without call observer?

And if we attach call observer then why we need Thread.sleep() to answer the call.


Does JTAPI signalling take that much of time due to which we require Thread.sleep()?

2 Replies 2

mpotluri
Level 5
Level 5

You need have call observer on address or terminal to see the call or terminal connections. JTAPI is not aware of the call until application adds call observer.

Signal flow about the call from CTI to JTAPI starts only after call observer is added and it takes a few hundred milli seconds for it to complete hence the need for delay.

Normally applications should use CallCtrlTermConnTalkingEv to answer the call which doesn't need any delay.

I am using CallCtlTermConnRingingEv to answer the call.

CallCtlTermConnRingingEv event means terminal is ringing and we answer the call when phone rings.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: