1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-26 05:52:06 +01:00

Fixes in Negotiations and Listeners

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7733 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Thiago Camargo 2007-03-27 16:53:46 +00:00 committed by thiago
parent bdfec79207
commit b9b0b6134f
2 changed files with 11 additions and 21 deletions

View file

@ -124,7 +124,6 @@ public class IncomingJingleSession extends JingleSession {
}
setMediaNeg(new MediaNegotiator(this, payloadTypes));
if (resolver.getType().equals(TransportResolver.Type.rawupd)) {
setTransportNeg(new TransportNegotiator.RawUdp(this, resolver));
}
@ -132,11 +131,6 @@ public class IncomingJingleSession extends JingleSession {
setTransportNeg(new TransportNegotiator.Ice(this, resolver));
}
updatePacketListener();
// Establish the default state
setState(accepting);
}
/**
@ -161,20 +155,24 @@ public class IncomingJingleSession extends JingleSession {
* @throws XMPPException
*/
public void start(JingleSessionRequest initialJingleSessionRequest) throws XMPPException {
// Establish the default state
setState(accepting);
updatePacketListener();
Jingle packet = initialJingleSessionRequest.getJingle();
if (packet != null) {
// Initialize the session information
setSid(packet.getSid());
sendAck(packet);
respond(packet);
}
else {
throw new XMPPException(
"Session request with null Jingle packet.");
}
// Set the new session state
setState(pending);
}
/**
@ -183,16 +181,7 @@ public class IncomingJingleSession extends JingleSession {
* @throws XMPPException
*/
public void start() throws XMPPException {
start(this.getInitialSessionRequest());
}
/**
* Force a call acceptance. Used to accept a hooked call.
*
* @deprecated Avoid to use this method. Not compliance.
*/
public void accept() {
setState(active);
start(getInitialSessionRequest());
}
/**
@ -233,6 +222,8 @@ public class IncomingJingleSession extends JingleSession {
* @throws XMPPException
*/
public Jingle eventInitiate(Jingle inJingle) throws XMPPException {
// Set the new session state
setState(pending);
return super.eventInitiate(inJingle);
}

View file

@ -110,7 +110,6 @@ public class JingleMediaTest extends SmackTestCase {
IncomingJingleSession incomingJingleSession = (IncomingJingleSession) jm1.getSession(js0.getConnection().getUser());
incomingJingleSession.removeAllStateListeners();
incomingJingleSession.accept();
Thread.sleep(15000);