We have 2 cisco phones: one for call manager and another for his superviser.
We need to create a conference when the manager answers and put the supervisor's phone on mute. We are trying to achieve it using JTApi: wait for event TermConnActiveEv
, then trying to create conference.
Here is the code sample.
if (callEv instanceof TermConnActiveEv) {
CiscoCall thisCall = (CiscoCall) callEv.getCall();
TerminalConnection connection = ((TermConnActiveEv) callEv).getTerminalConnection();
if (thisCall.getState() != Call.ACTIVE)
{
System.out.println("call is not active");
return;
}
try {
CiscoCall newCall = (CiscoCall) provider.createCall();
newCall.consult(connection);
newCall.conference(thisCall);
....
However, PreConditionException
is thrown. What are we doing wrong?
You don't need to use Barge to create a conference.
You can try to do something like that:
To set mute you can use:
Before the application can make use of this feature, it must add
TerminalObserver
on the terminal.