3

I am using native sip apis to implement sip calling in android app and it is working fine but in some devices like CANVAS 3 it was not working .After debugging I found this line of code was returning NULL

 **manager = SipManager.newInstance(ctx);**

That measns that device does not support Sip Apis.But on the same device other application for sipcalling like SipDroid etc are working properly.How it is possible ?Are they do not use native sip Apis???

Sneha Bansal
  • 941
  • 1
  • 13
  • 38

2 Answers2

5

you can go with custom SipLibraries.

Third party open source sip stacks library for Android

  1. Jain sip: http://jsip.java.net/
  2. Pjsip: http://www.pjsip.org/
  3. Mjsip: http://mjsip.org/mjua.html
  4. Doubango: http://www.doubango.org/

There are different open source projects which have used these libraries in their projects.

  1. Jain sip: Not used in a "famous" app.
  2. Sipdroid uses MjSip
  3. Csipsimple uses PjSip
  4. Imsdroid uses doubango.

Open source SIP stacks: Android SDK's default implementation (API > 9) Advantages : Documentation available. Easy to understand. Disadvantages : Not all devices are supported due carriers restriction. Works on WiFi only. Can't change codecs.

Third party: JainSIP Advantages : Oracle (Sun) project ==> Active development. Looks easier than MjSIP (more documentation). Disadvantages : None Android 2.3 using external JAIN-SIP(J-SIP) Stack | Classpath

Third party: MjSIP 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).Development almost dead

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

Followed from

Community
  • 1
  • 1
SilentKiller
  • 6,944
  • 6
  • 40
  • 75
  • Man, your post is exactly like [this](http://www.basic4ppc.com/android/forum/threads/third-party-open-source-sip-stacks-library-for-android-over-b4a.27966/) ;-) – jcm Dec 14 '13 at 12:02
  • @jcm i think i had given the link also. may be updated by someone. – SilentKiller Dec 14 '13 at 12:04
  • sorry, I didn't want to upset only that I recalled the post and thinking that mrodriguez was not very fair regarding Jain SIP. – jcm Dec 14 '13 at 12:13
  • 1
    @jcm its nothing like i had added that link as i had used that thing only. but dont know where that link gone so added again no upset every thing is up and set.. ;) – SilentKiller Dec 14 '13 at 12:18
  • I think my [answer](http://stackoverflow.com/a/15605924/1449056) was copied twice. – JohnTube Aug 13 '15 at 06:48
4

Just to complement SilentKiller response I would forward my answer to this question but, please, keep in mind that choosing a stack is a quite complex task and depends of your goals and preferences.


Android SIP Stack relays on an old JAIN SIP version plus some extensions (IMS, supporting RTP, etc.). Main problem with this stack is that, in most devices, it only works via WiFi, no 3G or LTE (note that android.net.sip.SipManager contains method isSipWifiOnly to know if this limitation is enabled).

On the other hand, pjsip is quite complete, like they say, it's not a SIP stack but a full multimedia communications library. It's really versatile: you can use a huge number of configuration or just run it as a simple user agent. It works with any kind of data connection (not limited to WiFi).

Now the comparison: In my opinion, pjsip is more complete and versatile but more difficult to integrate with you project (with Android SIP Stack everything remains in the SDK environment while, with pjsip, you would need to use the NDK and a JNI library).

My opinion: If you plan to create a very simple SIP app and you don't mind the WiFi limitation, I think, the best would be using native SIP API but, if you plan to improve it and do something more "interesting", I would strongly recommend pjsip. I've used both JAIN SIP and pjsip and, again, my vote goes for psip. But this is just my opinion.


There's also another third party stack that worths checking: Linphone. It is also integrated into your project with a JNI (like pjsip) and is also quite complete but, maybe, a bit more complex and heavy.

Hope this helps.

Community
  • 1
  • 1
jcm
  • 2,568
  • 14
  • 18
  • Thank you so much for such a brief and easy explanation.I tried to integrate pjsip by following steps provided by it but as you already know its quite complex so can you please guide me how should I start it ,I mean what should I need to learn first . – Sneha Bansal Dec 16 '13 at 05:15
  • also in device where it is not working I checked method IsSipWifiOnly and it returned false that means no problem regarding wifi . – Sneha Bansal Dec 16 '13 at 06:22
  • @Bansal_Sneha Yes, no problem. First step is to get used to build pjsip for android, please, check [this](http://stackoverflow.com/a/20194563/1419134) response to get a step by step guide of this. – jcm Dec 16 '13 at 09:43
  • sorry for this question but I am not getting how to implement pjsip lib in my so I have build csipsipmple project and it is well running .Can you please tell me how to use its jni or is it possible to use it or not ? – Sneha Bansal Jan 07 '14 at 09:36
  • @Bansal_Sneha Sorry but, although I've some experience with CSipSimple source code, I don't know its JNI very well. Of course it would be possible to use it in your project (you can check src/com/csipsimple/pjsip package to get some hint about how to interact with generated library) but, I think, it would be quite complex. Usually, you should create a JNI library wrapping pjsua calls and add it to your project. You can use pjsip-apps/src/samples/simple_pjsua.c (very simple SIP client) as reference to create this wrapper. – jcm Jan 11 '14 at 09:55