SIP and WebRTC

We are investigating solutions that we could use to build video and voice calling in our Ionic application. The requirement is that our solution can be attached to another company using the SIP protocol. Therefore we are looking into solutions that use SIP with WebRTC (for media).

There are a few projects that only support WebRTC and no SIP, like:
TokBox: Problem is here we could never add a SIP layer to this plugin, because there is no configuration for hosting your own servers. You are bound to there signaling and TURN/STUN servers.
PhoneRTC: Completely opensource and ability to host your own servers.

So we had a deeper look into PhoneRTC and found that someone from JSSIP was trying to add a SIP layer to it with the project jssip-cordova. Unfortunaly after a short time he decided to stop this project and it will be deleted soon as mentioned in this issue.

We are in need of a solution for both Android and IOS. And since Crosswalk has been added to Ionic it should be possible for the Android solution to use Ionic + Crosswalk + JSSIP to be able to connect to our Asterisk server. Only issue we will have then is that there is no solution for IOS (yet).

I have been looking into the roadmap of Crosswalk for IOS and found this JIRA enrtry. In this issue it is mentioned that Apple has a strict policy regarding browsers and webviews. They always need to use the Safari rendering engine. Which makes me think if it will ever by possible for Crosswalk to add WebRTC support to IOS? If not we are stuck with Android and we could not use the same solution for IOS in the future.

Also Cordova hasnā€™t added WebRTC support yet and is still on the roadmap (if this link reflects the roadmap): https://wiki.apache.org/cordova/RoadmapProjects

So after all this research I am kinda stuck/lost howto get a solution for Android and IOS using SIP and WebRTC together. I was wondering if other people could help me to get on the right track?

So in the basics we need a solution for voice and video calling (any protocol is OK). But this solution should be attached to an SIP (Asterisk) server. This because we need to add a SIP trunk from our SIP server to other SIP servers. And IOS and Android should be supported as well as common browsers.

Any suggestions are welcome!

EDIT:
I came across http://build.rtc.io/. Which claims to enable WebRTC on IOS. See some explanation here: https://groups.google.com/forum/#!topic/rtc-io/JYLNYGRltHs. But I am wondering if it would be possible to use this cloud build, because Cordova will maybe not be wrapped with it (if you send the platforms folder).

2 Likes

Not sure if youā€™ve seen this

http://phonertc.io/

@mhartington well I did, but integrating SIP wasnā€™t that easy according to a developer of JSSIP: https://github.com/versatica/jssip-cordova/issues/1#issuecomment-70574781

Maybe Ionic could integrate Webrtc in IOS like build.rtc.io does?

Or crosswalk should release something for IOS with Webrtc enabled

Hmm, are you tied into using JSSIP?

Seems theres this project as well.

If that doesnā€™t work for you, you could try the WKWebView plugin by @EddyVerbruggen, though its still a beta right now. Other than that, Iā€™m not sure what can be done.

@mhartington I have tried sipjs-cordova, but this is also based on PhoneRTC 1.0. And PhoneRTC released a version 2.0 a few months ago. SIPJS is not converting to PhoneRTC 2.0.

Also there a few problems with PhoneRTC:

  • It is not 64-bit compatiable at the time of writing
  • It doesnā€™t allow you to resize video container etc.

I have looked at your suggestion to the WKWebView plugin, not sure if WebRTC is enabled in it, so I contacted @EddyVerbruggen to see if he can clarify. Thanks for the tip!

Hi Mark,

I remember skimming through Intelā€™s documentation a while ago when I found out they ā€œsecretelyā€ released an open source WebRTC SDK. I used one of their scripts for signaling to do a crosswalk video call application prototype on android, but didnā€™t do too much digging into what else they had in there.

I know they made a significant investment into WebRTC and crossplatform hybrid applications so thereā€™s a chance they might have something youā€™re looking for. Once I find the links buried somewhere in my 500 bookmarks Iā€™ll try to post back here.

The other one that might be worth checking out is SightCall, they built some kind of drivers/plugin so its cross browser and they have iOS and Android SDKs (although I believe they are native environment solutions), from what I recollect they had both WebRTC and sip.

Stay in touch let me know how it goes, there arenā€™t many guides on this kinda stuff so Iā€™m always looking for people with a similar knowledge pool in this area.

Antonvoltchok1@gmail.com
@antonvoltchok

I just remembered about this one too:



https://github.com/joseph-onsip/openwebrtc
The good people at EricssonResearch decided to open source all of their work. Itā€™s a lot to dig through, let me know if it helps.

Antonvoltchok1@gmail.com
@antonvoltchok

Hi Anton,

Thanks for these updates. I have been looking into SightCall a while ago, just before they acquired Weemo. Weemo did have a Cordova plugin in the past, but they quit the development of it, because it was taken to much resources (as they have told me).

