Skip to content

Commit

Permalink
Fix #112. Enhance CANCEL request processing
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillan committed Jun 26, 2013
1 parent 1740e5e commit 3e84eaf
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jssip",
"title": "JsSIP",
"description": "the Javascript SIP library",
"version": "0.3.5",
"version": "0.3.6",
"homepage": "http://jssip.net",
"author": "José Luis Millán <[email protected]>",
"contributors": [
Expand Down
4 changes: 1 addition & 3 deletions src/RTCSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -671,15 +671,13 @@ RTCSession.prototype.receiveRequest = function(request) {
* established.
*/

// Reply 487
this.request.reply(487);

/*
* Terminate the whole session in case the user didn't accept nor reject the
*request opening the session.
*/
if(this.status === C.STATUS_WAITING_FOR_ANSWER) {
this.status = C.STATUS_CANCELED;
this.request.reply(487);
this.failed('remote', request, JsSIP.C.causes.CANCELED);
}
} else {
Expand Down
1 change: 1 addition & 0 deletions src/Transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ Transactions.checkTransaction = function(ua, request) {
case JsSIP.C.CANCEL:
tr = ua.transactions.ist[request.via_branch];
if(tr) {
request.reply_sl(200);
if(tr.state === C.STATUS_PROCEEDING) {
return false;
} else {
Expand Down
1 change: 0 additions & 1 deletion src/UA.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ 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);
Expand Down

0 comments on commit 3e84eaf

Please sign in to comment.