SIPSAK(1)
β¨ sipsak(1) β¨
User Manuals Β· the manual name is sipsak π
πΈ NAME πΈ
sipsak β a utility for various tests on sip servers and user agents π¦
π SYNOPSIS π
sipsak [-dFGhiILnNMRSTUVvwz] [-a PASSWORD ] [-b NUMBER ] [-c SIPURI ]
[-C SIPURI ] [-D NUMBER ] [-e NUMBER ] [-E STRING ] [-f FILE ] [-g
STRING ] [-H HOSTNAME ] [-j STRING ] [-J STRING ] [-l PORT ] [-m NUMBER
] [-o NUMBER ] [-p HOSTNAME ] [-P NUMBER ] [-q REGEXP ] [-r PORT ] [-t
NUMBER ] [-u STRING ] [-W NUMBER ] [-x NUMBER ] -s SIPURI
π DESCRIPTION π
okay so bestie, sipsak is a SIP stress and diagnostics utility, and it literally does it all β¨. It sends SIP requests to the server inside the sip-uri and then looks at whatever responses come back. It runs in one of these modes:
- default mode β A SIP message gets sent to the destination in sip-uri and the reply status is displayed. The request is either taken from filename or generated fresh as a new
OPTIONSmessage. π«Ά - traceroute mode (
-T) β this one is giving "let me learn the request's path" energy. It operates similarly to the IP-layer utilitytraceroute(8). π§ - message mode (
-M) β sends a short message (similar to SMS from the mobile phones, iykyk) to a given target. With the option-Bthe content of the MESSAGE can be set. In this mode, options-cand-Omight be useful. π - usrloc mode (
-U) β stress mode for SIP registrar. sipsak keeps registering to a SIP server at high pace, no cap. Additionally the registrar can be stressed with the-Ior the-Moption. If-Iand-Mare omitted, sipsak can be used to register any given contact (with the-Coption) for an account at a registrar, and to query the current bindings for an account at a registrar. π - randtrash mode (
-R) β parser torture mode π. sipsak keeps sending randomly corrupted messages to torture a SIP server's parser. genuinely feral behavior. - flood mode (
-F) β stress mode for SIP servers. sipsak keeps sending requests to a SIP server at high pace. π₯
If c-ares (http://daniel.haxx.se/projects/c-ares/) support is compiled into the sipsak binary, then first a SRV lookup for _sip._tcp.hostname is made. If that fails, a SRV lookup for _sip._udp.hostname is made. And if this lookup fails, a normal A lookup is made. If a port was given in the target URI, the SRV lookup is omitted. Failover, load distribution and other transports are not supported yet β bestie they're just not there π.
β¨ OPTIONS β¨
-a,--password PASSWORDβ With the given PASSWORD an authentication will be tried on received'401 Unauthorized'. Authorization will be tried on time. If this option is omitted, an authorization with an empty password ("") will be tried. If the password is equal to-the password will be read from the standard input (e.g. the keyboard). This prevents other users on the same host from seeing the password in the process list. NOTE: the password still can be read from the memory if other users have access to it. π-A,--timingβ prints only the timing values of the test run if verbosity is zero because no-vwas given. If one or more-vwere given, this option will be ignored. β±οΈ-b,--appendix-begin NUMBERβ The starting number which is appended to the user name in the usrloc mode. This NUMBER is increased until it reaches the value given by the-eparameter. If omitted, the starting number will be one. π’-B,--message-body STRINGβ The given STRING will be used as the body for outgoing MESSAGE requests. βοΈ-c,--from SIPURIβ The given SIPURI will be used in theFromheader if sipsak runs in the message mode (initiated with the-Moption). This is helpful to present the receiver of a MESSAGE a meaningful and usable address to where maybe even responses can be sent. π-C,--contact SIPURIβ This is the content of theContactheader in the usrloc mode. This allows to insert forwards like for mail. For example you can insert the uri of your first SIP account at a second account, thus all calls to the second account will be forwarded to the first account. As the argument to this option will not be enclosed in brackets, you can give also multiple contacts in the raw format as comma separated list. The special wordsemptyornonewill result in no contact header in theREGISTERrequest, and thus the server should answer with the current bindings for the account at the registrar. The special words*orstarwill result in Contact header containing just a star, e.g. to remove all bindings by using expires value 0 together with this Contact. π-d,--ignore-redirectsβ If this option is set, all redirects will be ignored. By default, without this option, received redirects will be respected. This option is automatically activated in the randtrash mode and in the flood mode. π«-D,--timeout-factor NUMBERβ TheSIP_T1timer is getting multiplied with the given NUMBER. After receiving a provisional response for anINVITErequest, or when a reliable transport like TCP or TLS is used, sipsak waits for the resulting amount of time for a final response until it gives up. β-e,--appendix-end NUMBERβ The ending number which is appended to the user name in the usrloc mode. This number is increased until it reaches this ending number. In the flood mode this is the maximum number of messages which will be sent. If omitted, the default value is2^31 (2147483647)in the flood mode. π-E,--transport STRINGβ The value of STRING will be used as IP transport for sending and receiving requests and responses. This option overwrites any result from the URI evaluation and SRV lookup. Currently only'udp'and'tcp'are accepted as value for STRING. π-f,--filename FILEβ The content of FILE will be read in in binary mode and will be used as replacement for the alternatively created sip message. This can be used in the default mode to make other requests thanOPTIONSrequests (e.g.INVITE). By default, missing carriage returns in front of line feeds will be inserted (use-Lto de-activate this function). If the filename is equal to-the file is read from standard input, e.g. from the keyboard or a pipe. Please note that the manipulation functions (e.g. insertingViaheader) are only tested with RFC conform requests. Additionally special strings within the file can be replaced with some local or given values (see-gand-Gfor details). π-F,--flood-modeβ This option activates the flood mode. In this modeOPTIONSrequests with increasingCSeqnumbers are sent to the server. Replies are ignored β source port 9 (discard) of localhost is advertised in topmostVia. π-h,--helpβ Prints out a simple usage help message. If the long option--helpis available it will print out a help message with the available long options. π-g,--replace-string STRINGβ Activates the replacement of$replace$within the request (usually read in from a file) with the STRING. Alternatively you can also specify a list of attributes and values. This list has to start and end with a non alpha-numeric character. The same character has to be used also as separator between the attribute and the value and between new further attribute value pairs. The string"$attribute$"will be replaced with the value string in the message. π-G,--replaceβ Activates the automatic replacement of the following variables in the request (usually read in from a file):$dsthost$will be replaced with the host or domainname which is given by the-sparameter.$srchost$will be replaced by the hostname of the local machine.$port$will be replaced by the local listening port of sipsak.$user$will be replaced by the username which is given by the-sparameter. πͺ-H,--hostname HOSTNAMEβ Overwrites the automatic detection of the hostname with the given parameter. Warning: use this with caution (preferable only if the automatic detection fails). β οΈ-i,--no-viaβ Deactivates the insertion of theVialine of the localhost. Warning: this probably disables the receiving of the responses from the server. π¬-I,--invite-modeβ Activates the Invites cycles within the usrloc mode. It should be combined with-U. In this combination sipsak first registers a user, and then simulates an invitation to this user. First anInviteis sent, this is replied with200 OKand finally anACKis sent. This option can also be used without-U, but you should be sure to NOT invite real UAs with this option. In the case of a missing-Uthe-l PORTis required because only if you made a-Urun with a fixed local port before, a run with-Iand the same fixed local port can be successful. Warning: sipsak is no real UA and invitations to real UAs can result in unexpected behaviour. π-j,--headers STRINGβ The string will be added as one or more additional headers to the request. The string"\n"(note: two characters) will be replaced with CRLF and thus result in two separate headers. That way more then one header can be added. π-J,--autohash STRINGβ The string will be used as theH(A1)input to the digest authentication response calculation. Thus no password from the-aoption is required if this option is provided. The given string is expected to be a hex string with the length of the used hash function. π-k,--local-ip STRINGβ The local ip address to be used π-l,--local-port PORTβ The receiving UDP socket will use the local network port. Useful if a file is given by-fwhich contains a correctVialine. Check the-Soption for details how sipsak sends and receives messages. π-L,--no-crlfβ De-activates the insertion of carriage returns (\r) before all line feeds (\n) (which is not already proceeded by carriage return) if the input is coming from a file (-f). Without this option also an empty line will be appended to the request if required. π-m,--max-forwards NUMBERβ This sets the value of theMax-Forwardheader field. If omitted, no Max-Forward field will be inserted. If omitted in the traceroute mode, number will be255. π-M,--message-modeβ okay so this one turns on the Messages cycles inside usrloc mode π (fun fact: this used to just be part of the normal usrloc test back in sipsak pre 0.8.0). You should pair it with-Uso a successful registration gets tested with a test message to the user and gets replied to with200 OK. It can run without-Utoo, but bestie β warning β doing that can cause unexpected behavior. π-n,--numericβ instead of putting the full qualified domain name in the Via line, it uses the IP of the local host. And plot twist: this option is now on by default. slay β¨-N,--nagios-codeβ use Nagios compliant return codes instead of the normal sipsak ones. So sipsak returns0if everything was ok, and2in case of any error (local or remote). monitoring girlies this one's for you π-o,--sleep NUMBERβ sipsak sleeps for NUMBER ms before it starts the next cycle in the usrloc mode. It slows the whole test process down to be more realistic. Each cycle still gets completed as fast as possible, but the whole test is slowed down. it's giving "walk, don't run" πΆββοΈ-O,--disposition STRINGβ the given STRING becomes the content for theContent-Dispositionheader. Without this option there will be noContent-Dispositionheader in the request. no header, no vibe.-p,--outbound-proxy HOSTNAME[:PORT]β the address of the hostname is the target where the request gets sent (the outgoing proxy). Use this if the destination host is different from the host part of the request uri. The hostname gets resolved via DNS SRV if supported (peep the description for SRV resolving) and no port is given. π°οΈ-P,--processes NUMBERβ start NUMBER of processes in parallel to do the send and reply checking. Only makes sense if a higher number for-eis given in the usrloc, message or invite mode. parallel processing, we love a multitasking queen π-q,--search REGEXPβ match replies against REGEXP and return false if no match occurred. Super useful, for example, to detect the server name in theServerheader field. detective mode π-r,--remote-port PORTβ instead of the default sip port5060, the PORT gets used. Alternatively the remote port can be given within the sip uri of the-sparameter. your call, bestie π-R,--random-modeβ this activates the randtrash mode. In this mode,OPTIONSrequests get sent to the server with increasing numbers of randomly crashed characters within this request. The position within the request and the replacing character are randomly chosen. Any other response than Bad request (4xx) will stop this mode. Also three unresponded sends will stop this mode. With the-tparameter the maximum of trashed characters can be given. chaotic, but make it methodical π-s,--sip-uri SIPURIβ this mandatory option sets the destination of the request. It depends on the mode whether only the server name or also a user name is mandatory. Example for a full SIPURI:sip:test@foo.bar:123. See the note in the description part about SRV lookups for details on how the hostname of this URI is converted into an IP and port. no-s, no party π-S,--symmetricβ with this option sipsak will use only one port for sending and receiving messages. The local port for sending will be the value from the-loption. In the default mode sipsak sends from a random port and listens on the given port from the-loption.
Note: with this option sipsak will not be able to receive replies from servers with asymmetric signaling (and broken rport implementation) like the Cisco proxy. If you run sipsak as root and with raw socket support (check the output from the -V option) then this option is not required, because in this case sipsak already uses only one port for sending and receiving messages. π
-t,--trash-chars NUMBERβ this parameter specifies the maximum of trashed characters in the randtrash mode. If omitted, NUMBER will be set to the length of the request. default: just trash the whole thing, iconic ποΈ-T,--traceroute-modeβ this activates the traceroute mode. This mode works like the well knowntraceroute(8)command, except that it's not the number of network hops being counted β rather the number of servers on the way to the destination user. Also the round trip time of each request is printed out, but due to a limitation within the sip protocol the identity (IP or name) can only be determined and printed out if the response from the server contains a warning header field. In this mode, on each outgoing request the value of theMax-Forwardsheader field is increased, starting with one. The maximum of theMax-Forwardsheader will be255if no other value is given by the-mparameter. Any other response than483or1xxis treated as a final response and will terminate this mode. πΊοΈ-u,--auth-username STRINGβ use the given STRING as the username value for the authentication (different account and authentication username). two identities, one girl π«Ά-U,--usrloc-modeβ this activates the usrloc mode. Without the-Ior the-Moption, this only registers users at a registrar. With one of the above options the previously registered user will also be probed, whether with a simulated call flow (invite, 200, ack) or with an instant message (message, 200). One password for all users accounts within the usrloc test can be given with the-aoption. A user name is mandatory for this mode in the-sparameter. The number starting from the-bparameter to the-eparameter is appended the user name. If the-band the-eparameter are omitted, only one run with the given username, but without append number to the usernames, is done. registering girlies rise up π-v,--verboseβ this parameter increases the output verbosity. No-vmeans nearly no output except in traceroute and error messages. The maximum of three v's prints out the content of all packets received and sent. more v's, more tea β-V,--versionβ prints out the name and version number of sipsak and the options which were compiled into the binary. receipts, bestie π§Ύ-w,--extract-ipβ activates the extraction of the IP or hostname from theWarningheader field. pulling the info out of the warning like it's a gossip thread π-W,--nagios-warn NUMBERβ return the Nagios warn exit code (1) if the number of retransmissions before success was above the given number. π-x,--expires NUMBERβ sets the value of theExpiresheader to the given number. clock's ticking β°-z,--remove-bindingsβ activates the randomly removing of old bindings in the usrloc mode. How many percent of the bindings will be removed is determined by theUSRLOC_REMOVE_PERCENTdefine within the code (set it before compilation). Multiple removing of bindings is possible, and cannot be prevented. out with the old, no takebacks π-Z,--timer-t1β sets the amount of milliseconds for the SIP timer T1. It determines the length of the gaps between two retransmissions of a request on an unreliable transport. Default value is500if not changed via the configure option--enable-timeout. β³
β¨ RETURN VALUES β¨
okay so here's the scoreboard, bestie π
- The return value
0means that a200was received. π 1means something else than1xxor2xxwas received.2will be returned on local errors like non resolvable names or wrong options combination.3will be returned on remote errors like socket errors (e.g. icmp error), redirects without a contact header or simply no answer (timeout).
If the -N option was given, the return code will be 2 in case of any (local or remote) error, 1 in case there have been retransmissions from sipsak to the server, and 0 if there was no error at all. π―
π CAUTION π
Use sipsak responsibly. Running it in any of the stress modes puts substantial burden on network and server under test.
fr fr, don't be that girl. be kind to the servers, they have feelings (and limited CPU). πΈ
π EXAMPLES π
Here's the group chat showing how it's done π
- ``` sipsak -vv -s sip:nobody@foo.bar
displays received replies. π
2. ```
sipsak -T -s sip:nobody@foo.bar
traces SIP path to nobody. π€οΈ
- ``` sipsak -U -C sip:me@home -x 3600 -a password -s sip:myself@company
inserts forwarding from work to home for one hour. π β¨
4. ```
sipsak -f bye.sip -g '!FTAG!345.af23!TTAG!1208.12!' -s sip:myproxy
reads the file bye.sip, replaces $FTAG$ with 345.af23 and $TTAG$ with 1208.12 and finally sends this message to myproxy. π
π LIMITATIONS / NOT IMPLEMENTED π
the sad part of the story, bestie:
- Many servers may decide NOT to include SIP
Warningheader fields. Unfortunately, this makes displaying IP addresses of SIP servers in traceroute mode impossible. π - IPv6 is not supported. nope, not even a little. π«
- Missing support for the
Record-RouteandRouteheader.
π BUGS π
sipsak is only tested against the SIP Express Router (ser) β though their could be various bugs. Please feel free to mail them to the author. π¬
π AUTHOR π
Nils Ohlmeier <nils at sipsak dot org> β the main character who built all this π«Ά
π¦ SEE ALSO π¦
and that's a wrap on the SIPSAK(1) page, bestie π this one shipped on Linux, dated JULY 2002 - SEPTEMBER 2005, and it's still out here doing the most. go forth and sip responsibly, mwah πβ¨
π¦ where this page comes from
- alpine 3.22: sipsak-doc 0.9.8.1-r1 Β· GPL-2.0-or-later
- alpine 3.23: sipsak-doc 0.9.8.1-r1 Β· GPL-2.0-or-later
- alpine 3.24: sipsak-doc 0.9.8.1-r1 Β· GPL-2.0-or-later
- debian bookworm: sipsak 0.9.8.1-1 Β· GPL-2.0-or-later
- debian trixie: sipsak 0.9.8.1-1+b2 Β· GPL-2.0-or-later
- fedora 43: sipsak 0.9.8.1-14.fc43 Β· GPL-2.0-or-later
- fedora 44: sipsak 0.9.8.1-15.fc44 Β· GPL-2.0-or-later
- ubuntu jammy: sipsak 0.9.8.1-1build1 Β· GPL-2.0-or-later
- ubuntu noble: sipsak 0.9.8.1-1build4 Β· GPL-2.0-or-later
- ubuntu questing: sipsak 0.9.8.1-1build4
- ubuntu resolute: sipsak 0.9.8.1-1build5 Β· GPL-2.0-or-later
- ubuntu stonking: sipsak 0.9.8.1-1.1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms