<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="../plugin.xsl" type="text/xsl"?>
<plugin name="SipInjector">
  <object class="org.ow2.isac.plugin.sipinjector.SessionObject">
    <params />
    <help>SipInjector is a plug-in for CLIF. It allows you to send and receive SIP packets to test an equipment or a software.

This plug-in doesn't control yours parameters, so it is important to know how SIP works before using it.

To add multiples vUsers, you have to use Counter plug-in or CsvProvider plug-in because there can have only one user per port.

Fields with (*) are mandatory.
Fields with (-) are automatically generated if they are empty, because they are mandatory.

Here are the variables you can use in the others injector :
	- sip_body : returns the body without change,
	- sip_header=header_name : returns the value of the header_name (ex: sip_header=Subject returns the value of the header Subject if it exists),
	- sip_message : returns the message (request or response),
	- sip_first_line : returns the first line of the message (request line or status line),
	- sdp=type_attribute : returns the value of the type_attribute (ex: sdp=session_name returns the value of the name of the session if it exists). SDP is split in 3 type (media, session and time). For each type there is attributes. Actually SipInjector only handles following attributes :
		- session_name, 
		- session_origin, 
		- session_version, 
		- session_information, 
		- session_email_numberoftheemail (numberoftheemail is the value of the email you want to return, ex: session_email_0 return the first email of the list),
		- session_uri, 
		- session_phone_numberofthephone (see session_email_numberoftheemail),
		- session_key, 
		- session_connection, 
		- time_start, 
		- time_stop,
		- media_port, 
		- media_protocol, 
		- media_type,
		- media_format_numberoftheformat (see session_email_numberoftheemail).

In this version, it permits to send basic request based on RFC 3261, 3265, 3428 and 4566.

Version: 1.0</help>
  </object>
  <sample name="waitResponse" number="0">
    <params>
      <param name="sessionId" type="String" />
      <param name="timeOut" type="String" />
    </params>
    <help>Wait a response from the network.</help>
  </sample>
  <sample name="waitResponseCode" number="61">
    <params>
      <param name="sessionId" type="String" />
      <param name="timeOut" type="String" />
      <param name="responseCode" type="String" />
      <param name="method" type="String" />
      <param name="nRetryRequest" type="String" />
    </params>
    <help>Wait a response from the network whose code is the given one</help>
  </sample>
  <control name="initSipStack" number="32">
    <params>
      <param name="ipAddress" type="String" />
      <param name="port" type="String" />
      <param name="serverIpAddress" type="String" />
      <param name="transport" type="String" />
      <param name="serverPort" type="String" />
    </params>
    <help>Initiliaze SIP Stack.

This control must be the first control added to the scenario.

There is only one initSipStack per scenario and per user. To add multiples vUsers, you have to use Counter plug-in or CsvProvider plug-in.</help>
  </control>
  <control name="setGlobalDefaults" number="24">
    <params>
      <param name="localDisplayName" type="String" />
      <param name="userName" type="String" />
      <param name="password" type="String" />
      <param name="domain" type="String" />
      <param name="realm" type="String" />
      <param name="remoteDisplayName" type="String" />
      <param name="remoteUserName" type="String" />
      <param name="imsParameter" type="String" />
      <param name="imsImpi" type="String" />
      <param name="imsImpu" type="String" />
      <param name="remoteDomain" type="String" />
      <param name="maxForwards" type="String" />
      <param name="userAgent" type="String" />
      <param name="otherHeaders" type="String" />
      <param name="timeOut" type="String" />
      <param name="algorithm" type="String" />
      <param name="cNonce" type="String" />
      <param name="nonce" type="String" />
      <param name="nonceCount" type="String" />
      <param name="opaque" type="String" />
      <param name="qop" type="String" />
      <param name="response" type="String" />
      <param name="scheme" type="String" />
    </params>
    <help>Default global parameters and headers. This control must be the second control added to the scenario.

