SIPp功能很强大,通过配置流程可以实现大部分的SIP场景。下面是利用SIPp实现的对OpenSIPS进行REGISTER进行压测的xml文件和csv文件。
register.xml
- <?xml version="1.0" encoding="ISO-8859-1" ?>
- <!DOCTYPE scenario SYSTEM "sipp.dtd">
- <scenario name="branch_client">
- <send retrans="500">
- <![CDATA[
- REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
- Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
- From: <sip:[field0]@[remote_ip]:[remote_port]>;tag=[call_number]
- To: <sip:[field0]@[remote_ip]:[remote_port]>
- Call-ID: [call_id]
- CSeq: 1 REGISTER
- Contact: sip:[field0]@[local_ip]:[local_port]
- Max-Forwards: 5
- Expires: 60
- User-Agent: SIPp
- Content-Length: 0
- ]]>
- </send>
- <recv response="401" auth="true">
- </recv>
- <send retrans="500">
- <![CDATA[
- REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
- Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
- From: <sip:[field0]@[remote_ip]:[remote_port]>;tag=[call_number]
- To: <sip:[field0]@[remote_ip]:[remote_port]>
- Call-ID: [call_id]
- CSeq: 2 REGISTER
- Contact: sip:[field0]@[local_ip]:[local_port]
- [field1]
- Max-Forwards: 5
- Expires: 60
- User-Agent: SIPp
- Content-Length: 0
- ]]>
- </send>
- <recv response="200"></recv>
- <!-- definition of the response time repartition table (unit is ms) -->
- <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
- <!-- definition of the call length repartition table (unit is ms) -->
- <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
- </scenario>
data.csv
- <span style="font-family:Courier New;font-size:14px;">SEQUENTIAL
- 6000;[authentication username=6000 password=6000]
- 6001;[authentication username=6001 password=6001]
- 6002;[authentication username=6002 password=6002]
- 6003;[authentication username=6003 password=6003]</span>
以上代码对Asterisk 和 OpenSIPS均适用。