0.1.3 • Published 1 year ago

sipp-js v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

new SIPP(options)

Constructs a new SIPP object.

ParamTypeDescription
optionsSIPPOptionsConfiguration object for SIPP
options.remoteHoststringRemote host to connect to
options.localPortnumberLocal port to use for SIP signaling
options.timeoutnumberTimeout 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.setUsername(username) ⇒ SIPP

Optional username for SIP authentication.

Kind: instance method of SIPP

ParamTypeDescription
usernamestringUsername for SIP authentication

sipP.setPassword(password) ⇒ SIPP

Optional password for SIP authentication.

Kind: instance method of SIPP

ParamTypeDescription
passwordstringPassword for SIP authentication

sipP.withScenario(scenarioFile) ⇒ SIPP

Scenario file to use for SIP signaling.

Kind: instance method of SIPP

ParamTypeDescription
scenarioFilestringScenario file to use for SIP signaling

sipP.withReportFreq(frequency) ⇒ SIPP

Statistics report frequency.

Kind: instance method of SIPP

ParamTypeDescription
frequencynumberFrequency in seconds

sipP.withTraceStat() ⇒ SIPP

Dumps all statistics in <scenarioname>.csv file.

Kind: instance method of SIPP

sipP.withTraceScreen() ⇒ SIPP

Dump statistic screens in the <scenarioname>_screens.log file when quitting SIPp.

Kind: instance method of SIPP

sipP.withTransportMode(transportMode) ⇒ SIPP

Selects the transport mode to use.

Kind: instance method of SIPP

ParamTypeDescription
transportModeTransportModeTransport mode to use

sipP.withInf(info) ⇒ SIPP

Inject values from an external CSV file during calls into the scenarios.

Kind: instance method of SIPP
Returns: SIPP - Also see setInfIndex

ParamTypeDescription
infostringCSV file to use

sipP.setInfIndex(info, index) ⇒ SIPP

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

ParamTypeDescription
infostringCSV file to use
indexnumberIndex of CSV file to use

sipP.setVariable(variable, value) ⇒ SIPP

Sets a variable to a value. The variable must exist in the scenario.

Kind: instance method of SIPP

ParamTypeDescription
variablestringVariable to set
valuestringValue to set

sipP.withStats(fileName) ⇒ SIPP

Set the file name to use to dump statistics

Kind: instance method of SIPP
Returns: SIPP - Also see withReportFreq

ParamTypeDescription
fileNamestringFile name to use

sipP.withCallRate(rate) ⇒ SIPP

Set the call rate (in calls per seconds).

Kind: instance method of SIPP

ParamTypeDescription
ratenumberCall rate to use

sipP.withCallLimit(limit) ⇒ SIPP

Set max simultaneous calls.

Kind: instance method of SIPP
Returns: SIPP - Also see withCallRate

ParamTypeDescription
limitnumberNumber of calls to make

sipP.withCallRateIncrease(rate, time) ⇒ SIPP

Set rate increase (in calls per seconds).

Kind: instance method of SIPP
Returns: SIPP - Also see withCallRate

ParamTypeDescription
ratenumberRate increase to use
timenumberTime to use

sipP.withCallMax(calls) ⇒ SIPP

Set the number of calls to make.

Kind: instance method of SIPP

ParamTypeDescription
callsnumberNumber of calls to make

sipP.withOpt(key, parameter) ⇒ SIPP

Sets an arbitrary parameter.

Kind: instance method of SIPP

ParamTypeDescription
keystringOption to set
parameterstringValue to set

sipP.withTimeout(timeout) ⇒ SIPP

Sets a timeout to quit SIPp.

Kind: instance method of SIPP

ParamTypeDescription
timeoutnumberTimeout to use (in seconds)

sipP.build() ⇒ string

Builds the command.

Kind: instance method of SIPP

sipP.start() ⇒ Promise.<Buffer>

Starts an instance of SIPp synchronously.

Kind: instance method of SIPP

sipP.startAsync(callback) ⇒ ChildProcess

Starts an instance of SIPp asynchronously.

Kind: instance method of SIPP

ParamTypeDescription
callbackcallbackCallback function

sipP.stop()

Stops the instance.

Kind: instance method of SIPP