mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
catch exceptions from req.cancel() (#1359)
* catch exceptions from req.cancel() * catch other instances of req.cancel * fix prev commit
This commit is contained in:
@@ -329,7 +329,13 @@ class SingleDialer extends Emitter {
|
||||
*/
|
||||
async kill(Reason) {
|
||||
this.killed = true;
|
||||
if (this.inviteInProgress) await this.inviteInProgress.cancel();
|
||||
if (this.inviteInProgress) {
|
||||
try {
|
||||
await this.inviteInProgress.cancel();
|
||||
} catch (err) {
|
||||
this.logger.error({err}, 'SingleDialer:kill error cancelling invite');
|
||||
}
|
||||
}
|
||||
else if (this.dlg && this.dlg.connected) {
|
||||
const duration = moment().diff(this.dlg.connectTime, 'seconds');
|
||||
this.logger.debug('SingleDialer:kill hanging up called party');
|
||||
|
||||
Reference in New Issue
Block a user