sipp模拟freeswitch分机测试(SIP协议调试)

1、freeswitch安装

1) freeswitch一键安装脚本

https://blog.csdn.net/gredn/article/details/75393207

默认的配置注册不上,报403 Forbidden(Invalid domain in From: header)

2018-12-31 22:19:12.061220 [WARNING] sofia_reg.c:1792 SIP auth challenge (REGISTER) on sofia profile 'internal' for [[email protected]] from ip 119.131.168.166
2018-12-31 22:19:12.121205 [WARNING] sofia_reg.c:1737 SIP auth failure (REGISTER) on sofia profile 'internal' for [[email protected]] from ip 119.131.168.166

https://www.cnblogs.com/yoyotl/p/6552891.html

2) 快速安装

wget https://www.freeswitch.org.cn/Makefile && make install

找不到Makefile,地址已经失效了

3) 网上很多安装方法都不靠谱,系统版本,各种依赖库一堆问题,下面是验证的可行的。

yum install -y http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm epel-release
yum install -y freeswitch-config-vanilla freeswitch-lang-* freeswitch-sounds-*
systemctl enable freeswitch
freeswitch

4) freeswitch v1.0在阿里云centos 7.03上的安装

https://blog.csdn.net/MoSee/article/details/77945546

2、freeswitch配置

以上默认能拨通,但是没声音,30秒左右就自动断线了,明显跟freepbx一样是NAT的故障

我偷懒用yun install安装的freeswitch,配置文件在/etc/freeswitch目录,安装文件比较分散

/var/lib/yum/repos/x86_64/7/freeswitch
/var/lib/freeswitch
/var/cache/yum/x86_64/7/freeswitch
/var/log/freeswitch
/usr/lib64/freeswitch
/usr/share/freeswitch
/usr/bin/freeswitch
/run/freeswitch
/etc/sysconfig/freeswitch
/etc/freeswitch

1) 修改internal.xml

cd /etc/freeswitch/sip_profiles

vi internal.xml

<param name="ext-rtp-ip" value="auto-nat"/>
<param name="ext-sip-ip" value="auto-nat"/>

将atto-nat改成云服务器公网IP

2) 关闭centos 7.2防火墙,先保持网络通畅,调完了在配置防火墙端口。

systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)

重启freeswitch

freeswitch -stop

freeswitch

3、freeswitch测试

sample sipp scenarios for testing freeswitch

https://github.com/os11k/sipp2freeswitch

1) 更改文件invite-accounts.csv中的SIP Proxy配置

SEQUENTIAL
# Username: 1000-1009
# Password: 1234
# SIP Proxy: 182.61.56.247, Destination Number: 9196
1000;182.61.56.247;[authentication username=1000 password=1234];9196;
1001;182.61.56.247;[authentication username=1001 password=1234];9196;
1002;182.61.56.247;[authentication username=1002 password=1234];9196;
1003;182.61.56.247;[authentication username=1003 password=1234];9196;
1004;182.61.56.247;[authentication username=1004 password=1234];9196;
1005;182.61.56.247;[authentication username=1005 password=1234];9196;
1006;182.61.56.247;[authentication username=1006 password=1234];9196;
1007;182.61.56.247;[authentication username=1007 password=1234];9196;
1008;182.61.56.247;[authentication username=1008 password=1234];9196;
1009;182.61.56.247;[authentication username=1009 password=1234];9196;

2) 更改文件register-accounts.csv中的SIP Proxy配置

SEQUENTIAL
# Username: 1000-1009
# Password: 1234
# SIP Proxy: 182.61.56.247
1000;182.61.56.247;[authentication username=1000 password=1234]
1001;182.61.56.247;[authentication username=1001 password=1234]
1002;182.61.56.247;[authentication username=1002 password=1234]
1003;182.61.56.247;[authentication username=1003 password=1234]
1004;182.61.56.247;[authentication username=1004 password=1234]
1005;182.61.56.247;[authentication username=1005 password=1234]
1006;182.61.56.247;[authentication username=1006 password=1234]
1007;182.61.56.247;[authentication username=1007 password=1234]
1008;182.61.56.247;[authentication username=1008 password=1234]
1009;182.61.56.247;[authentication username=1009 password=1234]

3)注意invite-auth.xml文件中的g711a.pcap目录

<exec play_pcap_audio="pcap/g711a.pcap"/>

4) 启动测试

sipp -i 172.16.0.6 -sf register.xml -inf register-accounts.csv 182.61.56.247:5060 -r 1 -rp 1000 -aa -trace_err
sipp -i 172.16.0.6 -sf invite-auth.xml -inf invite-accounts.csv 182.61.56.247:5060 -r 1 -rp 1000 -trace_err

 测试注册,拨号,rtp数据都通了

4、FreeSwitch默认只支持音频,为支持视频,修改vars.xml如下:

<X-PRE-PROCESS cmd="set" data="global_codec_prefs=PCMU,PCMA,GSM,H264,H263-1998,H263"/>
<X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=PCMU,PCMA,GSM,H264,H263-1998,H263"/>

5、杜金房的个人网站

http://www.dujinfang.com/

https://github.com/os11k/sipp2freeswitch

