
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
drachtio-srf
Advanced tools
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}`);
});
});
}
FAQs
drachtio signaling resource framework
The npm package drachtio-srf receives a total of 2,062 weekly downloads. As such, drachtio-srf popularity was classified as popular.
We found that drachtio-srf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.