3

I'm trying to use the JAIN-SIP (J-SIP) library on Android 2.3.3. (http://jsip.java.net/) Therefore I utilized a very basic SIP-example app that comes with the SIP-Stack. This example runs perfectly on Android devices <= Android 2.2.

The problem ist, that Android 2.3.3 brings a SIP-Strack with it's system-libraries, which is a slightly modified version of the JAIN-SIP stack. So on Android 2.3.3 devices, the internal SIP-Stack is loaded (because of same package/library names) instead of the JAIN-SIP that comes with the APK and the application crashes with "function not found" exceptions (due to the fact that some functions don't exist in this internal Android 2.3.3 SIP-Stack).

What I wan't to know is, how I can "priorize" my JAIN-SIP stack that comes with the APK and ignore the Android system SIP-Stack.

One Solution is using the internal SIP-Stack directyl, which is strongly discouraged, because no one knows if it's not further modified with the next Android releases.

The other solution that came to my mind is changing the package names of "my" JAIN-SIP stack that it is not mixed up with the internal SIP-stack.

The uses-library declaration in the manifest.xml does not work, because it's only for internal SDK-libs / SDK-Addons.

Any more ideas?

sweisgerber.dev
  • 1,726
  • 17
  • 36
  • Could you please help me to understand how you did this and how i can bring about the same thing into my Froyo stack? – Navaneeth Sen Jun 30 '11 at 06:21
  • I used the refactoring functions of the Eclipse IDE. Just Refactor->Rename the base packages of the SIP-API and the SIP-RI. After that you have to search in the whole API & RI for "gov.nist". There are ~5 strings with hardcoded packagenames that Eclipse did not detect. And finally fix the constants in *.core.PackageNames.java and you are done. BTW: On Android 2.2 and less the J-SIP (JAIN-SIP) API and RI runs out of the box. – sweisgerber.dev Jul 01 '11 at 07:58
  • I tried to download the J-SIP, but it is leading me to a svn like page. From where can i get the source? – Navaneeth Sen Jul 01 '11 at 09:52
  • `svn co https://svn.java.net/svn/jsip~svn` – sweisgerber.dev May 08 '12 at 09:39

2 Answers2

4

We are considering shipping jars which would allow to embed the JSIP Stack into any Android devices by renaming all the javax classes with a post convert tool and publish the jar along with the regular jsip jars. See https://groups.google.com/d/topic/mobicents-public/UD7ZTX74Yrk/discussion

Jean

jeand
  • 2,325
  • 14
  • 12
  • Thx jeand, great idea. In my opinion, that's something google should have done before including it on the platform :) Same goes for the crippled BouncyCastle library, which is included... – sweisgerber.dev Dec 20 '12 at 10:04
  • Sorry for the time it took to implement it but it's now ready, see our post at http://www.telestax.com/jain-sip-stack-for-android/ which allow you to integrate the latest JAIN SIP in android without conflicts. The post uses as an example a chat messaging application – jeand Sep 30 '14 at 12:23
2

I applied my proposed solution and renamed the packages of the JSIP-stack, via the Eclipse Refactoring function and got the JSIp stack working on Android 2.3.3 Emulator and device. There are package-path strings in the samples and in the class "SipStackImpl.java" which should get renamed (find/replace) by hand to new new package paths.

I tested it with the shootist and shootme samples from the JSIP stack.

It also ran on Android 2.2 in the Emulator.

If someone could come up with a better solution, I would apreciated it.

sweisgerber.dev
  • 1,726
  • 17
  • 36
  • 1
    Sorry for the time it took to implement it but it's now ready, see our post at http://www.telestax.com/jain-sip-stack-for-android/ which allow you to integrate the latest JAIN SIP in android without conflicts. The post uses as an example a chat messaging application – jeand Sep 30 '14 at 12:24
  • 1
    Thanks for the long-time follow up @jeand – sweisgerber.dev Oct 01 '14 at 07:53