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.
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...