drachtio - making SIP server apps as easy to build as web apps.
Translation pending
Developer toolsJavaScript · ShellGitHub @drachtioOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
drachtio signaling resource framework
Translation pending
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
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!Read the full README ↗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:[email protected]', 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}`);
});
});
}