Stanza.io Could not create WebRTC answer

369 views Asked by At

Im using ejabberd + stanza.io to make a realtime messaging website, everything is working perfectly. now im willing to implement Webrtc audio/video using the jingle protocole. this is my JS code that i use to connect:

var client = XMPP.createClient({
  jid: xmpp_user+'@'+XMPP_DOMAIN,
  password: cu.auth.user_password,
  transport: 'websocket',
  wsURL: "ws://"+xms+":5280/websocket/"
});


client.jingle.config.debug = true;


client.on('session:started', function () {
  client.enableCarbons();
  client.getRoster(function (err, resp) {
    client.updateCaps();
    client.sendPresence({
      caps: client.disco.caps
    });
  });
});

client.connect();

the problem is when i call the user from an other app (AstraChat: iOS app that support Jingle) i get this in browser log:

Jingle: 67bzrsog243: session-initiate undefined undefined
Jingle: 67bzrsog243: Could not create WebRTC answer undefined undefined

this is the xml that astrachat is sending:

<iq xmlns='jabber:client' xml:lang='en' to='[email protected]/352555070032013318140962' from='[email protected]/AstraChat-iOS-21820150' type='get' id='3e8kjajc22'><query xmlns='http://jabber.org/protocol/disco#info'/></iq>
<r xmlns='urn:xmpp:sm:3'/>
<a h='1' xmlns='urn:xmpp:sm:3'/>
<a h='2' xmlns='urn:xmpp:sm:3'/>
jingle:created
iq:set:jingle
<iq xmlns='jabber:client' xml:lang='en' to='[email protected]/352555070032013318140962' from='[email protected]/AstraChat-iOS-21820150' type='set' id='3e8kjajc23'><jingle xmlns='urn:xmpp:jingle:1' action='session-initiate' initiator='[email protected]/AstraChat-iOS-21820150' responder='[email protected]/352555070032013318140962' sid='3e8kjajc24'><content creator='initiator' name='voice'><description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'><payload-type id='101' name='speex' clockrate='8000'/></description><transport xmlns='urn:xmpp:jingle:transports:ice-udp:1' pwd='TC5NsD6IEQGXeDO8d5/3OU' ufrag='yA0z'/></content></jingle></iq>
<r xmlns='urn:xmpp:sm:3'/>
Jingle: 3e8kjajc24: session-initiate undefined undefined
Could not create WebRTC answer undefined undefined

i really have no clue on how to fix that, any help will be appreciated.

1

There are 1 answers

2
Philipp Hancke On BEST ANSWER

the session-initiate from Astra chat is this according to your logs: <iq xmlns="jabber:client" xml:lang="en" to="[email protected]/352555070032013318140962" from="[email protected]/AstraChat-iOS-21820150" type="set" id="3e8kjajc23"> <jingle xmlns="urn:xmpp:jingle:1" action="session-initiate" initiator="[email protected]/AstraChat-iOS-21820150" responder="[email protected]/352555070032013318140962" sid="3e8kjajc24"> <content creator="initiator" name="voice"> <description xmlns="urn:xmpp:jingle:apps:rtp:1" media="audio"> <payload-type id="101" name="speex" clockrate="8000" /> </description> <transport xmlns="urn:xmpp:jingle:transports:ice-udp:1" pwd="TC5NsD6IEQGXeDO8d5/3OU" ufrag="yA0z" /> </content> </jingle> </iq> which only offers the speex audio codec that WebRTC does not support (opus or G.711 are mandatory). Also there is no encryption which is mandatory in WebRTC.