Files
node-sbc/demo.js
2025-10-09 16:37:27 +02:00

30 lines
556 B
JavaScript

const Srf = require("drachtio-srf");
const srf = new Srf();
srf.connect({
host: "127.0.0.1",
port: 9022,
secret: "cymru"
});
srf.on("connect", (err, hostport) => {
console.log(`connected to a drachtio server listening on: ${hostport}`);
});
srf.register((req, res) => {
res.send(486, "So sorry, busy right now", {
headers: {
"X-Proudly-Served-By": "because why not?"
}
});
});
srf.invite((req, res) => {
res.send(486, "So sorry, busy right now", {
headers: {
"X-Custom-Header": "because why not?"
}
});
});