From what I have understood, SightCall doesnā€™t provide a Cordova plugin and it is not yet on their roadmap either.

OnSip does have a Cordova plugin build on top of PhoneRTC: https://github.com/joseph-onsip/sipjs-cordova. We have tested PhoneRTC standalone (https://github.com/alongubkin/phonertc) and we where not excited by itā€™s capacities. The audio / video is somewhat laggy and you donā€™t have that much control over the lay-out. Also notice this issue: https://github.com/versatica/jssip-cordova/issues/1.

We have read the Ericsson release of OpenWebRTC and their own bowser browser. But I canā€™t figure out if this could be of some help for us.

At this point we are developing a pure WebRTC solution without SIP based on TokBox and their OpenTok plugin. But we would like to add SIP functionality and are now investigating some alternatives, which would be (to my opinion):

  1. Build a own solution based on Asterisk + WebRTC and make use of JSSIP and CrossWalk. Only we donā€™t have any solution for IOS yet with this option.
  2. Build a own solution based on Astiersk + WebRTC and build a own Cordova plugin that supports SIP + WebRTC on both Android and IOS and that can connect to any SIP server with WebRTC enabled.
  3. Search for a third party, like www.apidaze.nl and or partner up and let them build a Cordova plugin or do it yourself or do some more digging and find partners that has all.

Regards,

Mark

EDIT:
As soon as Apple adds WebRTC capabilities to Safari. Or maybe better said to the render engine of the browser. With JSSIP all should be covered ofcourse.

Honestly I feel like Apple is the new Microsoft in terms of holding the internet back these days, I know they will fight WebRTC as long as possible because of their own HLS. Even Microsoft gave in and accepted reality.

I found one one of those Intel links, now that I read your reply, not sure how much help itā€™s going to be but it includes:
Conference Server, Gateway Server for SIP as well as the Client SDK.
Conference Server enables not only P2P style communication, but also the
efficient WebRTC-based video conference. Gateway Server for SIP provides
the WebRTC connectivity into SIP conferences.
https://software.intel.com/sites/landingpage/webrtc/# ā€”> download section has the documentation.

Also I canā€™t remember at the moment, but there were these 2 solutions for iOS browser worker-arounds, also buried deep within my bookmark mountain, Iā€™ll take a loot later see if I can find it.

(Are you on twitter or anything? Seems this thread is turning into an email correspondence haha)

wkwebview also not support webrtc~

Hi Anton and Mark, Iā€™m quite interested in the topic as well. Have you guys found any other viable alternatives which allow for legacy sip integration as well as a decent webrtc implementation which can also support mobile clients?

At this moment we are going down 2 paths at the same time:

  1. Integrate pure WebRTC with Tokbox solution (OpenTok for Cordova)
  2. Integrate a SIP with WebRTC solution: JSSIP + Asterisk + Kurento

The SIP with WebRTC has a few issues at the moment, being:

  1. No support for IOS (yet)
  2. At this moment video is not working in our setup, but audio does.
  3. All seems a bit early to use in a production enviroment

Understoodā€¦ We are also looking at Opentok for the short term, although having a tight vendor lockin is a very bad point for usā€¦

Just to be clear, and in case you cant divulge its OK, why are you using Kurento in this setup? Also, in this setup couldnt you use some SIP ios solution to connect into the Asterisk server? (Assuming the Asterisk is dumping/proxying all relevant info to Kurento, using JSSIP or SIP shouldnt be an issue?)

In our case its a closed loop one-on-one or one-to-few chat that we are trying to accomplish, while still having a requirement to receive a call from a legacy SIP server. (In our case we even need to register on this specific legacy proxy, so things are a bit more complex)ā€¦ We are still looking for optionsā€¦

Are you at liberty to say what you are pursuing in terms of goals and why you set upon using JSSIP, Asterisk and Kurento? I looked at JSSIP and Kurento specifically and havent made any decision yetā€¦ (Our setup has the legacy sip proxying requirement as an extra barrier, but even if we split it up into 2, and just think of it as ā€œsomething to replace opentokā€, would your solution jssip+asterisk+kurento fit the bill nicely? can you give some idea of why you chose this as opposed to other solutions?)

Iā€™ve looked at a bunch of stuff, tested a handful of different webrtc servers, gateways, etc and still empty handedā€¦ Iā€™ve looked in some form or another at: easyrtc, opentok, bistri, happyrtc, kurento, ovx, phonertc, sipjs, simplewebrtc/otalk, janus, rtpengine, quickblox, jitsi, kamailio, sipml5/webrtc2sip, oversip, jssipā€¦

