55

I need to integrate VoIP service in my Android application.
Is there any free (best open source) library ?

I need that the library at least allows voice call over internet and not necessarily internet to phone (like 2 Skype account).

enfix
  • 6,680
  • 12
  • 55
  • 80

3 Answers3

61

From android version 2.3 SIP API is added in Android. you can use either inbuilt SipStack library or third party open source sip stacks.

Refer Android Developer's Guide

There are different open source sip stack libraries as well as projects are available on internet. You can download the source code of that projects.

Here is the List of some popular open source sip stack libraries which allows to voice call over internet.

1.Pjsip
2.Mjsip
3.doubango
4.belle-sip

There are different open source projects which have used these libraries in their projects.like Sipdroid uses MjSip, Csipsimple uses PjSip, imsdroid uses doubango and Linphone uses belle-sip.

You may also like to refer this Android SIP stack - what to use?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Juned
  • 6,290
  • 7
  • 45
  • 93
  • are you able to call and sign in on TLS i am trying using douubango but not luck over TLS on UDP it is working fine – Khan Aug 06 '13 at 10:45
  • @Khan sorry,I didn't dig very deep into this but yeah you can try [Lumicall](http://www.lumicall.org/) which supports TLS and its also an open source – Juned Aug 06 '13 at 11:00
  • I tried to implement CSIPSimple it having 4 or 5 projects and also it shows and error how do you configure it – Khan Aug 21 '13 at 10:19
  • @Khan you have to follow this steps to build its source http://code.google.com/p/csipsimple/wiki/HowToBuild and yes make sure to install all the dependencies – Juned Aug 22 '13 at 04:48
  • 1
    Good luck getting the Android SIP interface to work. A quick google for any working examples outside of their supposed demo will be fruitless. I've [spent hours](https://stackoverflow.com/questions/30241756/failed-to-create-sipsession-network-unavailable) trying to get the demo to connect to a SIP server that works in other clients with no luck, and nobody seems able/cares to address this problem, which is widely reported. It also depends on javax, and even after attempting to build the entire SIP stack in my project can't be done unless you want to build the entire Android OS. – EntangledLoops May 14 '15 at 17:26
  • @juned if i will use android sip apis , which server will host the voip calls ?! google ? or i have to search for a server to host the call? – Ahmed Gamal Nov 25 '15 at 15:20
  • 1
    @Gemi, no google will not host your calls. You can create your own server by installing any telephony engine in your system (local or remote) like Asterisk or Freeswitch, then you're good to go – Juned Nov 26 '15 at 05:14
  • Thank you very much @juned I couldn't up vote an comment so I up voted your answer – Ahmed Gamal Nov 26 '15 at 10:48
  • Its absolutely fine @Gemi, still you face any problem with setting up a server then let me kknow ;) – Juned Nov 26 '15 at 13:20
  • Have you ever build pjsip for android? – Muhammad Babar Mar 31 '16 at 09:31
  • I've used it with CSIpSimple @MuhammadBabar – Juned Apr 20 '16 at 04:50
  • I've tried to use Android's native sip. But, it does not support TLS. So, I've used PJSIP in Android. It has two libraries, one in C (PJSUA) and another in C++ (PJSUA2). PJSUA2 is a wrapper of PJSUA in such a way that other OOP language bindings can be created like Java, C#, python. The library is very fast. Like many open source project, the documentation is not that great. Although, Java binding are generated, You have to have knowledge of JNI, C/C++ to successfully use that.Here is a link for android - https://trac.pjsip.org/repos/wiki/Getting-Started/Android – MARK002-MAB Aug 29 '16 at 18:21
40

Open source SIP stacks :

  1. Android SDK's default implementation (API > 9) :
    Advantages : Documentation available. Easy to understand.
    Disadvantages : not all devices are supported. Can't change codecs.

  2. Third Party

Java :

  • JainSIP (license : Public Domain)

Advantages : Oracle (Sun) project ==> Active development. Looks easier than MjSIP (more documentation).
Disadvantages : Not used in a "famous" app.

  • MjSIP (license : GNU GPL)

Advantages : SipDroid is built on it. (source code available) (red5phone is another project) Disadvantages : Not fully compliant with RFC?. Lack of tutorials (Javadocs available though). SOPHISTICATED. Development almost dead.

  • Doubango framework [android-ngn-stack] (license : GNU GPLv3)

Advantages : IMSDroid is built on it. (source code available)
Disadvantages : Generated apk file size tend to be "heavy" (>15MB as mentioned here)

C/C++ :

  • Native SIP Stacks

Advantages : Various choice (PjSip [CSipSimple], GNU oSIP/eXoSIP [Linphone, which has made their own stack belle-sip]). Full compliance with RFC?. Better performance.
Disadvantages : Android NDK/JNI for a beginner.

Sources (old and mainly C/C++):

http://www.cs.columbia.edu/sip/implementations.html
http://www.pernau.at/kd/voip/bookmarks-sip-stacks.html

JohnTube
  • 1,782
  • 27
  • 46
  • 1
    "Works on WiFi only" --- Hmmm, strange, I just call myself via 3G normally – djdance Jul 25 '14 at 19:26
  • Is there any document reference of "Works on Wifi only" ? – ZhangLei Aug 13 '15 at 06:34
  • @ZhangLei "in most devices, it only works via WiFi, no 3G or LTE (note that `android.net.sip.SipManager` contains method [`isSipWifiOnly`](http://developer.android.com/reference/android/net/sip/SipManager.html#isSipWifiOnly(android.content.Context)) to know if this limitation is enabled)." [source](http://stackoverflow.com/a/20583243/1449056) – JohnTube Aug 13 '15 at 06:52
  • @JohnTube Thank you for your patience. By the way, I found the audio quality always turns bad, with too much noise, when I am using loud speaker both end. (I am trying to use sip stack of android sdk and linphone.) Do you have any idea of that? – ZhangLei Aug 13 '15 at 07:06
  • No sorry I can't help you with that. – JohnTube Aug 13 '15 at 07:12
  • **A miss interpretation!** `Disadvantages : not all devices are supported. Works on WiFi only on most devices. Can't change codecs.` **From the docs:** *SIP runs over a wireless data connection, so your device must have a data connection (with a mobile data service or Wi-Fi).* – Muhammad Babar Mar 24 '16 at 07:59
5

If you need VoIP but not SIP, check out WebRTC http://www.webrtc.org/

Hank Karl
  • 286
  • 2
  • 2