Integrate JsSip with react native webrtc

We are using JsSIP to integrate Turbobridge conferencing in our react native application. The desktop (browser) version is working correctly. But the iOS app using react native webrtc is not getting any streams. Below code snippet is for react native

connectWS = () => {

const connectParams = this._connectParams;
this.setSipURIs(this._connectParams.toSipURI, this._connectParams.fromSipURI);
var configuration = {
uri: this.fromURI,
register: false,
};

configuration.sockets = [new JsSIP.WebSocketInterface(connectParams.wsSipURI)];
this.ua = new JsSIP.UA(configuration);
this.ua
.on(‘connected’, () => {
this._call = () => {
const eventHandlers = {

                    peerconnection: e => {
          this._peerConnection = e.peerconnection;
          e.peerconnection.onaddstream = e => {            // not getting streams here 
               this._ontrack(e);

                this._setState(STATE.CONNECTED);
           };

            if (this._hasTransceivers && !this._sendingAudio) {
               e.peerconnection.addTransceiver('audio');
           }
       }
              }
           }
 })      
 .start();

};

Any suggestion/insights would be helpful.

Thanks,

Got following response from JsSip thread https://groups.google.com/forum/#!topic/jssip/QUrmdYqimmg

JsSIP does not listen for “addtrack” or “addstream” in the peerconnection. Instead JsSIP exposes the peerconnection to the app (via rtcSession.connection) and it’s up to the app whether it wishes to listen for “addtrack” or “addstream” events into it. Said that, if react-native-webrtc does not emit “addtrack” there is nothing JsSIP can do about it. So please, check whether react-native-webrtc emits or not “addstream” and/or “addtrack”.

1 Like