The ā€œrequirementsā€ (more of a wishlist at this point):

  • one-to-one & one-to-few (no more than 2 or 3 reqd) audio and audio/video / 1 way only audio or 1 way only video.
  • recording of sessions for later replay.
  • connect by desktop browser
  • mobile app sdk
  • [register on a sip proxy to receive audio call] -> this is for compatibility with an existing application: currently a sip applet is used. we have many NAT problems, etc.
  • reliable nat traversal, etcā€¦ (using https or socket for signalling through proxies and firewalls?)

We will be using Kurento or some kind of media server/mixer in out setup because of the following reasons:

  1. Imagine a call between user A, B, C and D. When you donā€™t use any media server/mixer. User A will do an upload to user B, C and D, also user A receives streams from B, C and D. Same applies to other users. Meaning every user opens a specific stream to the other users. On a desktop / laptop maybe it wonā€™t give you any problems (maybe with 16 users it will). But on a mobile device this isnā€™t a good practice, for the data usage and processor power to our experience.
  2. If you will be using SIP hardphones with video to your Asterisk server. These phones will most likely use H.264 video codec. So if you want to be able to have a video call between WebRTC client and a SIP hardphone client someone needs to do some video transcoding.
  3. If all media went peer-to-peer then you wouldnā€™t be able to record any video session, would you?

We are looking into JSSIP + Asterisk + Kurento because of the following reasons:

  1. Our users want the ability to always call a ā€˜traditional telephone lineā€™.
  2. Kurento is needed for above reasons (or some other media server if that seems to do a better job)
  3. Connect through browser, android and ios (ios is still an issue)
  4. Ability to add other SIP services to the platform

Hi Mark, thanks for your in-depth comment. It makes a lot of sense.

We will be trying something quite similarā€¦ I have been looking at Janus in some detail and it seems to offer some interesting functionality/possibilities, although it can be looked at as more of a framework than a server in itself. Iā€™ll need to get a Kurento instance up to really evaluate.

Thanks!

To all following an reading this thread. Some people finally added a WebRTC plugin to Cordova that exposes WebRTC on IOS, check this GitHub: https://github.com/eface2face/cordova-plugin-iosrtc

1 Like

At this moment TokBox is creating a new community-based Cordova plugin for WebRTC support. The plugin can be found on the cordova-plugin-opentokjs GitHub page. Please note that it is still in development at this moment. But everyone is working towards a 1.0.0 release.

We have added also an Ionic example based on the Ionic tabs starter project. The example can be found on our cordova-plugin-opentokjs-example GitHub page.

Noticed this yesterday https://www.sinch.com/products/voice-api/sip-integration/

1 Like

Integrating Bowser will save all the VOIPers! it will become rediciusly easy to manage voice and video calls with its full webRTC support.
as I said here im wiling to volenteer for this integration project. any one who see the benefits it might bring welcome to help me and announce it on the topic.

Hi all,

It is good to see I am not alone ā€˜fighting the crimeā€™. I need to start a complex media project based on mobiles (Android and iOS) and I do not have clear path to follow. Reading this thread I added a couple of things to look (Crosswalk or some cordova plugins), but after considering the rest of libraries/media servers/framewroks as you did, I am still lost (well, it is important to mention that I do not have time for doing proof of concepts because I need to have something to show in two months time :frowning: ).

In short: I am in the same position as @markdark @rvn were some months ago: ā€œchoosing/investigating technologiesā€, so, let me ask some questions and have a chance to finish something (please):

@rvn, @markdark if today you had to start a media project for phones, which technology you would use (SIP is not needed) for the client side (remember: iOS and Android devices)?

At the beginning I thought to use phoneRTC because it includes the Googleā€™s WebRTC implementation and instead of using its built-in backend modify the js files for using the JS wrapper which Kurento offers (or Licode), but I am terrible dissapointed when @markdark mentioned the performance was not good as it should be. I considered as well OpenTok but I ā€œcan notā€ use any commercial solution, so would you give Crosswalk a chance? It looks like it included WebRTC for iOS and Android, doesnā€™t it?

Do you know if CrossWalk when it is used inside ionic does it include everything related with WebRTC? If Crosswalk does not work which cordova/ionic plugins would you use? Maybe [this one][1] for both ios and Android 4.4+?

In the backend I am going to use Kurento as well (need to record conversations, control users, moving, extending, joining automatically chat roomsā€¦, so a Media Server is needed and it looks they have a constant development. I will give them a chance)

Something that I am missing? Of course if you have any question, feel free to ask me whatever needed.

I really appreciate your help. Thanks in advance,

Adolfo

PS. This thread brought me some hope in order to save time and start since the beginning following a valid path. Thanks.
[1]: https://github.com/eface2face/cordova-plugin-iosrtc

1 Like