From 19d674f5316e6cbf45f25676a584545e81434b7f Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Tue, 25 Feb 2020 11:36:18 -0500 Subject: [PATCH] bugfix: _evalUnansweredCallPrecondition should be checking res.finalResponseSent --- lib/session/call-session.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/session/call-session.js b/lib/session/call-session.js index 154a09ab..d378c932 100644 --- a/lib/session/call-session.js +++ b/lib/session/call-session.js @@ -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};