Hi,
I'm facing the following issue, I'm making a simple Call (cf. code below), and I use a ConnectionLister.
The problem is that I receive a ConnectedConnectionEvent in connectionconnected method, before the phone had picked up.
According Javadoc, this event should be fire when the two people are able to talk.
I must miss a point, but I don' understand why this event is sent. Do I use the good APIs or shoud I use another event?
Here is the code use
[code]
public class MyCallControl {
...
private void connect(String number) throws Exception {
Provider provider = jtapiPeer.getProvider(providerString.toString());
Address addressOfficier = provider.getAddress(callingFrom);
Terminal terminalOfficier = provider.getTerminal(callingFrom);
CallControlCall mainCall = (CallControlCall) provider.createCall();
MyCallListenerME myCallListener = new MyCallListenerME(this);
((LucentCall) mainCall).connect((LucentTerminal) terminalOfficier, (LucentAddress) addressOfficier, number, false, userInfo);
}
...
}
public class MyCallListenerME implements ConnectionListener {
...
@Override
public void connectionConnected(ConnectionEvent ce) {
try {
Address address = ce.getConnection().getAddress();
String addressName = address.getName();
...
}
} catch (Exception e) {
LOG.error("Exception in connection connected event", e);
}
}
...
}
Thanks,
Yann
|