Using pjsip with android

邮差的信 提交于 2019-12-06 05:13:29

问题


I successfully installed and builded the pjsip library and pjsua for android, I ran pjsua on my device and it worked, however I'm still lost on how to use the methods of this library.

I already took a look on the CSipSimple app and I noticed that the jni folders of these 2 projects are very different.

Do I have to convert each .c file of this library in .java files with SWIG? If anyone has an example about how to implement it in a very simple way (a SIP register procedure for instance) it would be helpful.


回答1:


It depends on how you would like to use the library.

The highest level API for pjsip is pjsua2 API, and there is already a java SWIG library build for you in the source code. You can just look at these examples.

http://www.pjsip.org/docs/book-latest/html/intro_pjsua2.html#building-python-and-java-swig-modules

However, if you don't need the sip signaling part, but just the media codecs and transportation part. You might have to design a JNI interfaces by yourself. You write the programs in C/C++ and link the libpjsua.so in the Android.mk file. for pjsua api C programming example: http://www.pjsip.org/docs/latest/pjsip/docs/html/group__PJSUA__LIB__BASE.htm

for pjmedia example: see the testing codes under pjmedia/src/test



来源:https://stackoverflow.com/questions/15817054/using-pjsip-with-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!