1) freeswitch一键安装脚本

https://blog.csdn.net/gredn/article/details/75393207

默认的配置注册不上,报403 Forbidden(Invalid domain in From: header)

2018-12-31 22:19:12.061220 [WARNING] sofia_reg.c:1792 SIP auth challenge (REGISTER) on sofia profile 'internal' for [[email protected]] from ip 119.131.168.166
2018-12-31 22:19:12.121205 [WARNING] sofia_reg.c:1737 SIP auth failure (REGISTER) on sofia profile 'internal' for [[email protected]] from ip 119.131.168.166

https://www.cnblogs.com/yoyotl/p/6552891.html

2) 快速安装

wget https://www.freeswitch.org.cn/Makefile && make install

找不到Makefile,地址已经失效了

3) 网上很多安装方法都不靠谱,系统版本,各种依赖库一堆问题,下面是验证的可行的。

yum install -y http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm epel-release
yum install -y freeswitch-config-vanilla freeswitch-lang-* freeswitch-sounds-*
systemctl enable freeswitch
freeswitch

4) freeswitch v1.0在阿里云centos 7.03上的安装

https://blog.csdn.net/MoSee/article/details/77945546

2、freeswitch配置

以上默认能拨通,但是没声音,30秒左右就自动断线了,明显跟freepbx一样是NAT的故障

我偷懒用yun install安装的freeswitch,配置文件在/etc/freeswitch目录,安装文件比较分散

/var/lib/yum/repos/x86_64/7/freeswitch
/var/lib/freeswitch
/var/cache/yum/x86_64/7/freeswitch
/var/log/freeswitch
/usr/lib64/freeswitch
/usr/share/freeswitch
/usr/bin/freeswitch
/run/freeswitch
/etc/sysconfig/freeswitch
/etc/freeswitch

1) 修改internal.xml

cd /etc/freeswitch/sip_profiles

vi internal.xml

<param name="ext-rtp-ip" value="auto-nat"/>
<param name="ext-sip-ip" value="auto-nat"/>

将atto-nat改成云服务器公网IP

2) 关闭centos 7.2防火墙,先保持网络通畅,调完了在配置防火墙端口。

systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)

重启freeswitch

freeswitch -stop

freeswitch

3、freeswitch测试

sample sipp scenarios for testing freeswitch

https://github.com/os11k/sipp2freeswitch

1) 更改文件invite-accounts.csv中的SIP Proxy配置

SEQUENTIAL
# Username: 1000-1009
# Password: 1234
# SIP Proxy: 182.61.56.247, Destination Number: 9196
1000;182.61.56.247;[authentication username=1000 password=1234];9196;
1001;182.61.56.247;[authentication username=1001 password=1234];9196;
1002;182.61.56.247;[authentication username=1002 password=1234];9196;
1003;182.61.56.247;[authentication username=1003 password=1234];9196;
1004;182.61.56.247;[authentication username=1004 password=1234];9196;
1005;182.61.56.247;[authentication username=1005 password=1234];9196;
1006;182.61.56.247;[authentication username=1006 password=1234];9196;
1007;182.61.56.247;[authentication username=1007 password=1234];9196;
1008;182.61.56.247;[authentication username=1008 password=1234];9196;
1009;182.61.56.247;[authentication username=1009 password=1234];9196;

2) 更改文件register-accounts.csv中的SIP Proxy配置

SEQUENTIAL
# Username: 1000-1009
# Password: 1234
# SIP Proxy: 182.61.56.247
1000;182.61.56.247;[authentication username=1000 password=1234]
1001;182.61.56.247;[authentication username=1001 password=1234]
1002;182.61.56.247;[authentication username=1002 password=1234]
1003;182.61.56.247;[authentication username=1003 password=1234]
1004;182.61.56.247;[authentication username=1004 password=1234]
1005;182.61.56.247;[authentication username=1005 password=1234]
1006;182.61.56.247;[authentication username=1006 password=1234]
1007;182.61.56.247;[authentication username=1007 password=1234]
1008;182.61.56.247;[authentication username=1008 password=1234]
1009;182.61.56.247;[authentication username=1009 password=1234]

3)注意invite-auth.xml文件中的g711a.pcap目录

<exec play_pcap_audio="pcap/g711a.pcap"/>

4) 启动测试

sipp -i 172.16.0.6 -sf register.xml -inf register-accounts.csv 182.61.56.247:5060 -r 1 -rp 1000 -aa -trace_err
sipp -i 172.16.0.6 -sf invite-auth.xml -inf invite-accounts.csv 182.61.56.247:5060 -r 1 -rp 1000 -trace_err

 测试注册,拨号,rtp数据都通了

4、FreeSwitch默认只支持音频,为支持视频,修改vars.xml如下:

<X-PRE-PROCESS cmd="set" data="global_codec_prefs=PCMU,PCMA,GSM,H264,H263-1998,H263"/>
<X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=PCMU,PCMA,GSM,H264,H263-1998,H263"/>

5、杜金房的个人网站

http://www.dujinfang.com/

猜你喜欢

转载自www.cnblogs.com/dong1/p/10239365.html
今日推荐