SipApi not supported by some device

2020-02-29 10:44发布

问题:

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???

回答1:

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.



回答2:

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