@jambonz/mw-registrar
v0.2.7
Published
jambonz middleware that provides access to the database of active registrations maintained as part of the SBC function
Downloads
648
Readme
mw-registrar
Jambonz class that handles inserting, removing, and querying the database of active sip registrations
const Registrar = require('jambonz-mw-registrar');
const registrar = new Registrar({host: '127.0.0.1', port: 6379});
// add a registration, optionally with an expires value in secs
registrar.add('[email protected]', {
contact: '10.10.1.1',
sbcAddress: '192.168.1.1',
protocol: 'udp'
}, 40);
const registrationDetails = await registrar.query('[email protected]');
// {"contact":"10.10.1.1","sbcAddress":"192.168.1.1","protocol":"udp"}
// get count of users for a realm
const userCount = await registrar.getCountOfUsers('drachtio.org');
// remove a user
registrar.remove('[email protected]');