First commit merge
This commit is contained in:
29
demo.js
Normal file
29
demo.js
Normal file
@@ -0,0 +1,29 @@
|
||||
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?"
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user