SIPP
sipp-js is a wrapper for sipp. The purpose of this library is to simplify the creation of SIPp instances. It is not intended to be a full SIPp implementation.
This library requires the sipp executable to be installed on the system.
Kind: global class
-
SIPP
- new SIPP(options)
-
.setUsername(username) ⇒
SIPP
-
.setPassword(password) ⇒
SIPP
-
.withScenario(scenarioFile) ⇒
SIPP
-
.withReportFreq(frequency) ⇒
SIPP
-
.withTraceStat() ⇒
SIPP
-
.withTraceScreen() ⇒
SIPP
-
.withTransportMode(transportMode) ⇒
SIPP
-
.withInf(info) ⇒
SIPP
-
.setInfIndex(info, index) ⇒
SIPP
-
.setVariable(variable, value) ⇒
SIPP
-
.withStats(fileName) ⇒
SIPP
-
.withCallRate(rate) ⇒
SIPP
-
.withCallLimit(limit) ⇒
SIPP
-
.withCallRateIncrease(rate, time) ⇒
SIPP
-
.withCallMax(calls) ⇒
SIPP
-
.withOpt(key, parameter) ⇒
SIPP
-
.withTimeout(timeout) ⇒
SIPP
-
.build() ⇒
string
-
.start() ⇒
Promise.<Buffer>
-
.startAsync(callback) ⇒
ChildProcess
- .stop()
new SIPP(options)
Constructs a new SIPP object.
Param | Type | Description |
---|---|---|
options | SIPPOptions |
Configuration object for SIPP |
options.remoteHost | string |
Remote host to connect to |
options.localPort | number |
Local port to use for SIP signaling |
options.timeout | number |
Timeout in milliseconds to quit SIPp. Defaults to 30 seconds. |
Example
const SIPP = require("sipp-js");
const sipp = new SIPP({
remoteHost: "remote.host.com",
localPort: 5060,
timeout: 30000
});
sipp.setUsername("user");
sipp.setPassword("password");
sipp.setScenario(`${process.cwd()}/scenarios/etc/arc.xml`);
sipp.start();
assert.ok(result.stderr == null)
SIPP
sipP.setUsername(username) ⇒ Optional username for SIP authentication.
Kind: instance method of SIPP
Param | Type | Description |
---|---|---|
username | string |
Username for SIP authentication |
SIPP
sipP.setPassword(password) ⇒ Optional password for SIP authentication.
Kind: instance method of SIPP
Param | Type | Description |
---|---|---|
password | string |
Password for SIP authentication |
SIPP
sipP.withScenario(scenarioFile) ⇒ Scenario file to use for SIP signaling.
Kind: instance method of SIPP
Param | Type | Description |
---|---|---|
scenarioFile | string |
Scenario file to use for SIP signaling |
SIPP
sipP.withReportFreq(frequency) ⇒ Statistics report frequency.
Kind: instance method of SIPP
Param | Type | Description |
---|---|---|
frequency | number |
Frequency in seconds |
SIPP
sipP.withTraceStat() ⇒ Dumps all statistics in <scenario_name>_.csv file.
Kind: instance method of SIPP
SIPP
sipP.withTraceScreen() ⇒ Dump statistic screens in the <scenario_name>__screens.log file when quitting SIPp.
Kind: instance method of SIPP
SIPP
sipP.withTransportMode(transportMode) ⇒ Selects the transport mode to use.
Kind: instance method of SIPP
Param | Type | Description |
---|---|---|
transportMode | TransportMode |
Transport mode to use |
SIPP
sipP.withInf(info) ⇒ Inject values from an external CSV file during calls into the scenarios.
Kind: instance method of SIPP
Returns: SIPP
- Also see setInfIndex
Param | Type | Description |
---|---|---|
info | string |
CSV file to use |
SIPP
sipP.setInfIndex(info, index) ⇒ Create an index of file using field. For example -inf users.csv -infindex users.csv 0 creates an index on the first key.
Kind: instance method of SIPP
Returns: SIPP
- Also see withInf
Param | Type | Description |
---|---|---|
info | string |
CSV file to use |
index | number |
Index of CSV file to use |
SIPP
sipP.setVariable(variable, value) ⇒ Sets a variable to a value. The variable must exist in the scenario.
Kind: instance method of SIPP
Param | Type | Description |
---|---|---|
variable | string |
Variable to set |
value | string |
Value to set |
SIPP
sipP.withStats(fileName) ⇒ Set the file name to use to dump statistics
Kind: instance method of SIPP
Returns: SIPP
- Also see withReportFreq
Param | Type | Description |
---|---|---|
fileName | string |
File name to use |
SIPP
sipP.withCallRate(rate) ⇒ Set the call rate (in calls per seconds).
Kind: instance method of SIPP
Param | Type | Description |
---|---|---|
rate | number |
Call rate to use |
SIPP
sipP.withCallLimit(limit) ⇒ Set max simultaneous calls.
Kind: instance method of SIPP
Returns: SIPP
- Also see withCallRate
Param | Type | Description |
---|---|---|
limit | number |
Number of calls to make |
SIPP
sipP.withCallRateIncrease(rate, time) ⇒ Set rate increase (in calls per seconds).
Kind: instance method of SIPP
Returns: SIPP
- Also see withCallRate
Param | Type | Description |
---|---|---|
rate | number |
Rate increase to use |
time | number |
Time to use |
SIPP
sipP.withCallMax(calls) ⇒ Set the number of calls to make.
Kind: instance method of SIPP
Param | Type | Description |
---|---|---|
calls | number |
Number of calls to make |
SIPP
sipP.withOpt(key, parameter) ⇒ Sets an arbitrary parameter.
Kind: instance method of SIPP
Param | Type | Description |
---|---|---|
key | string |
Option to set |
parameter | string |
Value to set |
SIPP
sipP.withTimeout(timeout) ⇒ Sets a timeout to quit SIPp.
Kind: instance method of SIPP
Param | Type | Description |
---|---|---|
timeout | number |
Timeout to use (in seconds) |
string
sipP.build() ⇒ Builds the command.
Kind: instance method of SIPP
Promise.<Buffer>
sipP.start() ⇒ Starts an instance of SIPp synchronously.
Kind: instance method of SIPP
ChildProcess
sipP.startAsync(callback) ⇒ Starts an instance of SIPp asynchronously.
Kind: instance method of SIPP
Param | Type | Description |
---|---|---|
callback | callback |
Callback function |
sipP.stop()
Stops the instance.
Kind: instance method of SIPP