分类
IT运维

pjsip linux下编译

系统环境:centos 6.5 64位
pjsip版本:2.5
官方文档:https://trac.pjsip.org/repos/wiki/Getting-Started/Autoconf
步骤:
chmod -R 777 pjproject-2.5
cd pjproject-2.5
./configure –disable-libyuv –disable-sound –disable-ffmpeg
#此处禁用了音视频
make dep
make
make install

编译时禁用一些不用的功能,可以减少错误,如视频通话等功能不用可以禁止。
Optional Features:
–disable-floating-point Disable floating point where possible
–disable-sound Exclude sound (i.e. use null sound)
–disable-small-filter Exclude small filter in resampling
–disable-large-filter Exclude large filter in resampling
–disable-g711-plc Exclude G.711 Annex A PLC
–disable-speex-aec Exclude Speex Acoustic Echo Canceller/AEC
–disable-g711-codec Exclude G.711 codecs from the build
–disable-l16-codec Exclude Linear/L16 codec family from the build
–disable-gsm-codec Exclude GSM codec in the build
–disable-speex-codec Exclude Speex codecs in the build
–disable-ilbc-codec Exclude iLBC codec in the build
–disable-ssl Force excluding TLS support (default is autodetected based on OpenSSL availability)
–disable-sdl Disable SDL (default: not disabled)
–disable-ffmpeg Disable ffmpeg (default: not disabled)
–disable-v4l2 Disable Video4Linux2 (default: not disabled)
–disable-openh264 Disable OpenH264 (default: not disabled)
–disable-libyuv Exclude libyuv in the build

编译pjsua java python库:
参照文章:http://www.geekapp.cn/archives/475.html

分类
未分类

pjsip Building PJSUA2

1、安装pjproject-2.7
官网下载:http://www.pjsip.org
2、安装SWIG
下载地址:http://www.swig.org/
老三步:configure/make/make install
3、安装jdk
4、安装python3
官网下载安装。
5、编译java和python库
cd pjproject-2.7/pjsip-apps/src/swig
make
make intall

遇到的坑:
1、编译时可能需要javac命令,默认的openjdk版本可能不包含,需要安装开发版的openjdk并配置java环境,已我的服务器为例:
yum install java-1.8.0-openjdk-devel.x86_64

2、配置环境变量
修改/etc/profile文件
如果你的计算机仅仅作为开发使用时推荐使用这种方法,因为所有用户的shell都有权使用这些环境变量,可能会给系统带来安全性问题。用文本编辑器打开/etc/profile在profile文件末尾加入:
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-0.b01.el6_9.x86_64/
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

3、重新登录
4、报错:swig: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory yum安装pcre命令:
yum install pcre
查找一下libpcre.so.1位置,我的在/usr/local/lib/目录中。
cd /usr/lib64
ln -s /usr/local/lib/libpcre.so.1