SIP support for Cordova/Phonegap
Asked Answered
G

4

8

Is there any possibility to use SIP in Cordova/Phonegap? I've not found any plugin, yet. Support for WebRTC is also not available (but planned in 2.x, according to their roadmap).

Greenhaw answered 14/5, 2013 at 11:22 Comment(1)
#15352737Torruella
C
2

Supporting SIP or WebRTC on Android has nothing to do with PhoneGap/Cordova, even though they could be added as some extension but naturally they come with the browser provided to PhoneGap by the OS. Right now you need to look for external libraries to do that for you.

You may add an extension to your PhoneGap (written in Java) yourself to communicated to some SIP server. Or if you would like you can use a Javascript library to implement the SIP protocol for you (like sipml5) but if you choose to use this late solution, your browser needs to support Websocket or WebRTC (both are applicable). As far as I know browser plugin provided to PhoneGap by Android does not support neither of the mentioned technologies, but my knowledge is for 6 month ago. Back then I tried to implement my own Websocket PhoneGap extension to provide the PhoneGap with Websocket. But I've never tested it with sipml5 and have no idea what problems you might encounter.

Chrisoula answered 28/5, 2013 at 5:23 Comment(0)
B
2

There are two parts to implement WerbRTC in cordova:

  1. SIP Communication to make call (send invite req) or receive incoming call (receive invite req)
  2. Then RTP communication to make ICE Channel for sharing media (voice or video)

For first part I used sipjs for IOS & android platforms. But for second part, I use different plaugins base each platform:

  • For Android, you don't need any platform for Android now supports WebRTC in their standard WebView or you can use Crosswalk to have some feature like re-invite automatically when Mobile device switches between WIFI / Mobile data such as 3G, 4G and LTE.
  • For IOs, I recommend to use eface2face cordova-plugin-iosrtc

If you need more information let me know.

Bouzoun answered 15/12, 2016 at 3:34 Comment(1)
Hi @Shadmehr, I tried using sipML5 and Crosswalk, with cordova-plugin-websocket , the sipML5 call the phone successfully on cordova but no sound, on desktop browser everything works great. With cordova-plugin-iosrtc, i got error when the call is connected ( error when Attaching Media )Elbow
T
1

You might be able to load sipml5 directly within your Phonegap application if the WebRTC support is available:

    <script type="text/javascript" src="js/SIPml.js"></script>

    var readyCallback = function(e){
        console.log('SIP initialized');
    };
    var errorCallback = function(e){
        console.error('Failed to initialize the engine: ' + e.message);
    }
    SIPml.init(readyCallback, errorCallback);

The Android emulator doesn't seem to support WebRTC, as I get this error:

Uncaught ReferenceError: tsk_utils_init_webrtc is not defined at file:///android_asset/www/js/SIPml.js:203

I haven't tried this on a real device ...

Torruella answered 26/5, 2013 at 1:5 Comment(4)
I've already tried that but WebRTC-Support is not available in PhoneGap/Cordova (is on roadmap for 3.0 AFAIK)Greenhaw
Cordova Roadmap for version 3.x includes WebSockets/WebRTC according to: wiki.apache.org/cordova/RoadmapProjectsSimar
@glutorange: Have you tried sipml5 now that Cordova has Websockets/WebRTC included? We are now also searching for a solution using WebRTC over SIP with Cordova. Any suggestions?Undulation
@Mark Veenstra: Sorry, that project has been abandoned. I'm working in other projects now and do not know if there was any progress since I left the project.Greenhaw
S
0

A proof-of-concept Cordova app that uses SIP.js with the PhoneRTC plugin to make WebRTC calls over the internet.

https://github.com/joseph-onsip/sipjs-cordova

Simar answered 13/8, 2014 at 0:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.