<?xml version="1.0" encoding="iso-8859-2" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<scenario name="UAC REGISTER + INVITE + INFO">

<!--  Use with CSV file struct like: 32;192.168.1.211;[authentication username=32 password=32];21;1;0;9
      (user part of uri, server address, auth tag, call target | dtmf digit1, digit2, digit3).
      In my test call target is actually FXS routed back to FXO that picks calls
      automatically and switches them to DISA. Caller dials then another subscriber
      number using SIP INFO messages. 
-->

  <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]@[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

    ]]>
  </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]@[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

    ]]>
  </send>

  <!-- asterisk -->
  <recv response="100" optional="true">
  </recv>

  <recv response="200">
  </recv>  
  




  <send retrans="500">
    <![CDATA[

      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

    ]]>
  </send>

  <recv response="100" optional="true">
  </recv>

  <recv response="180" optional="true">
  </recv>

  <recv response="183" optional="true">
  </recv>

  <recv response="200">
  </recv>

  <send>
    <![CDATA[

      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

    ]]>
  </send>


  <!-- "Listening to DISA announcement" -->
  <!-- <pause milliseconds="3000" /> -->
  <pause distribution="uniform" min="1000" max="10000" />

  <!-- Dial first digit -->
  <send retrans="500">
    <![CDATA[
      
      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
    ]]>  
  </send>  
  
  <recv response="200">
  </recv>


  <!-- Dial second digit -->
  <send retrans="500">
    <![CDATA[
      
      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
    ]]>  
  </send>  
  
  <recv response="200">
  </recv>


  <!-- Dial third digit -->
  <send retrans="500">
    <![CDATA[
      
      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
    ]]>  
  </send>  
  
  <recv response="200">
  </recv>


  
  <!-- Number dialed, wait for a moment -->  
  <pause distribution="uniform" min="1000" max="8000" /> 


  <send retrans="500">
    <![CDATA[

      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

    ]]>
  </send>

  <!-- The 'crlf' option inserts a blank line in the statistics report. -->
  <recv response="200" crlf="true">
  </recv>

  <!-- The purpose of this pause is to give some time for FXO/FXS lines to
       detect disconnection. 
  -->
  <pause milliseconds="5000" /> 



  <!-- 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>

