行业知识
SIP调试之SIPP测试工具
2026-11-30 15:39:00
来源:互联网转载
SIPP���针对SIP协议的一个性能测试的命令行工具,可以动态显示测试的统计信息(如呼叫速率、延时、消息统计等)。用户可以通过XML场景配置文件,自定义模拟各种UAC/UAS测试场景的信令交互流程,可以被用来测试IP话机、SIP代理、SIP PBX等SIP设备。
一、参考资料
官方网站:https://sipp.sourceforge.net/
参考文档:https://sipp.sourceforge.net/doc/reference.pdf
二、安装
linux平台:
sudo apt install sip-tester
注:也可以下载源码编译安装
三、使用
3.1 查看用法
# sipp -h
Usage: sipp remote_host[:remote_port] [options]Example: Run SIPp with embedded server (uas) scenario: ./sipp -sn uas On the same host, run SIPp with embedded client (uac) scenario: ./sipp -sn uac 127.0.0.1 Available options:*** Scenario file options: -sd : Dumps a default scenario (embedded in the SIPp executable) -sf : Loads an alternate XML scenario file. To learn more about XML scenario syntax, use the -sd option to dump embedded scenarios. They contain all the necessary help....................................................................
3.2 常用参数说明
-v
作用:显示版本信息
-bg
作用:后台模式运行
-sd
作用:输出SIPP内嵌的默认场景
sipp -sd
部分参数说明:
- uac: uac场景
- uas: uas场景
- uac_pcap: uac带媒体场景
将场景内容重定向到文件
sipp -sd uas > uas.xml
-sf
作用:加载指定的场景文件
sipp -sf uas.xml
-sn
作用:使用默认的内置场景文件
# sipp -sn uas
# sipp -sn uac
-t
作用:设置传输方式
部分参数说明:
u1: 使用一个UDP un: 一个呼叫用一个UDP t1: 使用一个TCP tn: 一个呼叫使用一个TCP
-i
作用:设置本地的IP地址,如contact,via,from
sip -i 192.168.1.100
-p
作用:设置本地的端口
sip -p 5060
-bind_local
作用:绑定本地IP地址
-ci
作用:本地控制IP
-cp
作用:本地控制PORT
3.3 场景文件
可以从在线参考文档(https://sipp.sourceforge.net/doc/reference.pdf) 中的链接获取一些内置的测试场景的xml模板,手动改变其中的一些参数或流程形成目标场景文件。
uac.xml:
;tag=[pid]SIPpTag00[call_number] To: [service] Call-ID: [call_id] CSeq: 1 INVITE Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 70 Subject: Performance Test Content-Type: application/sdp Content-Length: [len] v=0 o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] s=- c=IN IP[media_ip_type] [media_ip] t=0 0 m=audio [media_port] RTP/AVP 0 a=rtpmap:0 PCMU/8000 ]]> ;tag=[pid]SIPpTag00[call_number] To: [service] [peer_tag_param] Call-ID: [call_id] CSeq: 1 ACK Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 70 Subject: Performance Test Content-Length: 0 ]]> ;tag=[pid]SIPpTag00[call_number] To: [service] [peer_tag_param] Call-ID: [call_id] CSeq: 2 BYE Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 70 Subject: Performance Test Content-Length: 0 ]]>
uas.xml:
Content-Length: 0 ]]> Content-Type: application/sdp Content-Length: [len] v=0 o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] s=- c=IN IP[media_ip_type] [media_ip] t=0 0 m=audio [media_port] RTP/AVP 0 a=rtpmap:0 PCMU/8000 ]]> Content-Length: 0 ]]>
3.4 示例
3.4.1 运行内置UAS/UAC
# sipp -sn uas
# sipp -sn uac
3.4.2 指定自定义场景文件
sipp -sf my_uas.xml
3.4.3 指定本地IP/端口
sipp -sf uas.xml -i 192.168.1.200 5060
3.5 测试
192.168.1.16终端呼叫192.168.1.200
测试结果:
# sipp -sn uas 192.168.1.200Resolving remote host '192.168.1.200'... Done.------------------------------ Scenario Screen -------- [1-9]: Change Screen -- Port Total-time Total-calls Transport 5060 30.29 s 1 UDP 0 new calls during 0.172 s period 1 ms scheduler resolution 0 calls Peak was 1 calls, after 10 s 0 Running, 3 Paused, 0 Woken up 0 dead call msg (discarded) 3 open sockets 0/0/0 UDP errors (send/recv/cong) 0 Total RTP pckts sent 0.000 last period RTP rate (kB/s) Messages Retrans Timeout Unexpected-Msg ----------> INVITE 1 0 0 0 BYE 1 0 0 0
上一篇:tbc服务器如何选择?
下一篇:云服务器千兆