<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "document-v13.dtd">
<document> 
  <header> 
    <title>SIPp</title>
    <subtitle>SIPp reference documentation</subtitle>
    <authors>
        <person name="Richard GAYRAUD [initial code]" email="richard_gayraud@users.sourceforge.net"/>
        <person name="Olivier JACQUES [code/documentation]" email="ojacques@users.sourceforge.net"/>
        <person name="Many contributors [code]" email="none@email.com"/>
    </authors>
  </header> 
  <body> 
    <section>
      <title>Foreword</title>
      <warning>This version of the documentation is for SIPp 3.0 branch.
      To access the latest version of the documentation, go to <link href="../doc/reference.html">this page</link>.</warning>
      <p>SIPp is a performance testing tool for the SIP protocol. It includes a
      few basic SipStone user agent scenarios (UAC and UAS) and establishes and
      releases multiple calls with the INVITE and BYE methods. It can also reads
      XML scenario files describing any performance testing configuration. It
      features the dynamic display of statistics about running tests (call rate,
      round trip delay, and message statistics), periodic CSV statistics dumps,
      TCP and UDP over multiple sockets or multiplexed with retransmission
      management, regular expressions and variables in scenario files, and
      dynamically adjustable call rates.</p>
      <p>SIPp can be used to test many real SIP equipements like SIP proxies,
      B2BUAs, SIP media servers, SIP/x gateways, SIP PBX, ... It is also very
      useful to emulate thousands of user agents calling your SIP system. </p>
      <p><strong>Want to see it?</strong></p>
      <p>Here is a screenshot</p>
      <p><img src="images/sipp-01.jpg" alt="SIPp screenshot"/></p>
      <p>And here is a video (Windows Media Player 9 codec or above required) of
      SIPp in action:</p>
      <p><icon src="images/wmv.gif" alt="wmv"/><link href="images/sipp-01.wmv">sipp-01.wmv</link></p>
    </section>
    <section><title>Installation</title>
        <section>
          <title>Getting SIPp</title>
           <p>SIPp is released under the
           <link href="http://www.gnu.org/copyleft/gpl.html">GNU GPL license</link>.
           All the terms of the license apply. It is provided to the SIP
           community by <link href="http://www.hp.com">Hewlett-Packard</link>
           engineers in hope it can be useful.</p> <p>We receive some support
           from our company to work on this tool freely, but <strong>HP does not
           provide any support nor warranty concerning SIPp.</strong></p>
            </section>
        <section><title>Stable release</title>
            <p>Like many other "open source" projects, there are two versions of
            SIPp: a stable and unstable release. Stable release: before being
            labelled as "stable", a SIPp release is thoroughly tested. So you
            can be confident that all mentioned features will work :) </p>
            <note>Use the stable release for your everyday use and if you are
            not blocked by a specific feature present in the "unstable release"
            (see below).</note> <p><link href="http://sourceforge.net/project/showfiles.php?group_id=104305">SIPp
            stable download page</link></p>
            </section>
        <section><title>Unstable release</title>
            <p>Unstable release: all new features and bug fixes are checked in
            <link href="http://sipp.svn.sourceforge.net/viewvc/sipp/sipp/trunk/">SIPp's
            SVN</link> repository as soon as they are available. Every night, an
            automatic extraction is done and the source code of this release is
            made available. </p>
            <note> Use the unstable release if you absolutely need a bug fix or
            a feature that is not in the stable release. </note>
            <p><link href="http://sipp.sourceforge.net/snapshots/">SIPp "unstable" download page</link></p>
        </section>
        <section><title>Available platforms</title>
            <p>SIPp is available on almost all UNIX platforms: HPUX, Tru64,
            Linux (RedHat, Debian, FreeBSD), Solaris/SunOS.</p>
            <p>A Windows port has been contributed. You can now compile SIPp under
            Cygwin. A binary package with a Windows installer is also available. 
            Check <link href="http://sourceforge.net/project/showfiles.php?group_id=104305">the
            download page</link> to download it and run SIPp under Windows.</p>
            <note>SIPp works only over Windows XP and will not
            work on Win2000. This is because of IPv6 support. The Windows installer 
            should prevent someone to install SIPp on Win2000.</note>
            </section> 
        <anchor id="Compiling"/><section><title>Compiling SIPp</title>
          <ul>
          <li>Pre-requisites to compile SIPp are (see <link href="http://sipp.sourceforge.net/wiki/index.php/Compilation">Compilation tips</link>):
            <ul>
              <li>C++ Compiler</li>
              <li>curses or ncurses library</li>
              <li>For authentication and TLS support: OpenSSL &gt;= 0.9.8</li>
              <li>For pcap play support: libpcap and libnet</li>
              <li>For distributed pauses: <link href="http://www.gnu.org/software/gsl/">Gnu Scientific Libraries</link></li>
            </ul>
          </li>
          <li>You have four options to compile SIPp:
            <ul>
              <li><strong>Without TLS (Transport Layer Security) and authentication support</strong>:
              This is the recommended setup if you don't need to handle SIP authentication
            and/or TLS. In this case, there are <strong>no depencies to install</strong> before
            building SIPp. It is straight forward:
<source xml:space="preserve"><![CDATA[# gunzip sipp-xxx.tar.gz
# tar -xvf sipp-xxx.tar
# cd sipp
# make
]]></source></li>
              <li><strong>With TLS and <link href="#authentication">authentication</link> support</strong>, you must have
              installed <link href="http://www.openssl.org/">OpenSSL library</link> (&gt;=0.9.8) 
              (which may come with your system). Building SIPp consist only in adding
              the "ossl" option to the make command:
<source xml:space="preserve"><![CDATA[# gunzip sipp-xxx.tar.gz
# tar -xvf sipp-xxx.tar
# cd sipp
# make ossl
]]></source></li>
              <li><strong>With <link href="#pcapplay">PCAP play</link> and without <link href="#authentication">authentication</link> support</strong>:
<source xml:space="preserve"><![CDATA[# gunzip sipp-xxx.tar.gz
# tar -xvf sipp-xxx.tar
# cd sipp
# make pcapplay
]]></source></li>
              <li><strong>With <link href="#pcapplay">PCAP play</link> and <link href="#authentication">authentication</link> support</strong>:
