Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const __x = (callback) => {
const listener = _onError.bind(this, callback) ;
debug(`Mrf#connect - connecting to ${address}:${port}`);
const conn = new esl.Connection(address, port, secret, () => {
//...until we have initially connected and created a MediaServer object (which takes over error reporting)
debug('initial connection made');
conn.removeListener('error', listener) ;
const ms = new MediaServer(conn, this, listenAddress, listenPort, profile) ;
ms.once('ready', () => {
debug('Mrf#connect - media server is ready for action!');
callback(null, ms) ;
}) ;
});
conn.on('error', listener);
conn.on('esl::event::raw::text/rude-rejection', _onError.bind(this, callback, new Error('acl-error')));
};