### Compile SIPp without TLS, SCTP, or PCAP (Linux) Source: https://sipp.readthedocs.io/en/latest/installation This code snippet demonstrates the basic compilation of SIPp from source on Linux. It involves extracting the tarball, navigating to the directory, configuring with CMake, and then building the project. This is the recommended setup if advanced features are not required. ```bash tar -xvzf sipp-xxx.tar cd sipp cmake . make ``` -------------------------------- ### Compile SIPp with Combined Options (Linux) Source: https://sipp.readthedocs.io/en/latest/installation This snippet shows how to compile SIPp with multiple optional features enabled simultaneously, such as GSL, PCAP, TLS, and SCTP. It involves passing all desired options as arguments to the CMake command. ```bash tar -xvzf sipp-xxx.tar.gz cd sipp cmake . -DUSE_GSL=1 -DUSE_PCAP=1 -DUSE_SSL=1 -DUSE_SCTP=1 make ``` -------------------------------- ### SIPp Initialization Stanza Example Source: https://sipp.readthedocs.io/en/latest/scenarios/init_stanza This example demonstrates how to create an initialization stanza in SIPp. It sets the THINKTIME variable to 1 if it is not already defined, using and tags with conditional execution. ```xml ``` -------------------------------- ### SIPp XML - Start Response Time Duration Timer Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios Demonstrates how to use the `start_rtd` attribute within a `` command to start a Response Time Duration (RTD) timer. This timer is used for collecting statistics on response times and is named 'invite' in this example. ```xml ``` -------------------------------- ### Run SIPp with Embedded Server (uas) Scenario Source: https://sipp.readthedocs.io/en/latest/sipp This command starts SIPp with an embedded server scenario (uas). It is used to simulate a User Agent Server that receives SIP requests. No specific dependencies are mentioned other than having SIPp installed and executable. ```bash # ./sipp -sn uas ``` -------------------------------- ### Example INVITE with Authentication Source: https://sipp.readthedocs.io/en/latest/scenarios/sipauth This code snippet illustrates an INVITE request that includes the authentication header, specifying a username. This is part of a larger example scenario for performance testing. ```XML ;tag=[call_number] To: sut Call-ID: [call_id] CSeq: 2 INVITE Contact: sip:sipp@[local_ip]:[local_port] [authentication username=foouser] 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 ]]> ``` -------------------------------- ### Compile SIPp with TLS Support (Linux) Source: https://sipp.readthedocs.io/en/latest/installation This snippet shows how to compile SIPp with Transport Layer Security (TLS) support on Linux. It requires OpenSSL or WolfSSL to be installed. The compilation process is similar to the basic setup but includes the `-DUSE_SSL=1` flag during the CMake configuration step. ```bash tar -xvzf sipp-xxx.tar.gz cd sipp cmake . -DUSE_SSL=1 make ``` -------------------------------- ### Compile SIPp with PCAP Support (Linux) Source: https://sipp.readthedocs.io/en/latest/installation This code snippet illustrates how to compile SIPp with PCAP (Packet Capture) support, enabling features like media playback. The compilation process includes the `-DUSE_PCAP=1` option passed to the CMake command. ```bash tar -xvzf sipp-xxx.tar.gz cd sipp cmake . -DUSE_PCAP=1 make ``` -------------------------------- ### Compile SIPp with GSL Support for Distributed Pauses (Linux) Source: https://sipp.readthedocs.io/en/latest/installation This code demonstrates how to compile SIPp with support for statistically distributed pauses using the Gnu Scientific Libraries (GSL). The compilation is achieved by adding the `-DUSE_GSL=1` option to the CMake command. ```bash tar -xvzf sipp-xxx.tar.gz cd sipp cmake . -DUSE_GSL=1 make ``` -------------------------------- ### Example Injection File Structure Source: https://sipp.readthedocs.io/en/latest/scenarios/inject_from_csv Illustrates the format of an injection file containing user credentials, where each line consists of a username and a password separated by a comma. This structure is suitable for indexing by SIPp. ```text USERS alice,pass_A bob,pass_B carol,pass_C ``` -------------------------------- ### Launch SIPp UAS and UAC with IPv6 Source: https://sipp.readthedocs.io/en/latest/transport This example demonstrates how to launch a SIPp UAS (User Agent Server) and a UAC (User Agent Client) using IPv6 addresses. The UAS listens on a specified port, and the UAC sends traffic to the UAS's IPv6 address and port. Ensure that your system and network are configured for IPv6. ```bash ./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 ``` -------------------------------- ### SIPp UAC Scenario (XML) Source: https://sipp.readthedocs.io/en/latest/int_scenarios This scenario file defines the behavior of a SIPp User Agent Client (UAC). It outlines the sequence of SIP messages exchanged during a basic call setup, including INVITE, ACK, and BYE messages. No specific dependencies are mentioned beyond the SIPp executable itself. ```xml SIPp UAC Remote |(1) INVITE | |------------------>| |(2) 100 (optional) | |<------------------| |(3) 180 (optional) | |<------------------| |(4) 200 | |<------------------| |(5) ACK | |------------------>| | | |(6) PAUSE | | | |(7) BYE | |------------------>| |(8) 200 | |<------------------| ``` -------------------------------- ### SIPp 3PCC Extended sendCmd Example Source: https://sipp.readthedocs.io/en/latest/3PCC_extended An example of the `sendCmd` element in SIPp's 3PCC Extended mode. This syntax sends a command or SIP message to a specified peer instance (e.g., 's1'). The message content can include variables like '[call_id]' and must contain a 'From' field indicating the sender. ```xml ``` -------------------------------- ### Compile SIPp with SCTP Support (Linux) Source: https://sipp.readthedocs.io/en/latest/installation This snippet details the compilation of SIPp with SCTP (Stream Control Transmission Protocol) support on Linux. The process involves using the `-DUSE_SCTP=1` flag during the CMake configuration step. ```bash tar -xvzf sipp-xxx.tar.gz cd sipp cmake . -DUSE_SCTP=1 make ``` -------------------------------- ### SIPp regexp Scenario (XML) Source: https://sipp.readthedocs.io/en/latest/int_scenarios This XML scenario file configures SIPp to act as a User Agent Client (UAC) with regular expression capabilities, likely for dynamic message matching or response generation. It follows a standard call setup flow similar to the basic UAC scenario. Detailed explanation is deferred to another section. ```xml SIPp regexp Remote |(1) INVITE | |------------------>| |(2) 100 (optional) | |<------------------| |(3) 180 (optional) | |<------------------| |(4) 200 | |<------------------| |(5) ACK | |------------------>| | | |(6) PAUSE | | | |(7) BYE | |------------------>| |(8) 200 | |<------------------| ``` -------------------------------- ### Execute External Command: Log INVITE Sender Source: https://sipp.readthedocs.io/en/latest/scenarios/actions This example demonstrates executing an external system command. It logs the 'From' header of every received INVITE request to a file named 'from_list.log'. The command uses shell features to append output. ```xml ``` -------------------------------- ### SIPp XML - Conditional Branching with Next Attribute (Recv) Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios Shows how the `next` attribute can be used with `` commands. The `next` attribute is only taken if the optional message is received. This example demonstrates branching to label '5' if a 403 response is received. ```xml ``` -------------------------------- ### Run SIPp with Embedded Client (uac) Scenario Source: https://sipp.readthedocs.io/en/latest/sipp This command initiates SIPp with an embedded client scenario (uac) targeting a specific IP address (127.0.0.1 in this example). It simulates a User Agent Client sending SIP requests. This requires a running SIPp instance with a UAS scenario or a separate SIP server to interact with. ```bash # ./sipp -sn uac 127.0.0.1 ``` -------------------------------- ### SIPp XML: Basic SIP Server (UAS) INVITE Handling Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios Illustrates a basic SIP server scenario using SIPp XML, starting with a 'recv' command to accept an incoming INVITE request. It then uses 'send' to respond with a '180 Ringing' message, dynamically constructing headers from the received INVITE. ```XML Content-Length: 0 ]]> ``` -------------------------------- ### SIPp 3PCC Extended recvCmd Example Source: https://sipp.readthedocs.io/en/latest/3PCC_extended An example of the `recvCmd` element in SIPp's 3PCC Extended mode. This syntax defines an expected incoming message from a specific peer instance (e.g., 'm'). It supports regular expression matching (`ereg`) on the received message content for dynamic assignment of values. ```xml ``` -------------------------------- ### SIPp XML: Basic SIP Client (UAC) INVITE Scenario Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios Defines a basic SIP client scenario using SIPp XML. It starts with a 'send' command to transmit an INVITE message, followed by 'recv' commands to expect responses. Dynamic variables are used for SIP message fields. ```XML ;tag=[call_number] To: sut Call-ID: [call_id] Cseq: 1 INVITE Contact: sip:sipp@[local_ip]:[local_port] 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 ]]> ``` -------------------------------- ### Run SIPp with specific call rate and period Source: https://sipp.readthedocs.io/en/latest/controlling This example demonstrates how to run SIPp with a specified number of calls ('-r') and a defined call rate period ('-rp') in milliseconds. This allows for precise control over call generation frequency. ```bash ./sipp -sn uac -r 7 -rp 2000 127.0.0.1 ``` -------------------------------- ### Dynamic Authentication with CSV and XML Source: https://sipp.readthedocs.io/en/latest/scenarios/sipauth This example demonstrates how to use a CSV file to manage dynamic authentication credentials (username and password) and inject them into an XML SIP scenario using the [field1] keyword. ```XML From: Contact: ;transport=[transport] [field1] Expires: 300 Call-ID: [call_id] CSeq: 2 REGISTER Content-Length: 0 ]]> ``` -------------------------------- ### SIPp XML - Conditional Branching with Next Attribute (Send) Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios Provides an example of using the `next` attribute in a `` command to jump to a different part of the script after the message is sent. In this case, it jumps to label '12' after sending an ACK message. ```xml ``` -------------------------------- ### Execute Media Command: Play PCAP Audio Stream Source: https://sipp.readthedocs.io/en/latest/scenarios/actions This example demonstrates playing a pre-recorded RTP audio stream from a PCAP file. The 'play_pcap_audio' attribute specifies the file to be played. This action is non-blocking and initiates a separate thread for playback. ```xml ``` -------------------------------- ### Receive Commands and Assign to Variable in SIPp Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios This snippet illustrates how to use the `` element in SIPp to receive commands and optionally process them with an action. The example shows using `` within the action to extract information from the received message and assign it to a variable for later use. ```xml ``` -------------------------------- ### SIPp XML - Conditional Branching with Chance Attribute Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios Demonstrates how to use the `chance` attribute along with `test` and `next` for probabilistic branching. This example shows a 90% chance of branching to label '5' if variable '3' is set upon receiving a 403 response. ```xml ``` -------------------------------- ### SIPp XML - Inverse Conditional Execution with Condexec_inverse Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios Explains the `condexec_inverse` attribute, which inverts the condition specified by `condexec`. This allows a command to execute only when a variable is *not* set. In this example, the `` command executes if 'skipthis' variable is not set. ```xml ``` -------------------------------- ### SIPp UAC with Media Scenario (XML) Source: https://sipp.readthedocs.io/en/latest/int_scenarios This XML scenario file describes a SIPp User Agent Client (UAC) that includes media handling. It extends the basic UAC scenario by incorporating RTP send and RFC2833 digit handling, indicating capabilities for testing media-related SIP functionalities. Dependencies are assumed to be within the SIPp executable. ```xml 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 | |<------------------| ``` -------------------------------- ### SIPp XML: Basic SIP Client (UAC) ACK and BYE Scenario Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios Illustrates the completion of a SIP client call flow using SIPp XML. Includes sending an ACK message after receiving a '200 OK', a 'pause' command, and finally sending a 'BYE' request followed by a '200 OK' response. ```XML ;tag=[call_number] To: sut [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 ]]> ;tag=[call_number] To: sut [peer_tag_param] Call-ID: [call_id] Cseq: 2 BYE Contact: sip:sipp@[local_ip]:[local_port] Max-Forwards: 70 Subject: Performance Test Content-Length: 0 ]]> ``` -------------------------------- ### SIPp Branch Scenario (XML) Source: https://sipp.readthedocs.io/en/latest/int_scenarios This entry represents two complementary SIPp scenarios, `branchc.xml` (client-side) and `branchs.xml` (server-side), designed to work together for testing branching logic in SIP. The provided snippet shows a REGISTER and INVITE call flow with various responses, including a 403. Detailed explanation is available elsewhere. ```xml REGISTER ----------> 200 <---------- 200 <---------- INVITE ----------> 100 <---------- 180 <---------- 403 <---------- 200 <---------- ACK ----------> [ 5000 ms] BYE ----------> 200 <---------- ``` -------------------------------- ### SIPp XML - Stop Response Time Duration Timer Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios Illustrates the use of the `rtd` attribute in a `` command to stop one of the five Response Time Duration timers. In this example, timer number 2 is stopped when the message is sent. ```xml ``` -------------------------------- ### Configure Fixed and Uniform Pauses in SIPp Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios This snippet demonstrates how to configure fixed and uniform pauses using the `` element in SIPp. The `fixed` distribution pauses for a specified duration, while `uniform` pauses within a given range. No external libraries are required. ```xml pauses for 1 second. pauses between 2 and 5 seconds. ``` -------------------------------- ### Get Current Time using SIPp Source: https://sipp.readthedocs.io/en/latest/scenarios/actions The action retrieves the current time in seconds and microseconds since the epoch. The retrieved time values are assigned to specified variables, typically for timestamping or time-based logic within a SIPp scenario. ```xml ``` -------------------------------- ### Assign and Sample Numeric Variables in Sipp Source: https://sipp.readthedocs.io/en/latest/scenarios/actions Demonstrates assigning a literal value to a numeric variable and sampling from a normal distribution into another. It also shows assigning a string from an injection file and converting it to a double. ```xml ``` -------------------------------- ### Verify Authentication and Conditional Logic - SIPp Source: https://sipp.readthedocs.io/en/latest/scenarios/actions This SIPp configuration snippet shows how to receive a REGISTER request, extract the username from the Authorization header, look up credentials in a file, and verify authentication using the verifyauth action. It then uses NOP actions to direct the flow based on the authentication result. ```sipp ``` -------------------------------- ### Execute Internal Command: Stop Execution Source: https://sipp.readthedocs.io/en/latest/scenarios/actions This snippet shows how to use the internal command 'stop_now' to halt the SIPp script execution. It's triggered by receiving a specific SIP response code (603 in this example). The action is non-blocking and stops the current thread of execution. ```xml ``` -------------------------------- ### Automate SIPp Actions with Shell Script Source: https://sipp.readthedocs.io/en/latest/controlling This example shows a shell script that automates a series of actions for SIPp. It increases the call rate, waits for specified intervals, and eventually quits SIPp. Commands are sent to a UDP port (e.g., 8889) which is typically one port higher than the base port. ```shell #!/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 ``` -------------------------------- ### SIPp XML - Conditional Execution with Condexec Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios Shows the usage of the `condexec` attribute to execute a command only if a specific variable is set. This allows for more complex scenario logic without excessive use of `next` attributes and labels. Here, the `` command executes if 'executethis' variable is set. ```xml ``` -------------------------------- ### SIPp XML: Basic SIP Client (UAC) Receiving Responses Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios Demonstrates the 'recv' command within a SIPp client scenario to expect specific SIP responses. It shows how to define mandatory and optional responses, such as '100', '180', and '200'. ```XML optional="true" optional="true" ``` -------------------------------- ### SIPp UAS Scenario (XML) Source: https://sipp.readthedocs.io/en/latest/int_scenarios This XML scenario defines the behavior of a SIPp User Agent Server (UAS). It illustrates the message sequence for receiving calls, including INVITE, 180, 200, ACK, and BYE. This is useful for testing how a server responds to incoming SIP requests. No external dependencies are specified. ```xml Remote SIPp UAS |(1) INVITE | |------------------>| |(2) 180 | |<------------------| |(3) 200 | |<------------------| |(4) ACK | |------------------>| | | |(5) PAUSE | | | |(6) BYE | |------------------>| |(7) 200 | |<------------------| ``` -------------------------------- ### Configure SIP Authentication with Digest/MD5 Source: https://sipp.readthedocs.io/en/latest/scenarios/sipauth This snippet demonstrates how to configure SIP authentication using the Digest/MD5 algorithm in SIPp. It shows the parameters required for username and password, and how to specify them directly or via command-line arguments. ```XML From: Contact: ;transport=[transport] [authentication username=joe password=schmo] Expires: 300 Call-ID: [call_id] CSeq: 2 REGISTER Content-Length: 0 ]]> ``` -------------------------------- ### CSV Data Injection in SIPp Scenarios Source: https://sipp.readthedocs.io/en/latest/scenarios/inject_from_csv Demonstrates how to inject data from a CSV file into SIPp scenarios. The CSV file defines the data source, with the first line specifying the reading strategy (SEQUENTIAL, RANDOM, or USER). Subsequent lines contain data fields delimited by semicolons, which can be referenced in the XML scenario using `[fieldN]`. Comment lines starting with '#' are ignored. The `file=` parameter allows specifying different CSV files for different fields, and `line=` can be used to select specific lines. ```xml 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"]> ... ``` ```plaintext SEQUENTIAL #This line will be ignored Sarah;sipphone32 Bob;sipphone12 #This line too Fred;sipphone94 ``` ```plaintext [field0 line=1] ``` -------------------------------- ### SIPp XML - Conditional Branching with Test and Next Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios Illustrates using the `test` attribute in conjunction with `next` for conditional branching. The scenario will only branch to the specified label (e.g., '6') if the variable indicated by `test` (e.g., '4') is set, typically through a previous regexp match. ```xml ``` -------------------------------- ### Sipp Command Attributes Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios Defines how Sipp receives and processes incoming SIP messages. Attributes specify expected responses or requests, optional message handling, SDP processing, authentication, packet loss, timeouts, and actions to perform upon receiving a message. ```xml ``` -------------------------------- ### SIPp Log Actions and Ring Buffers Source: https://sipp.readthedocs.io/en/latest/error Illustrates how to use the 'log' action within a SIPp scenario to write custom traces to a log file. It also covers configuring log files as ring buffers to manage disk space by limiting file size and the number of rotated files. ```xml Using the action to print scenario traces. Example log file: __logs.log ``` ```bash -ringbuffer_size : Sets the maximum size for log files. -ringbuffer_files : Specifies the number of rotated log files to keep. ``` -------------------------------- ### Send Commands to Twin SIPp Instance Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios This snippet demonstrates how to send commands to a twin 3PCC (Third-Party Call Control) SIPp instance using the `` element. The content within the `CDATA` section is sent directly, and must include the Call-ID. In extended mode, the From header is also required. ```xml ``` -------------------------------- ### Jump to Scenario Index using SIPp Source: https://sipp.readthedocs.io/en/latest/scenarios/actions The action in SIPp enables jumping to an arbitrary scenario index, facilitating rudimentary subroutines. The caller can save their index using [msg_index], and the callee can return using this action. It can jump to a static index or to an index stored in a variable. ```xml ``` -------------------------------- ### Assign String Values in Sipp Source: https://sipp.readthedocs.io/en/latest/scenarios/actions Demonstrates how to assign string values to variables using the 'assignstr' command. The 'value' parameter can include substitutions, such as data from injection files. ```xml ``` -------------------------------- ### SIPp XML - Add CRLF to Message Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios Demonstrates the use of the `crlf` attribute within a `` command. Setting `crlf` to `true` will display an empty line after the message in the main SIPp screen output. ```xml ``` -------------------------------- ### SIPp Regular Expression Matching and Assignment Source: https://sipp.readthedocs.io/en/latest/scenarios/actions Demonstrates how to use the 'ereg' action in SIPp to match regular expressions against SIP messages or headers. It shows how to extract captured groups and assign them to variables for later use, with options to check for matches and specify the search context (message, header, body, or variable). ```xml ``` ```xml ``` -------------------------------- ### Specify Source for SIPp Receive Command Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios This snippet demonstrates how to specify the source twin SIPp instance from which a command is expected using the `src` attribute within the `` element. This is used in 3PCC extended mode to define the origin of incoming commands from specific instances like 's1'. ```xml the command will be expected to be received from the “s1” twin instance ``` -------------------------------- ### Configure Statistical Pauses with GSL in SIPp Source: https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios This snippet shows how to configure various statistical pauses using the `` element in SIPp, requiring the GSL (GNU Scientific Library). Distributions include normal, lognormal, exponential, Weibull, Pareto, Gamma, and negative binomial, each with specific parameter requirements. ```xml provides a normal pause with a mean of 60 seconds (i.e. 60,000 ms) and a standard deviation of 15 seconds. creates a distribution’s whose natural logarithm has a mean of 12.28 and a standard deviation of 1. creates an exponentially distributed pause with a mean of 15 minutes. creates a Weibull distribution with a scale of 3 and a shape of 4. creates a Pareto distribution with k and x m of 1 and 2, respectively. creates a Gamma distribution with k and theta of 9 and 2, respectively. creates a Negative binomial distribution with p and n of 0.1 and 2, respectively. ```