mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
further fixes for #210
This commit is contained in:
@@ -82,12 +82,18 @@ class CallSession extends Emitter {
|
|||||||
|
|
||||||
this._pool = srf.locals.dbHelpers.pool;
|
this._pool = srf.locals.dbHelpers.pool;
|
||||||
|
|
||||||
|
const handover = (newRequestor) => {
|
||||||
|
this.logger.info(`handover to new base url ${newRequestor.url}`);
|
||||||
|
this.requestor.removeAllListeners();
|
||||||
|
this.application.requestor = newRequestor;
|
||||||
|
this.requestor.on('command', this._onCommand.bind(this));
|
||||||
|
this.requestor.on('connection-dropped', this._onWsConnectionDropped.bind(this));
|
||||||
|
this.requestor.on('handover', handover.bind(this));
|
||||||
|
};
|
||||||
|
|
||||||
this.requestor.on('command', this._onCommand.bind(this));
|
this.requestor.on('command', this._onCommand.bind(this));
|
||||||
this.requestor.on('connection-dropped', this._onWsConnectionDropped.bind(this));
|
this.requestor.on('connection-dropped', this._onWsConnectionDropped.bind(this));
|
||||||
this.requestor.on('handover', (newRequestor) => {
|
this.requestor.on('handover', handover.bind(this));
|
||||||
this.logger.info(`handover to new base url ${newRequestor.url}`);
|
|
||||||
this.application.requestor = newRequestor;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ class HttpRequestor extends BaseRequestor {
|
|||||||
this.close();
|
this.close();
|
||||||
this.emit('handover', requestor);
|
this.emit('handover', requestor);
|
||||||
}
|
}
|
||||||
return requestor.request(type, hook, params, httpHeaders);
|
return requestor.request('session:new', hook, params, httpHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
let newClient;
|
let newClient;
|
||||||
|
|||||||
Reference in New Issue
Block a user