PjSIP和WebRTC整合的方案Android端实现,可以正常的和其他SIP终端,如Linphone,进行音视频通话。把开发的思路和开发遇到的问题整理出来,希望能帮到大家。
一、编译安卓版本的PJSIP库文件
按照PjSIP的官方编译方式:
https://trac.pjsip.org/repos/wiki/Getting-Started/Android
编译命令:
TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags
我的Ubuntu机器会报下面的错误:
TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags
configure-android: APP_PLATFORM not specified, using android-24
configure-android error: compiler not found, please check environment settings (TARGET_ABI, etc)
搜索下解决方案,正确的命令如下:
NDK_TOOLCHAIN_VERSION=4.9 TARGET_ABI=armeabi-v7a APP_PLATFORM=android-19 ./configure-android --use-ndk-cflags
更新上面的错误:找到官方解答
Release notes to r13 stated that NDK_TOOLCHAIN_VERSION now defaults to Clang, resulting error on configure-android which expects gcc:
configure-android error: compiler not found, please check environment settings (TARGET_ABI, etc)
As a workaround, you can specify NDK_TOOLCHAIN_VERSION (to 4.9) to use gcc.
NDK_TOOLCHAIN_VERSION=4.9 TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags
<