sip - 用sipp重放一个pcap文件

时间:2014-05-28 14:43:32

标签: sip

我正在尝试使用sipp重播捕获的pcap文件。 我的设置有2个电脑和一个代理。接收电脑有linphone,应该能够接听来自发送带有sipp的pcap文件的其他电脑的电话。 我用wireshark记录了媒体并将其保存为* .pcap。

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">


<scenario name="UAC with media">
  <!-- In client mode (sipp placing calls), the Call-ID MUST be         -->
  <!-- generated by sipp. To do so, use [call_id] keyword.              -->

  <send retrans="500">
    <![CDATA[

      REGISTER sip:[remote_ip] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
      From: <sip:[field0]@[field2]>;tag=[call_number]
      To: <sip:[field0]@[field2]>
      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

    ]]>
  </send>

  <!-- asterisk -->
  <recv response="100" optional="true">
  </recv>

  <recv response="401" auth="true">
  </recv>

  <send retrans="500">
    <![CDATA[

      REGISTER sip:[remote_ip] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: <sip:[field0]@[field2]>;tag=[call_number]
      To: <sip:[field0]@[field2]>
      Call-ID: [call_id]
      CSeq: [cseq] REGISTER
      Contact: <sip:[field0]@[local_ip]>
      [field3]
      Max-Forwards: 10
      Expires: 120
      User-Agent: SIPp/Win32
      Content-Length: 0

    ]]>
  </send>

  <!-- asterisk -->
  <recv response="100" optional="true">
  </recv>

  <recv response="200">
  </recv>


  <send retrans="500">
    <![CDATA[

      INVITE sip:[field1]@[field2] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
      From: <sip:[field0]@[field2]>;tag=[call_number]
      To: <sip:[field1]@[field2]>
      Call-ID: [call_id]
      CSeq: 20 INVITE
      Contact: <sip:[field0]@[local_ip]:[local_port]>
      Content-Type: application/sdp
      Max-Forwards: 70
      Subject: Phone Call
      Content-Length: [len]

      v=0
      o=user1 123456 654321 IN IP[media_ip_type] [media_ip]
      s=-
      c=IN IP[local_ip_type] [local_ip]
      t=0 0
      m=audio [media_port] RTP/AVP 0 8 101
      a=rtpmap:0 PCMU/8000/1
      a=rtpmap:8 PCMA/8000/1
      a=rtpmap:101 telephone-event/8000/1
      a=fmtp:101 0-11
      a=sendrecv
      m=video [media_port+2] RTP/AVP 99 98 34 100
      a=rtpmap:99 MP4V-ES/90000
      a=fmtp:99 profile-level-id=3
      a=rtpmap:98 H263-1998/90000
      a=fmtp:98 CIF=1;QCIF=1
      a=rtpmap:34 H263/90000
      a=rtpmap:100 x-snow/90000
      a=sendrecv

    ]]>
  </send>

  <recv response="100" optional="true">
  </recv>

  <recv response="180" optional="true">
  </recv>

  <!-- By adding rrs="true" (Record Route Sets), the route sets         -->
  <!-- are saved and used for following messages sent. Useful to test   -->
  <!-- against stateful SIP proxies/B2BUAs.                             -->
  <recv response="200" rtd="true" crlf="true">
  </recv>

  <!-- Packet lost can be simulated in any send/recv message by         -->
  <!-- by adding the 'lost = "10"'. Value can be [1-100] percent.       -->
  <send>
    <![CDATA[

      ACK sip:[field1]@[field2] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
      Route: <sip:[remote_ip]:[remote_port];lr=on>
      From: <sip:[field0]@[field2]>;tag=[call_number]
      To: <sip:[field1]@[field2]>
      Call-ID: [call_id]    
      CSeq: 20 ACK
      Contact: <sip:[field0]@[local_ip]:[local_port]>
      Max-Forwards: 70
      Subject: Phone Call
      Content-Length: [len]

    ]]>
  </send>

  <!-- Play a pre-recorded PCAP file (RTP stream)                       -->
  <nop>
    <action>
      <exec play_pcap_audio="/home/MM08-T/Desktop/owntest.pcap"/>
    </action>
  </nop>

  <pause milliseconds="10000"/>

  <!-- The 'crlf' option inserts a blank line in the statistics report. -->
  <send retrans="500">
    <![CDATA[

      BYE sip:[field1]@[field2] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      Route: <sip:[remote_ip]:[remote_port];lr=on>
      From: <sip:[field0]@[field2]>;tag=[call_number]
      To: <sip:[field1]@[field2]>
      Call-ID: [call_id]
      CSeq: 21 BYE
      Contact: <sip:[field0]@[local_ip]:[local_port]>
      Max-Forwards: 70
      Subject: Phone Call
      Content-Length: 0

    ]]>
  </send>

  <recv response="200" crlf="true">
  </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>

和注射文件:

  

SEQUENTIAL MM08-T; MM08-O; lab.ibk.tuwien.ac.at; [认证   username = MM08-T password = UHzd7wv0];

问题在于我总是收到错误消息:

  

2014-05-28 16:27:32:278 1401287252.278473:意外中止呼叫   Call-Id&#39; 10-12715@192.168.108.105'的消息:同时期待&#39; 180&#39;   (索引8),收到&#39; SIP / 2.0 101 Dialog Establishement Via:   SIP / 2.0 / UDP 192.168.108.105:5061; rport = 5061; branch = z9hG4bK-121515-10-6   记录路线:来自:   ; tag = 10 To:   ;标签= 1157919833呼叫ID:   10-12715@192.168.108.105 CSeq:20邀请联系方式:    用户代理:Linphone / 3.3.99.6   (eXosip2 / 3.3.0)内容长度:0 P-hint:

     

&#39 ;. sipp:有更多错误,启用-trace_err来记录它们。

在我看来,情景文件有一些问题,但我发现什么都不对。 有人有任何线索吗?

1 个答案:

答案 0 :(得分:1)

根据您在此处发布的错误消息,SIPP xml脚本不处理来自Linphone的“101 Dialog Establishment”响应。 您可以尝试在XML文件中添加101响应处理(作为可选项),然后重试。

<recv response="101" optional="true">
</recv>