#251 - unhandled exception in Session#_notifyCallStatusChange

This commit is contained in:
Dave Horton
2023-02-07 14:51:54 -05:00
parent ed284c367d
commit 7ae37b1e60

View File

@@ -1670,7 +1670,7 @@ class CallSession extends Emitter {
* @param {number} sipStatus - current sip status
* @param {number} [duration] - duration of a completed call, in seconds
*/
_notifyCallStatusChange({callStatus, sipStatus, sipReason, duration}) {
async _notifyCallStatusChange({callStatus, sipStatus, sipReason, duration}) {
if (this.callMoved) return;
/* race condition: we hang up at the same time as the caller */
@@ -1690,7 +1690,7 @@ class CallSession extends Emitter {
try {
const b3 = this.b3;
const httpHeaders = b3 && {b3};
this.notifier.request('call:status', this.call_status_hook, this.callInfo.toJSON(), httpHeaders);
await this.notifier.request('call:status', this.call_status_hook, this.callInfo.toJSON(), httpHeaders);
span.end();
} catch (err) {
span.end();