Task that runs a SipExer User Agent.
sipexer
is a cli tool that facilitates snding 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 WebScoket transport protocols, being suitable to test modern WebRTC SIP servers.
The tasks execute the sipexer
command in a scenario and waits for its
termination, returning the status code of the process executed.
Task returns status code: 0
when sip protocol's last response code is between 200 and 299 after call termination.
Task returns status code: 1
when sip protocol's last response code is between 400 and 499 after call termination.
In all other cases task returns status code: 3
Task uses nagios plugin exit codes. See Documentation for details.
The variables overwritten by default by the task are:
image
: the default image to run isyaroslavonline/sipexer
Additional settings that can be passed to the task:
message
: the message sectionmethod
: SIP method used. OPTIONS, INVITE, REGISTER, INFO, NOTIFY, SUBSRIBE, PUBLISH, MESSAGE (string). Default: OPTIONSbody
: message body (string)no_body
: no body used for INVITE or MESSAGE method (true/false). Default: falsecontent_type
: content type (string)
auth
: authentication credentialsuser
: authentication user (string)password
: authentication password (string)ha1
: authentication password in HA1 format (true/false). Default: false
register
: the register sectionexpires
: expires header value (string)party
: register a third party To user (true/false). Default: false
from
: the From headeruri
: From header URI (string)user
: From header URI username (string). Default: alicedomain
: From header URI domain (string). Default: localhost
to
: the To headeruri
: To header URIuser
: To header URI username (string). Default: bobdomain
: To header URI domain (string). Default: localhost
ruri
: the R-URI headeruri
: request uri (string)user
: request uri username for destination proxy address (string)set_domains
: set From/To domains based on R-URI (true/false). Default: falseset_user
: set R-URI user to To-URI user for destination proxy address (true/false). Default: false
contact
: the contact sectionbuild
: build Contact header based on local address (true/false). Default: falseuri
: contact uri (string)
extra
: extra headers. Use dict key as name, dict value as body of extra header (can be provided many times). For example,X-Custom-Header
: custom-valueX-Custom-Header-2
: custom-value
fields
: field values. Use dict key as name, dict value as value of field (can be provided many times). List of available fields:method
. Default: "OPTIONS"fuser
. Default: "alice"fdomain
. Default: "localhost"tuser
. Default: "bob"tdomain
. Default: "localhost"viabranch
. Default: "$uuid"rport
. Default: ";rport"fromtag
. Default: "$uuid"callid
. Default: "$uuid"cseqnum
. Default: "$randseq"date
. Default: "$daterfc1123"sdpuser
. Default: "sipexer"sdpsessid
. Default: "$timestamp"sdpsessversion
. Default: "$timestamp"sdpaf
. Default: "IP4"sdprtpport
. Default: "$rand(20000,40000)"
template
: the template sectionfields_file
: path to the json fields file (string)fields_eval
: evaluate expression in fields file (true/false). Default: falsefile
: path to template file (string)body_file
: path for template file for body (string)raw
: send raw template content (no evaluation) (true/false). Default: false
user_agent
: user agent value (string)logging
: the loggin sectionverbose
: verbosity level (0..3). Default: 2color
: color output (true/false). Default: false
ip
: local ip address (string)port
: local port (string)transport
: the transport sectionudp
: the UDP sectiondial
: attempt first connect for UDP (true/false). Default: false
tls
: the TLS sectionkey
: path to TLS private key (string)certificate
: path to TLS public certificate (string)insecure
: skip tls cerificate validation (true/false). Default: false
wss
: the WebSocket sectionorigin
: websocket origin http url (string). Default: http://127.0.0.1proto
: websocket sub-protocol (string). Default: sip
no_crlf
: do not replace '\n' with '\r\n' inside the data to be sent (true/false). Default: falseno_parse
: no SIP message parsing of input template resulttimeout
: the timeout sectionsession
: time in ms to wait for a session (int)receive
: timeout in ms to wait for receive data (int). Default: 32000write
: timeout in ms to write data to socket (int). Default: 4000
timer
: the timer sectiont1
: value of t1 timer in ms (int). Default: 500t2
: value of t2 timer in ms (int). Default: 4000
target
: can be 'host', 'proto:host', 'host:port', 'proto:host:port', sip-uri or wss url
For more information about usage, message template, template fields, field values evaluation etc. refer Documentation
Execute a sipexer task:
- name: WebRTC Call
type: sipexer
target: 'wss://example.com:8443/'
message:
method: invite
no_body: true
ruri:
uri: 'sip:[email protected]'
set_domains: true
set_user: true
from:
user: 1001
contact:
uri: [email protected]
auth:
user: 1001
password: qwerty
template:
file: 'sipexer/template.txt'
timeout:
session: 2000
write: 30000
logging:
verbose: 3
color: true