From 1b1ab739943fb5fd07f99367108fdbfe3bc9a83e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Mill=C3=A1n?= Date: Wed, 20 Feb 2013 18:01:39 +0100 Subject: [PATCH] Small Fix. Reply '200' to a CANCEL 'before' replying 487 to the INVITE - The order was inverted --- src/Session.js | 6 ++---- src/Transactions.js | 1 - src/UA.js | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Session.js b/src/Session.js index c67f632dc..d5c4dce06 100644 --- a/src/Session.js +++ b/src/Session.js @@ -305,10 +305,8 @@ JsSIP.Session.prototype.receiveRequest = function(request) { * established. */ - // Transaction layer already responded 487 to the initial request. - - // Reply 200 to CANCEL - request.reply(200); + // Reply 487 + this.request.reply(487); /* * Terminate the whole session in case the user didn't accept nor reject the diff --git a/src/Transactions.js b/src/Transactions.js index de03dcfaa..c28c76e0d 100644 --- a/src/Transactions.js +++ b/src/Transactions.js @@ -622,7 +622,6 @@ JsSIP.Transactions.checkTransaction = function(ua, request) { tr = ua.transactions.ist[request.via_branch]; if(tr) { if(tr.state === JsSIP.C.TRANSACTION_PROCEEDING) { - tr.request.reply(487); return false; } else { return true; diff --git a/src/UA.js b/src/UA.js index 5c2128d80..39286eff5 100644 --- a/src/UA.js +++ b/src/UA.js @@ -418,6 +418,7 @@ JsSIP.UA.prototype.receiveRequest = function(request) { request.reply(481); break; case JsSIP.C.CANCEL: + request.reply(200); session = this.findSession(request); if(session) { session.receiveRequest(request);