<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<!-- This program is free software; you can redistribute it and/or      -->
<!-- modify it under the terms of the GNU General Public License as     -->
<!-- published by the Free Software Foundation; either version 2 of the -->
<!-- License, or (at your option) any later version.                    -->
<!--                                                                    -->
<!-- This program is distributed in the hope that it will be useful,    -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of     -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      -->
<!-- GNU General Public License for more details.                       -->
<!--                                                                    -->
<!-- You should have received a copy of the GNU General Public License  -->
<!-- along with this program; if not, write to the                      -->
<!-- Free Software Foundation, Inc.,                                    -->
<!-- 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA             -->
<!--                                                                    -->
<!--          IMS Benchmark Registration scenario                       -->
<!--                                                                    -->
<!-- Author : David Verbeiren from Intel Corporation - July 2007        -->
<!--          Xavier Simonart from Intel Corporation - July 2007        -->
<!--          Philippe Lecluse from Intel Corporation - July 2007       -->
<!--                                                                    -->

<scenario name="ims_reg" on_unexpected="9" default_behavior="false">
  <info>
    <metric ref="PX_TRT-REG1" rtd="1" max="2000"/>
    <metric ref="PX_TRT-REG2" rtd="2" max="2000"/>
  </info>

<!-- *** STEP 1 *** -->
 <!-- Select a user from the 'Unregistered' pool and place it into a           -->
 <!-- '(De)Registration ongoing' pool so we don't register it multiple times   -->
 <!-- in parallel.                                                             -->
  <nop>
    <action>
      <assign_user pool="0" scheme="rand_uni"/>   <!-- 'Unregistered' user  -->
      <move_user pool="1"/>                       <!-- Registration ongoing -->
    </action>
  </nop>

<!-- *** STEP 2 *** -->
 <!-- Now that our preparation step is done, we wait for the time when the scenario -->
 <!-- must actually start, according to the random scenario arrival distribution.   -->
  <sync crlf="true">
    <action>
      <exec int_cmd="set_start_time"/>
    </action>
  </sync>

<!-- *** STEP 3 *** -->
 <!-- Now the SIP scenario really starts -->

  <send retrans="500" start_rtd="1">
    <![CDATA[
      REGISTER sip:[field3] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: "[field0]" <sip:[field0]@[field3]>;tag=[call_number]
      To: "[field0]" <sip:[field0]@[field3]>
      Call-ID: [call_id]
      CSeq: 1 REGISTER
      Contact: <sip:[field0]@[local_ip]:[local_port]>
      Expires: [%RegistrationExpire]
      Content-Length: 0
    ]]>
  </send>

  <recv response="200" rtd="2" crlf="true" next="10">
    <action>
      <!-- <ereg regexp=".*" search_in="hdr" header="Service-Route:" check_it="false" assign_to="u1" /> -->
       <!-- We store the Service-Route indicated by the SUT into a user variable  -->
       <!-- because we must use it as Route for subsequent dialogs we'll initiate -->
       <!-- as part of executing other scenarios for the registered user.         -->
      <move_user pool="2"/>    <!-- User is now 'Registered' -->
    </action>
  </recv>


  <label id="9"/>  <!-- FAILURE CASE -->

  <nop>
    <action>
      <move_user pool="0"/>    <!-- We ASSUME user is still 'Not Registered' -->
    </action>
  </nop>


  <label id="10"/> <!-- END OF SCENARIO -->


  <!-- definition of the response time repartition table (unit is ms)   -->
  <ResponseTimeRepartition value="10, 20"/>

  <!-- definition of the call length repartition table (unit is ms)     -->
  <CallLengthRepartition value="10"/>

</scenario>
