在Android中使用pjsip [英] Using pjsip with android

查看:746
本文介绍了在Android中使用pjsip的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功地为Android安装并建立了pjsip库和pjsua,我在设备上运行了pjsua并且可以正常工作,但是我仍然对如何使用该库的方法一无所知.

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.

我已经看过CSipSimple应用程序,我注意到这两个项目的jni文件夹非常不同.

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

我是否必须使用SWIG将该库的每个.c文件转换为.java文件? 如果有人提供了有关如何以非常简单的方式(例如SIP注册过程)实现该示例的示例,将很有帮助.

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.

推荐答案

这取决于您要如何使用该库.

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

pjsip的最高级别的API是pjsua2 API,并且在源代码中已经为您提供了一个Java SWIG库.您可以看一下这些示例.

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

但是,如果您不需要sip信令部分,而只需要媒体编解码器和传输部分.您可能必须自己设计一个JNI接口. 您使用C/C ++编写程序,并在Android.mk文件中链接libpjsua.so. 对于pjsua api C编程示例: http://www.pjsip.org/docs/latest/pjsip /docs/html/group__PJSUA__LIB__BASE.htm

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

以pjmedia为例:请参见pjmedia/src/test下的测试代码

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

这篇关于在Android中使用pjsip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