Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const parseUri = require('drachtio-srf').parseUri ;
const SipError = require('drachtio-srf').SipError;
const config = require('config');
const debug = require('debug')('drachtio-rtpengine-webrtcproxy') ;
class CallProcessor {
/**
* creates an instance of the call processor. this is intended to be a singleton instance.
* you call the 'start' method to kick it off
*/
constructor(logger) {
this._logger = logger;
// we need to track these only so we can fixup REFER messages for attended transfer
this.calls = new Map() ;
}
const parseUri = require('drachtio-srf').parseUri ;
const SipError = require('drachtio-srf').SipError;
class Subscriber {
constructor(logger) {
this._logger = logger;
}
get logger() {
return this._logger;
}
start(srf, registrar) {
srf.subscribe((req, res) => {
this.logger.info(`UAC subscribing: ${req.protocol}/${req.source_address}:${req.source_port}`) ;