I'm trying to run JAIN-SIP Stack on an Android-Device (4.0.2). I was able to repackage the jar-files which were needed (jain-sip-api-1.2-src.jar, jain-sip-src-1.2.1111.jar, concurrent.jar, log4j-1.2.8.jar).
This is my build.xml file which I used:
<!-- Converts this project's .class files into .dex files -->
<target name="-jarjar" depends="-compile">
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
classpath="buildtools/jarjar-1.4.jar"/>
<jarjar jarfile="${out.absolute.dir}/JainSipApi1.2_re.jar">
<zipgroupfileset dir="mylib" includes="jain-sip-api-1.2-src.jar" />
<rule pattern="javax.sip.**" result="sipper.sip.@1"/>
</jarjar>
<jarjar jarfile="${out.absolute.dir}/JainSipRi1.2_re.jar">
<zipgroupfileset dir="mylib" includes="jain-sip-src-1.2.1111.jar" />
<rule pattern="gov.nist.**" result="sipper.nist.@1"/>
</jarjar>
<jarjar jarfile="${out.absolute.dir}/concurrent_re.jar">
<zipgroupfileset dir="mylib" includes="concurrent.jar" />
<rule pattern="EDU.**" result="sipper.EDU.@1"/>
</jarjar>
<jarjar jarfile="${out.absolute.dir}/log4j-1.2.8_re.jar">
<zipgroupfileset dir="mylib" includes="log4j-1.2.8.jar" />
<rule pattern="org.apache.log4j.**" result="sipper.org.apache.log4j.@1"/>
</jarjar>
</target>
And this is a code-sample where I tried to test the repackaged file in a none Android environment:
import sipper.sip.SipFactory;
...
sipFactory = SipFactory.getInstance();
sipFactory.setPathName("sipper.nist");
Properties properties = new Properties();
properties.setProperty("javax.sip.STACK_NAME", "Sipper");
properties.setProperty("javax.sip.IP_ADDRESS", "127.0.0.1");
sipStack = sipFactory.createSipStack(properties);
When I try to run this code I got the following error:
Problem initializing the SIP stack.
sipper.sip.PeerUnavailableException: Missing javax.sip.STACK_NAME property
at sipper.sip.SipFactory.createSipStack(SipFactory.java:144)
at SipLayer.<init>(SipLayer.java:86)
at SipperClient.main(SipperClient.java:51)
As far as I understood, I've just changed the name of the packages, but it seems like that it doesn't work for the "interna" of some packages. That's why I looked into the source and saw there some hard coded strings like:
if (name == null ) throw new PeerUnavailableException("Missing javax.sip.STACK_NAME property");
Now is my question are there any appropriate ways/solutions to make JAIN-SIP under Android working?
Thanks for your help in advance :-)
Daniel