drachtio-srf
drachtio signaling resource framework
Last updated a month ago by beachdog .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install drachtio-srf 
SYNC missed versions from official npm registry.

drachtio-srf Build Status NPM version

drachtio logo

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

Please visit drachtio.org for getting started instructions, API documentation, sample apps and more!

Example proxy

  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

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)

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}`);
    });
  });
}

Current Tags

  • 4.4.23-beta.0                                ...           beta (5 months ago)
  • 4.4.31                                ...           latest (a month ago)

117 Versions

  • 4.4.31                                ...           a month ago
  • 4.4.30                                ...           2 months ago
  • 4.4.29                                ...           2 months ago
  • 4.4.28                                ...           2 months ago
  • 4.4.27                                ...           4 months ago
  • 4.4.26                                ...           4 months ago
  • 4.4.25                                ...           4 months ago
  • 4.4.24                                ...           4 months ago
  • 4.4.23                                ...           4 months ago
  • 4.4.23-beta.0                                ...           5 months ago
  • 4.4.22                                ...           5 months ago
  • 4.4.21                                ...           5 months ago
  • 4.4.20                                ...           5 months ago
  • 4.4.20-beta.2                                ...           5 months ago
  • 4.4.20-beta.1                                ...           5 months ago
  • 4.4.20-beta.0                                ...           5 months ago
  • 4.4.19                                ...           5 months ago
  • 4.4.19-beta.0                                ...           6 months ago
  • 4.4.18                                ...           7 months ago
  • 4.4.17                                ...           7 months ago
  • 4.4.15                                ...           8 months ago
  • 4.4.14                                ...           8 months ago
  • 4.4.14-beta.0                                ...           8 months ago
  • 4.4.13                                ...           8 months ago
  • 4.4.12                                ...           8 months ago
  • 4.4.11                                ...           8 months ago
  • 4.4.10                                ...           9 months ago
  • 4.4.10-beta.0                                ...           9 months ago
  • 4.4.9                                ...           9 months ago
  • 4.4.9-beta.0                                ...           9 months ago
  • 4.4.8                                ...           a year ago
  • 4.4.7                                ...           a year ago
  • 4.4.6                                ...           a year ago
  • 4.4.5                                ...           a year ago
  • 4.4.4                                ...           a year ago
  • 4.4.3                                ...           a year ago
  • 4.4.2                                ...           a year ago
  • 4.4.1                                ...           a year ago
  • 4.4.0                                ...           a year ago
  • 4.3.7                                ...           a year ago
  • 4.3.6                                ...           2 years ago
  • 4.3.5                                ...           2 years ago
  • 4.3.4                                ...           2 years ago
  • 4.3.3                                ...           2 years ago
  • 4.3.2                                ...           2 years ago
  • 4.3.1                                ...           2 years ago
  • 4.3.0                                ...           2 years ago
  • 4.2.18                                ...           2 years ago
  • 4.2.17                                ...           2 years ago
  • 4.2.16                                ...           2 years ago
  • 4.2.15                                ...           2 years ago
  • 4.2.14                                ...           2 years ago
  • 4.2.13                                ...           2 years ago
  • 4.2.12                                ...           2 years ago
  • 4.2.11                                ...           2 years ago
  • 4.2.10                                ...           2 years ago
  • 4.2.9                                ...           2 years ago
  • 4.2.8                                ...           2 years ago
  • 4.2.7                                ...           2 years ago
  • 4.2.6                                ...           2 years ago
  • 4.2.5                                ...           2 years ago
  • 4.2.4                                ...           2 years ago
  • 4.2.3                                ...           2 years ago
  • 4.2.2                                ...           2 years ago
  • 4.2.1                                ...           2 years ago
  • 4.2.0                                ...           2 years ago
  • 4.1.2                                ...           3 years ago
  • 4.1.1                                ...           3 years ago
  • 4.1.0                                ...           3 years ago
  • 4.0.2                                ...           3 years ago
  • 4.0.1                                ...           3 years ago
  • 4.0.0                                ...           3 years ago
  • 3.0.18                                ...           3 years ago
  • 3.0.17                                ...           3 years ago
  • 3.0.16                                ...           3 years ago
  • 3.0.14                                ...           3 years ago
  • 3.0.12                                ...           3 years ago
  • 3.0.11                                ...           3 years ago
  • 3.0.10                                ...           3 years ago
  • 3.0.9                                ...           3 years ago
  • 3.0.8                                ...           3 years ago
  • 3.0.7                                ...           3 years ago
  • 3.0.6                                ...           3 years ago
  • 3.0.5                                ...           3 years ago
  • 3.0.4                                ...           3 years ago
  • 3.0.3                                ...           3 years ago
  • 3.0.2                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 2.0.5                                ...           3 years ago
  • 2.0.4                                ...           3 years ago
  • 2.0.3                                ...           3 years ago
  • 2.0.2                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.16                                ...           3 years ago
  • 1.0.15                                ...           3 years ago
  • 1.0.14                                ...           3 years ago
  • 1.0.12                                ...           3 years ago
  • 1.0.11                                ...           3 years ago
  • 1.0.10                                ...           3 years ago
  • 1.0.9                                ...           3 years ago
  • 1.0.8                                ...           3 years ago
  • 1.0.7                                ...           3 years ago
  • 1.0.6                                ...           4 years ago
  • 1.0.5                                ...           4 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
  • 0.99.16                                ...           4 years ago
  • 0.99.7                                ...           4 years ago
  • 0.99.6                                ...           4 years ago
  • 0.99.5                                ...           4 years ago
  • 0.99.4                                ...           4 years ago
  • 0.99.3                                ...           4 years ago
  • 0.99.2                                ...           4 years ago
  • 0.99.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 121
Dependencies (12)
Dev Dependencies (14)

Copyright 2014 - 2017 © taobao.org |