bugfix: _evalUnansweredCallPrecondition should be checking res.finalResponseSent

This commit is contained in:
Dave Horton
2020-02-25 11:36:18 -05:00
parent fa05b76451
commit 19d674f531

View File

@@ -475,7 +475,7 @@ class CallSession extends Emitter {
_evalUnansweredCallPrecondition(task, callSid) {
if (!this.req) throw new Error('invalid precondition unanswered_call for outbound call');
if (this.callGone) new Error(`${BADPRECONDITIONS}: call gone`);
if (this.req.finalResponseSent) {
if (this.res.finalResponseSent) {
throw new Error(`${BADPRECONDITIONS}: final sip status already sent`);
}
return {req: this.req, res: this.res};