mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-26 16:22: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:
parent
bdfec79207
commit
b9b0b6134f
2 changed files with 11 additions and 21 deletions
|
@ -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,18 +181,9 @@ public class IncomingJingleSession extends JingleSession {
|
|||
* @throws XMPPException
|
||||
*/
|
||||
public void start() throws XMPPException {
|
||||
start(this.getInitialSessionRequest());
|
||||
start(getInitialSessionRequest());
|
||||
}
|
||||
|
||||
/**
|
||||
* Force a call acceptance. Used to accept a hooked call.
|
||||
*
|
||||
* @deprecated Avoid to use this method. Not compliance.
|
||||
*/
|
||||
public void accept() {
|
||||
setState(active);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the initial Jingle packet request
|
||||
*
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,6 @@ public class JingleMediaTest extends SmackTestCase {
|
|||
|
||||
IncomingJingleSession incomingJingleSession = (IncomingJingleSession) jm1.getSession(js0.getConnection().getUser());
|
||||
incomingJingleSession.removeAllStateListeners();
|
||||
incomingJingleSession.accept();
|
||||
|
||||
Thread.sleep(15000);
|
||||
|
||||
|
|
Loading…
Reference in a new issue