Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #822 - Call Events Early media call status #831

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/session/call-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -2005,6 +2005,11 @@ Duration=${duration} `
if (this.direction === CallDirection.Inbound) {
if (task.earlyMedia && !this.req.finalResponseSent) {
this.res.send(183, {body: ep.local.sdp});
this._notifyCallStatusChange({
callStatus: CallStatus.EarlyMedia,
sipStatus: 183,
sipReason: 'Early Media'
});
return {ep};
}
this.logger.debug('propogating answer');
Expand Down
11 changes: 11 additions & 0 deletions lib/session/inbound-call-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,24 @@ class InboundCallSession extends CallSession {
}

_onCancel() {
this.rootSpan.setAttributes({'call.termination': 'caller abandoned'});
surajshivkumar marked this conversation as resolved.
Show resolved Hide resolved
this.rootSpan.setAttributes({'call.termination': 'caller abandoned'});
this.callInfo.callTerminationBy = 'caller';
const wasEarlyMedia = this.callInfo.callStatus === 'early-media';
this._notifyCallStatusChange({
callStatus: CallStatus.NoAnswer,
sipStatus: 487,
sipReason: 'Request Terminated'
});
if (wasEarlyMedia) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this event. Please consider to remove it.

NoAnswer is already good enoug as it's final status as same as Completed

const duration = 0; // Set duration to 0 for early media termination, required param
this._notifyCallStatusChange({
callStatus: CallStatus.Completed,
sipStatus: 487,
sipReason: 'Call Terminated During Early Media',
duration: duration
});
}
this._callReleased();
}

Expand Down
Loading