我试图在Android设备(4.0.2)运行JAIN-SIP协议栈。 我能够重新包装这是需要(耆那教-SIP-API-1.2-src.jar,耆那教-SIP-SRC-1.2.1111.jar,concurrent.jar的是,log4j-1.2.8.jar)的jar-文件。
这是我用我的build.xml文件:
<!-- 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>
这是一个代码示例,我试图测试重新打包的文件中没有的Android环境:
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);
当我尝试运行此代码,我得到了以下错误:
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)
据我了解,我只是改变了包的名字,但似乎它不为一些软件包的“INTERNA”工作。 这就是为什么我看着源,看到有一些硬编码字符串,如:
if (name == null ) throw new PeerUnavailableException("Missing javax.sip.STACK_NAME property");
现在是我的问题是有没有合适的方法/解决方案,使JAIN-SIP下Android平台?
感谢您的帮助提前:-)
丹尼尔