added call_termination_by on app call status (#168)

Co-authored-by: Joan Salvatella <joan@bookline.io>
This commit is contained in:
Joan
2022-09-23 09:13:55 +02:00
committed by GitHub
parent 32714d73f3
commit c2c8f00978
4 changed files with 9 additions and 2 deletions

View File

@@ -34,6 +34,7 @@ class InboundCallSession extends CallSession {
_onCancel() {
this.rootSpan.setAttributes({'call.termination': 'caller abandoned'});
this.callInfo.callTerminationBy = 'caller';
this._notifyCallStatusChange({
callStatus: CallStatus.NoAnswer,
sipStatus: 487,
@@ -69,6 +70,7 @@ class InboundCallSession extends CallSession {
assert(this.dlg.connectTime);
const duration = moment().diff(this.dlg.connectTime, 'seconds');
this.rootSpan.setAttributes({'call.termination': 'hangup by caller'});
this.callInfo.callTerminationBy = 'caller';
this.emit('callStatusChange', {
callStatus: CallStatus.Completed,
duration