An open API service indexing awesome lists of open source software.

https://github.com/fonoster/sipp-js

A Javascript wrapper for SIPp
https://github.com/fonoster/sipp-js

signaling sip testing

Last synced: 4 months ago
JSON representation

A Javascript wrapper for SIPp

Awesome Lists containing this project

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](#SIPP)
* [new SIPP(options)](#new_SIPP_new)
* [.setUsername(username)](#SIPP+setUsername) ⇒ [SIPP](#SIPP)
* [.setPassword(password)](#SIPP+setPassword) ⇒ [SIPP](#SIPP)
* [.withScenario(scenarioFile)](#SIPP+withScenario) ⇒ [SIPP](#SIPP)
* [.withReportFreq(frequency)](#SIPP+withReportFreq) ⇒ [SIPP](#SIPP)
* [.withTraceStat()](#SIPP+withTraceStat) ⇒ [SIPP](#SIPP)
* [.withTraceScreen()](#SIPP+withTraceScreen) ⇒ [SIPP](#SIPP)
* [.withTransportMode(transportMode)](#SIPP+withTransportMode) ⇒ [SIPP](#SIPP)
* [.withInf(info)](#SIPP+withInf) ⇒ [SIPP](#SIPP)
* [.setInfIndex(info, index)](#SIPP+setInfIndex) ⇒ [SIPP](#SIPP)
* [.setVariable(variable, value)](#SIPP+setVariable) ⇒ [SIPP](#SIPP)
* [.withStats(fileName)](#SIPP+withStats) ⇒ [SIPP](#SIPP)
* [.withCallRate(rate)](#SIPP+withCallRate) ⇒ [SIPP](#SIPP)
* [.withCallLimit(limit)](#SIPP+withCallLimit) ⇒ [SIPP](#SIPP)
* [.withCallRateIncrease(rate, time)](#SIPP+withCallRateIncrease) ⇒ [SIPP](#SIPP)
* [.withCallMax(calls)](#SIPP+withCallMax) ⇒ [SIPP](#SIPP)
* [.withOpt(key, parameter)](#SIPP+withOpt) ⇒ [SIPP](#SIPP)
* [.withTimeout(timeout)](#SIPP+withTimeout) ⇒ [SIPP](#SIPP)
* [.build()](#SIPP+build) ⇒ string
* [.start()](#SIPP+start) ⇒ Promise.<Buffer>
* [.startAsync(callback)](#SIPP+startAsync) ⇒ ChildProcess
* [.stop()](#SIPP+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**
```js
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](#SIPP)
Optional username for SIP authentication.

**Kind**: instance method of [SIPP](#SIPP)

| Param | Type | Description |
| --- | --- | --- |
| username | string | Username for SIP authentication |

### sipP.setPassword(password) ⇒ [SIPP](#SIPP)
Optional password for SIP authentication.

**Kind**: instance method of [SIPP](#SIPP)

| Param | Type | Description |
| --- | --- | --- |
| password | string | Password for SIP authentication |

### sipP.withScenario(scenarioFile) ⇒ [SIPP](#SIPP)
Scenario file to use for SIP signaling.

**Kind**: instance method of [SIPP](#SIPP)

| Param | Type | Description |
| --- | --- | --- |
| scenarioFile | string | Scenario file to use for SIP signaling |

### sipP.withReportFreq(frequency) ⇒ [SIPP](#SIPP)
Statistics report frequency.

**Kind**: instance method of [SIPP](#SIPP)

| Param | Type | Description |
| --- | --- | --- |
| frequency | number | Frequency in seconds |

### sipP.withTraceStat() ⇒ [SIPP](#SIPP)
Dumps all statistics in _.csv file.

**Kind**: instance method of [SIPP](#SIPP)

### sipP.withTraceScreen() ⇒ [SIPP](#SIPP)
Dump statistic screens in the __screens.log file when quitting SIPp.

**Kind**: instance method of [SIPP](#SIPP)

### sipP.withTransportMode(transportMode) ⇒ [SIPP](#SIPP)
Selects the transport mode to use.

**Kind**: instance method of [SIPP](#SIPP)

| Param | Type | Description |
| --- | --- | --- |
| transportMode | TransportMode | Transport mode to use |

### sipP.withInf(info) ⇒ [SIPP](#SIPP)
Inject values from an external CSV file during calls into the scenarios.

**Kind**: instance method of [SIPP](#SIPP)
**Returns**: [SIPP](#SIPP) - Also see `setInfIndex`

| Param | Type | Description |
| --- | --- | --- |
| info | string | CSV file to use |

### sipP.setInfIndex(info, index) ⇒ [SIPP](#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](#SIPP)
**Returns**: [SIPP](#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](#SIPP)
Sets a variable to a value. The variable must exist in the scenario.

**Kind**: instance method of [SIPP](#SIPP)

| Param | Type | Description |
| --- | --- | --- |
| variable | string | Variable to set |
| value | string | Value to set |

### sipP.withStats(fileName) ⇒ [SIPP](#SIPP)
Set the file name to use to dump statistics

**Kind**: instance method of [SIPP](#SIPP)
**Returns**: [SIPP](#SIPP) - Also see `withReportFreq`

| Param | Type | Description |
| --- | --- | --- |
| fileName | string | File name to use |

### sipP.withCallRate(rate) ⇒ [SIPP](#SIPP)
Set the call rate (in calls per seconds).

**Kind**: instance method of [SIPP](#SIPP)

| Param | Type | Description |
| --- | --- | --- |
| rate | number | Call rate to use |

### sipP.withCallLimit(limit) ⇒ [SIPP](#SIPP)
Set max simultaneous calls.

**Kind**: instance method of [SIPP](#SIPP)
**Returns**: [SIPP](#SIPP) - Also see `withCallRate`

| Param | Type | Description |
| --- | --- | --- |
| limit | number | Number of calls to make |

### sipP.withCallRateIncrease(rate, time) ⇒ [SIPP](#SIPP)
Set rate increase (in calls per seconds).

**Kind**: instance method of [SIPP](#SIPP)
**Returns**: [SIPP](#SIPP) - Also see `withCallRate`

| Param | Type | Description |
| --- | --- | --- |
| rate | number | Rate increase to use |
| time | number | Time to use |

### sipP.withCallMax(calls) ⇒ [SIPP](#SIPP)
Set the number of calls to make.

**Kind**: instance method of [SIPP](#SIPP)

| Param | Type | Description |
| --- | --- | --- |
| calls | number | Number of calls to make |

### sipP.withOpt(key, parameter) ⇒ [SIPP](#SIPP)
Sets an arbitrary parameter.

**Kind**: instance method of [SIPP](#SIPP)

| Param | Type | Description |
| --- | --- | --- |
| key | string | Option to set |
| parameter | string | Value to set |

### sipP.withTimeout(timeout) ⇒ [SIPP](#SIPP)
Sets a timeout to quit SIPp.

**Kind**: instance method of [SIPP](#SIPP)

| Param | Type | Description |
| --- | --- | --- |
| timeout | number | Timeout to use (in seconds) |

### sipP.build() ⇒ string
Builds the command.

**Kind**: instance method of [SIPP](#SIPP)

### sipP.start() ⇒ Promise.<Buffer>
Starts an instance of SIPp synchronously.

**Kind**: instance method of [SIPP](#SIPP)

### sipP.startAsync(callback) ⇒ ChildProcess
Starts an instance of SIPp asynchronously.

**Kind**: instance method of [SIPP](#SIPP)

| Param | Type | Description |
| --- | --- | --- |
| callback | callback | Callback function |

### sipP.stop()
Stops the instance.

**Kind**: instance method of [SIPP](#SIPP)