Skip to content

Commit

Permalink
Small Fix. Reply '200' to a CANCEL 'before' replying 487 to the INVITE
Browse files Browse the repository at this point in the history
- The order was inverted
  • Loading branch information
jmillan committed Feb 20, 2013
1 parent d64168a commit 1b1ab73
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/Session.js
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/Transactions.js
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/UA.js
Expand Up @@ -418,6 +418,7 @@ JsSIP.UA.prototype.receiveRequest = function(request) {
request.reply(481);
break;
case JsSIP.C.CANCEL:
request.reply(200);

This comment has been minimized.

Copy link
@ibc

ibc Feb 20, 2013

Member

Y U REPLY 200 ALWAYS?

What about if the INVITE server transaction does not exist?

This comment has been minimized.

Copy link
@jmillan

jmillan Feb 20, 2013

Author Member

No response is sent if the transaction does not exist.

https://github.com/versatica/JsSIP/blob/master/src/Transactions.js#L624

This comment has been minimized.

Copy link
@ibc

ibc Feb 20, 2013

Member

I was so wrong... XD

This comment has been minimized.

Copy link
@jmillan

jmillan Feb 20, 2013

Author Member

No problem, the diff invites to think so xD

session = this.findSession(request);
if(session) {
session.receiveRequest(request);
Expand Down

0 comments on commit 1b1ab73

Please sign in to comment.