# flmcat-sip

> Javascript SDK for Twilio Client

Latest version **1.14.1-dev** (published 2021-06-06) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install flmcat-sip
pnpm add flmcat-sip
yarn add flmcat-sip
bun add flmcat-sip
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.14.1-dev |
| Published | 2021-06-06 |
| First published | 2021-06-06 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 113.6 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | flmcap |
| Keywords | twilio, client, voice, voip |

## Links

- npm: https://www.npmjs.com/package/flmcat-sip
- npm.io page: https://npm.io/package/flmcat-sip

## Dependencies (7)

- [ws](https://npm.io/package/ws.md) 6.1.3
- [backoff](https://npm.io/package/backoff.md) 2.5.0
- [loglevel](https://npm.io/package/loglevel.md) 1.6.7
- [xmlhttprequest](https://npm.io/package/xmlhttprequest.md) 1.8.0
- [@twilio/audioplayer](https://npm.io/package/@twilio/audioplayer.md) 1.0.6
- [@twilio/voice-errors](https://npm.io/package/@twilio/voice-errors.md) 1.0.1
- [rtcpeerconnection-shim](https://npm.io/package/rtcpeerconnection-shim.md) 1.2.8

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.14.1-dev (latest) — 2021-06-06

## README

## Twilio is currently running a public pilot phase for 2.0!
This repository is the current stable version of Twilio's Javascript Client SDK. We recently released a 2.0 pilot to gather customer feedback.
In this phase, it is possible that some aspects of the 2.0 API may change before GA. If you're interested in trying it out, see the
[2.0 pilot version of the SDK](https://github.com/twilio/twilio-voice.js).

This new major version cleans up a lot of the legacy API, such as:
- Removing deprecated methods
- Renaming classes and methods to be less ambiguous
- Implementing the new features from 1.x as defaults rather than behind feature flags
- Completely moving to the new TwilioError class which is standardized between Voice SDKs and contains much more detailed information about errors

Additionally, new features from this point onward will only be added to the 2.0 project, and not be backported to 1.x, so anyone looking to use the
latest features will want to be moved to the new 2.0 API.

twilio-client.js
================

[![Travis Build Status](https://travis-ci.org/twilio/twilio-client.js.svg?branch=master)](https://travis-ci.org/twilio/twilio-client.js) [![NPM](https://img.shields.io/npm/v/twilio-client.svg)](https://www.npmjs.com/package/twilio-client)

twilio-client.js allows you to add real-time voice and PSTN calling to your web apps.

* [API Docs](https://twilio.github.io/twilio-client.js/index.html)
* [More Docs](https://www.twilio.com/docs/voice/client/javascript/overview)
* [Quickstart](https://www.twilio.com/docs/voice/client/javascript/quickstart)
* [Changelog](https://github.com/twilio/twilio-client.js/blob/master/CHANGELOG.md)

### Technical Support
If you need technical support, contact
[help@twilio.com](mailto:help@twilio.com).

Installation
------------

### NPM

We recommend using `npm` to add the Client SDK as a dependency.

```
npm install twilio-client --save
```

Using this method, you can `import` twilio-client.js using ES Module or TypeScript syntax:

```js
import { Device } from 'twilio-client';

```

Or using CommonJS:

```js
const Device = require('twilio-client').Device;
```

### CDN

Though not recommended, releases of twilio-client.js are also hosted on a CDN and you can include
these directly in your web app using a &lt;script&gt; tag.

```html
<script src="https://sdk.twilio.com/js/client/v1.14/twilio.js"></script>
```

Using this method, twilio-client.js will set a browser global:

```js
const Device = Twilio.Device;
```

Testing
-------

Running unit tests requires no setup aside from installation (above). You can run unit tests via:

```
npm run test:unit
```

Integration tests require some set up:

1. If the account you want to use doesn't already have a TwiML app set up, create one using the
   TwiML code below.
2. Copy config.example.yaml to config.yaml, replacing the placeholder information with valid credentials.

```xml
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial>
    <Client>
      <Identity>{{To}}</Identity>
      <Parameter name="duplicate" value="12345" />
      <Parameter name="duplicate" value="123456" />
      <Parameter name="custom + param" value="我不吃蛋" />
      <Parameter name="foobar" value="some + value" />
      <Parameter name="custom1" value="{{Custom1}}" />
      <Parameter name="custom2" value="{{Custom2}}" />
      <Parameter name="custom3" value="{{Custom3}}" />
    </Client>
  </Dial>
</Response>
```

Integration tests can be run via:

```
npm run test:integration
```

These tests will run via karma, one at a time, in your system's default Chrome and then Firefox.

Content Security Policy (CSP)
----------------------------

Use the following policy directives to enable [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) that is compatible with twilio-client.js.

```
script-src https://media.twiliocdn.com https://sdk.twilio.com
media-src mediastream https://media.twiliocdn.com https://sdk.twilio.com
connect-src https://eventgw.twilio.com wss://chunderw-vpc-gll.twilio.com https://media.twiliocdn.com https://sdk.twilio.com
```

If you are providing a non-default value for `Device.Options.edge` or `Device.Options.region` parameter, you need to add the Signaling URI `wss://chunderw-vpc-gll-{regionId}.twilio.com` in your `connect-src` directive where `regionId` is the `Region ID` as defined in this [page](https://www.twilio.com/docs/global-infrastructure/edge-locations/legacy-regions). See examples below.

**If `Device.Options.region` is `us1`**

```
connect-src https://eventgw.twilio.com https://media.twiliocdn.com https://sdk.twilio.com wss://chunderw-vpc-gll-us1.twilio.com
```

**If `Device.Options.edge` is `ashburn`**

```
connect-src https://eventgw.twilio.com https://media.twiliocdn.com https://sdk.twilio.com wss://chunderw-vpc-gll-us1.twilio.com
```

**If `Device.Options.edge` is `['ashburn', 'sydney', 'roaming']`**

```
connect-src https://eventgw.twilio.com https://media.twiliocdn.com https://sdk.twilio.com wss://chunderw-vpc-gll-us1.twilio.com wss://chunderw-vpc-gll-au1.twilio.com wss://chunderw-vpc-gll.twilio.com
```

License
-------

See [LICENSE.md](https://github.com/twilio/twilio-client.js/blob/master/LICENSE.md)

---
_Source: https://npm.io/package/flmcat-sip · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
