mirror of
https://github.com/jambonz/sbc-inbound.git
synced 2025-12-19 04:37:43 +00:00
SIGTERM handler to remove entry from active-sip
This commit is contained in:
8
app.js
8
app.js
@@ -218,4 +218,12 @@ setInterval(async() => {
|
||||
}
|
||||
}, 20000);
|
||||
|
||||
process.on('SIGUSR2', handle.bind(null, removeFromSet, setName));
|
||||
process.on('SIGTERM', handle.bind(null, removeFromSet, setName));
|
||||
|
||||
function handle(removeFromSet, setName, signal) {
|
||||
logger.info(`got signal ${signal}, removing ${srf.locals.privateSipAddress} from set ${setName}`);
|
||||
removeFromSet(setName, srf.locals.privateSipAddress);
|
||||
}
|
||||
|
||||
module.exports = {srf, logger};
|
||||
|
||||
Reference in New Issue
Block a user