The default timeout is 60 ms.</help>
  </control>
  <control name="updateGlobalDefaults" number="30">
    <params>
      <param name="localDisplayName" type="String" />
      <param name="userName" type="String" />
      <param name="password" type="String" />
      <param name="domain" type="String" />
      <param name="realm" type="String" />
      <param name="imsParameter" type="String" />
      <param name="imsImpi" type="String" />
      <param name="imsImpu" type="String" />
      <param name="remoteDisplayName" type="String" />
      <param name="remoteUserName" type="String" />
      <param name="remoteDomain" type="String" />
      <param name="maxForwards" type="String" />
      <param name="userAgent" type="String" />
      <param name="otherHeaders" type="String" />
      <param name="timeOut" type="String" />
      <param name="algorithm" type="String" />
      <param name="cNonce" type="String" />
      <param name="nonce" type="String" />
      <param name="nonceCount" type="String" />
      <param name="opaque" type="String" />
      <param name="qop" type="String" />
      <param name="response" type="String" />
      <param name="scheme" type="String" />
    </params>
    <help>Update default global parameters and headers.</help>
  </control>
  <control name="setMethodDefaults" number="59">
    <params>
      <param name="fromInTo" type="String" />
      <param name="qValue" type="String" />
      <param name="expires" type="String" />
      <param name="addContact" type="String" />
      <param name="otherHeaders" type="String" />
      <param name="contentType" type="String" />
      <param name="method" type="String" />
      <param name="via" type="String" />
    </params>
    <help>Default parameter for request selected.</help>
  </control>
  <control name="setResponseDefaults" number="34">
    <params>
      <param name="addContact" type="String" />
      <param name="qValue" type="String" />
      <param name="expires" type="String" />
      <param name="contentType" type="String" />
      <param name="otherHeaders" type="String" />
    </params>
    <help>Default parameter for response.</help>
  </control>
  <control name="setSdp" number="3">
    <params>
      <param name="attributeV" type="String" />
      <param name="ownerUserName" type="String" />
      <param name="sessionId" type="String" />
      <param name="sessionVersion" type="String" />
      <param name="ownerNetworkType" type="String" />
      <param name="ownerAddressType" type="String" />
      <param name="ownerAddress" type="String" />
      <param name="attributeS" type="String" />
      <param name="mediaType" type="String" />
      <param name="mediaPort" type="String" />
      <param name="mediaProto" type="String" />
      <param name="mediaFormat" type="String" />
      <param name="otherHeaders" type="String" />
      <param name="startTime" type="String" />
      <param name="stopTime" type="String" />
    </params>
    <help>Default parameter for SDP.</help>
  </control>
  <control name="setBody" number="4">
    <params>
      <param name="value" type="String" />
    </params>
    <help>Default parameter for body. 

Need FileReader plug-in to work. Add ${name_of_your_filereader_plugin:} to the single field of the control.</help>
  </control>
  <control name="waitRequest" number="6">
    <params>
      <param name="sessionId" type="String" />
      <param name="timeOut" type="String" />
    </params>
    <help>Wait a request from the network.</help>
  </control>
  <control name="request" number="33">
    <params>
      <param name="method" type="String" />
      <param name="callId" type="String" />
      <param name="contentLength" type="String" />
      <param name="cSeqSequenceNumber" type="String" />
      <param name="otherHeaders" type="String" />
      <param name="toTag" type="String" />
      <param name="fromTag" type="String" />
      <param name="requestId" type="String" />
      <param name="addToTag" type="String" />
      <param name="authorization" type="String" />
      <param name="generateAuthorization" type="String" />
      <param name="userName" type="String" />
      <param name="host" type="String" />
      <param name="via" type="String" />
    </params>
    <help>Local headers for request. Be sure you have added setMethodDefault once before.</help>
  </control>
  <control name="response" number="35">
    <params>
      <param name="statusCode" type="String" />
      <param name="reasonPhrase" type="String" />
      <param name="contentLength" type="String" />
      <param name="toTag" type="String" />
      <param name="otherHeaders" type="String" />
      <param name="responseId" type="String" />
    </params>
    <help>Local headers for response. Be sure you have added setResponseDefault once before.</help>
  </control>
  <control name="deleteSession" number="60">
    <params>
      <param name="SessionID" type="String" />
    </params>
    <help>Give control help.</help>
  </control>
  <test name="responseCodeIs" number="7">
    <params>
      <param name="responseCode" type="String" />
      <param name="notChoice" type="String" />
      <param name="method" type="String" />
    </params>
    <help>Test if the response code is the same defined in parameter.</help>
  </test>
  <test name="responseIs1xx" number="8">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the response code is include between 100 and 199.</help>
  </test>
  <test name="responseIs2xx" number="9">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the response code is include between 200 and 299.</help>
  </test>
  <test name="responseIs3xx" number="10">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the response code is include between 300 and 399.</help>
  </test>
  <test name="responseIs4xx" number="11">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the response code is include between 400 and 499.</help>
  </test>
  <test name="responseIs5xx" number="12">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the response code is include between 500 and 599.</help>
  </test>
  <test name="responseIs6xx" number="13">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the response code is include between 600 and 699.</help>
  </test>
  <test name="requestIsAck" number="16">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the request is ACK.</help>
  </test>
  <test name="requestIsBye" number="17">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the request is BYE.</help>
  </test>
  <test name="requestIsCancel" number="18">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the request is CANCEL.</help>
  </test>
  <test name="requestIsInvite" number="15">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the request is INVITE.</help>
  </test>
  <test name="requestIsOptions" number="19">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the request is OPTIONS.</help>
  </test>
  <test name="requestIsRegister" number="14">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the request is REGISTER.</help>
  </test>
  <test name="requestIsSubscribe" number="21">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the request is SUBSCRIBE.</help>
  </test>
  <test name="requestIsNotify" number="22">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the request is NOTIFY.</help>
  </test>
  <test name="requestIsMessage" number="20">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the request is MESSAGE.</help>
  </test>
  <test name="isTimeOut" number="23">
    <params>
      <param name="notChoice" type="String" />
    </params>
    <help>Test if the time out is reached.</help>
  </test>
</plugin>

