30 lines
556 B
JavaScript
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?"
|
|
}
|
|
});
|
|
});
|