Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SIP support for Cordova/Phonegap

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

like image 746
glutorange Avatar asked May 14 '13 11:05

glutorange


2 Answers

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.

like image 151
Mehran Avatar answered Oct 01 '22 16:10

Mehran


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.

like image 41
Shadmehr Avatar answered Oct 01 '22 16:10

Shadmehr