Logo Questions Linux Laravel Mysql Ubuntu Git Menu

Android-ready JAIN-SIP library?


I am developing (trying to develop) a VoIP SIP application for Android, and after two weeks of bickering with mjsip, pjsip and the sdk's libraries, I have settled on JAIN-SIP. The libraries look great, in theory. No need to learn any android native code, lots of documentation (yet not enough, since I'm here), etc.

My first attempt was using the Android SDK's SIP libs (yes, I know they're based on JSIP), and it failed after the SipManager.open() refused to open the profile for communication with the server, with no exceptions or any sort of output to help me diagnose the issue. (If you have a potential solution please look here) After dicking around with mjsip and pjsip I decided that, being on a schedule, it would take too much time to figure out the native code, so JAIN seemed like the perfect solution... or is it?

Problem is- the JAIN SIP libraries use the same name, in the packaging, as java's core libraries, therefore causing a dex issue with dalvik. But ok- theres an "ant make all-android" solution to build the sip stack source into a single .jar prepared for android. WRONG. Only the "gov.nist" packages get refactored, leaving the "javax" packages as they were before, causing the same dalvik dex problems. But wait!- theres JarJar, a tool that repackages your jar and refactors the packages, resolving the dex conflict. WRONG. Repackaging using JarJar also renames the references to the actual javax.net packages that the stack requires for encryption and whatnot, causing exceptions and crashes and all sorts of issues. So I spent the majority of yesterday refactoring the javax libraries by hand, which led to

 ...Caused by: java.lang.Error: Unresolved compilation problem:

So here are my questions...

  1. Has anyone come across any android-ready jain-sip libraries that really work out of the box, without the need to rename,repackage, and refactor?
  2. Maybe my JarJar rules are wrong? Can someone provide me with rules to rename all the packages and references to "javax.sip" and "javax.sdp", but NOT "javax.net"?
  3. Are there any other SIP libs for android (that dont require any knowledge of the NDK or native code)?
  4. Why is this still such a pain in the back in 2014?

P.S. Before pointing me to a google page or other stackoverflow questions, consider that I've been stuck on this for two weeks now, doing nothing else but trying to solve the issue- I can assure you, the internet has been thoroughly searched and the solutions either don't apply or don't work.

Edit May 2016 - The accepted answer is now out of date, refer to thejoelpatrol's response below for the newer solution. HERE

like image 359
Linas Martusevicius Avatar asked Mar 18 '23 10:03

Linas Martusevicius

2 Answers

You can find Android specific JAIN SIP packages renamed to com.telestax here https://mobicents.ci.cloudbees.com/job/jain-sip/ (android-jain-sip-ri jar) that we have built at TeleStax to overcome the native JAIN SIP Android issues. We are working on creating a Mobile SDKs that integrate WebRTC media as well so it's easier to implement messaging and video calls in native Android Apps We will create a blog post in the coming days on how to set things up. I'll update the thread here once this is done

like image 128
jeand Avatar answered Mar 29 '23 19:03


The accepted answer is out of date. The official builds now include a version suitable for Android, linked from the homepage: https://jsip.java.net/

I'm using them now and can confirm that they work fine.

like image 29
thejoelpatrol Avatar answered Mar 29 '23 17:03