# drachtio-srf

> drachtio signaling resource framework

Latest version **5.0.29** (published 2026-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install drachtio-srf
pnpm add drachtio-srf
yarn add drachtio-srf
bun add drachtio-srf
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 5.0.29 |
| Published | 2026-09-14 |
| First published | 2015-11-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 18.x |
| Dependencies | 10 |
| Unpacked size | 583.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 224 |
| Author | Dave Horton |
| Maintainers | beachdog |

## Links

- npm: https://www.npmjs.com/package/drachtio-srf
- Repository: https://github.com/drachtio/drachtio-srf
- Homepage: https://github.com/drachtio/drachtio-srf#readme
- Issues: https://github.com/drachtio/drachtio-srf/issues
- npm.io page: https://npm.io/package/drachtio-srf

## Dependencies (10)

- [only](https://npm.io/package/only.md) ^0.0.2
- [debug](https://npm.io/package/debug.md) ^4.4.3
- [delegates](https://npm.io/package/delegates.md) ^1.0.0
- [node-noop](https://npm.io/package/node-noop.md) ^1.0.0
- [short-uuid](https://npm.io/package/short-uuid.md) ^6.0.3
- [sip-status](https://npm.io/package/sip-status.md) ^0.1.0
- [sip-methods](https://npm.io/package/sip-methods.md) ^0.3.0
- [utils-merge](https://npm.io/package/utils-merge.md) ^1.0.1
- [uuid-random](https://npm.io/package/uuid-random.md) ^1.3.2
- [sdp-transform](https://npm.io/package/sdp-transform.md) ^2.15.0

## Recent versions

- 5.0.29 (latest) — 2026-09-14
- 5.0.11-beta.0 (beta) — 2025-06-03
- 5.0.27 — 2026-07-09
- 5.0.26 — 2026-07-05
- 5.0.25 — 2026-06-30
- 5.0.24 — 2026-06-05
- 5.0.23 — 2026-05-13
- 5.0.22 — 2026-04-17
- 5.0.21 — 2026-04-13
- 5.0.20 — 2026-03-05
- 5.0.19 — 2026-02-20
- 5.0.18 — 2026-02-08
- 5.0.17 — 2026-01-14
- 5.0.15 — 2025-12-19
- 5.0.14 — 2025-10-29
- … 205 more at https://npm.io/package/drachtio-srf/versions

## README

# drachtio-srf ![Build Status](https://github.com/drachtio/drachtio-srf/workflows/CI/badge.svg)

[![drachtio logo](http://davehorton.github.io/drachtio-srf/img/definition-only-cropped.png)](https://drachtio.org)

Welcome to the Drachtio Signaling Resource framework (drachtio-srf), the Node.js framework for SIP Server applications.

Please visit [drachtio.org](https://drachtio.org) for getting started instructions, API documentation, sample apps and more!

*Example proxy*
```js
  const Srf = require('drachtio-srf');
  const srf = new Srf();

  srf.connect({
    host: '192.168.32.5',
    port: 9022,
    secret: 'cymru'
  });
  
  srf.invite((req, res) => {
    srf.proxyRequest(req, ['sip.example1.com', 'sip.example2.com'], {
      recordRoute: true,
      followRedirects: true,
      provisionalTimeout: '2s'
    }).then((results) => {
      console.log(JSON.stringify(result)); 
      // {finalStatus: 200, finalResponse:{..}, responses: [..]}
    });
  });
  ```
*Example Back-to-back user agent*
  ```js
  const Srf = require('drachtio-srf');
  const srf = new Srf();

  srf.connect({
    host: '192.168.32.5',
    port: 9022,
    secret: 'cymru'
  });
    const Srf = require('drachtio-srf');
  const srf = new Srf();

  srf.invite((req, res) => {
    srf.createB2BUA('sip:1234@10.10.100.1', req, res, {localSdpB: req.body})
      .then(({uas, uac}) => {
        console.log('call connected');

        // when one side terminates, hang up the other
        uas.on('destroy', () => { uac.destroy(); });
        uac.on('destroy', () => { uas.destroy(); });
        return;
      })
      .catch((err) => {
        console.log(`call failed to connect: ${err}`);
      });
  });
  ```
*Example sending a request (OPTIONS ping)*
  ```js
  const Srf = require('drachtio-srf');
  const srf = new Srf();

  srf.connect({host: '127.0.0.1', port: 9022, secret: 'cymru'});

  srf.on('connect', (err, hp) => {
    if (err) return console.log(`Error connecting: ${err}`);
    console.log(`connected to server listening on ${hp}`);

    setInterval(optionsPing, 10000);
  });

  function optionsPing() {
    srf.request('sip:tighthead.drachtio.org', {
      method: 'OPTIONS',
      headers: {
        'Subject': 'OPTIONS Ping'
      }
    }, (err, req) => {
      if (err) return console.log(`Error sending OPTIONS: ${err}`);
      req.on('response', (res) => {
        console.log(`Response to OPTIONS ping: ${res.status}`);
      });
    });
  }
  ```

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