sipp-js
v0.1.3
Published
Wrapper library for SIPp
Downloads
197
Maintainers
Readme
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.setUsername(username) ⇒ SIPP
Optional username for SIP authentication.
Kind: instance method of SIPP
| Param | Type | Description | | --- | --- | --- | | username | string | Username for SIP authentication |
sipP.setPassword(password) ⇒ SIPP
Optional password for SIP authentication.
Kind: instance method of SIPP
| Param | Type | Description | | --- | --- | --- | | password | string | Password for SIP authentication |
sipP.withScenario(scenarioFile) ⇒ SIPP
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.withReportFreq(frequency) ⇒ SIPP
Statistics report frequency.
Kind: instance method of SIPP
| Param | Type | Description | | --- | --- | --- | | frequency | number | Frequency in seconds |
sipP.withTraceStat() ⇒ SIPP
Dumps all statistics in <scenario_name>_.csv file.
Kind: instance method of SIPP
sipP.withTraceScreen() ⇒ SIPP
Dump statistic screens in the <scenario_name>__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
| Param | Type | Description | | --- | --- | --- | | transportMode | TransportMode | Transport 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
| Param | Type | Description | | --- | --- | --- | | info | string | CSV 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
| Param | Type | Description | | --- | --- | --- | | info | string | CSV file to use | | index | number | Index 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
| Param | Type | Description | | --- | --- | --- | | variable | string | Variable to set | | value | string | Value 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
| Param | Type | Description | | --- | --- | --- | | fileName | string | File name to use |
sipP.withCallRate(rate) ⇒ SIPP
Set the call rate (in calls per seconds).
Kind: instance method of SIPP
| Param | Type | Description | | --- | --- | --- | | rate | number | Call rate to use |
sipP.withCallLimit(limit) ⇒ SIPP
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.withCallRateIncrease(rate, time) ⇒ SIPP
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.withCallMax(calls) ⇒ SIPP
Set the number of calls to make.
Kind: instance method of SIPP
| Param | Type | Description | | --- | --- | --- | | calls | number | Number of calls to make |
sipP.withOpt(key, parameter) ⇒ SIPP
Sets an arbitrary parameter.
Kind: instance method of SIPP
| Param | Type | Description | | --- | --- | --- | | key | string | Option to set | | parameter | string | Value to set |
sipP.withTimeout(timeout) ⇒ SIPP
Sets a timeout to quit SIPp.
Kind: instance method of SIPP
| Param | Type | Description | | --- | --- | --- | | timeout | number | Timeout 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
| Param | Type | Description | | --- | --- | --- | | callback | callback | Callback function |
sipP.stop()
Stops the instance.
Kind: instance method of SIPP