<source xml:space="preserve"><![CDATA[# gunzip sipp-xxx.tar.gz
# tar -xvf sipp-xxx.tar
# cd sipp
# make pcapplay_ossl
]]></source></li>

            </ul>
            <anchor id="gsl"/><note>To enable <link href="http://www.gnu.org/software/gsl/">GSL</link> at compile time, 
            you must install GSL and its include files, as well as un-comment 
            the lines in the local.mk file of SIPp distribution. Then, re-compile SIPp.</note>
          </li>
          <li>On Windows, SIPp is provided both with the source and the pre-compiled 
          executable. Just execute the installer to have SIPp installed.
          <warning>SIPp compiles under CYGWIN, provided that you installed IPv6
          extension for CYGWIN (<link href="http://win6.jp/Cygwin/">http://win6.jp/Cygwin/</link>),
          as well as OpenSSL and libncurses.</warning></li>
          <li>To compile SIPp on Windows with pcap (media support), you must:
          <ul>
            <li>Copy the <link href="http://www.winpcap.org/devel.htm">WinPcap developer package</link> to "C:\cygwin\lib\WpdPack"</li>
            <li>Remove or rename "pthread.h" in "C:\cygwin\lib\WpdPack\Include", as it interfers with pthread.h from cygwin</li>
            <li>Compile using either "make pcapplay_cygwin" or "pcapplay_ossl_cygwin"</li>
          </ul>
          </li>
          </ul>
        </section>
        <anchor id="Installing"/><section><title>Installing SIPp</title>
        <p>Binary packages are also available for several Linux and HP_UX platforms. For each one of these platforms, the given archive contains two packages:</p>
        <ul><li>sipp-standard was produced compiling sipp without options. Therefore, you can use it only for the sipp features which does'nt need any dependency</li><br/>
            <li>sipp-pcapplay-ossl comes with pcap play, TLS, authentication and pause distribution support. So you need openssl, libpcap and gsl libraries to be installed to use this package</li>
        </ul>
        <p>Those packages are incompatible to each other.</p>
        <p>Note that there is currently no sipp-pcapplay-ossl package available for HP_UX 11.23 IA64.</p>
        <p>First, unzip and untar the sipp archive:</p>
        <source xml:space="preserve"><![CDATA[sipp-[standard|pcapplay-ossl]-[tool version]-[OS]-[OS release version].tar.gz
        ]]></source>
        <p>Then, use the package installer of your platform:</p>
        <ul>
          <li>HPUX 11i/11.23: 
            <source xml:space="preserve"><![CDATA[swinstall -s /full_path_to_the_depot/sipp-[standard|pcapplay-ossl]-[tool version]-[OS]-[OS release version]-[processor].depot]]></source>
          </li>
          <li>Linux RedHat : 
            <source xml:space="preserve"><![CDATA[rpm -ivh sipp-[standard|pcapplay-ossl]-[tool version]-[OS]-[OS release version]-[processor].rpm]]></source>
          </li>
        </ul>
        <p>Executable is located at</p>
         <ul>
           <li>/usr/local/bin/sipp</li>
         </ul>
         <p>The pcapplay-ossl package also provide the following directory, containg the example pcap files:</p>
         <ul>
           <li>/usr/local/share/sipp/pcap</li>
         </ul>
        </section>     
        <anchor id="filedesc"/><section><title>Increasing File Descriptors Limit</title>
        <p>If your system does not supports enough file descriptors, 
        you may experience problems when using the TCP/TLS mode with many simultaneous calls.</p>
        <p>You have two ways to overcome this limit: either use the <link href="#maxsocket"><code>-max_socket</code></link>
        command line option or change the limits of your system.</p> 
        <p>Depending on the operating system you use, different procedures 
        allow you to increase the maximum number of file descriptors:</p>
        <ul>
            <li><p>On Linux 2.4 kernels the default number of file descriptors can 
            be increased by modifying the <code>/etc/security/limits.conf</code> 
            and the <code>/etc/pam.d/login</code> file. </p>
            <p>Open the <code>/etc/security/limits.conf</code> file and add the following lines:</p>
<source xml:space="preserve"><![CDATA[soft nofile 1024
hard nofile 65535]]></source>
            <p>Open the <code>/etc/pam.d/login</code> and add the following line</p>
<source xml:space="preserve"><![CDATA[session required /lib/security/pam_limits.so]]></source>
            <p>The system file descriptor limit is set in the <code>/proc/sys/fs/file-max</code> file. 
            The following command will increase the file descriptor limit:</p>
<source xml:space="preserve"><![CDATA[echo 65535> /proc/sys/fs/file-max]]></source>
            <p>To increase the number of file descriptors to its maximum limit 
            (65535) set in the <code>/etc/security/limits.conf</code> file, type:</p>
<source xml:space="preserve"><![CDATA[ulimit -n unlimited]]></source>
            <p>Logout then login again to make the changes effective.</p>
            </li>
            <li><p>On HP-UX systems the default number of file descriptors 
            can be increased by modifying the system configuration with the sam utility. 
            In the Kernel Configuration menu, select Configurable parameters, 
            and change the following attributes:</p> 
<source xml:space="preserve"><![CDATA[maxfiles : 4096
maxfiles_lim : 4096
nfiles : 4096
ninode : 4096
max_thread_proc : 4096
nkthread : 4096]]></source>
            </li>
          </ul>
        </section>
    </section>
   <section><title>Using SIPp</title>
        <section>
          <title>Main features</title>
            <p>SIPp allows to generate one or many SIP calls to one remote
            system. The tool is started from the command line. In this example,
            two SIPp are started in front of each other to demonstrate SIPp
            capabilities.</p>
            <p>Run sipp with embedded server (uas) scenario:</p>
            <source xml:space="preserve"><![CDATA[# ./sipp -sn uas]]></source>
            <p>On the same host, run sipp with embedded client (uac) scenario</p>
            <source xml:space="preserve"><![CDATA[# ./sipp -sn uac 127.0.0.1]]></source>
        </section>     
        <section>
          <title>Integrated scenarios</title>
            <p>Integrated scenarios? Yes, there are scenarios that are embedded
            in SIPp executable. While you can create your own custom SIP
            scenarios (see <link href="#xmlsyntax">how to create your own XML
            scenarios</link>), a few basic (yet useful) scenarios are available
            in SIPp executable.</p>
            <section>
              <title>UAC</title>
                <p>Scenario file: <link href="uac.xml.html">uac.xml</link> (<link href="uac.xml">original XML file</link>)</p>
                <source xml:space="preserve"><![CDATA[SIPp UAC            Remote
    |(1) INVITE         |
    |------------------>|
    |(2) 100 (optional) |
    |<------------------|
    |(3) 180 (optional) |
    |<------------------|
    |(4) 200            |
    |<------------------|
    |(5) ACK            |
    |------------------>|
    |                   |
    |(6) PAUSE          |
    |                   |
    |(7) BYE            |
    |------------------>|
    |(8) 200            |
    |<------------------|
]]></source>
            </section>
            <anchor id="uac_with_media"/><section>
              <title>UAC with media</title>
                <p>Scenario file: <link href="uac_pcap.xml.html">uac_pcap.xml</link> (<link href="uac_pcap.xml">original XML file</link>)</p>
                <source xml:space="preserve"><![CDATA[SIPp UAC            Remote
    |(1) INVITE         |
    |------------------>|
    |(2) 100 (optional) |
    |<------------------|
    |(3) 180 (optional) |
    |<------------------|
    |(4) 200            |
    |<------------------|
    |(5) ACK            |
    |------------------>|
    |                   |
    |(6) RTP send (8s)  |
    |==================>|
    |                   |
    |(7) RFC2833 DIGIT 1|
    |==================>|
    |                   |
    |(8) BYE            |
    |------------------>|
    |(9) 200            |
    |<------------------|
]]></source>
            </section>
            <section>
              <title>UAS</title>
                <p>Scenario file: <link href="uas.xml.html">uas.xml</link> (<link href="uas.xml">original XML file</link>)</p>
                <source xml:space="preserve"><![CDATA[Remote              SIPp UAS
    |(1) INVITE         |
    |------------------>|
    |(2) 180            |
    |<------------------|
    |(3) 200            |
    |<------------------|
    |(4) ACK            |
    |------------------>|
    |                   |
    |(5) PAUSE          |
    |                   |
    |(6) BYE            |
    |------------------>|
    |(7) 200            |
    |<------------------|
]]></source>
            </section>
            <section>
              <title>regexp</title>
                <p>Scenario file: <link href="regexp.xml.html">regexp.xml</link> (<link href="regexp.xml">original XML file</link>)</p>
                <p>This scenario, which behaves as an UAC is explained in greater details in <link href="#action_regexp">this section</link>.</p>
                <source xml:space="preserve"><![CDATA[SIPp regexp         Remote
    |(1) INVITE         |
    |------------------>|
    |(2) 100 (optional) |
    |<------------------|
    |(3) 180 (optional) |
    |<------------------|
    |(4) 200            |
    |<------------------|
    |(5) ACK            |
    |------------------>|
    |                   |
    |(6) PAUSE          |
    |                   |
    |(7) BYE            |
    |------------------>|
    |(8) 200            |
    |<------------------|
]]></source>
            </section>
            <anchor id="scenario_branch"/><section>
              <title>branch</title>
                <p>Scenario files: <link href="branchc.xml.html">branchc.xml</link> (<link href="branchc.xml">original XML file</link>) and
                <link href="branchs.xml.html">branchs.xml</link> (<link href="branchs.xml">original XML file</link>)</p>
                <p>Those scenarios, which work against each other (branchc for client side and 
                branchs for server side) are explained in greater details in <link href="#branching">this section</link>.</p>
                <source xml:space="preserve"><![CDATA[    REGISTER ---------->
         200 <----------
         200 <----------
      INVITE ---------->
         100 <----------
         180 <----------
         403 <----------
         200 <----------
         ACK ---------->
             [  5000 ms]
         BYE ---------->
         200 <----------]]></source>
            </section>
            <anchor id="ThreePCC"/><section>
              <title>3PCC</title>
                <p>3PCC stands for 3rd Party Call Control. 3PCC is described in 
                <link href="http://www.ietf.org/rfc/rfc3725.txt">RFC 3725</link>.
                While this feature was first developped to allow 3PCC like scenarios, 
                it can also be used for every case where you would need one SIPp to talk
                to several remotes.</p>
                <p>In order to keep SIPp simple (remember, it's a test tool!),
                one SIPp instance can only talk to one remote. Which is an issue
                in 3PCC call flows, like call flow I (SIPp beeing a controller):</p>
                <source xml:space="preserve"><![CDATA[             A              Controller               B
             |(1) INVITE no SDP  |                   |
             |<------------------|                   |
             |(2) 200 offer1     |                   |
             |------------------>|                   |
             |                   |(3) INVITE offer1  |
             |                   |------------------>|
             |                   |(4) 200 OK answer1 |
             |                   |<------------------|
             |                   |(5) ACK            |
             |                   |------------------>|
             |(6) ACK answer1    |                   |
             |<------------------|                   |
             |(7) RTP            |                   |
             |.......................................|
]]></source>
                <p>Scenario file: <link href="3pcc-A.xml.html">3pcc-A.xml</link> (<link href="3pcc-A.xml">original XML file</link>)</p>
                <p>Scenario file: <link href="3pcc-B.xml.html">3pcc-B.xml</link> (<link href="3pcc-B.xml">original XML file</link>)</p>
                <p>Scenario file: <link href="3pcc-C-A.xml.html">3pcc-C-A.xml</link> (<link href="3pcc-C-A.xml">original XML file</link>)</p>
                <p>Scenario file: <link href="3pcc-C-B.xml.html">3pcc-C-B.xml</link> (<link href="3pcc-C-B.xml">original XML file</link>)</p>
                <p>The 3PCC feature in SIPp allows to have two SIPp instances
                launched and synchronised together. If we take the example of 
                call flow I, one SIPp instance will take care of the dialog with
                remote A (this instance is called 3PCC-C-A for 3PCC-Controller-A-Side) 
                and another SIPp instance will take care of the dialog with remote B 
                (this instance is called 3PCC-C-B for 3PCC-Controller-B-Side).</p>
                <p>The 3PCC call flow I will, in reality, look like this
                (Controller has been divided in two SIPp instances):</p>
                <source xml:space="preserve"><![CDATA[
             A             Controller A         Controller B            B
             |(1) INVITE no SDP  |                  |                   |
             |<------------------|                  |                   |
             |(2) 200 offer1     |                  |                   |
             |------------------>|                  |                   |
             |                sendCmd  (offer1)     |                   |
             |                   |----------------->|                   |
             |                   |               recvCmd                |
             |                   |                  |(3) INVITE offer1  |
             |                   |                  |------------------>|
             |                   |                  |(4) 200 OK answer1 |
             |                   |                  |<------------------|
             |                   |               sendCmd                |
             |                   |     (answer1)    |                   |
             |                   |<-----------------|                   |
             |                 recvCmd              |(5) ACK            |
             |                   |                  |------------------>|
             |(6) ACK answer1    |                  |                   |
             |<------------------|                  |                   |
             |(7) RTP            |                  |                   |
             |..........................................................|
]]></source>
                <p>As you can see, we need to pass informations
                between both sides of the controller. SDP "offer1" is provided
                by A in message (2) and needs to be sent to B side in message (3). 
                This mechanism is implemented 
                in the scenarios through the &lt;<link href="#sendCmd">sendCmd</link>&gt; command. This:</p>
<source xml:space="preserve"><![CDATA[<sendCmd>
  <![CDATA[
    Call-ID: [call_id]
    [$1]

   ]]]]><![CDATA[>
</sendCmd>
]]></source>
                <p>Will send a "command" to the twin SIPp instance. Note that including
                the Call-ID is mandatory in order to correlate the commands to
                actual calls. In the same manner, this:</p>
<source xml:space="preserve"><![CDATA[<recvCmd>
  <action
     <ereg regexp="Content-Type:.*"
           search_in="msg"
           assign_to="2"/>
  </action>
</recvCmd>
]]></source>
                <p>Will receive a "command" from the twin SIPp instance. 
                Using the <link href="#action_regexp">regular expression</link> mechanism, 
                the content is retrieved
                and stored in a call variable ($2 in this case), ready to be
                reinjected</p>
<source xml:space="preserve"><![CDATA[  <send>
    <![CDATA[

      ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port]
      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
      [$2]

    ]]]]><![CDATA[>
  </send>
]]></source>                
                <p>In other words, <link href="#sendCmd">sendCmd</link> and <link href="#recvCmd">recvCmd</link> can be seen as synchronization points
                between two SIPp instances, with the ability to pass parameters
                between each other.</p>
                <p>Another scenario that has been reported to be do-able with the
                3PCC feature is the following:</p>
                <ul>
                  <li>A calls B. B answers. B and A converse</li>
                  <li>B calls C. C answers. C and B converse</li>
                  <li>B "REFER"s A to C and asks to replace A-B call with B-C call.</li>
                  <li>A accepts. A and C talk. B drops out of the calls.</li>
                </ul>
            </section>
        </section>
        <anchor id="ThreePCCExtended"/><section>
              <title>3PCC Extended</title>
              <p>An extension of the 3pcc mode is implemented in sipp.
               This feature allows n twin sipp instances to communicate each other,
               each one of them being connected to a remote host.</p>
               <p>The sipp instance which initiates the call is launched in "master" mode. 
               The others are launched in "slave" mode. Twin sipp instances have names,
               given in the command line (for example, s1, s2...sn for the slaves and m for the master) 
               Correspondances between instances names and their addresses must be stored in a file (provided by -slave_cfg command line
	       argument), in the following format:</p> 
<source xml:space="preserve"><![CDATA[
  s1;127.0.0.1:8080
  s2;127.0.0.1:7080
  m;127.0.0.1:6080
]]></source> 
               <p>Each twin sipp instance must access a different copy of this file.</p>
               <p><link href="#sendCmd">sendCmd</link> and <link href="#recvCmd">recvCmd</link> have additional attributes:</p>
<source xml:space="preserve"><![CDATA[<sendCmd dest="s1">
  <![CDATA[
    Call-ID: [call_id]
    From: m
    [$1]

   ]]]]><![CDATA[>
</sendCmd>
]]></source>
                 <p>Will send a command to the "s1" peer instance, which can be either master or slave,
                    depending on the command line argument, which must be consistent with the scenario:
                    a slave instance cannot have a sendCmd action before having any recvCmd.
                    Note that the message must contain a "From" field, filled with the name of the sender. </p>
<source xml:space="preserve"><![CDATA[<recvCmd src="m">
  <action
     <ereg regexp="Content-Type:.*"
           search_in="msg"
           assign_to="2"/>
  </action>
</recvCmd>
]]></source>
                <p>Indicates that the twin command is expected to be received from the "m" peer instance.</p>
                <p>Note that the master must be the launched at last.</p>
                <p>There is no integrated scenarios for the 3pcc extended mode, but you can easily adapt those from 3pcc.</p>
		<p><b>Example:</b> the following drawing illustrate the entire procedure. The arrows that are
		shown between SIPp master and slaves depict only the synchronization commands exchanged between
		the different SIPp instances. The SIP message exchange takes place as usual.<br/><br/>
		<img alt="Master / slave feature" src="images/master_slave.png"/>
		</p>
                </section>
        <anchor id="traffic_control"/><section><title>Traffic control</title>
        <p>SIPp generates SIP traffic according to the scenario specified. You
        can control the number of calls (scenario) that are started per second.
        This can be done either: </p>        
        <ul>
            <li>Interactively, by pressing keys on the keyboard
              <ul>
                  <li>'+' key to increase call rate by 1</li>
                  <li>'-' key to decrease call rate by 1</li>
                  <li>'*' key to increase call rate by 10</li>
                  <li>'/' key to decrease call rate by 10</li>
              </ul>
            </li>
            <li>At starting time, by specifying parameters on the command line:
                <ul>
                    <li>"-r" to specify the call rate in number of calls per seconds</li>
                    <li>"-rp" to specify the "<strong>r</strong>ate <strong>p</strong>eriod" 
                    in milliseconds for the call rate (default is 1000ms/1sec). 
                    This allows you to have n calls every m milliseconds (by using <code>-r n -rp m</code>).
                        <note>Example: run SIPp at 7 calls every 2 seconds (3.5 calls per second)</note>
                        <source xml:space="preserve"><![CDATA[./sipp -sn uac -r 7 -rp 2000 127.0.0.1]]></source>
                    </li>
                </ul>
            </li>
        </ul>
        <p>You can also <strong>pause</strong> the traffic by pressing the 'p' key. 
        SIPp will stop placing new calls and wait until all current calls go to their end. 
        You can <strong>resume</strong> the traffic by pressing 'p' again.</p>
        <p>To <strong>quit</strong> SIPp, press the 'q' key. 
        SIPp will stop placing new calls and wait until all current calls go to their end.
        SIPp will then exit.</p>
        <p>You can also force SIPp to <strong>quit</strong> immediatly by pressing the 'Q' key. 
        Current calls will be terminated by sending a BYE or CANCEL message (depending if the calls have been established or not).
        The same behaviour is obtained by pressing 'q' twice.</p>
        <note><strong>TIP:</strong> you can place a defined number of calls and
        have SIPp exit when this is done. Use the <code>-m</code> option on the
        command line.</note>
        </section>
        <anchor id="remote_control"/><section><title>Remote control</title>
          <p>SIPp can be "remote-controlled" through a UDP socket. This allows for example</p>
          <ul>
            <li>To automate a series of actions, like increasing the call rate smoothly, 
            wait for 10 seconds, increase more, wait for 1 minute and loop</li>
            <li>Have a feedback loop so that an application under test can
            remote control SIPp to lower the load, pause the traffic, ...</li>
          </ul>
          <p>Each SIPp instance is listening to a UDP socket. It 
          starts to listen to port 8888 and each following SIPp instance (up to 60)
          will listen to base_port + 1 (8889, 8890, ...).</p>
          <p>It is then possible to control SIPp like this:</p>
          <source xml:space="preserve"><![CDATA[echo p >/dev/udp/x.y.z.t/8888 -> put SIPp in pause state (p key)
echo q >/dev/udp/x.y.z.t/8888 -> quit SIPp (q key)]]></source>
          <note>All keys available through keyboard are also available in 
          the remote control interface</note>
          <p>You could also have a small shell script to automate a serie of action. 
          For example, this script will 
          increase the call rate by 10 more new calls/s every 5 seconds, wait at this call rate
          for one minute and exit SIPp:</p>
          <source xml:space="preserve"><![CDATA[#!/bin/sh
echo "*" >/dev/udp/127.0.0.1/8889
sleep 5
echo "*" >/dev/udp/127.0.0.1/8889
sleep 5
echo "*" >/dev/udp/127.0.0.1/8889
sleep 5
echo "*" >/dev/udp/127.0.0.1/8889
sleep 60
echo "q" >/dev/udp/127.0.0.1/8889
]]></source>
        </section>
        <section><title>Running SIPp in background</title>
          <p>SIPp can be launched in background mode (<code>-bg</code> command
          line option).</p>
          <p>By doing so, SIPp will be detached from the current terminal and run
          in the background. The PID of the SIPp process is provided. If you didn't specify a number of calls to execute
          with the <code>-m</code> option, SIPp will run forever.</p>
          <p>There is a mechanism implemented to stop SIPp smoothly. The command
          <code>kill -SIGUSR1 [SIPp_PID]</code> will instruct SIPp to stop placing
          any new calls and finish all ongoing calls before exiting.</p>
          <p>When using the background mode, the main sipp instance stops and a child process will continue the job. Therefore,
           the log files names will contain another PID than the actual sipp instance PID. </p>
        </section>
        <anchor id="xmlsyntax"/><section><title>Create your own XML scenarios</title>
            <p>Of course embedded scenarios will not be enough. So it's time to
            create your own scenarios. A SIPp scenario is written in XML
            (a DTD that may help you write SIPp
            scenarios does exist and has been tested with jEdit - this is described in a later section).
            A scenario will always start with:</p>
            <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="ISO-8859-1" ?>
<scenario name="Basic Sipstone UAC">
]]></source>
            <p>And end with:</p>
<source xml:space="preserve"><![CDATA[</scenario>]]></source>
            <p>Easy, huh? Ok, now let's see what can be put inside. You are not
            obliged to read the whole table now! Just go in the next section for
            an example.</p>
            <table>
                <caption>List of commands with their attributes</caption>
                <tr>
                    <th colspan="1" rowspan="1">Command</th>
                    <th colspan="1" rowspan="1">Attribute(s)</th>
                    <th colspan="1" rowspan="1">Description</th>
                    <th colspan="1" rowspan="1">Example</th>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><anchor id="send"/><strong>&lt;send&gt;</strong></td>
                    <td colspan="1" rowspan="1">retrans</td>
                    <td colspan="1" rowspan="1">Used for UDP transport only: it specifies the T1 timer value,
                    as described in SIP RFC 3261, section 17.1.1.2.</td>
                    <td colspan="1" rowspan="1"><code>&lt;send retrans="500"&gt;</code>: will initiate T1 timer to 500 milliseconds (RFC3261 default).</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"><anchor id="start_rtd"/></td>
                    <td colspan="1" rowspan="1">start_rtd</td>
                    <td colspan="1" rowspan="1">Starts one of the 5 "<strong>R</strong>esponse <strong>T</strong>ime <strong>D</strong>uration" timer.
                    (see <link href="#Response+times">statistics section</link>).</td>
                    <td colspan="1" rowspan="1"><code>&lt;send start_rtd="2"&gt;</code>: the timer number 2 will start when the message is sent.</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"><anchor id="rtd"/></td>
                    <td colspan="1" rowspan="1">rtd</td>
                    <td colspan="1" rowspan="1">Stops one of the 5 "<strong>R</strong>esponse <strong>T</strong>ime <strong>D</strong>uration" timer.</td>
                    <td colspan="1" rowspan="1"><code>&lt;send rtd="2"&gt;</code>: the timer number 2 will stop when the message is sent.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">repeat_rtd</td>
                    <td colspan="1" rowspan="1">Used with a rtd attribute, it allows the corresponding "<strong>R</strong>esponse <strong>T</strong>ime <strong>D</strong>uration" timer
                    to be counted more than once per call (useful for loop call flows). </td>
                    <td colspan="1" rowspan="1"><code>&lt;send rtd="1" repeat_rtd="true"&gt;</code>: the timer number 1 value will be printed but the timer won't stop.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">crlf</td>
                    <td colspan="1" rowspan="1">Displays an empty line <strong>after</strong> the arrow for the message in main SIPp screen.</td>
                    <td colspan="1" rowspan="1"><code>&lt;send crlf="true"&gt;</code></td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">lost</td>
                    <td colspan="1" rowspan="1">Emulate packet lost. The value is specified as a percentage.</td>
                    <td colspan="1" rowspan="1"><code>&lt;send lost="10"&gt;</code>: 10% of the message sent are actually not sent :).</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">next</td>
                    <td colspan="1" rowspan="1">You can put a "next" in a send to go to another part of the script when you are done with sending the message. 
                    See <link href="#branching">conditional branching</link> section for more info.</td>
                    <td colspan="1" rowspan="1">Example to jump to label "12" after sending an ACK:<source xml:space="preserve"><![CDATA[  <send next="12">
    <![CDATA[

      ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
      Via: ...
      From: ...
      To: ...
      Call-ID: ...
      Cseq: ...
      Contact: ...
      Max-Forwards: ...
      Subject: ...
      Content-Length: 0

    ]]]]><![CDATA[>
  </send>
]]></source></td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">test</td>
                    <td colspan="1" rowspan="1">You can put a "test" next to a "next" attribute to indicate
                    that you only want to branch to the label specified with "next"
                    if the variable specified in "test" is set (through <link href="#action_regexp">regexp</link>
                    for example).
                    See <link href="#branching">conditional branching</link> section for more info.</td>
                    <td colspan="1" rowspan="1">Example to jump to label "6" after sending an ACK only if
                    variable 4 is set:<source xml:space="preserve"><![CDATA[  <send next="6" test="4">
    <![CDATA[

      ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
      Via: ...
      From: ...
      To: ...
      Call-ID: ...
      Cseq: ...
      Contact: ...
      Max-Forwards: ...
      Subject: ...
      Content-Length: 0

    ]]]]><![CDATA[>
  </send>
]]></source></td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">counter</td>
                    <td colspan="1" rowspan="1">Increments the counter given as parameter when the message is sent. A total of 5 counter can be used.
                    The counter are saved in the <link href="#Available+counters">statistic file</link>.</td>
                    <td colspan="1" rowspan="1"><code>&lt;send counter="1"&gt;</code>: Increments counter #1 when the message is sent.</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"><anchor id="recv"/><strong>&lt;recv&gt;</strong></td>
                    <td colspan="1" rowspan="1">response</td>
                    <td colspan="1" rowspan="1">Indicates what SIP message code is expected.</td>
                    <td colspan="1" rowspan="1"><code>&lt;recv response="200"&gt;</code>: SIPp will expect a SIP message with code "200".</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">request</td>
                    <td colspan="1" rowspan="1">Indicates what SIP message request is expected.</td>
                    <td colspan="1" rowspan="1"><code>&lt;recv request="ACK"&gt;</code>: SIPp will expect an "ACK" SIP message.</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">optional</td>
                    <td colspan="1" rowspan="1">Indicates if the message to receive is optional. In case of an optional
                    message and if the message is actually received, it is not seen as a unexpected message.
                    When an unexpected message is received, Sipp looks if this message matches an optional message defined in the previous step of the scenario.<br/>
                    If optional is set to "global", Sipp will look every previous steps of the scenario.</td><td colspan="1" rowspan="1"><code>&lt;recv response="100" optional="true"&gt;</code>: The 100 SIP message can be received without 
                    being considered as "unexpected".</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">crlf</td>
                    <td colspan="1" rowspan="1">Displays an empty line <strong>after</strong> the arrow for the message in main SIPp screen.</td>
                    <td colspan="1" rowspan="1"><code>&lt;recv crlf="true"&gt;</code></td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">rrs</td>
                    <td colspan="1" rowspan="1"><strong>R</strong>ecord <strong>R</strong>oute <strong>S</strong>et. if this attribute is set to "true",
                    then the "Record-Route:" header of the message received is stored and can be recalled using the <strong>[routes]</strong> keyword.</td>
                    <td colspan="1" rowspan="1"><code>&lt;recv response="100" rrs="true"&gt;</code>.</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">auth</td>
                    <td colspan="1" rowspan="1"><link href="#authentication">Authentication</link>. if this attribute is set to "true",
                    then the "Proxy-Authenticate:" header of the message received is stored and is used to build
                    the <strong>[authentication]</strong> keyword.</td>
                    <td colspan="1" rowspan="1"><code>&lt;recv response="407" auth="true"&gt;</code>.</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">start_rtd</td>
                    <td colspan="1" rowspan="1">Starts one of the 5 "<strong>R</strong>esponse <strong>T</strong>ime <strong>D</strong>uration" timer.
                    (see <link href="#Response+times">statistics section</link>).</td>
                    <td colspan="1" rowspan="1"><code>&lt;recv start_rtd="4"&gt;</code>: the timer number 4 will start when the message is received.</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">rtd</td>
                    <td colspan="1" rowspan="1">Stops one of the 5 "<strong>R</strong>esponse <strong>T</strong>ime <strong>D</strong>uration" timer.</td>
                    <td colspan="1" rowspan="1"><code>&lt;recv rtd="4"&gt;</code>: the timer number 4 will stop when the message is received.</td>
                </tr> 
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">repeat_rtd</td>
                    <td colspan="1" rowspan="1">Used with a rtd attribute, it allows the corresponding "<strong>R</strong>esponse <strong>T</strong>ime <strong>D</strong>uration" timer
                    to be counted more than once per call (useful for loop call flows). </td>
                    <td colspan="1" rowspan="1"><code>&lt;recv rtd="1" repeat_rtd="true"&gt;</code>: the timer number 1 value will be printed but the timer won't stop.</td>
                </tr>           
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">lost</td>
                    <td colspan="1" rowspan="1">Emulate packet lost. The value is specified as a percentage.</td>
                    <td colspan="1" rowspan="1"><code>&lt;recv lost="10"&gt;</code>: 10% of the message received are thrown away.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">timeout</td>
                    <td colspan="1" rowspan="1">Specify a timeout while waiting for a message. If the message is not received, the call is aborted, unless an ontimeout label is defined. </td>
                    <td colspan="1" rowspan="1"><code>&lt;recv timeout="100000"&gt;</code></td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">ontimeout</td>
                    <td colspan="1" rowspan="1">Specify a label to jump to if the timeout popped before the message to be received.</td>
                    <td colspan="1" rowspan="1">Example to jump to label "5" when not receiving a 100 message after 100 seconds:<source xml:space="preserve"><![CDATA[  <recv response="100" timeout="100000" ontimeout="5">
  </recv>
]]></source></td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">action</td>
                    <td colspan="1" rowspan="1">Specify an action when receiving the message. See  <link href="#actions">Actions section</link> for possible actions.</td>
                    <td colspan="1" rowspan="1">Example of a "regular expression" action:<source xml:space="preserve"><![CDATA[<recv response="200">
 <action>
  <ereg regexp="([0-9]{1,3}\.){3}[0-9]{1,3}:[0-9]*"
    search_in="msg"
    check_it="true"
    assign_to="1,2"/>
  </action>
 </recv>]]></source></td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">next</td>
                    <td colspan="1" rowspan="1">You can put a "next" in an optional receive to go to another part of the script if you receive that message. 
                    See <link href="#branching">conditional branching</link> section for more info.</td>
                    <td colspan="1" rowspan="1">Example to jump to label "5" when receiving a 403 message:<source xml:space="preserve"><![CDATA[  <recv response="100"
        optional="true">
  </recv>
  <recv response="180" optional="true">
  </recv>
  <recv response="403" optional="true" next="5">
  </recv>
  <recv response="200">
  </recv>
]]></source></td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">test</td>
                    <td colspan="1" rowspan="1">You can put a "test" in an optional receive to go to another part of the script if you receive that message
                    only if the variable specified by "test" is set. 
                    See <link href="#branching">conditional branching</link> section for more info.</td>
                    <td colspan="1" rowspan="1">Example to jump to label "5" when receiving a 403 message only if
                    variable 3 is set:<source xml:space="preserve"><![CDATA[  <recv response="100"
        optional="true">
  </recv>
  <recv response="180" optional="true">
  </recv>
  <recv response="403" optional="true" next="5" test="3">
  </recv>
  <recv response="200">
  </recv>
]]></source></td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">chance</td>
                    <td colspan="1" rowspan="1">In combination with "test", probability to actually branch to another part
		    of the scenario. Chance can have a value between 0 (never) and 1 (always). 
		    See <link href="#branching">conditional branching</link> section for more info.</td>
                    <td colspan="1" rowspan="1"><source xml:space="preserve"><![CDATA[  <recv response="403" optional="true" next="5" test="3" chance="0.90">
  </recv>]]></source>90% chance to go to label "5" if variable "3" is set.</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">counter</td>
                    <td colspan="1" rowspan="1">Increments the counter given as parameter when the message is received. A total of 5 counter can be used.
                    The counter are saved in the <link href="#Available+counters">statistic file</link>.</td>
                    <td colspan="1" rowspan="1"><code>&lt;recv counter="1"&gt;</code>: Increments counter #1 when the message is received.</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">regexp_match</td>
                    <td colspan="1" rowspan="1">Boolean. Indicates if 'request' ('response' is not available) is given as a regular expression. If so, the recv
		    command will match against the regular expression. This allows to catch several cases
		    in the same receive command.
		    </td>
                    <td colspan="1" rowspan="1">Example of a recv command that matches MESSAGE or PUBLISH or SUBSCRIBE requests:<br/>
		    <source xml:space="preserve"><![CDATA[<recv request="MESSAGE|PUBLISH|SUBSCRIBE" crlf="true" regexp_match="true">
</recv>]]></source></td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"><strong>&lt;pause&gt;</strong></td>
                    <td colspan="1" rowspan="1">milliseconds</td>
                    <td colspan="1" rowspan="1">Specify the pause delay, in milliseconds. When this delay is not set, the value of the <code>-d</code> command
                    line parameter is used.</td>
                    <td colspan="1" rowspan="1"><code>&lt;pause milliseconds="5000"/&gt;</code>: pause the scenario for 5 seconds.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">variable</td>
                    <td colspan="1" rowspan="1">Indicates which call variable to use to determine the length of the pause.</td>
                    <td colspan="1" rowspan="1"><code>&lt;pause variable="1" /&gt;</code> pauses for the number of milliseconds specified by call variable 1.</td>
                </tr>
                <tr>
		    <anchor id="pause_distributions"/>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">distribution</td>
                    <td colspan="1" rowspan="1">Indicates which statistical distribution to use to determine the length of the pause.  Without GSL, you may use <code>uniform</code> or <code>fixed</code>.  With GSL, normal, exponential, gamma, lambda, lognormal, negbin, (negative binomial), pareto, and weibull are available.  Depending on the distribution you select, you must also supply distribution specific parameters.</td>
                    <td colspan="1" rowspan="1">
			The following examples show the various types of distributed pauses:

			<ul>
			<li><code>&lt;pause distribution="fixed" value="1000" /&gt;</code> pauses for 1 second.</li>
			<li><code>&lt;pause distribution="uniform" min="2000" max="5000"/&gt;</code> pauses between 2 and 5 seconds.</li>
			</ul>

			The remaining distributions require GSL.  In general The
			parameter names were chosen to be as consistent with
			Wikipedia's distribution description pages.
			<ul>
			<li><code>&lt;pause distribution="normal" mean="60000" stdev="15000"/&gt;</code> provides a normal pause with a mean of 60 seconds (i.e. 60,000 ms) and a standard deviation of 15 seconds.  The mean and standard deviation are specified as integer milliseconds.  The distribution will look like:<br/>
			<img alt="Normal pause distribution" src="images/dist_normal.gif"/>
			</li>
			<li><code>&lt;pause distribution="lognormal" mean="12.28" stdev="1" /&gt;</code> creates a distribution's whose natural logarithm has a mean of 12.28 and a
  standard deviation of 1.  The mean and standard deviation are specified as
  double values (in milliseconds).  The distribution will look like:<br/>
			<img alt="Log normal pause distribution" src="images/dist_lognormal.gif"/></li>

                        <li><code>&lt;pause distribution="exponential" mean="900000"/&gt;</code> creates an exponentially distributed pause with a mean of 15 minutes.  The distribution will look like:<br/>
                        <img alt="Normal pause distribution" src="images/dist_exponential.gif"/></li>

                        <li><code>&lt;pause distribution="weibull" lambda="3" k ="4"/&gt;</code> creates a Weibull distribution with a scale of 3 and a shape of 4 (see <link href="http://en.wikipedia.org/wiki/Weibull">Weibull on Wikipedia</link> for a description of the distribution).</li>

                        <li><code>&lt;pause distribution="pareto" k="1" x_m="2"/&gt;</code> creates a Pareto distribution with k and x<sub>m</sub> of 1 and 2, respectively (see <link href="http://en.wikipedia.org/wiki/Pareto_distribution">Pareto on Wikipedia</link> for a description of the distribution).</li>

                        <li><code>&lt;pause distribution="gamma" k="3" theta="2"/&gt;</code> creates a Gamma distribution with k and theta of 9 and 2, respectively (see <link href="http://en.wikipedia.org/wiki/Gamma_distribution">Gamma on Wikipedia</link> for a description of the distribution).</li>

                        <li><code>&lt;pause distribution="negbin" p="0.1" n="2"/&gt;</code> creates a Negative binomial distribution with p and n of 0.1 and 2, respectively (see <link href="http://en.wikipedia.org/wiki/Negative_binomial_distribution">Negative Binomial on Wikipedia</link> for a description of the distribution).</li>
			</ul>

                    </td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">crlf</td>
                    <td colspan="1" rowspan="1">Displays an empty line <strong>after</strong> the arrow for the message in main SIPp screen.</td>
                    <td colspan="1" rowspan="1"><code>&lt;pause crlf="true"&gt;</code></td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">next</td>
                    <td colspan="1" rowspan="1">You can put a "next" in a pause to go to another part of the script when you are done with the pause. 
                    See <link href="#branching">conditional branching</link> section for more info.</td>
                    <td colspan="1" rowspan="1">Example to jump to label "7" after pausing 4 seconds:<source xml:space="preserve"><![CDATA[<pause milliseconds="4000" next="7"/>]]></source></td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">sanity_check</td>
                    <td colspan="1" rowspan="1">By default, statistically distributed pauses are sanity checked to ensure that their 99th percentile values are less than INT_MAX.  Setting <strong>sanity_check</strong> to false disables this behavior.</td>
                    <td colspan="1" rowspan="1"><code>&lt;pause distribution="lognormal" mean="10" stdev="10" sanity_check="false"/&gt;</code> disables sanity checking of the lognormal distribution.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><anchor id="nop"/><strong>&lt;nop&gt;</strong></td>
                    <td colspan="1" rowspan="1">action</td>
                    <td colspan="1" rowspan="1">The nop command doesn't do anything at SIP level. It is 
                    only there to specify an action to execute. See  <link href="#actions">Actions section</link> for possible actions.</td>
                    <td colspan="1" rowspan="1">Execute the play_pcap_audio/video action:<source xml:space="preserve"><![CDATA[<nop>
  <action>
    <exec play_pcap_audio="pcap/g711a.pcap"/>
  </action>
</nop>
]]></source></td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">start_rtd</td>
                    <td colspan="1" rowspan="1">Starts one of the 5 "<strong>R</strong>esponse <strong>T</strong>ime <strong>D</strong>uration" timer.
                     (see <link href="#Response+times">statistics section</link>).</td>
                    <td colspan="1" rowspan="1"><code>&lt;nop start_rtd="1"&gt;</code>: the timer number 1 starts when nop is executed.</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">rtd</td>
                    <td colspan="1" rowspan="1">Stops one of the 5 "<strong>R</strong>esponse <strong>T</strong>ime <strong>D</strong>uration" timer.</td>
                    <td colspan="1" rowspan="1"><code>&lt;nop rtd="1"&gt;</code>: the timer number 1 will stops when nop is executed.</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"><anchor id="sendCmd"/><strong>&lt;sendCmd&gt;</strong></td>
                    <td colspan="1" rowspan="1">&lt;![CDATA[]]&gt;</td>
                    <td colspan="1" rowspan="1">Content to be sent to the twin <link href="#ThreePCC">3PCC</link> SIPp instance. The Call-ID must be included in the CDATA. In 3pcc extended mode, the From must be included to. </td>
                    <td colspan="1" rowspan="1"><source xml:space="preserve"><![CDATA[<sendCmd>
  <![CDATA[
    Call-ID: [call_id]
    [$1]

   ]]]]><![CDATA[>
</sendCmd>]]></source></td>
                </tr> 
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">dest</td>
                    <td colspan="1" rowspan="1">3pcc extended mode only: the twin sipp instance which the command will be sent to</td>
                    <td colspan="1" rowspan="1"><code>&lt;sendCmd dest="s1"&gt;</code>: the command will be sent to the "s1" twin instance</td>
                </tr>           
                <tr>
                    <td colspan="1" rowspan="1"><anchor id="recvCmd"/><strong>&lt;recvCmd&gt;</strong></td>
                    <td colspan="1" rowspan="1">action</td>
                    <td colspan="1" rowspan="1">Specify an action when receiving the command. See  <link href="#actions">Actions section</link> for possible actions.</td>
                    <td colspan="1" rowspan="1">Example of a "regular expression" to retrieve what has been send by a sendCmd command:<source xml:space="preserve"><![CDATA[<recvCmd>
  <action
     <ereg regexp="Content-Type:.*"
           search_in="msg"
           assign_to="2"/>
  </action>
</recvCmd>]]></source></td>
                </tr> 
                <tr>
                    <td colspan="1" rowspan="1"/>
                    <td colspan="1" rowspan="1">src</td>
                    <td colspan="1" rowspan="1">3pcc extended mode only: indicate the twin sipp instance which the command is expected to be received from </td>
                    <td colspan="1" rowspan="1"><code>&lt;recvCmd src = "s1"&gt;</code>: the command will be expected to be received from the "s1" twin instance</td>
                </tr>           
                <tr>
                    <td colspan="1" rowspan="1"><strong>&lt;label&gt;</strong></td>
                    <td colspan="1" rowspan="1">id</td>
                    <td colspan="1" rowspan="1">A label is used when you want to branch to specific parts
                    in your scenarios. The "id" attribute is an integer where the maximum value is 19.
                    See <link href="#branching">conditional branching</link> section for more info.</td>
                    <td colspan="1" rowspan="1">Example: set label number 13:<source xml:space="preserve"><![CDATA[<label id="13"/>]]></source></td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><anchor id="resptimerep"/><strong>&lt;Response Time Repartition&gt;</strong></td>
                    <td colspan="1" rowspan="1">value</td>
                    <td colspan="1" rowspan="1">Specify the intervals, in milliseconds, used to distribute the values of response times.</td>
                    <td colspan="1" rowspan="1"><code>&lt;ResponseTimeRepartition value="10, 20,
                    30"/&gt;</code>: response time values are distributed
                    between 0 and 10ms, 10 and 20ms, 20 and 30ms, 30 and
                    beyond.</td>
                </tr>            
                <tr>
                    <td colspan="1" rowspan="1"><anchor id="calllengthrep"/><strong>&lt;Call Length Repartition&gt;</strong></td>
                    <td colspan="1" rowspan="1">value</td>
                    <td colspan="1" rowspan="1">Specify the intervals, in milliseconds, used to distribute the values of the call length measures.</td>
                    <td colspan="1" rowspan="1"><code>&lt;CallLengthRepartition value="10, 20,
                    30"/&gt;</code>: call length values are distributed between
                    0 and 10ms, 10 and 20ms, 20 and 30ms, 30 and beyond.</td>
                </tr>
            </table>
            <p>There are not so many commands: send, recv, sendCmd, recvCmd,
            pause, ResponseTimeRepartition and CallLengthRepartition. To make
            things even clearer, nothing is better than an example...</p>
            <section><title>Structure of client (UAC like) XML scenarios</title>
            <p>A client scenario is a scenario that starts with a "send" command. So let's start:</p>
            <source xml:space="preserve"><![CDATA[<scenario name="Basic Sipstone UAC">
  <send>
    <![CDATA[
    
      INVITE sip:]]><strong>[service]</strong><![CDATA[@]]><strong>[remote_ip]</strong><![CDATA[:]]><strong>[remote_port]</strong><![CDATA[ SIP/2.0
      Via: SIP/2.0/]]><strong>[transport]</strong><![CDATA[ ]]><strong>[local_ip]</strong><![CDATA[:]]><strong>[local_port]</strong><![CDATA[
      From: sipp <sip:sipp@]]><strong>[local_ip]</strong><![CDATA[:]]><strong>[local_port]</strong><![CDATA[>;tag=]]><strong>[call_number]</strong><![CDATA[
      To: sut <sip:]]><strong>[service]</strong><![CDATA[@]]><strong>[remote_ip]</strong><![CDATA[:]]><strong>[remote_port]</strong><![CDATA[>
      Call-ID: ]]><strong>[call_id]</strong><![CDATA[
      Cseq: 1 INVITE
      Contact: sip:sipp@]]><strong>[local_ip]</strong><![CDATA[:]]><strong>[local_port]</strong><![CDATA[
      Max-Forwards: 70
      Subject: Performance Test
      Content-Type: application/sdp
      Content-Length: ]]><strong>[len]</strong><![CDATA[

      v=0
      o=user1 53655765 2353687637 IN IP]]><strong>[local_ip_type]</strong><![CDATA[ ]]><strong>[local_ip]</strong><![CDATA[
      s=-
      t=0 0
      c=IN IP]]><strong>[media_ip_type]</strong><![CDATA[ ]]><strong>[media_ip]</strong><![CDATA[
      m=audio ]]><strong>[media_port]</strong><![CDATA[ RTP/AVP 0
      a=rtpmap:0 PCMU/8000


    ]]]]><![CDATA[>
  </send>]]></source>
            <p>Inside the "send" command, you have to enclose your SIP message
            between the "&lt;![CDATA" and the "]]&gt;" tags. Everything between
            those tags is going to be sent toward the remote system. You may
            have noticed that there are strange keywords in the SIP message,
            like <strong>[service], [remote_ip], ...</strong>. Those keywords
            are used to indicate to SIPp that it has to do something with
            it.</p>
            <p>Here is the list:</p>
            <anchor id="keyword"/>
            <table>
                <caption>Keyword list</caption>
                <tr>
                    <th colspan="1" rowspan="1">Keyword</th>
                    <th colspan="1" rowspan="1">Default</th>
                    <th colspan="1" rowspan="1">Description</th>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[service]</strong></td>
                    <td colspan="1" rowspan="1">service</td>
                    <td colspan="1" rowspan="1">Service field, as passed in the <strong><code>-s service_name</code></strong></td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[remote_ip]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Remote IP address, as passed on the command line.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[remote_port]</strong></td>
                    <td colspan="1" rowspan="1">5060</td>
                    <td colspan="1" rowspan="1">Remote IP port, as passed on the command line. You can 
                    add a computed offset [remote_port+3] to this value.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[transport]</strong></td>
                    <td colspan="1" rowspan="1">UDP</td>
                    <td colspan="1" rowspan="1">Depending on the value of <strong>-t</strong> parameter, this will take the values "UDP" or "TCP".</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[local_ip]</strong></td>
                    <td colspan="1" rowspan="1">Primary host IP address</td>
                    <td colspan="1" rowspan="1">Will take the value of <strong>-i</strong> parameter.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[local_ip_type]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Depending on the address type of <strong>-i</strong> parameter (IPv4 or IPv6),
                    local_ip_type will have value "4" for IPv4 and "6" for IPv6.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[local_port]</strong></td>
                    <td colspan="1" rowspan="1">Chosen by the system</td>
                    <td colspan="1" rowspan="1">Will take the value of <strong>-p</strong> parameter.
                    You can add a computed offset [local_port+3] to this value.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[len]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Computed length of the SIP body. To be used in "Content-Length"
                    header. You can add a computed offset [len+3] to this value.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[call_number]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Index. The call_number starts from "1" and is incremented by 1 for each call.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[cseq]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Generates automatically the CSeq number. The initial value is 1 by default. It
                    can be changed by using the <code>-base_cseq</code> command line option.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[call_id]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">A call_id identifies a call and is generated by SIPp for each new call. <strong>In client mode, it is mandatory
                    to use the value generated by SIPp in the "Call-ID" header.</strong> Otherwise, SIPp will not recognise
                    the answer to the message sent as being part of an existing call.<br/>
                    Note: [call_id] can be pre-pended with an arbitrary string using '///'. Example: Call-ID: ABCDEFGHIJ///[call_id] - it will still be recognized by SIPp as part of the same call.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[media_ip]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Depending on the value of <strong>-mi</strong> parameter, it is the local IP address for RTP echo.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[media_ip_type]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Depending on the address type of <strong>-mi</strong> parameter (IPv4 or IPv6),
                    media_ip_type will have value "4" for IPv4 and "6" for IPv6. Useful to build the SDP independently
                    of the media IP type.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[media_port]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Depending on the value of <strong>-mp</strong> parameter, it set the local RTP echo port number. Default
                      is none. RTP/UDP packets received on that port are echoed to their sender. You can 
                    add a computed offset [media_port+3] to this value.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[auto_media_port]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Only for pcap. To make audio and video ports begin from the value of <strong>-mp</strong> parameter, 
                        and change for each call using a periodical system, modulo 10000 (which limits to 10000 concurrent RTP sessions for pcap_play) </td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[last_*]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">The '[last_*]' keyword is replaced automatically by the
                    specified header if it was present in the last message
                    received (except if it was a retransmission). If the header
                    was not present or if no message has been received, the
                    '[last_*]' keyword is discarded, and all bytes until the end
                    of the line are also discarded. If the specified header was
                    present several times in the message, all occurences are
                    concatenated (CRLF separated) to be used in place of the
                    '[last_*]' keyword.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[field0-n]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Used to inject values from an external CSV file. See
                    <link href="#inffile">"Injecting values from an external CSV
                    during calls"</link> section.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[$n]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Used to inject the value of call variable number n. See "<link href="#actions">Actions</link>" section</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[authentication]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Used to put the authentication header. This field can have parameters, in the following form: 
                    [authentication username=myusername password=mypassword]. If no username is provided, 
                    the value from -s command line parameter (service) is used.  If no password is provided, the value 
                    from -ap command line parameter is used. See "<link href="#authentication">Authentication</link>" section</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[pid]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Provide the process ID (pid) of the main SIPp thread.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[routes]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">If the "rrs" attribute in a recv command is set to "true",
                    then the "Record-Route:" header of the message received is stored 
                    and can be recalled using the [routes] keyword</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[next_url]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">If the "rrs" attribute in a recv command is set to "true",
                    then the [next_url] contains the contents of the Contact header 
                    (i.e within the '&lt;' and '&gt;' of Contact)</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[branch]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Provide a branch value which is a concatenation of magic cookie 
                    (z9hG4bK) + call number + message index in scenario.<br/> An offset (like [branch-N]) can be appended if you need to have the same branch value as a previous message.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[msg_index]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Provide the message number in the scenario.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[cseq]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Provides the CSeq value of the last request received. This value can be incremented (e.g. [cseq+1] adds 1 to
                        the CSeq value of the last request).</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[clock_tick]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Includes the internal SIPp clock tick value in the message.</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[tdmmap]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Includes the tdm map values used by the call in the message (see -tdmmap option).</td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1"><strong>[fill]</strong></td>
                    <td colspan="1" rowspan="1">-</td>
                    <td colspan="1" rowspan="1">Injects filler characters into the message.  The length of the fill
		    text is equal to the call variable stored in the
		    <code>variable=N</code> parameter.  By default the text is a sequence
		    of X's, but can be controlled with the <code>text="text"</code> parameter.</td>
                </tr>
            </table>
            <p>Now that the INVITE message is sent, SIPp can wait for an answer by using the "<link href="#recv">recv</link>" command.</p>
<source xml:space="preserve"><![CDATA[  <recv response="100"> optional="true"
  </recv>

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

  <recv response="200">
  </recv>]]></source>
            <p>100 and 180 messages are optional, and 200 is mandatory. 
            <strong>In a "recv" sequence, there must be one mandatory message</strong>.</p>
            <p>Now, let's send the ACK:</p>
<source xml:space="preserve"><![CDATA[  <send>
    <![CDATA[

      ACK sip:]]><strong>[service]</strong><![CDATA[@]]><strong>[remote_ip]</strong><![CDATA[:]]><strong>[remote_port]</strong><![CDATA[ SIP/2.0
      Via: SIP/2.0/]]><strong>[transport]</strong><![CDATA[ ]]><strong>[local_ip]</strong><![CDATA[:]]><strong>[local_port]</strong><![CDATA[
      From: sipp <sip:sipp@]]><strong>[local_ip]</strong><![CDATA[:]]><strong>[local_port]</strong><![CDATA[>;tag=]]><strong>[call_number]</strong><![CDATA[
      To: sut <sip:]]><strong>[service]</strong><![CDATA[@]]><strong>[remote_ip]</strong><![CDATA[:]]><strong>[remote_port</strong><![CDATA[]>]]><strong>[peer_tag_param]</strong><![CDATA[
      Call-ID: ]]><strong>[call_id]</strong><![CDATA[
      Cseq: 1 ACK
      Contact: sip:sipp@]]><strong>[local_ip]</strong><![CDATA[:]]><strong>[local_port]</strong><![CDATA[
      Max-Forwards: 70
      Subject: Performance Test
      Content-Length: 0

    ]]]]><![CDATA[>
  </send>]]></source>
            <p>We can also insert a pause. The scenario will wait for 5 seconds at this point.</p>
<source xml:space="preserve"><![CDATA[  <pause milliseconds="5000"/>]]></source>
            <p>And finish the call by sending a BYE and expecting the 200 OK:</p>
<source xml:space="preserve"><![CDATA[    <send retrans="500">
     <![CDATA[

      BYE sip:]]><strong>[service]</strong><![CDATA[@]]><strong>[remote_ip]</strong><![CDATA[:]]><strong>[remote_port]</strong><![CDATA[ SIP/2.0
      Via: SIP/2.0/]]><strong>[transport] [local_ip]</strong><![CDATA[:]]><strong>[local_port]</strong><![CDATA[
      From: sipp  <sip:sipp@]]><strong>[local_ip]</strong><![CDATA[:]]><strong>[local_port]</strong><![CDATA[>;tag=]]><strong>[call_number]</strong><![CDATA[
      To: sut  <sip:]]><strong>[service]</strong><![CDATA[@]]><strong>[remote_ip]</strong><![CDATA[:]]><strong>[remote_port]</strong><![CDATA[>]]><strong>[peer_tag_param]</strong><![CDATA[
      Call-ID: ]]><strong>[call_id]</strong><![CDATA[
      Cseq: 2 BYE
      Contact: sip:sipp@]]><strong>[local_ip]</strong><![CDATA[:]]><strong>[local_port]</strong><![CDATA[
      Max-Forwards: 70
      Subject: Performance Test
      Content-Length: 0

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

   <recv response="200">
   </recv>]]></source>
            <p>And this is the end of the scenario:</p>
<source xml:space="preserve"><![CDATA[</scenario>]]></source>
            <p>Creating your own SIPp scenarios is not a big deal. 
            If you want to see other examples, use the <code>-sd</code> parameter
            on the command line to display embedded scenarios.</p>
            </section>
            <section><title>Structure of server (UAS like) XML scenarios</title>
            <p>A server scenario is a scenario that starts with a "<link href="#recv">recv</link>" command. 
            The syntax and the list of available commands is the same as for
            "client" scenarios.</p>
            <p>But you are more likely to use [last_*] keywords in those server
            side scenarios. For example, a UAS example will look like:</p>
<source xml:space="preserve"><![CDATA[  <recv request="INVITE">
  </recv>

  <send>
    <![CDATA[

      SIP/2.0 180 Ringing
      ]]><strong>[last_Via:]</strong><![CDATA[
      ]]><strong>[last_From:]</strong><![CDATA[
      ]]><strong>[last_To:]</strong><![CDATA[;tag=]]><strong>[call_number]</strong><![CDATA[
      ]]><strong>[last_Call-ID:]</strong><![CDATA[
      ]]><strong>[last_CSeq:]</strong><![CDATA[
      Contact: <sip:]]><strong>[local_ip]</strong><![CDATA[:]]><strong>[local_port]</strong><![CDATA[;transport=]]><strong>[transport]</strong><![CDATA[>
      Content-Length: 0

    ]]]]><![CDATA[>
  </send>]]></source>
            <p>The answering message, 180 Ringing in this case, is built
            with the content of headers received in the INVITE message.</p>
            </section>
            <anchor id="actions"/><section><title>Actions</title>
              <p>In a "<link href="#recv">recv</link>" or "<link href="#recvCmd">recvCmd</link>" command, you have the possibility to
              execute an action. Several actions are available:</p>
              <ul>
                <li><link href="#action_regexp">Regular expressions</link> (ereg)</li>
                <li><link href="#action_log">Log something in aa log file</link> (log)</li>
                <li><link href="#action_exec">Execute an external (system), internal (int_cmd) or 
                pcap_play_audio/pcap_play_video command</link> (exec)</li>
              </ul>
                <anchor id="action_regexp"/><section><title>Regular expressions</title>
                  <p>Using regular expressions in SIPp allows to</p>
                  <ul>
                     <li>Extract content of a SIP message or a SIP header and
                     store it for future usage (called re-injection)</li>
                     <li>Check that a part of a SIP message or of an header 
                     is matching an expected expression</li>
                  </ul>
                  <p>Regular expressions used in SIPp are defined per 
                  <link href="http://www.opengroup.org/onlinepubs/007908799/xbd/re.html">
                  Posix Extended standard (POSIX 1003.2)</link>. If you want to
                  learn how to write regular expressions, I will recommend 
                  this <link href="http://analyser.oli.tudelft.nl/regex/index.html.en">
                  regexp tutorial</link>.</p>
                  <p>Here is the syntax of the regexp action:</p>
                  <table>
                      <caption>regexp action syntax</caption>
                      <tr>
                          <th colspan="1" rowspan="1">Keyword</th>
                          <th colspan="1" rowspan="1">Default</th>
                          <th colspan="1" rowspan="1">Description</th>
                      </tr>
                      <tr>
                          <td colspan="1" rowspan="1">regexp</td>
                          <td colspan="1" rowspan="1">None</td>
                          <td colspan="1" rowspan="1">Contains the regexp to use for matching the 
                          received message or header. MANDATORY.</td>
                      </tr>
                      <tr>
                          <td colspan="1" rowspan="1">search_in</td>
                          <td colspan="1" rowspan="1">msg</td>
                          <td colspan="1" rowspan="1">can have 2 values: "msg" (try to match against 
                          the entire message) or "hdr" (try to match against a specific SIP header).</td>
                      </tr>
                      <tr>
                          <td colspan="1" rowspan="1">header</td>
                          <td colspan="1" rowspan="1">None</td>
                          <td colspan="1" rowspan="1">Header to try to match against. Only used when 
                          the search_in tag is set to hdr. MANDATORY IF 
                          search_in is equal to hdr.</td>
                      </tr>
                      <tr>
                          <td colspan="1" rowspan="1">case_indep</td>
                          <td colspan="1" rowspan="1">false</td>
                          <td colspan="1" rowspan="1">To look for a header ignoring case . Only used when 
                          the search_in tag is set to hdr. </td>
                      </tr>
                      <tr>
                          <td colspan="1" rowspan="1">occurence</td>
                          <td colspan="1" rowspan="1">1</td>
                          <td colspan="1" rowspan="1">To find the nth occurence of a header. Only used when 
                          the search_in tag is set to hdr.</td>
                      </tr>
                      <tr>
                          <td colspan="1" rowspan="1">start_line</td>
                          <td colspan="1" rowspan="1">false</td>
                          <td colspan="1" rowspan="1">To look only at start of line. Only used when 
                          the search_in tag is set to hdr.</td>
                      </tr>
                      <tr>
                          <td colspan="1" rowspan="1">check_it</td>
                          <td colspan="1" rowspan="1">false</td>
                          <td colspan="1" rowspan="1">if set to true, the call is marked as failed if 
                          the regexp doesn't match.</td>
                      </tr>
                      <tr>
                          <td colspan="1" rowspan="1">assign_to</td>
                          <td colspan="1" rowspan="1">None</td>
                          <td colspan="1" rowspan="1">contain the variable id (integer) or a list of 
                          variable id which will be used to store the 
                          result(s) of the matching process between the regexp 
                          and the message. Those variables can be re-used at 
                          a later time either by using '[$n]' in the scenario 
                          to inject the value of the variable in the messages or
                          by using the content of the variables for <link href="#branching">conditional 
                          branching</link>. The first variable in the variable list of
                          assign_to contains the entire regular
                          expression matching. The following variables contain the
                          sub-expressions matching. Example: <source xml:space="preserve"><![CDATA[<ereg regexp="o=([[:alnum:]]*) ([[:alnum:]]*) ([[:alnum:]]*)"
            search_in="msg"
            check_it=i"true"
            assign_to="3,4,5,8"/>]]></source>If the SIP message contains the line <source xml:space="preserve"><![CDATA[o=user1 53655765 2353687637 IN IP4 127.0.0.1]]></source>
            variable 3 contains "o=user1 53655765 2353687637", variable 4 contains "user1", 
            variable 5 contains "53655765" and variable 8 contains "2353687637".</td>
                      </tr>
                  </table>
                  <p>Note that you can have several regular expressions
                  in one action.</p>
                  <p>The following example is used to:</p>
                  <ul>
                    <li>First action:
                      <ul>
                        <li>Extract the first IPv4 address of the received SIP message</li>
                        <li>Check that we could actually extract this IP address (otherwise
                        call will be marked as failed)</li>
                        <li>Assign the extracted IP address to call variables 1
                        and 2.</li>
                      </ul>
                    </li>
                    <li>Second action:
                      <ul>
                        <li>Extract the Contact: header of the received SIP message</li>
                        <li>Assign the extracted Contract: header to variable 6.</li>
                      </ul>
                    </li>
                  </ul>
                  <source xml:space="preserve"><![CDATA[
<recv response="200" start_rtd="true">
  <action>
    <ereg regexp="([0-9]{1,3}\.){3}[0-9]{1,3}:[0-9]*" search_in="msg" check_it="true" assign_to="1,2" /> 
    <ereg regexp=".*" search_in="hdr" header="Contact:" check_it="true" assign_to="6" />
  </action>
</recv>
]]></source>
                </section>
                <anchor id="action_log"/><section><title>Log a message</title>
                  <p>The "log" action allows you to customize your traces. Messages
                  are printed in the &lt;scenario file name&gt;_&lt;pid&gt;_logs.log file.
                  Any <link href="#keyword">keyword</link> is expanded to reflect the value actually used.</p>
                  <warning>Logs are generated only if -trace_logs option is set on
                  the command line.</warning>
                  <p>Example:</p>
                  <source xml:space="preserve"><![CDATA[   <recv request="INVITE" crlf="true" rrs="true">
     <action>
	 <ereg regexp=".*" search_in="hdr" header="Some-New-Header:" assign_to="1" />
          <log message="From is [last_From]. Custom header is [$1]"/>
     </action>
   </recv>]]></source>
                </section>
                <anchor id="action_exec"/><section><title>Execute a command</title>
                  <p>The "exec" action allows you to execute "internal", "external", "play_pcap_audio" or "play_pcap_video" commands.</p>
                  <section><title>Internal commands</title>
                  <p><strong>Internal</strong> commands (specified using int_cmd attribute) are stop_call, stop_gracefully (similar to pressing 'q'), stop_now (similar to ctrl+C).</p>
                  <p>Example that stops the execution of the script on receiving a 603 response:</p>
                  <source xml:space="preserve"><![CDATA[   <recv response="603" optional="true">
     <action>
          <exec int_cmd="stop_now"/>
      </action>
   </recv>]]></source>

                  </section>
                  <section><title>External commands</title>
                  <p><strong>External</strong> commands (specified using command attribute) are anything that can be executed on local host with a shell.</p>
                  <p>Example that execute a system echo for every INVITE received:</p>
                  <source xml:space="preserve"><![CDATA[   <recv request="INVITE">
     <action>
          <exec command="echo [last_From] is the from header received >> from_list.log"/>
      </action>
   </recv>]]></source>
                  </section>
                  </section>
                  <section><title>PCAP (media) commands</title>
                  <p><strong>PCAP play</strong> commands (specified using play_pcap_audio / play_pcap_video attributes) 
                    allow you to send a pre-recorded RTP stream using the <link href="http://www.tcpdump.org/pcap3_man.html">pcap library</link>.
                      <p>Choose <strong>play_pcap_audio</strong> to send the pre-recorded RTP stream using the "m=audio" SIP/SDP line port as a base for the replay.</p>
                      <p>Choose <strong>play_pcap_video</strong> to send the pre-recorded RTP stream using the "m=video" SIP/SDP line port as a base.</p> 
                      <p>The play_pcap_audio/video command has the following format: play_pcap_audio="[file_to_play]" with:</p>
                          <ul>
                            <li>file_to_play: the pre-recorded pcap file to play</li>
                          </ul>
                          <note>The action is non-blocking. SIPp will start a light-weight thread to play the file 
                          and the scenario with continue immediately. If needed, you will need to add a pause
                          to wait for the end of the pcap play.</note></p>
                  <p>Example that plays a pre-recorded RTP stream:</p>
                  <source xml:space="preserve"><![CDATA[<nop>
  <action>
    <exec play_pcap_audio="pcap/g711a.pcap"/>
  </action>
</nop>
]]></source>

		  </section>

                  <anchor id="action_variables"/><section><title>Variable Manipulation</title>
		<p>You may also perform simple arithmetic (add, subtract,
		multiply, divide) on floating point values.  The "assign_to" attribute contains
		the first operand, and is also the destination of the resulting value.
		The second operand is either an immediate value or stored in a variable, represented by
		the "value" and "variable" attributes, respectively.</p>



                  <p>SIPp supports call variables that take on double-precision floating values.
		  The actions that modify double variables all write to the
		  variable referenced by the <strong>assign_to</strong> parameter.  
		  These variables can be assigned using one of three actions:
		  assign, sample, or todouble.  For assign, the
		  double precision value is stored in the "value" parameter.  The sample action assigns
		  values based on statistical distributions, and uses the same
		  parameters as a <link href="#pause_distributions">statistically distributed
		  pauses</link>.  Finally, the todouble command converts the variable referenced by the
		  "variable" attribute to a double before assigning it.</p>


                  <p>For example, to assign the value 1.0 to $1 and sample from the normal distribution into $2:</p>
                  <source xml:space="preserve"><![CDATA[<nop>
  <action>
    <assign assign_to="1" value="1" />
    <sample assign_to="2" distribution="normal" mean="0" stdev="1"/>
    <!-- Stores the first field in the injection file into string variable $3.
         You may also use regular expressions to store string variables. -->
    <assignstr assign_to="3" value="[field0]" />
    <!-- Converts the string value in $3 to a double-precision value stored in $4. -->
    <todouble assign_to="4" variable="3" />
  </action>
</nop>
]]></source>

		  <p>Simple arithmetic is also possible using the <strong>&lt;add&gt;</strong>, <strong>&lt;subtract&gt;</strong>, <strong>&lt;multiply&gt;</strong>, and <strong>&lt;divide&gt;</strong> actions, which add, subtract, multiply, and divide the variable referenced by <strong>assign_to</strong> by the value in <strong>value</strong>.
For example, the following action modifies variable one as follows:</p>
<source xml:space="preserve"><![CDATA[<nop>
  <action>
    <assign assign_to="1" value="0" /> <!-- $1 == 0 -->
    <add assign_to="1" value="2" /> <!-- $1 == 2 -->
    <subtract assign_to="1" value="3" /> <!-- $1 == -1 -->
    <multiply assign_to="1" value="4" /> <!-- $1 == -4 -->
    <divide assign_to="1" value="5" /> <!-- $1 == -0.8 -->
  </action>
]]></source>
		<p>Rather than using fixed values, you may also retrieve the second operand from a variable, using the <strong>&lt;variable&gt;</strong> parameter.  For example:</p>
		<source xml:space="preserve"><![CDATA[<nop>
  <action>
	 <!-- Multiplies $1 by itself -->
	 <multiply assign_to="1" variable="1" />
	 <!-- Divides $1 by $2, Note that $2 must not be zero -->
	 <multiply assign_to="1" variable="2" />
     </action>
   </nop>]]></source>

                  </section>

                  <anchor id="action_strings"/><section><title>String Variables </title>
		<p>You can create string variables by using the <strong>&lt;assignstr&gt;</strong>
		command, which accepts two parameters: <strong>assign_to</strong> and
		<strong>value</strong>.  The value may contain any of the same substitutions
		that a message can contain.  For example:</p>
		<source xml:space="preserve"><![CDATA[<nop>
     <action>
         <!-- Assign the value in field0 of the CSV file to a $1. -->
	 <assignstr assign_to="1" value="[field0]" />
     </action>
   </nop>]]></source>
		</section>


                  <anchor id="action_test"/><section><title>Variable Testing</title>
                  <p>Variable testing allows you to construct loops and control structures using call variables.  THe <strong>test</strong> action takes four arguments: <strong>variable</strong> which is the variable that to <strong>compare</strong> against <strong>value</strong>, and <strong>assign_to</strong> which is a boolean call variable that the result of the test is stored in.  Compare may be one of the following tests: <strong>equal</strong>, <strong>not_equal</strong>, <strong>greater_than</strong>, <strong>less_than</strong>, <strong>greater_than_equal</strong>, or <strong>less_than_equal</strong>.</p>
                  <p>Example that sets $2 to true if  $1 is less than 10:</p>
                  <source xml:space="preserve"><![CDATA[<nop>
  <action>
    <test assign_to="2" variable="1" compare="less_than" value="10" />
  </action>
</nop>
]]></source>
                  </section>
            </section>
            <anchor id="inffile"/><section><title>Injecting values from an external CSV during calls</title>
                <p>You can use "<code>-inf file_name</code>" as a command line parameter
                to input values into the scenarios. The first line of the file should
                say whether the data is to be read in sequence (SEQUENTIAL), random
                order (RANDOM),  or in a user based manner (USER). Each line corresponds
		to one call and has one or more ';' delimited data fields and they can be
		referred as [field0], [field1], ... in the xml scenario file. Example:</p>
<source xml:space="preserve"><![CDATA[SEQUENTIAL
#This line will be ignored
Sarah;sipphone32
Bob;sipphone12
#This line too
Fred;sipphone94]]></source>
                <p>Will be read in sequence (first call will use first line,
                second call second line). At any place where the keyword
                "[field0]" appears in the scenario file, it will be replaced by
                either "Sarah", "Bob" or "Fred" depending on the call. At any
                place where the keyword "[field1]" appears in the scenario file,
                it will be replaced by either "sipphone32" or "sipphone12" or
                "sipphone94" depending on the call. At the end of the file, SIPp
                will re-start from the beginning. The file is not limited in
                size.</p>
                <p>The CSV file can contain comment lines. A comment line is
                a line that starts with a "#".</p>
                <p>As a picture says more than 1000 words, here is one:</p>
                <p><img src="images/sipp-02.gif" alt="Field injection"/></p>
                <p>Think of the possibilities of this feature. They are huge.</p>
		<p>It is possible to use more than one injection file, and is
		necessary when you want to select different types of data in different
		ways.  For example, when running a user-based benchmark, you may have
		a caller.csv with "USER" as the first line and a callee.csv
		with "RANDOM" as the first line.  To specify which CSV file is
		used, add the file= parameter to the keyword.  For example:</p>
		<source xml:space="preserve"><![CDATA[
INVITE sip:[field0 file="callee.csv"] SIP/2.0
From: sipp user <[field0 file="caller.csv"]>;tag=[pid]SIPpTag00[call_number]
To: sut user <[field0 file="callee.csv"]>
...]]></source>
		<p>Will select the destination user from callee.csv and the sending
		user from caller.csv.  If no file parameter is specified, then the
		first input file on the command line is used by default.</p>
            </section>
            <anchor id="branching"/><section><title>Conditional branching</title>
	      <section><title>Conditional branching in scenarios</title>
		      <p>It is possible to execute a scenario in a non-linear
		      way. You can jump from one part of the scenario to another for example 
		      when a message is received or if a call variable is set.</p>
		      <p>You define a label (in the xml) as <code>&lt;label id="n"/&gt;</code>
		      Where n is a number between 1 and 19 (we can easily have more if needed). 
		      The label commands go anywhere in the main scenario between other commands.
		      To any action command (send, receive, pause, etc.) you add a next="n"
		      parameter, where n matches the id of a label. <strong>When it has done the 
		      command</strong> it continues the scenario from that label. This part is
		      useful with optional receives like 403 messages, because it allows 
		      you to go to a different bit of script to reply to it and then 
		      rejoin at the BYE (or wherever or not).</p>

		      <p>Alternatively, if you add a <strong>test="m"</strong> parameter to the next, 
		      it goes to the label only if variable [$m] is set. This allows you 
		      to look for some string in a received packet and alter the 
		      flow either on that or a later part of the script.  The
		      evaluation of a test varies based on the type of call
                      variable.  For regular expressions, at least one match must have been found;
		      for boolean variables the value must be true; and for all others a value must
		      have been set (currently this only applies to doubles).  For more complicated
		      tests, see the <link href="#action_test">&lt;test&gt; action</link>.</p>


		      <warning>If you add special cases at the end, don&#8217;t forget to put 
		      a label at the real end and jump to it at the end of the normal flow.</warning>
		      <p><strong>Example:</strong></p>
		      <p>The following example corresponds to the embedded '<link href="#scenario_branch">branchc</link>' (client side) scenario.
		      It has to run against the embedded '<link href="#scenario_branch">branchs</link>' (server side) scenario.<br/>
		      <img alt="Conditional branching example" src="images/branching_01.gif"/><br/>
		      <img alt="Conditional branching example" src="images/branching_02.gif"/></p>
              </section>
	      <section><title>Randomness in conditional branching</title>
	        <p>To have SIPp behave somewhat more like a "normal" SIP client being used by a human, 
		it is possible to use "statistical branching". 
		Wherever you can have a conditional branch on a variable being set (test="4"), 
		you can also branch based on a statistical decision using the attribute 
		"chance" (e.g. chance="0.90"). Chance can have a value between 0 (never) 
		and 1 (always). "test" and "chance" can be combined, i.e. only 
		branching when the test succeeds and the chance is good.</p>
		<p>With this, you can have a variable reaction in a given scenario 
		(e.g.. answer the call or reject with busy), or run around in a
		loop (e.g. registrations) and break out of it after some random number of iterations.</p>
              </section>
            </section>
            <anchor id="authentication"/><section><title>SIP authentication</title>
              <p>SIPp supports SIP authentication. Two authentication algorithm are supported: Digest/MD5 ("algorithm="MD5"")
              and Digest/AKA ("algorithm="AKAv1-MD5"", as specified by 3GPP for IMS).</p>
              <warning>To enable authentication support, SIPp must be compiled in a
              special way. See <link href="#installing">SIPp installation</link>
              for details</warning>
              <p>Enabling authentication is simple. When receiving a 401 (Unauthorized)
              or a 407 (Proxy Authentication Required), you must add auth="true"
              in the &lt;recv&gt; command to take the challenge into account.
              Then, the authorization header can be re-injected in the next message
              by using [authentication] keyword.</p>
              <p>Computing the authorization header is done through the usage of the
              "[authentication]" keyword. Depending on the algorithm ("MD5" or "AKAv1-MD5"), 
              different parameters must be passed next to the authentication
              keyword:</p>
              
              <ul>
                <li>Digest/MD5 (example: [authentication username=joe password=schmo])
                  <ul>
                    <li><strong>username</strong>: username: if no username is specified, the username is taken from the '-s' (service) command
              line parameter</li>
                    <li><strong>password</strong>: password: if no password is specified, the password is taken from the '-ap' (authentication
              password) command line parameter</li>
                  </ul>
                </li>
                <li>Digest/AKA: (example: [authentication username=HappyFeet aka_OP=0xCDC202D5123E20F62B6D676AC72CB318 aka_K=0x465B5CE8B199B49FAA5F0A2EE238A6BC aka_AMF=0xB9B9])
                  <ul>
                    <li><strong>username</strong>: username: if no username is specified, the username is taken from the '-s' (service) command
              line parameter</li>
                    <li><strong>aka_K</strong>: Permanent secret key. If no aka_K is provided, the "password" attributed is used as aka_K.</li>
                    <li><strong>aka_OP</strong>: OPerator variant key</li>
                    <li><strong>aka_AMF</strong>: Authentication Management Field (indicates the algorithm and key in use)</li>
                  </ul>
                </li>
              </ul>
              <p>In case you want to use authentication with a different username/password or aka_K
              for each call, you can do this:</p>
              <ul>
                <li>Make a CSV like this: 
                <source xml:space="preserve"><![CDATA[SEQUENTIAL
User0001;[authentication username=joe password=schmo]
User0002;[authentication username=john password=smith]
User0003;[authentication username=betty password=boop]]]></source>
                </li>
                <li>And an XML like this (the [field1] will be substituted with the full auth string, which is the processed as a new keyword):
                <source xml:space="preserve"><![CDATA[<send retrans="500">
    <![CDATA[

      REGISTER sip:[remote_ip] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port]
      To: <sip:[field0]@sip.com:[remote_port]>
      From: <sip:[field0]@[remote_ip]:[remote_port]>
      Contact: <sip:[field0]@[local_ip]:[local_port]>;transport=[transport]
      [field1]
      Expires: 300
      Call-ID: [call_id]
      CSeq: 2 REGISTER
      Content-Length: 0

    ]]]]><![CDATA[>
  </send>
]]></source>
                </li>
              </ul>
              <p><strong>Example:</strong></p>
<source xml:space="preserve"><![CDATA[  <recv response="407" ]]><strong>auth="true"</strong><![CDATA[>
  </recv>

  <send>
    <![CDATA[

      ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port]
      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

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

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

      INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port]
      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
      To: sut <sip:[service]@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: 2 INVITE
      Contact: sip:sipp@[local_ip]:[local_port]
      ]]><strong>[authentication username=foouser]</strong><![CDATA[
      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=-
      t=0 0
      c=IN IP[media_ip_type] [media_ip]
      m=audio [media_port] RTP/AVP 0
      a=rtpmap:0 PCMU/8000

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

]]></source>
            </section>
        </section>
        <section><title>Screens</title>
            <p>Several screens are available to monitor SIP traffic. You can 
            change the screen view by pressing 1 to 9 keys on the keyboard.</p>
            <ul>
                <li>Key '1': Scenario screen. It displays a call flow of
                the scenario as well as some important informations.
                <p><img src="images/sipp-03.jpg" alt="Scenario screen"/></p>
                </li>
                <li><anchor id="stat_screen"/>Key '2': Statistics screen. It displays the main statistics
                counters. The "Cumulative" column gather all statistics, since
                SIPp has been launched. The "Periodic" column gives the statistic
                value for the period considered (specified by <code>-f frequency</code> command
                line parameter).
                <p><img src="images/sipp-04.jpg" alt="Statistics screen"/></p>
                </li>
                <li>Key '3': Repartition screen. It displays the distribution
                of response time and call length, as specified in the scenario.
                <p><img src="images/sipp-05.jpg" alt="Repartition screen"/></p></li>
                <li>Key '4': Variables screen. It displays informations on
                actions in scenario as well as scenario variable informations.
                <p><img src="images/sipp-06.jpg" alt="Variables screen "/></p></li>
            </ul>
        </section>
        <section><title>Transport modes</title>
            <p>SIPp has several transport modes. The default transport mode is 
            "UDP mono socket".</p>
            <section><title>UDP mono socket</title>
                <p>In UDP mono socket mode (<code>-t u1</code> command line parameter),
                one IP/UDP socket is opened between SIPp and the remote. All calls
                are placed using this socket.</p>
                <p>This mode is generally used for emulating a relation
                between 2 SIP servers.</p>
            </section>
            <section><title>UDP multi socket</title>
                <p>In UDP multi socket mode (<code>-t un</code> command line parameter),
                one IP/UDP socket is opened for each new call between SIPp and the remote.</p>
                <p>This mode is generally used for emulating user agents calling a SIP server.</p>
            </section>
            <section><title>UDP with one socket per IP address</title>
                <p>In UDP with one socket per IP address mode (<code>-t ui</code> command line parameter),
                one IP/UDP socket is opened for each IP address given in the <link href="#inffile">inf file</link>.</p>
                <p>In addition to the "-t ui" command line parameter, one must indicate which field in the
                inf file is to be used as local IP address for this given call. Use "-ip_field &lt;nb&gt;"
                to provide the field number.</p>
                <p>There are two distinct cases to use this feature:</p>
                <ul><li>Client side: when using -t ui for a client, SIPp will originate each call
                with a different IP address, as provided in the inf file. In this case,
                when your IP addresses are in field X of the inject file, 
                then you have to use [fieldX] instead of [local_ip] in your UAC XML scenario file. </li>
                <li>Server side: when using -t ui for a server, SIPp will bind itself
                to all the IP addresses listed in the inf file instead of using 0.0.0.0. This
                will have the effect SIPp will answer the request on the same IP on which 
                it received the request. In order to have proper Contact and Via fields,
                a keyword [server_ip] can be used and provides the IP address on
                which a request was received. So when using this, you have to replace the [local_ip] in
                your UAS XML scenario file by [server_ip].</li></ul>
                <p>In the following diagram, the command line for a client scenario will look like: 
                <code>./sipp -sf myscenario.xml -t ui -inf database.csv -ip_field 2 192.168.1.1</code><br/>
                By doing so, each new call will come sequentially from IP 192.168.0.1, 192.168.0.2, 192.168.0.3, 192.168.0.1, ...<br/><br/>
                <img alt="One originating IP per call" src="images/sipp-03.gif"/></p>
                <p>This mode is generally used for emulating user agents, using on IP address
                per user agent and calling a SIP server.</p>
            </section>
            <section><title>TCP mono socket</title>
                <p>In TCP mono socket mode (<code>-t t1</code> command line parameter),
                one IP/TCP socket is opened between SIPp and the remote. All calls
                are placed using this socket.</p>
                <p>This mode is generally used for emulating a relation between 2 SIP servers.</p>
            </section>
            <section><title>TCP multi socket</title>
                <p>In TCP multi socket mode (<code>-t tn</code> command line parameter),
                one IP/TCP socket is opened for each new call between SIPp and the remote.</p>
                <p>This mode is generally used for emulating user agents calling a SIP server.</p>
            </section>
            <section><title>TCP reconnections</title>
                <p>SIPp handles TCP reconnections. In case the TCP socket is lost,
                SIPp will try to reconnect. The following parameters on the command line
                control this behaviour:</p>
                <ul>
                  <li><strong>-max_reconnect</strong>: Set the maximum number of reconnection attempts.</li>
                  <li><strong>-reconnect_close true/false</strong>: Should calls be closed on reconnect?</li>
                  <li><strong>-reconnect_sleep int</strong>: How long to sleep (in milliseconds) between the close and reconnect? </li>
                </ul>
            </section>
            <anchor id="tls"/><section><title>TLS mono socket</title>
                <p>In TLS mono socket mode (<code>-t l1</code> command line parameter),
                one secured TLS (Transport Layer Security) socket is opened between SIPp and the remote. All calls
                are placed using this socket.</p>
                <p>This mode is generally used for emulating a relation between 2 SIP servers.</p>
                <warning>When using TLS transport, SIPp will expect to have two files in the current
                directory: a certificate (cacert.pem) and a key (cakey.pem). 
                If one is protected with a password, SIPp will
                ask for it.</warning>
                <p>SIPp supports X509's CRL (Certificate Revocation List). The CRL is 
                read and used if <code>-tls_crl</code> command line specifies
                a CRL file to read.</p>
            </section>
            <section><title>TLS multi socket</title>
                <p>In TLS multi socket mode (<code>-t ln</code> command line parameter),
                one secured TLS (Transport Layer Security) socket is opened for each new call between SIPp and the remote.</p>
                <p>This mode is generally used for emulating user agents calling a SIP server.</p>
            </section>
            <anchor id="ipv6"/><section><title>IPv6 support</title>
                <p>SIPp includes IPv6 support. To use IPv6, just specify the local
                IP address (-i command line parameter) to be an IPv6 IP address.</p>
                <p>The following example launches a UAS server listening on port 5063 and a UAC client sending
                IPv6 traffic to that port.</p>
                <source xml:space="preserve"><![CDATA[./sipp -sn uas -i [fe80::204:75ff:fe4d:19d9] -p 5063
./sipp -sn uac -i [fe80::204:75ff:fe4d:19d9] [fe80::204:75ff:fe4d:19d9]:5063
                ]]></source>
                <warning>The Pcap play feature may currently not work on IPv6.</warning>
            </section>
            <anchor id="maxsocket"/><section><title>Multi-socket limit</title>
                <p>When using one of the "multi-socket" transports, the maximum number of sockets that can be opened
                (which corresponds to the number of simultaneous calls) will be determined by
                the system (see <link href="#filedesc">how to increase file descriptors section</link> to
                modify those limits). You can also limit the number of socket used by using the <code>-max_socket</code>
                command line option. Once the maximum number of opened sockets is reached,
                the traffic will be distributed over the sockets already opened.
                </p>
            </section>
        </section>
        <section><title>Handling media with SIPp</title>
          <p>SIPp is originally a signalling plane traffic generator. There is a limited
          support of media plane (RTP).</p>
          <section><title>RTP echo</title>
            <p>The "RTP echo" feature allows SIPp to listen to one or two local IP
            address and port (specified using <code>-mi</code> and
            <code>-mp</code> command line parameters) for RTP media. Everything
            that is received on this address/port is echoed back to the
            sender.</p>
            <p>RTP/UDP packets coming on this port + 2 are also echoed to their sender (used for
            sound and video echo).</p>
          </section>
          <anchor id="pcapplay"/><section><title>PCAP Play</title>
            <p>The PCAP play feature makes use of the <link href="http://www.tcpdump.org/pcap3_man.html">PCAP library</link>
            to replay pre-recorded RTP streams towards a destination. RTP streams can be 
            recorded by tools like <link href="http://www.wireshark.org/">Wireshark</link>
            (formerly known as Ethereal) or <link href="http://www.tcpdump.org/">tcpdump</link>. This allows you to:</p>
            <ul>
              <li>Play any RTP stream (voice, video, voice+video, out of band DTMFs/RFC 2833, T38 fax, ...)</li>
              <li>Use any codec as the codec is not handled by SIPp</li>
              <li>Emulate precisely the behavior of any SIP equipment as the 
              pcap play will try to replay the RTP stream as it was recorded (limited
              to the performances of the system).</li>
              <li>Reproduce exactly what has been captured using an IP sniffer like <link href="http://www.wireshark.org/">Wireshark</link>.</li>
            </ul>
            <p>A good example is the <link href="#uac_with_media">UAC with media</link> (uac_pcap) embedded scenario.</p>
            <p>SIPp comes with a G711 alaw pre-recorded pcap file and 
            out of band (RFC 2833) DTMFs in the pcap/ directory.</p>
            <warning>The PCAP play feature uses pthread_setschedparam calls from pthread library. 
            Depending on the system settings, you might need to be root to allow this. Please
            check "man 3 pthread_setschedparam" man page for details</warning>
            <p>More details on the possible PCAP play actions can be found in the <link href="#action_exec">action reference section</link>.</p>
            <p>The latest info on this feature, tips and tricks can be found on <link href="http://sipp.sourceforge.net/wiki/index.php/Pcapplay">SIPp wiki</link>.</p>
          </section>
        </section>
        <section><title>Exit codes</title>
            <p>To ease automation of testing, upon exit (on fatal error or when
            the number of asked calls (<code>-m</code> command line option) is
            reached, sipp exits with one of the following exit codes:</p>
            <ul>
                <li>0: All calls were successful</li>
                <li>1: At least one call failed</li>
                <li>97: exit on internal command. Calls may have been processed. Also exit on global timeout (see -timeout_global option) </li>
                <li>99: Normal exit without calls processed</li>
                <li>-1: Fatal error</li>
            </ul>
            <p>Depending on the system that SIPp is running on, you can echo
            this exit code by using "<code>echo ?</code>" command.</p>
        </section>
        <section><title>Statistics</title>
            <section><title>Response times</title>
                 <p>Response times can be gathered and reported. SIPp has 5 timers 
                 (the number is set at compile time) used to compute time between 
                 two SIPp commands (send, recv or nop). You can start a timer
                 by using the <link href="#start_rtd">start_rtd</link> attribute
                 and stop it using the <link href="#rtd">rtd</link> attribute.</p>
                 <p>You can view the value of those timers in the SIPp interface
                 by pressing 3, 6, 7, 8 or 9. You can also save the values 
                 in a CSV file using the -trace_stat option (see below).</p>
                 <p>If the -trace_rtt option is set, the response times are also dumped
                 in the &gt;scenario file name&lt;_&gt;pid&lt;_rtt.csv.</p>
                 <p>Each line represents a RTD measure (triggered by a message reception with a rtd="n" attribute).
                 The dump frequency is tuned by the -rtt_freq parameter.</p>
            </section>
            <section><title>Available counters</title>
                <p>The <code>-trace_stat</code> option dumps all statistics in
                the scenario_name_pid.csv file. The dump starts with one header line
                with all counters. All following lines are 'snapshots' of
                statistics counter given the statistics report frequency (-fd
                option). When SIPp exits, the last values of the statistics
                are also dumped in this file.</p>
                <p>This file can be easily imported in any spreadsheet
                application, like Excel.</p>
                <p>In counter names, (P) means 'Periodic' - since last statistic
                row and (C) means 'Cumulated' - since sipp was started.</p>
<anchor id="stats"/><p>Available statistics are:</p>
  <ul>
    <li>StartTime: 
    Date and time when the test has started.</li>
    <li>LastResetTime:
    Date and time when periodic counters where last reseted.</li>
    <li>CurrentTime:
    Date and time of the statistic row.</li>
    <li>ElapsedTime:
    Elapsed time.</li>
    <li>CallRate:
    Call rate (calls per seconds).</li>
    <li>IncomingCall:
    Number of incoming calls.</li>
    <li>OutgoingCall:
    Number of outgoing calls.</li>
    <li>TotalCallCreated:
    Number of calls created.</li>
    <li>CurrentCall:
    Number of calls currently ongoing.</li>
    <li>SuccessfulCall:
    Number of successful calls.</li>
    <li>FailedCall:
    Number of failed calls (all reasons).</li>
    <li>FailedCannotSendMessage:
    Number of failed calls because Sipp cannot send the
    message (transport issue).</li>
    <li>FailedMaxUDPRetrans:
    Number of failed calls because the maximum number of
    UDP retransmission attempts has been reached.</li>
    <li>FailedUnexpectedMessage:
    Number of failed calls because the SIP message received
    is not expected in the scenario.</li>
    <li>FailedCallRejected:
    Number of failed calls because of Sipp internal error.
    (a scenario sync command is not recognized or a scenario
    action failed or a scenario variable assignment failed).</li>
    <li>FailedCmdNotSent:
    Number of failed calls because of inter-Sipp
    communication error (a scenario sync command failed to
    be sent).</li>
    <li>FailedRegexpDoesntMatch:
    Number of failed calls because of regexp that doesn't
    match (there might be several regexp that don't match
    during the call but the counter is increased only by
    one).</li>
    <li>FailedRegexpHdrNotFound:
    Number of failed calls because of regexp with hdr    
    option but no matching header found.</li>
    <li>FailedOutboundCongestion:
    Number of failed outgoing calls because of TCP congestion. </li>
    <li>FailedTimeoutOnRecv:
    Number of failed calls because of a recv timeout statement.</li>
    <li>FailedTimeoutOnSend: 
    Number of failed calls because of a send timeout statement.</li>
    <li>OutOfCallMsgs:
    Number of SIP messages received that cannot be associated
    with an existing call.</li>
    <li>Retransmissions:
    Number of SIP messages being retransmitted.</li>
    <li>AutoAnswered:
    Number of unexpected specific messages received for new Call-ID.
    The message has been automatically answered by a 200 OK
    Currently, implemented for 'PING' message only.</li>
    </ul>
    <p>The counters defined in the scenario are also dumped in the stat file (GenericCounter columns). </p>
    <p>In addition, two other statistics are gathered:</p>
    <ul><li>ResponseTime (see previous section)</li>
    <li>CallLength: this is the time of the duration of an entire call.</li>
    </ul>
    <p>Both ResponseTime and CallLength statistics can be tuned using <link href="#resptimerep">ResponseTimeRepartition</link>
    and <link href="#calllengthrep">CallLengthRepartition</link> commands in the scenario.</p>
    <p>The standard deviation (STDev) is also available in the log stat file for these two statistics.</p>
            </section>
            <section><title>Importing statistics in spreadsheet applications</title>
                <section><title>Example: importation in Microsoft Excel</title>
                  <p>Here is a video (Windows Media Player 9 codec or above
                  required) on how to import CSV statistic files in Excel and
                  create a graph of failed calls over time.</p>
                  <p><icon src="images/wmv.gif" alt="wmv"/><link href="images/sipp-02.wmv">sipp-02.wmv</link></p>
                </section>
            </section>
        </section>
        <section><title>Error handling</title>
            <p>SIPp has advanced feature to handle errors and unexpected events. 
            They are detailed in the following sections.</p>
            <section><title>Unexpected messages</title>
                <ul>
                    <li>When a SIP message that <strong>can</strong> be
                    correlated to an existing call (with the
                    <code>Call-ID:</code> header) but is not expected in the
                    scenario is received, SIPp will send a CANCEL message if no
                    200 OK message has been received or a BYE message if a 200
                    OK message has been received. The call will be marked 
                    as failed. If the unexpected message is a 4XX or 5XX,
                    SIPp will send an ACK to this message, close the call
                    and mark the call as failed.</li>
                    <li>When a SIP message that <strong>can't</strong> be
                    correlated to an existing call (with the
                    <code>Call-ID:</code> header) is received, SIPp will send a
                    BYE message. The call will not be counted at all.</li>
                    <li>When a SIP "PING" message is received, SIPp will send
                    an ACK message in response. This message is not counted as 
                    being an unexpected message. But it is counted in the "AutoAnswered"
                    <link href="#stats">statistic counter</link>.
                    </li>
                    <li>An unexpected message that is not a SIP message will
                    be simply dropped.</li>
                </ul>
            </section>
            <section><title>Retransmissions (UDP only)</title>
                <p>A retransmission mechanism exists in UDP transport mode. 
                To activate the retransmission mechanism, the "send" command must include
                the "retrans" attribute.</p>
                <p>When it is activated and a SIP message is sent and no ACK or
                response is received in answer to this message, the message is
                re-sent.</p>
                <note>The retransmission mechanism follows RFC 3261, section 17.1.1.2. 
                Retransmissions are differentiated between INVITE and non-INVITE 
                methods.</note>
                <p><code>&lt;send retrans="500"&gt;</code>: will initiate the T1 timer
                to 500 milliseconds.</p>
                <p>Even if retrans is specified in your scenarios, you can override this by 
                using the <code>-nr</code> command line option to globally disable the
                retransmission mechanism.</p>
            </section>
            <section><title>Log files </title>
                <p>There are several ways to trace what is going on during your SIPp runs.</p>
                <ul>
                    <li>You can log sent and received SIP messages in &lt;name_of_the_scenario&gt;_&lt;pid&gt;_messages.log by
                    using the command line parameter <code>-trace_msg</code>. The messages are time-stamped so that you
                    can track them back.</li>
                    <li>You also can trace it using the <code>-trace_shortmsg</code> parameter. This logs the most important
	                values of a message as CSV into one line of the &lt;scenario file name&gt;_&lt;pid&gt;_shortmessages.log </li>
                    <li>You can trace all unexpected messages or events in &lt;name_of_the_scenario&gt;_&lt;pid&gt;_errors.log by using
                    the command line parameter <code>-trace_err</code>.</li>
                    <li>You can save in a file the statistics screens, as displayed in
                    the interface. This is especially useful when running SIPp in background
                    mode.<br/>
                    This can be done in different ways:
                    <ul>
                      <li>When SIPp exits to get a final status report (-trace_screen option)</li>
                      <li>On demand by using USR2 signal (example: <code>kill -SIGUSR2 738</code>)</li>
                      <li>By pressing 's' key (if -trace_screen option is set)</li>
                    </ul>
                    </li>
                  <!--  <li>You can log all call ids for calls that timeout (the maximum
                    number of retransmissions for UDP transport is reached)
                    by using the command line parameter <code>-trace_timeout</code></li>
                    <li>If the -trace_logs option is set, you can print some scenario traces in the <![CDATA[<scenario file name>_<pid>_logs.log]]> file.
                    See the <a href="#action_log">Log action section </a></li> -->
                </ul>
            </section>
        </section>
        <section><title>Online help (-h)</title>
          <p>The online help, available through the -h option is duplicated here for your
          convenience</p>
          <source xml:space="preserve"><![CDATA[Usage:

  sipp remote_host[:remote_port] [options]

  Available options:

