尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证drachtio signaling resource framework
翻译准备中
取自仓库 README
正在加载完整 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!查看完整 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}`);
});
});
}