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.
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.
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