Commit 87d0efed authored by Dele Olajide's avatar Dele Olajide Committed by dele

Rayo Plugin - Bug fixing

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13808 b35dd754-fafc-0310-a699-88a17e54d16e
parent bb57baf9
......@@ -161,7 +161,7 @@
{
window.connection.rayo.phone(
{
codec_name: "PCMU",
codec_name: document.getElementById("codec").value,
stereo_pan: "0",
sip_handset: sipHandset,
......@@ -356,7 +356,7 @@
if (!username) groupname = null;
window.connection.rayo.dial("xmpp:" + window.connection.jid, sipUri, {
codec_name: "PCMU",
codec_name: document.getElementById("codec").value,
//group_name: groupname
});
......@@ -397,6 +397,7 @@
</script>
</head>
<body style="position: absolute; width: 500px: height: 300px;">
<div>Codec<select id="codec"><option value="OPUS"><b>OPUS</b></option><option value="PCMU"><b>PCMU (Ulaw)</b></option></select></div>
<span id="status">Loading...</span>
</body>
</html>
\ No newline at end of file
......@@ -104,6 +104,8 @@ Strophe.addConnectionPlugin('rayo',
{
var iq = $iq({to: mixer + "@" + this._connection.domain, from: this._connection.jid, type: "get"}).c("join", {xmlns: Strophe.NS.RAYO_CORE, "mixer-name": mixer});
//console.log(iq.toString());
that._connection.sendIQ(iq, null, function(error)
{
$('error', error).each(function()
......@@ -122,9 +124,11 @@ Strophe.addConnectionPlugin('rayo',
var that = this;
var iq = $iq({to: mixer + "@" + this._connection.domain, from: this._connection.jid, type: "get"}).c("unjoin", {xmlns: Strophe.NS.RAYO_CORE, "mixer-name": mixer});
//console.log(iq.toString());
that._connection.sendIQ(iq, function(response)
{
this._onhook();
that._onhook();
}, function(error) {
......
......@@ -152,8 +152,10 @@ public class Handshake extends ServerSession
a.E(j);
X.put(new String(c.J), c);
}
P p = new P();
Peer p = new Peer();
p.A(M.L());
if(c.B == 0)
{
D d = null;
......
......@@ -24,7 +24,7 @@ package com.jcumulus.server.rtmfp;
import com.jcumulus.server.rtmfp.publisher.FlowWriter;
import com.jcumulus.server.rtmfp.stream.B;
public interface D
public interface ISession
{
public abstract void A(boolean flag);
......
......@@ -24,5 +24,5 @@ package com.jcumulus.server.rtmfp;
public interface ISessions
{
public abstract ServerSession A(int i, byte abyte0[], byte abyte1[], P p);
public abstract ServerSession A(int i, byte abyte0[], byte abyte1[], Peer p);
}
......@@ -34,8 +34,6 @@ import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.apache.log4j.Logger;
// Referenced classes of package com.jcumulus.server.rtmfp:
// K, C
public class N
{
......
......@@ -36,16 +36,16 @@ import java.util.List;
import org.apache.log4j.Logger;
public class P extends Client
public class Peer extends Client
{
private static final Logger L = Logger.getLogger(P.class);
private static final Logger L = Logger.getLogger(Peer.class);
private SocketAddress J;
private List N;
private ClientHandler K;
private boolean M;
public P()
public Peer()
{
N = new ArrayList();
}
......
......@@ -40,12 +40,12 @@ import org.apache.log4j.Logger;
import org.jboss.netty.channel.Channel;
public class ServerSession implements D
public class ServerSession implements ISession
{
private static final Logger J = Logger.getLogger(ServerSession.class);
int O;
int D;
protected P M;
protected Peer M;
boolean I;
boolean F;
byte H;
......@@ -67,10 +67,10 @@ public class ServerSession implements D
public ServerSession(int i, int j, byte abyte0[], byte abyte1[])
{
this(i, j, abyte0, abyte1, new P());
this(i, j, abyte0, abyte1, new Peer());
}
public ServerSession(int i, int j, byte abyte0[], byte abyte1[], P p)
public ServerSession(int i, int j, byte abyte0[], byte abyte1[], Peer p)
{
N = new B();
G = new com.jcumulus.server.rtmfp.pipe.B();
......
......@@ -39,7 +39,7 @@ public class Sessions implements ISessions
D = new Handshake(this);
}
public ServerSession A(int i, byte abyte0[], byte abyte1[], P p)
public ServerSession A(int i, byte abyte0[], byte abyte1[], Peer p)
{
int j = A();
ServerSession h = new ServerSession(j, i, abyte0, abyte1, p);
......
......@@ -20,10 +20,13 @@ package com.jcumulus.server.rtmfp.application;
* This file is a part of jCumulus.
*/
import com.jcumulus.server.rtmfp.ISession;
public class AudioWriter extends StreamWriter
{
public AudioWriter(byte abyte0[], com.jcumulus.server.rtmfp.D d)
public AudioWriter(byte abyte0[], ISession d)
{
super((byte)8, abyte0, d);
}
......
......@@ -20,7 +20,7 @@ package com.jcumulus.server.rtmfp.application;
* This file is a part of jCumulus.
*/
import com.jcumulus.server.rtmfp.P;
import com.jcumulus.server.rtmfp.Peer;
import com.jcumulus.server.rtmfp.packet.*;
import com.jcumulus.server.rtmfp.publisher.E;
import com.jcumulus.server.rtmfp.publisher.FlowWriter;
......@@ -38,7 +38,7 @@ import org.apache.log4j.Logger;
public class Publication
{
private static final Logger F = Logger.getLogger(Publication.class);
private P E;
private Peer E;
private FlowWriter A;
private boolean G;
private String J;
......@@ -109,7 +109,7 @@ public class Publication
J = s;
}
public boolean A(P p, int i, FlowWriter h, boolean flag)
public boolean A(Peer p, int i, FlowWriter h, boolean flag)
{
Listener j = (Listener)H.get(Integer.valueOf(i));
if(j != null)
......@@ -132,7 +132,7 @@ public class Publication
}
}
public void A(P p, int i)
public void A(Peer p, int i)
{
Listener j = (Listener)H.get(Integer.valueOf(i));
if(j == null)
......@@ -165,7 +165,7 @@ public class Publication
}
}
public void A(P p, int i, FlowWriter h)
public void A(Peer p, int i, FlowWriter h)
throws Exception
{
if(I != 0)
......@@ -195,7 +195,7 @@ public class Publication
h.A("Publish.Start", (new StringBuilder()).append(J).append(" is now published").toString());
}
public void B(P p, int i)
public void B(Peer p, int i)
{
B.A();
if(I != i)
......
......@@ -22,7 +22,7 @@ package com.jcumulus.server.rtmfp.application;
import com.jcumulus.server.rtmfp.packet.*;
import com.jcumulus.server.rtmfp.D;
import com.jcumulus.server.rtmfp.ISession;
import com.jcumulus.server.rtmfp.stream.B;
import org.apache.log4j.Logger;
......@@ -35,7 +35,7 @@ public class StreamWriter extends com.jcumulus.server.rtmfp.publisher.FlowWriter
private boolean U;
public StreamWriter(byte byte0, byte abyte0[], D d)
public StreamWriter(byte byte0, byte abyte0[], ISession d)
{
super(abyte0, d);
T = new G();
......
......@@ -20,7 +20,7 @@ package com.jcumulus.server.rtmfp.application;
* This file is a part of jCumulus.
*/
import com.jcumulus.server.rtmfp.P;
import com.jcumulus.server.rtmfp.Peer;
import com.jcumulus.server.rtmfp.publisher.FlowWriter;
import java.util.*;
import org.apache.log4j.Logger;
......@@ -66,7 +66,7 @@ public class Streams
}
}
public Publication A(P p, int i, String s, FlowWriter h)
public Publication A(Peer p, int i, String s, FlowWriter h)
throws Exception
{
Publication b = A(s);
......@@ -83,7 +83,7 @@ public class Streams
return b;
}
public void A(P p, int i, String s)
public void A(Peer p, int i, String s)
{
Publication b = (Publication)C.get(s);
if(b == null)
......@@ -96,7 +96,7 @@ public class Streams
A(b);
}
public boolean A(P p, int i, String s, FlowWriter h, double d)
public boolean A(Peer p, int i, String s, FlowWriter h, double d)
{
Publication b = (Publication)C.get(s);
boolean flag = false;
......@@ -111,7 +111,7 @@ public class Streams
return flag;
}
public void B(P p, int i, String s)
public void B(Peer p, int i, String s)
{
Publication b = (Publication)C.get(s);
if(b == null)
......
......@@ -20,13 +20,13 @@ package com.jcumulus.server.rtmfp.application;
* This file is a part of jCumulus.
*/
import com.jcumulus.server.rtmfp.D;
import com.jcumulus.server.rtmfp.ISession;
public class VideoWriter extends StreamWriter
{
public VideoWriter(byte abyte0[], D d)
public VideoWriter(byte abyte0[], ISession d)
{
super((byte)9, abyte0, d);
}
......
......@@ -110,9 +110,15 @@ public class Packet
public byte[] F(int i)
{
byte abyte0[] = Arrays.copyOfRange(D, A, A + i);
A += i;
return abyte0;
if (A > D.length || (A + i) > D.length)
{
return new byte[0];
} else {
byte abyte0[] = Arrays.copyOfRange(D, A, A + i);
A += i;
return abyte0;
}
}
private int F()
......
......@@ -21,7 +21,7 @@ package com.jcumulus.server.rtmfp.pipe;
* This file is a part of jCumulus.
*/
import com.jcumulus.server.rtmfp.P;
import com.jcumulus.server.rtmfp.Peer;
public class C
......@@ -31,7 +31,7 @@ public class C
{
}
public static void A(String s, P p)
public static void A(String s, Peer p)
{
}
......
......@@ -21,8 +21,8 @@ package com.jcumulus.server.rtmfp.publisher;
*/
import com.jcumulus.server.rtmfp.packet.*;
import com.jcumulus.server.rtmfp.D;
import com.jcumulus.server.rtmfp.P;
import com.jcumulus.server.rtmfp.ISession;
import com.jcumulus.server.rtmfp.Peer;
import com.jcumulus.server.rtmfp.application.Publication;
import com.jcumulus.server.rtmfp.application.C;
......@@ -52,7 +52,7 @@ public class A extends com.jcumulus.server.rtmfp.publisher.E
String a;
public A(int i, byte abyte0[], P p, D d)
public A(int i, byte abyte0[], Peer p, ISession d)
{
super(i, abyte0, "NetStream", p, d);
Packet a1 = new AudioPacket(abyte0, abyte0.length);
......
......@@ -20,14 +20,14 @@ package com.jcumulus.server.rtmfp.publisher;
* This file is a part of jCumulus.
*/
import com.jcumulus.server.rtmfp.D;
import com.jcumulus.server.rtmfp.P;
import com.jcumulus.server.rtmfp.ISession;
import com.jcumulus.server.rtmfp.Peer;
public class C extends E
{
public C(int i, P p, D d)
public C(int i, Peer p, ISession d)
{
super(i, Q, "NetGroup", p, d);
}
......
......@@ -22,8 +22,8 @@ package com.jcumulus.server.rtmfp.publisher;
import com.jcumulus.server.rtmfp.packet.*;
import com.jcumulus.server.rtmfp.D;
import com.jcumulus.server.rtmfp.P;
import com.jcumulus.server.rtmfp.ISession;
import com.jcumulus.server.rtmfp.Peer;
import com.jcumulus.server.rtmfp.pipe.C;
import com.jcumulus.server.rtmfp.flow.H;
import com.jcumulus.server.rtmfp.stream.BinaryWriter;
......@@ -49,9 +49,9 @@ public class E
public static com.jcumulus.server.rtmfp.application.C I = new com.jcumulus.server.rtmfp.application.C();
protected int A;
private int J;
protected P K;
protected Peer K;
private boolean G;
private D D;
private ISession D;
private com.jcumulus.server.rtmfp.publisher.D B;
protected com.jcumulus.server.rtmfp.publisher.FlowWriter O;
private Map P;
......@@ -59,7 +59,7 @@ public class E
public E(int i, byte abyte0[], String s, P p, D d)
public E(int i, byte abyte0[], String s, Peer p, ISession d)
{
P = new HashMap();
A = i;
......
......@@ -20,8 +20,8 @@ package com.jcumulus.server.rtmfp.publisher;
* This file is a part of jCumulus.
*/
import com.jcumulus.server.rtmfp.D;
import com.jcumulus.server.rtmfp.P;
import com.jcumulus.server.rtmfp.ISession;
import com.jcumulus.server.rtmfp.Peer;
import com.jcumulus.server.rtmfp.flow.A;
import com.jcumulus.server.rtmfp.flow.B;
import com.jcumulus.server.rtmfp.flow.E;
......@@ -36,7 +36,7 @@ import org.jivesoftware.util.*;
public class F extends com.jcumulus.server.rtmfp.publisher.E
{
public F(int i, P p, D d)
public F(int i, Peer p, ISession d)
{
super(i, S, "NetConnection", p, d);
U = new ArrayList();
......
......@@ -20,7 +20,7 @@ package com.jcumulus.server.rtmfp.publisher;
* This file is a part of jCumulus.
*/
import com.jcumulus.server.rtmfp.D;
import com.jcumulus.server.rtmfp.ISession;
import com.jcumulus.server.rtmfp.packet.*;
import com.jcumulus.server.rtmfp.pipe.C;
import com.jcumulus.server.rtmfp.application.VideoWriter;
......@@ -44,7 +44,7 @@ public class FlowWriter
private boolean K;
private int C;
private byte I[];
private D H;
private ISession H;
private boolean B;
private L A;
private final List P = new ArrayList();
......@@ -60,7 +60,7 @@ public class FlowWriter
public FlowWriter(byte abyte0[], D d)
public FlowWriter(byte abyte0[], ISession d)
{
A = new L();
K = false;
......
......@@ -1361,6 +1361,8 @@ public class MemberReceiver implements MixDataSource, TreatmentDoneListener {
public synchronized void handleWebRtcMedia(int[] data, short sequenceNumber)
{
if (readyToReceiveData() == false) return;
timeCurrentPacketReceived = System.currentTimeMillis();
int elapsedTime = (int) (timeCurrentPacketReceived - timePreviousPacketReceived);
......
......@@ -104,6 +104,8 @@ Strophe.addConnectionPlugin('rayo',
{
var iq = $iq({to: mixer + "@" + this._connection.domain, from: this._connection.jid, type: "get"}).c("join", {xmlns: Strophe.NS.RAYO_CORE, "mixer-name": mixer});
//console.log(iq.toString());
that._connection.sendIQ(iq, null, function(error)
{
$('error', error).each(function()
......@@ -122,9 +124,11 @@ Strophe.addConnectionPlugin('rayo',
var that = this;
var iq = $iq({to: mixer + "@" + this._connection.domain, from: this._connection.jid, type: "get"}).c("unjoin", {xmlns: Strophe.NS.RAYO_CORE, "mixer-name": mixer});
//console.log(iq.toString());
that._connection.sendIQ(iq, function(response)
{
this._onhook();
that._onhook();
}, function(error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment