SIP - pjsip Linux & Windows 编译安装

SIP - pjsip Linux & Windows 编译安装

PJSIP是一个包含了SIP、SDP、RTP、RTCP、STUN、ICE等协议实现的开源库, 并集成了丰富的pjsip示例与 softphone pjsua 命令行工具.
此文仅用于Linux&Windows平台编译&安装测试SIP信令使用.
在这里插入图片描述

Linux 编译&安装

https://github.com/pjsip/pjproject/releases

libx264

$ git clone https://code.videolan.org/videolan/x264.git
$ cd x264 && mkdir build && cd build
$ ./configure --enable-static  --prefix=/usr --libdir=/usr/lib64
$ make && make install-lib-static

ffmpeg

http://ffmpeg.org/

$ git clone git://source.ffmpeg.org/ffmpeg.git
$ cd ffmpeg && mkdir build && cd build
$ ../configure  --disable-shared --enable-static --enable-gpl --enable-libx264 --prefix=/usr  --libdir=/usr/lib64
$ make  && make install
$ git cl
one https://github.com/pjsip/pjproject 
$ cd pjproject && git checkout 2.9 -b 2.9
$ ./configure --enable-static --prefix=/usr
$ touche pjlib/include/pj/config_site.h
$ make -j dep 
$ make -j install

Windows VS2019 编译&安装

修改平台工具集

pjsip 默认使用VS2015编译工程, Alt+Enter 修改工程属性 平台工具集Visutal Studio 2019 (v142) 即可.
在这里插入图片描述

SDL

https://www.libsdl.org/release/SDL2-devel-2.0.16-VC.zip

FFMPEG

https://www.gyan.dev/ffmpeg/builds/

下载 build-shared 版本

编译

编辑pjlib 配置 pjlib\include\pj\config_site.h:

#define PJMEDIA_HAS_VIDEO         1
#define PJMEDIA_VIDEO_DEV_HAS_SDL       1
#define PJMEDIA_HAS_FFMPEG         1

SDL2 & FFMPEG includelib 目录分别加入 pjmedia_videodev/pjmedia/pjmedia_codec/pjsua VC++ 包含目录与库目录, 注意x86和x64分别对应不同的文件. 这里选择 releasex64 编译 pjsua 即可
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

pjsua

pjsua 是基于 pjsip 的命令行 SIP user agent(sofphone), 可直接用于测试 SIP 信令&拨打VOIP.

pjsua Manual Page
在这里插入图片描述

示例:

直接发起INVITE:

pjsip sip:192.168.22.42

注册&认证&发起 INVITE:

pjsip-apps\bin\pjsua-x86_64-x64-vc14-Release --id sip:9001@192.168.22.42:5060 --registrar sip:192.168.22.42:5060 --username 9001 --password 1234 --realm '*' --auto-play sip:9664@192.168.22.42
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值