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

<scenario name="bob_busy_random_cancel_s">
  <recv request="INVITE"/>
  <send>
    <![CDATA[

      SIP/2.0 180 Ringing
      [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

    ]]>
  </send>	
  <!-- Wait 5 seconds to send 486, alternatively wait for a CANCEL -->
  <recv request="CANCEL" optional="true" next="1"></recv>
  <pause milliseconds="5000" next="2" />

	
  <!-- CANCEL received, send 200ok for the CANCEL, and 487 for the INVITE,
  receive ACK, and end scenario -->
  <label id="1"/>
  <send>
    <![CDATA[

      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

    ]]>
  </send>
  <send>
    <![CDATA[

      SIP/2.0 487 Request Cancelled
      [last_Via:]
      [last_From:]
      [last_To:];tag=[call_number]
      [last_Call-ID:]
      CSeq: 1 INVITE
      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
      Content-Length: 0

    ]]>
  </send>    
  <recv request="ACK" next="5"></recv>
  
  
  <!-- Timer fired,send 486 busy here -->
  <label id="2"/>
  <send>
    <![CDATA[

      SIP/2.0 486 Busy Here
      [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

    ]]>
  </send>
  <!-- now we have two options CANCEL or ACK -->
  <recv request="CANCEL" optional="true" next="3"></recv>
  <recv request="ACK" optional="true" next ="4"></recv>


  <!-- CANCEL received, simply rec the ACK, and end scenario>
  <label id="3"/>
  <recv request="ACK" next="5"></recv>
  
  
  <label id="4"/>
  <!-- ACK received before CANCEL, we can still received the CANCEL -->
  <recv request="CANCEL" optional="true" next="3"></recv>
  <pause milliseconds="5000" next="5"/>
  
  
  <!-- end scenario -->
  <label id="5">
  

  <!-- 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>

