您當(dāng)前的位置是:  首頁(yè) > 資訊 > 國(guó)內(nèi) >
 首頁(yè) > 資訊 > 國(guó)內(nèi) >

完整SIPp測(cè)試環(huán)境下各種SIP場(chǎng)景測(cè)試和配置文件

2019-06-27 13:45:02   作者:james.zhu   來(lái)源:Asterisk開(kāi)源派   評(píng)論:0  點(diǎn)擊:


  SIPp是一個(gè)免費(fèi)的SIP壓力測(cè)試比較好的工具。我們?cè)诓渴餝IP語(yǔ)音網(wǎng)絡(luò)中可能需要測(cè)試不同的服務(wù)器端的兼容性或者其他終端的兼容性問(wèn)題,處理能力等問(wèn)題。筆者大概在2008年使用此工具進(jìn)行了關(guān)于編碼轉(zhuǎn)換壓力的測(cè)試,之后,使用SIPp也做過(guò)多種場(chǎng)景的測(cè)試。
 
  但是,因?yàn)镾IPp使用過(guò)程中,測(cè)試人員需要根據(jù)不同的場(chǎng)景來(lái)編寫自己的XML文件,測(cè)試人員需要首先學(xué)習(xí)這些XML語(yǔ)法,所以,通常在測(cè)試過(guò)程中,編寫XML文件耗費(fèi)很多的精力。今天,我們幫助SIP軟交換/媒體服務(wù)器開(kāi)發(fā)和測(cè)試人員快速了解SIPp的壓力測(cè)試,筆者推薦一個(gè)比較完整全面的網(wǎng)站,這個(gè)網(wǎng)站匯集了很多SIP的功能測(cè)試場(chǎng)景的XML和其語(yǔ)法。
  說(shuō)明:筆者不再這里進(jìn)一步介紹關(guān)于SIPp的安裝和使用語(yǔ)法,筆者不再這里介紹如何安裝服務(wù)器端的應(yīng)用和其呼叫規(guī)則。用戶可以安裝Asterisk/FreeSWITCH,添加相應(yīng)的分機(jī)進(jìn)行測(cè)試。具體安裝文檔,網(wǎng)絡(luò)有很多資料。筆者這里僅分享官方使用場(chǎng)景,命令和其測(cè)試項(xiàng)目說(shuō)明。
  測(cè)試示例1- OPTIONS
  對(duì)目的地地址發(fā)送5次 OPTIONS 消息-30@192.168.1.211。
  sipp 192.168.1.211 -sf OPTIONS.xml -m 5 -s 30
  Send OPTIONS message 30 times to 30@192.168.1.211 waiting 200 ms for 200/OK reply each time.
  sipp 192.168.1.211 -sf OPTIONS_recv_200.xml -m 30 -s 30
  1. <scenario name="Options">
  2. <send>
  3. <![CDATA[
  4. OPTIONS sip:[service]@[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] Max-Forwards: 70 To: <sip:[service]@[remote_ip]> From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] Call-ID: [call_id] CSeq: 1 OPTIONS Contact: <sip:sipp@[local_ip]:[local_port]> Accept: application/sdp Content-Length: 0
  5. ]]>
  6. </send>
  7. <recv response="200" timeout="200"> </recv>
  8. </scenario>
  測(cè)試示例2-REGISTER
  通過(guò)CVS的配置賬號(hào)對(duì)服務(wù)器進(jìn)行注冊(cè) 192.168.1.106。用戶可以在CVS文件中添加多個(gè)文件,通過(guò) -I 選項(xiàng)增加呼叫限制。
  命令:
  sipp 192.168.1.106 -sf REGISTER_client.xml
  -inf REGISTER_client.csv -m 1 -l 1 -trace_msg -trace_err
  XML配置文件:
  1. <!--
  2. Use with CSV file struct like: 3000;192.168.1.106;[authentication username=3000 password=3000];
  3. (user part of uri, server address, auth tag in each line)
  4. -->
  5. <scenario name="register_client">
  6. <send retrans="500">
  7. <![CDATA[
  8. REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
  9. ]]>
  10. </send>
  11. <!--  asterisk  -->
  12. <recv response="100" optional="true"> </recv>
  13. <recv response="401" auth="true"> </recv>
  14. <send retrans="500">
  15. <![CDATA[
  16. REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] [field2] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
  17. ]]>
  18. </send>
  19. <!--  asterisk  -->
  20. <recv response="100" optional="true"> </recv>
  21. <recv response="200"> </recv>
  22. <!--  response time repartition table (ms)    -->
  23. <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
  24. <!--  call length repartition table (ms)      -->
  25. <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
  26. </scenario>
  CVS文件:
  測(cè)試示例3- REGISTER + SUBSCRIBE application/dialog-info+xml (BLF)
  注冊(cè)到192.168.1.211地址,同時(shí)在CVS文件中的參數(shù)支持了dialog-info subscription (RFC4235)訂閱。
  XML配置文件:
  1. <scenario name="UAC REGISTER + SUBSCRIBE dialog-info">
  2. <!--
  3. Use with CSV file struct like: 32;192.168.1.211;[authentication username=32 password=32];21;
  4. (user part of uri, server address, auth tag, subscribed user in each line)
  5. -->
  6. <send retrans="500">
  7. <![CDATA[
  8. REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
  9. ]]>
  10. </send>
  11. <!--  asterisk  -->
  12. <recv response="100" optional="true"> </recv>
  13. <recv response="401" auth="true"> </recv>
  14. <send retrans="500">
  15. <![CDATA[
  16. REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] [field2] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
  17. ]]>
  18. </send>
  19. <!--  asterisk  -->
  20. <recv response="100" optional="true"> </recv>
  21. <recv response="200"> </recv>
  22. <send retrans="500">
  23. <![CDATA[
  24. SUBSCRIBE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field3]@[field1]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] SUBSCRIBE Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Event: dialog Expires: 120 User-Agent: SIPp/Win32 Accept: application/dialog-info+xml, multipart/related, application/rlmi+xml Content-Length: 0
  25. ]]>
  26. </send>
  27. <recv response="200" rtd="true"> </recv>
  28. <recv request="NOTIFY" crlf="true"> </recv>
  29. <send>
  30. <![CDATA[
  31. SIP/2.0 200 OK [last_Via:] [last_From:] [last_To:] [last_Call-ID:] [last_CSeq:] Content-Length: 0
  32. ]]>
  33. </send>
  34. <!--
  35. definition of the response time repartition table (unit is ms)
  36. -->
  37. <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
  38. <!--
  39. definition of the call length repartition table (unit is ms)
  40. ->
  41. <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
  42. </scenario>
  CVS文件:
  測(cè)試示例4-REGISTER + INVITE
  SIPp 模擬3個(gè)UACs, 每個(gè)UAC執(zhí)行呼出流程。對(duì)方進(jìn)行應(yīng)答,然后進(jìn)行語(yǔ)音播放(single pjsua instance with 3 accounts)。注意,這里的被呼叫方是PJSUA終端。
  命令:
  pjsua_vc6d --local-port=5068
  --id sip:33@192.168.1.211 --registrar sip:192.168.1.211
  --proxy sip:192.168.1.211 --realm * --username 33 --password 33
  --next-account --id sip:34@192.168.1.211 --registrar sip:192.168.1.211
  --proxy sip:192.168.1.211 --realm * --username 34 --password 34
  --next-account --id sip:35@192.168.1.211 --registrar sip:192.168.1.211
  --proxy sip:192.168.1.211 --realm * --username 35 --password 35
  --play-file file.wav --auto-answer 200 --auto-play
  配置文件:
  1. <scenario name="UAC REGISTER + INVITE + call">
  2. <!--
  3. Use with CSV file struct like: 32;192.168.1.211;[authentication username=32 password=32];21;
  4. (user part of uri, server address, auth tag, call target)
  5.  ->
  6. <send retrans="500">
  7. <![CDATA[
  8. REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
  9. ]]>
  10. </send>
  11. <!--  asterisk  -->
  12. <recv response="100" optional="true"> </recv>
  13. <recv response="401" auth="true"> </recv>
  14. <send retrans="500">
  15. <![CDATA[
  16. REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] [field2] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
  17. ]]>
  18. </send>
  19. <!--  asterisk  -->
  20. <recv response="100" optional="true"> </recv>
  21. <recv response="200"> </recv>
  22. <send retrans="500">
  23. <![CDATA[
  24. INVITE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field3]@[field1]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 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
  25. ]]>
  26. </send>
  27. <recv response="100" optional="true"> </recv>
  28. <recv response="180" optional="true"> </recv>
  29. <recv response="183" optional="true"> </recv>
  30. <recv response="200"> </recv>
  31. <send>
  32. <![CDATA[
  33. ACK sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
  34. ]]>
  35. </send>
  36. <pause milliseconds="30000"/>
  37. <send retrans="500">
  38. <![CDATA[
  39. BYE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number]  [last_To:] Call-ID: [call_id] CSeq: [cseq] BYE Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
  40. ]]>
  41. </send>
  42. <!--
  43. The 'crlf' option inserts a blank line in the statistics report.
  44. -->
  45. <recv response="200" crlf="true"> </recv>
  46. <!--
  47. definition of the response time repartition table (unit is ms)
  48. -->
  49. <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
  50. <!--
  51. definition of the call length repartition table (unit is ms)
  52. -->
  53. <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
  54. </scenario>
  CVS文件:
  測(cè)試示例5-REGISTER + INVITE (2)
  1)INVITE以后,首先處理。
  2) 使用rrs="true" 和 [routes] 保存 Record-Route header 頭。
  3) 在ACK和BYE消息中使用 [next_url] 。
  命令:
  sipp 192.168.1.211 -sf REGISTER_INVITE_client2.xml
  -inf REGISTER_INVITE_client.csv -recv_timeout 10000 -m 1 -l 1
  XML文件:
  1. <scenario name="UAC REGISTER + INVITE + call">
  2. <!--
  3. Use with CSV file struct like: 32;192.168.1.211;[authentication username=32 password=32];21;
  4. (user part of uri, server address, auth tag, call target)
  5. -->
  6. <send retrans="500">
  7. <![CDATA[
  8. REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 100 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
  9. ]]>
  10. </send>
  11. <!--  asterisk  -->
  12. <recv response="100" optional="true"> </recv>
  13. <recv response="401" auth="true"> </recv>
  14. <send retrans="500">
  15. <![CDATA[
  16. REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] [field2] Max-Forwards: 100 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
  17. ]]>
  18. </send>
  19. <!--  asterisk  -->
  20. <recv response="100" optional="true"> </recv>
  21. <recv response="200"> </recv>
  22. <send retrans="500">
  23. <![CDATA[
  24. INVITE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field3]@[field1]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 100 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 8 a=rtpmap:8 PCMA/8000
  25. ]]>
  26. </send>
  27. <recv response="100" optional="true"> </recv>
  28. <recv response="407" auth="true"> </recv>
  29. <send>
  30. <![CDATA[
  31. ACK sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 100 Content-Length: 0
  32. ]]>
  33. </send>
  34. <send retrans="500">
  35. <![CDATA[
  36. INVITE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field3]@[field1]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: sip:[field0]@[local_ip]:[local_port] [field2]  Max-Forwards: 100 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 8 a=rtpmap:8 PCMA/8000
  37. ]]>
  38. </send>
  39. <recv response="100" optional="true"> </recv>
  40. <recv response="180" optional="true"> </recv>
  41. <recv response="183" optional="true"> </recv>
  42. <recv response="200" rrs="true"> </recv>
  43. <send>
  44. <![CDATA[
  45. ACK [next_url] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] [last_To:] [routes] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 100 Content-Length: 0
  46. ]]>
  47. </send>
  48. <!--  Play a pre-recorded PCAP file (RTP stream)                        -->
  49. <nop>
  50. <action>
  51. <exec play_pcap_audio="pcap/g711a.pcap"/>
  52. </action>
  53. </nop>
  54. <!--
  55. Pause 60 seconds, which is less than the duration of the
  56. -->
  57. <pause milliseconds="60000"/>
  58. <send retrans="500">
  59. <![CDATA[
  60. BYE [next_url] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number]  [last_To:] [routes] Call-ID: [call_id] CSeq: [cseq] BYE Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 100 Content-Length: 0
  61. ]]>
  62. </send>
  63. <!--
  64. The 'crlf' option inserts a blank line in the statistics report.
  65. -->
  66. <recv response="200" crlf="true"> </recv>
  67. <!--
  68. definition of the response time repartition table (unit is ms)
  69. -->
  70. <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
  71. <!--
  72. definition of the call length repartition table (unit is ms)
  73. -->
  74. <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
  75. </scenario>
  CVS文件:
  測(cè)試示例6-INVITE + CANCEL immediately after SIP/100
  命令:
  sipp 192.168.1.211 -sf INVITE_CANCEL.xml -recv_timeout 10000 -m 1 -l 1
  1. <scenario name="UAC INVITE + call">
  2. <!--
  3. Use with CSV file struct like: 32;192.168.1.211;[authentication username=32 password=32];21;
  4. (user part of uri, server address, auth tag, call target)
  5. -->
  6. <send retrans="500">
  7. <![CDATA[
  8. INVITE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: "98765432" <sip:32@[local_ip]>;tag=[call_number] To: <sip:[remote_ip]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 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 8 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000
  9. ]]>
  10. </send>
  11. <recv response="100">
  12. <action>
  13. <ereg regexp=";branch=[^;]*" search_in="hdr" header="Via" check_it="false" assign_to="1"/>
  14. </action>
  15. </recv>
  16. <send retrans="500">
  17. <![CDATA[
  18. CANCEL sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port][$1] [last_From:] [last_To:] Call-ID: [call_id] CSeq: [cseq] CANCEL Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
  19. ]]>
  20. </send>
  21. <recv response="200"/>
  22. <recv response="487"/>
  23. <send>
  24. <![CDATA[
  25. ACK sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port][$1] [last_From:] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
  26. ]]>
  27. </send>
  28. <pause milliseconds="3000"/>
  29. <!--
  30. definition of the response time repartition table (unit is ms)
  31. -->
  32. <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
  33. <!--
  34. definition of the call length repartition table (unit is ms)
  35. -->
  36. <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
  37. </scenario>
  測(cè)試示例7-INVITE with video stream SDP (H.263, H.264, AS/TIAS bandwidth modifiers)
  命令:
  sipp 192.168.1.211 -sf INVITE_SDP_video.xml -recv_timeout 30000 -m 1 -l 1
  XML文件:
  1. <scenario name="UAC INVITE with video SDP + call">
  2. <send retrans="500">
  3. <![CDATA[
  4. INVITE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: "98765432" <sip:32@[local_ip]>;tag=[call_number] To: <sip:[remote_ip]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 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] b=AS:352 t=0 0 m=audio [media_port] RTP/AVP 0 8 b=TIAS:64000  a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000  m=video 40012 RTP/AVP 97 96 c=IN IP4 [media_ip] b=TIAS:128000 a=rtcp:40013 IN IP4 [media_ip] a=sendrecv a=rtpmap:97 H264/90000 a=fmtp:97 profile-level-id=42e01e; packetization-mode=1 a=rtpmap:96 H263-1998/90000 a=fmtp:96 CIF=1;QCIF=1
  5. ]]>
  6. </send>
  7. <recv response="100" optional="true"> </recv>
  8. <recv response="180" optional="true"> </recv>
  9. <recv response="183" optional="true"> </recv>
  10. <recv response="200"> </recv>
  11. <send>
  12. <![CDATA[
  13. ACK sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[local_ip]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
  14. ]]>
  15. </send>
  16. <pause milliseconds="30000"/>
  17. <send retrans="500">
  18. <![CDATA[
  19. BYE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[local_ip]>;tag=[call_number]  [last_To:] Call-ID: [call_id] CSeq: [cseq] BYE Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
  20. ]]>
  21. </send>
  22. <!--
  23. The 'crlf' option inserts a blank line in the statistics report.
  24. -->
  25. <recv response="200" crlf="true"> </recv>
  26. <pause milliseconds="1500"/>
  27. <!--
  28. definition of the response time repartition table (unit is ms)
  29. -->
  30. <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
  31. <!--
  32. definition of the call length repartition table (unit is ms)
  33. -->
  34. <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
  35. </scenario>
  測(cè)試示例8-INVITE + re-INVITE with T38 offer
  但檢測(cè)到傳真音時(shí),第一個(gè)終端發(fā)送re-INVITE攜帶T38/image offer。第二個(gè)終端拒絕了這個(gè)re-INVITE, 并且回復(fù)了488/Not Acceptable。但是,呼叫不能掛機(jī)。
  命令:
  sipp 192.168.0.192 -sf INVITE_T38_reINVITE.xml -s 30 -r 1 -l 12 -m 1
  XML文件:
  1. <scenario name="UAC INVITE + call">
  2. <!--
  3. sipp 192.168.1.211 -sf invite_T38_reINVITE.xml -s 30 -r 1 -l 12 -m 1
  4. -->
  5. <send retrans="500">
  6. <![CDATA[
  7. INVITE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: "98765432" <sip:98765432@[local_ip]>;tag=[call_number] To: <sip:[remote_ip]:[remote_port]> Call-ID: [call_id] CSeq: 1 INVITE Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 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 8 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000
  8. ]]>
  9. </send>
  10. <recv response="100" optional="true"> </recv>
  11. <recv response="180" optional="true"> </recv>
  12. <recv response="183" optional="true"> </recv>
  13. <recv response="200"> </recv>
  14. <send>
  15. <![CDATA[
  16. ACK sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[local_ip]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: 1 ACK Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
  17. ]]>
  18. </send>
  19. <pause milliseconds="5000"/>
  20. <send retrans="500">
  21. <![CDATA[
  22. INVITE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: "98765432" <sip:98765432@[local_ip]>;tag=[call_number] To: <sip:[remote_ip]:[remote_port]>[peer_tag_param] Call-ID: [call_id] CSeq: 2 INVITE Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Type: application/sdp Content-Length: [len]  v=0 o=BroadWorks 65527945 2 IN IP4 78.8.190.36 s=- c=IN IP4 78.8.190.36 t=0 0 m=image 27914 udptl t38 a=sendrecv a=T38FaxVersion:0 a=T38MaxBitRate:9600 a=T38FaxRateManagement:transferredTCF a=T38FaxMaxBuffer:1000 a=T38FaxMaxDatagram:200 a=T38FaxUdpEC:t38UDPRedundancy
  23. ]]>
  24. </send>
  25. <recv response="488"> </recv>
  26. <send>
  27. <![CDATA[
  28. ACK sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[local_ip]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
  29. ]]>
  30. </send>
  31. <pause milliseconds="5000"/>
  32.   
  33. <!--
  34. <send retrans="500">
  35. <![CDATA[
  36.   
  37. BYE sip:[remote_ip]:[remote_port] SIP/2.0
  38. Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
  39. From: <sip:[local_ip]>;tag=[call_number]
  40. [last_To:]
  41. Call-ID: [call_id]
  42. CSeq: [cseq] BYE
  43. Contact: sip:sipp@[local_ip]:[local_port]
  44. Max-Forwards: 10
  45. Content-Length: 0
  46. ]]>
  47.   
  48. </send>
  49. -->
  50. <!--
  51. The 'crlf' option inserts a blank line in the statistics report.
  52. -->
  53. <recv response="200" crlf="true"> </recv>
  54. <pause milliseconds="1500"/>
  55. <!--
  56. definition of the response time repartition table (unit is ms)
  57. -->
  58. <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
  59. <!--
  60. definition of the call length repartition table (unit is ms)
  61. -->
  62. <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
  63. </scenario>
  測(cè)試示例9- REGISTER UAS + SUBSCRIBE application/dialog-info+xml (BLF) UAS
  這里要求兩個(gè)實(shí)際的處理流程來(lái)模擬此環(huán)境。SIPp同時(shí)發(fā)送注冊(cè)信息和BLF訂閱消息,對(duì)方快速回復(fù)結(jié)束訂閱的響應(yīng),回復(fù)結(jié)果攜帶 reason=noresource。
  1) 首先進(jìn)行注冊(cè): 30@your_pc_ip_address,無(wú)密碼,創(chuàng)建dialog-info+xml subscription支持108@your_pc_ip_address。
  2) 然后執(zhí)行UAS REGISTER scenario ,等待電話登錄。
  3)使用熱鍵組合打斷注冊(cè)流程Ctrl+C,然后運(yùn)行UAS SUBSCRIBE 流程。
  命令:
  sipp -sf uas_register.xml
  sipp -sf uas_subscribe.xml
  XML配置文件(uas_register):
  1. <scenario name="UAS REGISTER + SUBSCRIBE/noresource">
  2. <!--
  3. By adding rrs="true" (Record Route Sets), the route sets
  4. -->
  5. <!--
  6. are saved and used for following messages sent. Useful to test
  7. -->
  8. <!--  against stateful SIP proxies/B2BUAs.                              -->
  9. <recv request="REGISTER" crlf="true"> </recv>
  10. <!--
  11. The '[last_*]' keyword is replaced automatically by the
  12. -->
  13. <!--
  14. specified header if it was present in the last message received
  15. -->
  16. <!--
  17. (except if it was a retransmission). If the header was not
  18. -->
  19. <!--
  20. present or if no message has been received, the '[last_*]'
  21. -->
  22. <!--
  23. keyword is discarded, and all bytes until the end of the line
  24. -->
  25. <!--  are also discarded.                                               -->
  26. <!--                                                                    -->
  27. <!--
  28. If the specified header was present several times in the
  29. -->
  30. <!--
  31. message, all occurences are concatenated (CRLF seperated)
  32. -->
  33. <!--  to be used in place of the '[last_*]' keyword.                    -->
  34. <send>
  35. <![CDATA[
  36. SIP/2.0 200 OK [last_Via:] [last_From:] [last_To:];tag=[call_number] [last_Call-ID:] [last_CSeq:] Contact: <sip:[local_ip]:[local_port];transport=[transport]> Content-Length: 0
  37. ]]>
  38. </send>
  39. </scenario>
  XML配置文件(uas_subscribe):
  1. <scenario name="UAS SUBSCRIBE/noresource">
  2. <recv request="SUBSCRIBE" crlf="true"> </recv>
  3. <send>
  4. <![CDATA[
  5. SIP/2.0 200 OK [last_Via:] [last_Call-ID:] [last_From:] [last_To:];tag=[call_number] [last_CSeq:] Expires: 120 Contact: <sip:30@[local_ip]:[local_port];transport=[transport]> Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, REFER, MESSAGE, OPTIONS Supported: 100rel, norefersub Content-Length: 0
  6. ]]>
  7. </send>
  8. <send>
  9. <![CDATA[
  10. NOTIFY sip:30@prima SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] Max-Forwards: 70 From: <sip:108@[local_ip]:[local_port]>;tag=[call_number] To: "30" <sip:30@[local_ip]>;tag=1 Contact: <sip:30@[local_ip]:[local_port];transport=[transport]> [last_Call-ID:] CSeq: 15540 NOTIFY Event: dialog Subscription-State: terminated;reason=noresource Allow-Events: dialog, refer User-Agent: Prima 2.00.00 Content-Length: 0
  11. ]]>
  12. </send>
  13. <recv response="200" rtd="true"> </recv>
  14. </scenario>
  測(cè)試示例10-REGISTER UAS 發(fā)送 unsolicited MWI NOTIFY 信息
  對(duì)已注冊(cè)的終端發(fā)送unsolicited message-summary 事件,終端為 (31@192.168.0.228)。MWI是終端經(jīng)常使用的功能,簡(jiǎn)單來(lái)說(shuō),就是對(duì)終端發(fā)送提示指示,例如有語(yǔ)音影響留言,BLF等。用戶可以測(cè)試很多品牌的SIP終端話機(jī)。
  命令:
  sipp 192.168.0.228 -s 31
  -sf NOTIFY_MWI_unsolicited.xml -m 1 -l 1 -r 1 -rp 1000
  XML配置文件:
  1. <scenario name="Unsolicited NOTIFY with MWI (message-summary Event)">
  2. <!--
  3. Respond to registration request. Tested phone seems to do not
  4. react to NOTIFY sent from other host than registration server
  5. -->
  6. <recv request="REGISTER" crlf="true"> </recv>
  7. <send>
  8. <![CDATA[
  9. SIP/2.0 200 OK [last_Via:] [last_From:] [last_To:];tag=[call_number] [last_Call-ID:] [last_CSeq:] Contact: <sip:[local_ip]:[local_port];transport=[transport]> Expires: 120  Content-Length: 0
  10. ]]>
  11. </send>
  12. <!--
  13. Send unsolicited NOTIFY with MWI info (2 new/8 old messages, 0 new urgent/ 2 old urgent )
  14. -->
  15. <send retrans="500">
  16. <![CDATA[
  17. NOTIFY sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[service]@[local_ip]>;tag=[call_number] To: <sip:[service]@[local_ip]> Call-ID: [call_id] CSeq: [cseq] NOTIFY Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Event: message-summary Subscription-State: active Content-Type: application/simple-message-summary Content-Length: [len]  Messages-Waiting: yes Message-Account: sip:[service]@[local_ip] Voice-Message: 2/8 (0/2)
  18. ]]>
  19. </send>
  20. <recv response="200"> </recv>
  21. <pause milliseconds="10000"/>
  22. <!--  Send unsolicited NOTIFY with MWI info: no messages     -->
  23. <send retrans="500">
  24. <![CDATA[
  25. NOTIFY sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[service]@[local_ip]>;tag=[call_number] To: <sip:[service]@[local_ip]> Call-ID: [call_id] CSeq: [cseq] NOTIFY Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Event: message-summary Subscription-State: active Content-Type: application/simple-message-summary Content-Length: [len]  Messages-Waiting: no Message-Account: sip:[service]@[local_ip] Voice-Message: 0/0 (0/0)
  26. ]]>
  27. </send>
  28. <recv response="200"> </recv>
  29. <pause milliseconds="10000"/>
  30. <!--
  31. Send unsolicited NOTIFY with MWI info (3 new/9 old messages, 1 new urgent/ 1 old urgent )
  32. -->
  33. <send retrans="500">
  34. <![CDATA[
  35. NOTIFY sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[service]@[local_ip]>;tag=[call_number] To: <sip:[service]@[local_ip]> Call-ID: [call_id] CSeq: [cseq] NOTIFY Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Event: message-summary Subscription-State: active Content-Type: application/simple-message-summary Content-Length: [len]  Messages-Waiting: yes Message-Account: sip:[service]@[local_ip] Voice-Message: 3/9 (1/1)
  36. ]]>
  37. </send>
  38. <recv response="200"> </recv>
  39. <pause milliseconds="10000"/>
  40. <!--  Send unsolicited NOTIFY with MWI info: no messages     -->
  41. <send retrans="500">
  42. <![CDATA[
  43. NOTIFY sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[service]@[local_ip]>;tag=[call_number] To: <sip:[service]@[local_ip]> Call-ID: [call_id] CSeq: [cseq] NOTIFY Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Event: message-summary Subscription-State: active Content-Type: application/simple-message-summary Content-Length: [len]  Messages-Waiting: no Message-Account: sip:[service]@[local_ip] Voice-Message: 0/0 (0/0)
  44. ]]>
  45. </send>
  46. <recv response="200"> </recv>
  47.   <!--
  48. definition of the response time repartition table (unit is ms)
  49. -->
  50. <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
  51. <!--
  52. definition of the call length repartition table (unit is ms)
  53. -->
  54. <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
  55. </scenario>
  測(cè)試示例11-Unsolicited NOTIFY with Event: talk
  發(fā)送Unsolicited talk event (如果支持的話,終端可呼叫應(yīng)答-31@192.168.0.228。
  命令:
  sipp 192.168.0.228 -s 31
  -sf NOTIFY_talk_unsolicited.xml -m 1 -l 1 -r 1 -rp 1000
  XML配置文件:
  1. <!--
  2.  
  3. NOTIFY with Event: talk can trigger accepting incoming call on supporting phone
  4. (e.g. Yealink, Polycom).
  5. Note: this scenario does not handle authentification.
  6. -->
  7. <scenario name="Unsolicited NOTIFY with Event: talk">
  8. <send retrans="500">
  9. <![CDATA[
  10. NOTIFY sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[service]@[local_ip]>;tag=[call_number] To: <sip:[service]@[local_ip]> Call-ID: [call_id] CSeq: [cseq] NOTIFY Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Event: talk Subscription-State: terminated  Content-Length: [len]
  11. ]]>
  12. </send>
  13. <recv response="200"> </recv>
  14. </scenario>
  測(cè)試示例12-Session audit using UPDATE message
  終端發(fā)送200/OK攜帶一個(gè)SDP offer,但是沒(méi)有修改會(huì)話參數(shù)。
  命令:
  sipp 192.168.0.228
  -sf INVITE_UPDATE_session_audit.xml -m 1 -l 1
  XML配置:
  1. <!--
  2.   
  3. Testing: device response to UPDATE message with no body
  4. (aka session audit).
  5. Usage: sipp-win32 ip_address -sf invite_update.xml -m 1
  6. -->
  7. <scenario name="UAC INVITE + call">
  8. <send retrans="500">
  9. <![CDATA[
  10. INVITE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: "9876" <sip:1234@[local_ip]>;tag=[call_number] To: <sip:[remote_ip]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 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 8 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000
  11. ]]>
  12. </send>
  13. <recv response="100" optional="true"> </recv>
  14. <recv response="180" optional="true"> </recv>
  15. <recv response="183" optional="true"> </recv>
  16. <recv response="200"> </recv>
  17. <send>
  18. <![CDATA[
  19. ACK sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[local_ip]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
  20. ]]>
  21. </send>
  22. <pause milliseconds="5000"/>
  23. <send retrans="500">
  24. <![CDATA[
  25. UPDATE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/UDP [local_ip]:[local_port];branch=z9hG4bK1489807744192936848 [last_From:] [last_To:] [last_Call-ID:] CSeq: [cseq] UPDATE Contact: <sip:[local_ip]:[local_port];transport=[transport]> Max-Forwards: 70 User-Agent: SIPp/WinXP Content-Type: application/sdp Content-Length: 0
  26. ]]>
  27. </send>
  28. <recv response="200"> </recv>
  29. <send retrans="500">
  30. <![CDATA[
  31. BYE sip:[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[local_ip]>;tag=[call_number]  [last_To:] Call-ID: [call_id] CSeq: [cseq] BYE Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
  32. ]]>
  33. </send>
  34. <!--
  35. The 'crlf' option inserts a blank line in the statistics report.
  36. -->
  37. <recv response="200" crlf="true"> </recv>
  38. <pause milliseconds="1500"/>
  39. <!--
  40. definition of the response time repartition table (unit is ms)
  41. -->
  42. <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
  43. <!--
  44. definition of the call length repartition table (unit is ms)
  45. -->
  46. <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
  47. </scenario>
  測(cè)試示例13-REGISTER UAC + INVITE + DTMF INFO
  1) SIP 注冊(cè)和認(rèn)證。
  2) 呼叫110. 這里的測(cè)試110是一個(gè)FXS分機(jī),然后通過(guò)FXS再呼叫到FXO端口,呼叫通過(guò)DISA應(yīng)答。這種方式可以通過(guò)Asterisk加語(yǔ)音板卡(FXS/FXO實(shí)現(xiàn))。
  3) 呼叫其他的3位數(shù)號(hào)碼,使用的是SIP INFO DTMF (Content-Type: application/dtmf-relay in this scenario)。呼叫沒(méi)有被應(yīng)答。
  4) 掛機(jī)流程。
  注意,"application/dtmf" Content-Type 的DTMF“*”解析為10,#解析為11.
  命令:
  sipp 192.168.1.211 -sf REGC_INVITE_INFO.xml
  -inf REGC_INVITE_INFO.csv -m 5 -l 1 -r 1 -rp 10000
  XML配置文件:
  1. <scenario name="UAC REGISTER + INVITE + INFO">
  2. <!--
  3. Use with CSV file struct like: 32;192.168.1.211;[authentication username=32 password=32];21;1;0;9
  4. (user part of uri, server address, auth tag, call target | dtmf digit1, digit2, digit3).
  5. In my test call target is actually FXS routed back to FXO that picks calls
  6. automatically and switches them to DISA. Caller dials then another subscriber
  7. number using SIP INFO messages.
  8. -->
  9. <send retrans="500">
  10. <![CDATA[
  11. REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
  12. ]]>
  13. </send>
  14. <!--  asterisk  -->
  15. <recv response="100" optional="true"> </recv>
  16. <recv response="401" auth="true"> </recv>
  17. <send retrans="500">
  18. <![CDATA[
  19. REGISTER sip:[remote_ip] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field0]@[field1]> Call-ID: [call_id] CSeq: [cseq] REGISTER Contact: sip:[field0]@[local_ip]:[local_port] [field2] Max-Forwards: 10 Expires: 120 User-Agent: SIPp/Win32 Content-Length: 0
  20. ]]>
  21. </send>
  22. <!--  asterisk  -->
  23. <recv response="100" optional="true"> </recv>
  24. <recv response="200"> </recv>
  25. <send retrans="500">
  26. <![CDATA[
  27. INVITE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] To: <sip:[field3]@[field1]:[remote_port]> Call-ID: [call_id] CSeq: [cseq] INVITE Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 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
  28. ]]>
  29. </send>
  30. <recv response="100" optional="true"> </recv>
  31. <recv response="180" optional="true"> </recv>
  32. <recv response="183" optional="true"> </recv>
  33. <recv response="200"> </recv>
  34. <send>
  35. <![CDATA[
  36. ACK sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
  37. ]]>
  38. </send>
  39. <!--  "Listening to DISA announcement"  -->
  40. <!--  <pause milliseconds="3000" />  -->
  41. <pause distribution="uniform" min="1000" max="10000"/>
  42. <!--  Dial first digit  -->
  43. <send retrans="500">
  44. <![CDATA[
  45. INFO sip:[remote_ip]:[remote_port];[transport] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] INFO Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Content-Type: application/dtmf-relay Content-Length: [len]  Signal=[field4] Duration=300
  46. ]]>
  47. </send>
  48. <recv response="200"> </recv>
  49. <!--  Dial second digit  -->
  50. <send retrans="500">
  51. <![CDATA[
  52. INFO sip:[remote_ip]:[remote_port];[transport] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] INFO Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Content-Type: application/dtmf-relay Content-Length: [len]  Signal=[field5] Duration=300
  53. ]]>
  54. </send>
  55. <recv response="200"> </recv>
  56. <!--  Dial third digit  -->
  57. <send retrans="500">
  58. <![CDATA[
  59. INFO sip:[remote_ip]:[remote_port];[transport] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:[field0]@[field1]>;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] INFO Contact: sip:[field0]@[local_ip]:[local_port] Max-Forwards: 10 Content-Type: application/dtmf-relay Content-Length: [len]  Signal=[field6] Duration=300
  60. ]]>
  61. </send>
  62. <recv response="200"> </recv>
  63. <!--  Number dialed, wait for a moment  -->
  64. <pause distribution="uniform" min="1000" max="8000"/>
  65. <send retrans="500">
  66. <![CDATA[
  67. BYE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: <sip:[field0]@[field1]>;tag=[call_number]  [last_To:] Call-ID: [call_id] CSeq: [cseq] BYE Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 10 Content-Length: 0
  68. ]]>
  69. </send>
  70. <!--
  71. The 'crlf' option inserts a blank line in the statistics report.
  72. -->
  73. <recv response="200" crlf="true"> </recv>
  74. <!--
  75. The purpose of this pause is to give some time for FXO/FXS lines to
  76. detect disconnection.
  77.   
  78. -->
  79. <pause milliseconds="5000"/>
  80. <!--
  81. definition of the response time repartition table (unit is ms)
  82. -->
  83. <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
  84. <!--
  85. definition of the call length repartition table (unit is ms)
  86. -->
  87. <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
  88. </scenario>
  CVS配置文件:
  測(cè)試示例14- SIP digest 漏洞測(cè)試
  通過(guò)此命令檢測(cè)IPPBX分機(jī)號(hào)碼的漏洞。
  命令:
  sipp 192.168.1.211 -sf uac_digest_leak.xml -s 30 -m 1
  XML配置:
  1. his XML file does not appear to have any style information associated with it. The document tree is shown below.
  2. <!--  SIP digest leak test scenario  -->
  3. <!--
  4. Note: realm at WWW-Authenticate may have to be changed if phone realm configuration is not empty
  5. -->
  6. <!--
  7. (empty realm at phone configuration = auth against any realm)
  8. -->
  9. <!--  http://tomeko.net  -->
  10. <scenario name="SIP digest leak test">
  11. <!--
  12. In client mode (sipp placing calls), the Call-ID MUST be
  13. -->
  14. <!--
  15. generated by sipp. To do so, use [call_id] keyword.
  16. -->
  17. <send retrans="500">
  18. <![CDATA[
  19. INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] To: sut <sip:[service]@[remote_ip]:[remote_port]> 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
  20. ]]>
  21. </send>
  22. <recv response="100" optional="true"> </recv>
  23. <recv response="180" optional="true"> </recv>
  24. <!--
  25. By adding rrs="true" (Record Route Sets), the route sets
  26. -->
  27. <!--
  28. are saved and used for following messages sent. Useful to test
  29. -->
  30. <!--  against stateful SIP proxies/B2BUAs.                              -->
  31. <recv response="200" rtd="true"> </recv>
  32. <!--
  33. Packet lost can be simulated in any send/recv message by
  34. -->
  35. <!--
  36. by adding the 'lost = "10"'. Value can be [1-100] percent.
  37. -->
  38. <send>
  39. <![CDATA[
  40. ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] To: sut <sip:[service]@[remote_ip]:[remote_port]>[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
  41. ]]>
  42. </send>
  43. <!--
  44. At this moment second party is hanging up call (no audio there)
  45. -->
  46. <recv request="BYE"/>
  47. <!--
  48. Test with SIP hardware phone: must use WWW-Authenticate instead of Proxy-Authenticate.
  49. You could also try with SIP/2.0 401 Unauthorized.
  50. -->
  51. <send>
  52. <![CDATA[
  53. SIP/2.0 407 Proxy Authentication Required [last_Via:] [last_From:] [last_To:] [last_Call-ID:] [last_CSeq:] WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="69d327e5" Content-Length: 0
  54. ]]>
  55. </send>
  56. <recv request="BYE"/>
  57. </scenario>
  測(cè)試示例15-生成帶G.729 編碼的呼叫
  在很多呼叫中心的呼叫過(guò)程中,為了節(jié)省帶寬資源,很多運(yùn)營(yíng)商可能提供帶G.729的編碼。
  這里,我們可以通過(guò)SIPp測(cè)試攜帶G.729編碼的呼叫。
  當(dāng)然,用戶需要使用此默認(rèn)配置文件 SIPp. Here is .pcap file,此配置文件攜帶了
  2分鐘的語(yǔ)音流支持了G.729 編碼。配置時(shí)需要保存到默認(rèn)路徑。
  命令:
  sipp 192.168.1.211 -sf uac_pcap_G729.xml -l 1 -m 10
  XML配置:
  1. <!--
  2. This program is free software; you can redistribute it and/or
  3. -->
  4. <!--
  5. modify it under the terms of the GNU General Public License as
  6. -->
  7. <!--
  8. published by the Free Software Foundation; either version 2 of the
  9. -->
  10. <!--  License, or (at your option) any later version.                     -->
  11. <!--                                                                      -->
  12. <!--
  13. This program is distributed in the hope that it will be useful,
  14. -->
  15. <!--
  16. but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. -->
  18. <!--
  19. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. -->
  21. <!--  GNU General Public License for more details.                        -->
  22. <!--                                                                      -->
  23. <!--
  24. You should have received a copy of the GNU General Public License
  25. -->
  26. <!--  along with this program; if not, write to the                       -->
  27. <!--  Free Software Foundation, Inc.,                                     -->
  28. <!--
  29. 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  30. -->
  31. <!--                                                                      -->
  32. <!--                  Sipp 'uac' scenario with pcap (rtp) play            -->
  33. <!--                                                                      -->
  34. <scenario name="UAC with media">
  35. <!--
  36. In client mode (sipp placing calls), the Call-ID MUST be
  37. -->
  38. <!--
  39. generated by sipp. To do so, use [call_id] keyword.
  40. -->
  41. <send retrans="500">
  42. <![CDATA[
  43. INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] To: sut <sip:[service]@[remote_ip]:[remote_port]> 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[local_ip_type] [local_ip] t=0 0 m=audio [auto_media_port] RTP/AVP 18 101 a=rtpmap:18 G729/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-11,16
  44. ]]>
  45. </send>
  46. <recv response="100" optional="true"> </recv>
  47. <recv response="180" optional="true"> </recv>
  48. <!--
  49. By adding rrs="true" (Record Route Sets), the route sets
  50. -->
  51. <!--
  52. are saved and used for following messages sent. Useful to test
  53. -->
  54. <!--  against stateful SIP proxies/B2BUAs.                              -->
  55. <recv response="200" rtd="true" crlf="true"> </recv>
  56. <!--
  57. Packet lost can be simulated in any send/recv message by
  58. -->
  59. <!--
  60. by adding the 'lost = "10"'. Value can be [1-100] percent.
  61. -->
  62. <send>
  63. <![CDATA[
  64. ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] To: sut <sip:[service]@[remote_ip]:[remote_port]>[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
  65. ]]>
  66. </send>
  67. <!--  Play a pre-recorded PCAP file (RTP stream)                        -->
  68. <nop>
  69. <action>
  70. <exec play_pcap_audio="pcap/g729.pcap"/> // 文件存放地址
  71. </action>
  72. </nop>
  73. <!--
  74. Pause 60 seconds, which is less than the duration of the
  75. -->
  76. <!--  PCAP file                                                         -->
  77. <pause milliseconds="60000"/>
  78. <!--  Play an out of band DTMF '1'                                      -->
  79. <nop>
  80. <action>
  81. <exec play_pcap_audio="pcap/dtmf_2833_1.pcap"/>
  82. </action>
  83. </nop>
  84. <pause milliseconds="1000"/>
  85. <!--
  86. The 'crlf' option inserts a blank line in the statistics report.
  87. -->
  88. <send retrans="500">
  89. <![CDATA[
  90. BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] To: sut <sip:[service]@[remote_ip]:[remote_port]>[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
  91. ]]>
  92. </send>
  93. <recv response="200" crlf="true"> </recv>
  94. <!--
  95. definition of the response time repartition table (unit is ms)
  96. -->
  97. <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
  98. <!--
  99. definition of the call length repartition table (unit is ms)
  100. -->
  101. <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
  102. </scenario>
  測(cè)試示例16-視頻呼叫支持的RTP (H.264)
  命令:
  sipp 127.0.0.1 -sf uac_pcap_H264.xml -l 1 -m 1
  XML配置文件:
  H264配置文件
  http://tomeko.net/other/sipp/scenarios/uac_pcap_H264.xml
  測(cè)試示例17-Blind transfer 電話盲轉(zhuǎn)
  注冊(cè)分機(jī),進(jìn)行呼叫,然后執(zhí)行電話盲轉(zhuǎn)。
  命令:
  sipp 192.168.1.211 -sf REGISTER_INVITE_REFER.xml
  -inf REGISTER_INVITE_REFER.csv -m 1 -l 1 -r 1 -rp 10000
  XML配置文件:
  配置文件
  http://tomeko.net/other/sipp/scenarios/REGISTER_INVITE_REFER.xml
  測(cè)試示例18-UAS with T38 reinvite
  檢測(cè)到傳真音時(shí),模擬UAS發(fā)送re-INVITE,攜帶image/t38。涉及測(cè)試需要根據(jù)官方文檔
  做進(jìn)一步配置說(shuō)明。
  命令:
  sipp -sf uas_T38_reinvite.xml
  XML配置文件
  配置文件
  http://tomeko.net/other/sipp/scenarios/uas_T38_reinvite.xml
  模擬測(cè)試的話: 需要配置rtp_pcma_fax_cng.pcap -這是一個(gè)CNG 錄音文件來(lái)檢測(cè)CNG detection。
  測(cè)試示例19-Sipsak 命令重新啟動(dòng)yealink 話機(jī)
  用戶首先需要下載Sipsak工具,配置執(zhí)行文件,通過(guò)Sipsak對(duì)yealink 話機(jī)發(fā)送自定義的消息(NOTIFY Event: check-sync;reboot=true
  重新啟動(dòng)Yealink話機(jī)。
  命令:
  sipsak -f reboot_yealink.sipfile -s sip:1234@192.168.0.195
  配置文件
  配置文件
  http://tomeko.net/other/sipp/sipsak/reboot_yealink.sipfile
  總結(jié):
  以上19個(gè)SIPp測(cè)試示例是第三方測(cè)試人員的測(cè)試文檔,筆者在前幾年僅測(cè)試過(guò)幾個(gè)示例,基本上都
  可以工作。需要強(qiáng)調(diào)的是,用戶需要安裝自己的IPPBX,軟交換或者其他媒體服務(wù)器,
  并且需要有針對(duì)性的配置。然后根據(jù)XML配置文件和預(yù)設(shè)的默認(rèn)支持文件來(lái)實(shí)現(xiàn)測(cè)試。
  筆者僅是共享此文檔,如果測(cè)試人員需要進(jìn)一步獲取完整的測(cè)試XML文件,到參考鏈接的官方獲取。
  參考資料:
  http://tomeko.net/other/sipp/sipp_cheatsheet.php?lang=en
 
   
  FreeSBC/ProSBC 免費(fèi)邊界會(huì)話控制器, 下載ISO:https://freesbc.telcobridges.com/
  關(guān)注微信公眾號(hào):asterisk-cn,獲得有價(jià)值的Asterisk行業(yè)分享
  Asterisk freepbx 中文官方論壇:http://bbs.freepbx.cn/forum.php
  Asterisk freepbx技術(shù)文檔: www.freepbx.org.cn
  融合通信商業(yè)解決方案,協(xié)同解決方案首選產(chǎn)品:www.hiastar.com
  Asterisk/FreePBX中國(guó)合作伙伴,官方qq技術(shù)分享群(3000千人):589995817
 

【免責(zé)聲明】本文僅代表作者本人觀點(diǎn),與CTI論壇無(wú)關(guān)。CTI論壇對(duì)文中陳述、觀點(diǎn)判斷保持中立,不對(duì)所包含內(nèi)容的準(zhǔn)確性、可靠性或完整性提供任何明示或暗示的保證。請(qǐng)讀者僅作參考,并請(qǐng)自行承擔(dān)全部責(zé)任。

專題

CTI論壇會(huì)員企業(yè)