Modern and flexible SIP (RFC3261) command line tool.


sipexer is a cli tool that facilitates sending SIP requests to servers. It uses a flexible template
system to allow defining many parts of the SIP request via command line parameters. It has support
for UDP, TCP, TLS and WebSocket transport protocols, being suitable to test modern WebRTC SIP servers.

sipexer is not a SIP cli softphone, but a tool for crafting SIP requests mainly for the purpose
of testing SIP signaling routing or monitoring servers.

It is written in Go, aiming to be usable from Linux, MacOS or Windows.

The meaning of the name sipexer: randomly selected to be easy to write and pronounce,
quickly after thought of it as the shortening of SIP EXEcutoR.



Compile From Sources

First install Go. Once the Go environment is configured, clone sipexer git repository:

git clone

Download dependencies and build:

cd sipexer
go get ./...
go build .

The binary sipexer should be generated in the current directory.

Download Binary Release




sipexer [options] [target]

See sipexer -h for the command line options and arguments.


  • target address: sip:
  • SIP method: OPTIONS
  • From user: alice
  • From domain: localhost
  • To user: bob
  • To domain: localhost


Send an OPTIONS request over UDP to and port 5060 – couple of variants:

sipexer 5060
sipexer udp 5060
sipexer udp:
sipexer sip:
sipexer "sip:;transport=udp"

Specify a different R-URI:

sipexer -ruri sip:[email protected] udp:

Send from UDP local port 55060:

sipexer -laddr udp:

Send REGISTER request with generated contact, expires as well as user and password authentication:

sipexer -register -cb -ex 600 -au alice -ap test123 udp:

Set fuser field to carol:

sipexer -sd -fv "fuser:carol" udp:

Set fuser field to carol and tuser field to david:

sipexer -sd -fv "fuser:carol"  -fv "tuser:david" udp:

Add extra headers:

sipexer -sd -xh "X-My-Key:abcdefgh" -xh "P-Info:xyzw" udp:

Send MESSAGE request with body:

sipexer -message -mb 'Hello!' -sd -su udp:

Message Template

Template Data

The message to be sent via the SIP connection is built from a template file and a fields file.

The template file can contain any any of the directives supported by Go package text/template – for more see:


{{.method}} {{.ruri}} SIP/2.0
Via: SIP/2.0/{{.viaproto}} {{.viaaddr}}{{.rport}};branch=z9hG4bKSG.{{.viabranch}}
From: {{if .fname}}"{{.fname}}" {{end}}<sip:{{if .fuser}}{{.fuser}}@{{end}}{{.fdomain}}>;tag={{.fromtag}}
To: {{if .tname}}"{{.tname}}" {{end}}<sip:{{if .tuser}}{{.tuser}}@{{end}}{{.tdomain}}>
Call-ID: {{.callid}}
CSeq: {{.cseqnum}} {{.method}}
{{if .subject}}Subject: {{.subject}}{{else}}$rmeol{{end}}
{{if .date}}Date: {{.date}}{{else}}$rmeol{{end}}
{{if .contacturi}}Contact: {{.contacturi}}{{if .contactparams}};{{.contactparams}}{{end}}{{else}}$rmeol{{end}}
{{if .expires}}Expires: {{.expires}}{{else}}$rmeol{{end}}
{{if .useragent}}User-Agent: {{.useragent}}{{else}}$rmeol{{end}}
Content-Length: 0

The internal template can be found at the top of sipexer.go file.

Template Fields

The fields file has to contain a JSON document with the fields to be replaced
in the template file. The path to the JSON file is provided via -ff or --fields-file

When the --fields-eval of -fe cli option is provided, sipexer evaluates the values of the
fields in the root structure of the JSON document. That means special tokens (expressions)
are replaced if the value of the field is a string matching one of the next:

  • "$uuid" – replace with a UUID value
  • "$randseq" – replace with a random number from 1 to 1 000 000.
  • "$datefull" – replace with output of time.Now().String()
  • "$daterfc1123" – replace with output of time.Now().Format(time.RFC1123)
  • "$dateansic" – replace with output of time.Now().Format(time.ANSIC)
  • "$dateunix" – replace with output of time.Now().Format(time.UnixDate)
  • "$timestamp" – replace with output of time.Now().Unix()
  • "$cr" – replace with \r
  • "$lf" – replace with \n

When internal template is used, --fields-eval is turned on.

Example fields file:

	"method": "OPTIONS",
	"fuser": "alice",
	"fdomain": "localhost",
	"tuser": "bob",
	"tdomain": "localhost",
	"viabranch": "$uuid",
	"rport": ";rport",
	"fromtag": "$uuid",
	"callid": "$uuid",
	"cseqnum": "$randseq",
	"date": "$daterfc1123"

The internal fields data can be found at the top of sipexer.go file.

The values for fields can be also provided using --field-val or -fv cli parameter, in
format name:value, for example:

sipexer --field-val="" ...

The value provided via --field-val overwrites the value provided in the
JSON fields file.


There are several alternatives that might be useful to consider:

  • sipp – SIP testing tool using XML-based scenarios
  • sipsak – SIP swiss army knife – SIP cli testing tool
  • wsctl – WebSocket cli tool with basic support for SIP
  • baresip – cli SIP softphone
  • pjsua – cli SIP softphone



Copyright: Daniel-Constantin Mierla (Asipto)


Contributions are welcome!

Fork and do pull requests:


View Github