PJSIP2.5.1编译

来源:互联网 发布:cnc编程招聘信息 编辑:程序博客网 时间:2024/06/05 02:52

此文记录pjsip编译过程中遇到的一些问题以及解决方法。

首先参考一下www.pjsip.org官网的Getting Started基础


一、MAC下编译


主要为IPHONE进行编译,包括模拟器版本和真机版本,baidu出来按如下网址进行:

http://www.tuicool.com/articles/Z7VjMn,里面的脚本整的不错,比较方便

这里写了i386,armv7,armv7s,arm64的编译,但是无x86_64版本

编译x86_64版本

$ export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer$ ARCH="-arch x86_64" CFLAGS="-O2 -m64 -mios-simulator-version-min=5.0" LDFLAGS="-O2 -m64 -mios-simulator-version-min=5.0" ./configure-iphone$ make dep && make clean && make
其他相同。

在2.6版本里生成的文件名和2.5不同,故里面的合并脚本需要修改,需要将每个arch版本生产的库文件统一改名成一样的名称


二、linux编译


问题1:ALSA的支持,无ALSA,confiure是检测不到,编译找不到ALSA的头文件

解答1:由于只需要做服务器端代理,不需要声卡支持,在config_site.h中加上#define PJMEDIA_AUDIO_DEV_HAS_ALSA   0


三、windows编译


问题1:srtp.h中找不到stdint.h

解答1:

#ifdef _MSC_VER  
typedef __int32 int32_t; 
typedef unsigned __int32 uint32_t; 
typedef __int64 int64_t; 
typedef unsigned __int64 uint64_t;  
#else 
#include <stdint.h> 
#endif 

问题2:call.cpp中

MathStat::MathStat()
: n(0), max(0),min(0),last(0), mean(0)
{
}

error:大致是说把max当成宏了,syntax error

解答2:

MathStat::MathStat()
: n(0), last(0), mean(0)
{
max = 0;
min = 0;
}


四、ipv6的支持

2.5.5以后支持ipv6,我现在用了2.6,2.6编译生成的文件名称和2.5略有不同

1、https://trac.pjsip.org/repos/wiki/IPv6#IPv6Supportinpjsip

#define PJ_HAS_IPV6 1

tp_type = PJSIP_TRANSPORT_TCP6;status = pjsua_transport_create(tp_type, &tp_cfg, &udp6_tp_id);if (status != PJ_SUCCESS)
acc_cfg.transport_id = udp6_tp_id; 

2、http://www.cnblogs.com/HemJohn/p/5590483.html

getaddrinfo获取到本地地址,判断是否是ipv6格式,即":"分隔的为v6网络

0 0
原创粉丝点击