Using ErizoAPI without erizo controller, status 500 after sending SDP answer

Hi Everyone!

First of all, Happy New Year!

I am trying to use only Erizo and Erizo API as we have our own signalling
protocol and room management infrastructure.
The infrastructure was originally built for Kurento, but Licode handles low
bandwidth scenarios much better, so we’d like to use it.

What I am trying to achieve is to be able to use the same low level Node
interface for Kurento and Licode.
As the low level interface of Kurento is better documented and I already
have my code written for that, I decided to write a wrapper around
the Erizo API (the native node module) with the interface of the Kurento
Node API.
I’d like to make it open source once it works as a commitment to the
community.

But I think I have missed something while trying to understand how erizo
controller works and my code won’t work.

I can create a WebRtcConnection, which receives the 102 status, creates the
SDP answer and after the callback I send it back to the client:

if(!connection) connection = new addon.WebRtcConnection(true, true, stunServer, stunPort, min, max);
connection.setRemoteSdp(sdpOffer);
connection.init(function(status) {
if(status === 102) {
var sdpAnswer = connection.getLocalSdp();
if(publicIP) sdpAnswer = sdpAnswer.replace(localRegexp, publicIP);

    callback(sdpAnswer);
}
else if(status === 103) {
    if(muxer) muxer.sendFIR();
}

});

I also was able to instantiate the OneToManyProcessor in the callback:

if(!muxer) muxer = new addon.OneToManyProcessor();

connection.setAudioReceiver(muxer);
connection.setVideoReceiver(muxer);
muxer.setPublisher(connection);

The client accepts the SDP answer (which is exactly the same as when it was
created by erizo controller), but the status 103 never gets received,
instead I get a status 500 (which means ICE failure) and also the client
side log states ICE connection failure.

I think this might be related to the client code of mine (which is also not
erizo.js, but a custom implementation based on SimpleWebRtc).
But I don’t know what can be wrong with it. I configure the
WebRtcConnection with the same STUN server as on the server side and also I
have a working TURN server added. I also set every constraint the same way
erizo.js does, the only difference is that instead your roap messages I use
my own protocol.

My protocol, the room infrastructure and all my code was tested with
Kurento, so it should not be the cause of this problem.

So my questions:

  1. What could be the problem with the ICE negotiation?
  2. Since I am not using erizo agent I don’t have any logs. What should I do
    to enable logging for Erizo?

Thank you for your help,
Adam