Anyone try the eFace2Face Cordova Plugin for iOS webRTC with SIP.js?

594 views
Skip to first unread message

SD

unread,
Oct 21, 2015, 11:52:05 AM10/21/15
to SIP.js
Perhaps this is a path to getting applications using SIP.js and webRTC working on an iOS (iPad / iPhone) system?



This plugin exposes the WebRTC W3C API for Cordova iOS apps (you know there is no WebRTC in iOS, right?), which means no need to learn "yet another WebRTC API" and no need to use a specific service/product/provider.



SAMPLE


What do you think?
thanks

Warren McDonald

unread,
Oct 21, 2015, 6:08:40 PM10/21/15
to SIP.js
I have done some testing and can say that it is not compatible with 0.7.x, but is broadly compatible with 0.6.4.

In 0.6.x there is a glitch in ICE Server array handling that prevents TURN servers being passed to eface2face. I fixed this by backporting the 0.7 ice server array handling to 0.6.4.

So out of the box you are stuck between 2 versions without a bit of hacking.

My testing was not exhaustive by any means, just enough to establish base compatibility for voice and video call to a media server.

Will Mitchell

unread,
Oct 21, 2015, 6:27:17 PM10/21/15
to SIP.js
Hey Warren,

I haven't had much bandwidth lately to play around with mobile, but I'm surprised that 0.7.x doesn't work similarly to 0.6.4.  Did you by any chance dig into that at all?  If it's a quick patch, I'd be happy to pull it in.  It may fall short of official support, but at least we'd remove another reason to use an older version.

-Will

SD

unread,
Oct 21, 2015, 9:38:43 PM10/21/15
to SIP.js
I would love to give this a try, but not sure where to begin.
Thanks for your help!

Sean Langley

unread,
Nov 18, 2015, 10:07:52 PM11/18/15
to SIP.js
Hey SD,

I dug into it a little bit, and the big thing with Sip.js and the Cordova plugin is initialization.

For eface2face to work seamlessly it waits for deviceready to register the globals that the browser based WebRTC implementations provide.

SIP.js v0.7.x attempts to check if WebRTC is available at load time, which ends up being way before the eface2face registration happens.

I've been able to work around the problems and have 0.7.2 working with eface2face cursorily (ie not fully tested) with the following modification to their suggested 'deviceready' handler.

Can anyone suggest a method I can use to modify SIP.js such that a pull request will be accepted so this hack doesn't need to be done?

document.addEventListener('deviceready', function () {
// Just for iOS devices.
if (window.device.platform === 'iOS') {
cordova.plugins.iosrtc.registerGlobals();

SIP.WebRTC.isSupported = function isSupported() { return true; }
SIP.WebRTC.MediaStream = cordova.plugins.iosrtc.MediaStream;
SIP.WebRTC.getUserMedia = cordova.plugins.iosrtc.getUserMedia;
SIP.WebRTC.RTCPeerConnection = cordova.plugins.iosrtc.RTCPeerConnection;
SIP.WebRTC.RTCSessionDescription = cordova.plugins.iosrtc.RTCSessionDescription;
}
});


Thanks!
Sean

Will Mitchell

unread,
Nov 19, 2015, 10:44:50 AM11/19/15
to SIP.js
> SIP.js v0.7.x attempts to check if WebRTC is available at load time, ...

This shouldn't be the case.  The way we set it up, we only check for the WebRTC globals exist the first time `SIP.WebRTC.isSupported` is called, which is usually when the first Session is created.  If this isn't happening, we should open an Issue to track it.  Are you perhaps using a custom media handler or creating media streams at load time?

-Will

SD

unread,
Nov 21, 2016, 10:33:33 AM11/21/16
to SIP.js, slan...@popcornlabs.com
Sean,
Your post was extremely helpful.   I am testing the eFace2Face plugin on iOS with SIPjs  0.7.5 and I was able to make it work only after making your suggested changes.
thanks!

Will, 
I suspect the issue that Sean has identified related to  isSupported()  executing prior to expected first use may still be an issue with 0.7.5

thanks!




On Wednesday, November 18, 2015 at 10:07:52 PM UTC-5, Sean Langley wrote:

Michael Hartomo

unread,
Sep 4, 2017, 5:10:10 AM9/4/17
to SIP.js, slan...@popcornlabs.com
Hi SD,

Would you please give me an example?

I have tried to implement latest ( and 0.75 on ) sipjs with latest iosrtc but got crash when getting user media stream.

Thank you
Reply all
Reply to author
Forward
0 new messages