Is there any way to make Android native sip stack to support voip on all android devices?

时间秒杀一切 提交于 2020-02-25 13:28:09

问题


I have invested some time building a simple VOIP call using android native sip API. But later came to know that it does not support voip call on all Android devices. And it was mentioned that it was relied on Jain sip stack. So is there any way i can make it support on all Android Device (from Android 4 on ward) using native sip stack. Any simple demo source code on implementing sip using pjsip would be also highly appreciated.


回答1:


PJSip Android Library Build Up Steps

Requirements: 
- Latest Version on NDK (https://developer.android.com/ndk/downloads)
- PjSip Original Source Code (https://www.pjsip.org/download.htm)

Steps:

1)  Download PjSip source code in a specific location
or
Trunk the URL (http://svn.pjsip.org/repos/pjproject/trunk)
Open Terminal and go to a specific location where you can put trunk folder
How to trunk url:-
Execute in Terminal:- svn co http://svn.pjsip.org/repos/pjproject/trunk

2) Download Latest NDK in a specific location.

3) Open PjSip or Trunk folder and go to pjlib/include/pj/ 

4) Create a config_site.h File and Set Below Value in config_site.h File.

/* Activate Android specific settings in the 'config_site_sample.h' */
#define PJ_CONFIG_ANDROID 1
#include <pj/config_site_sample.h>

5) Just run Following Command to build PjSip Library.

- cd/ path to your Pjsip or Trunk Directory
- export ANDROID_NDK_ROOT=/ set your NDK download Directory
- TARGET_ABI=armeabi-v7a
- ./configure-android
- make dep && make clean && make

After complete all step go to pjsip-app/src/swig/java/android you find an android source code with a .so file in JNI folder. now simply open a source in android studio and connect the user with your free switch user with id, password, and server-id. and make a first VoIP call.

Thanks, Happy coding...



来源:https://stackoverflow.com/questions/57089165/is-there-any-way-to-make-android-native-sip-stack-to-support-voip-on-all-android

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