Skip to content

Commit

Permalink
3.0.18
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillan committed Oct 13, 2017
1 parent 611ac7d commit 818f40a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

Version 3.0.18 (released in 2017-10-13)
--------------------------------------
* Dialog: ACK to initial INVITE could have lower CSeq than current remote_cseq.


Version 3.0.17 (released in 2017-10-12)
--------------------------------------
* RTCSession: process INFO in early state.
Expand Down
27 changes: 22 additions & 5 deletions dist/jssip.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* JsSIP v3.0.17
* JsSIP v3.0.18
* the Javascript SIP library
* Copyright: 2012-2017 José Luis Millán <jmillan@aliax.net> (https://github.com/jmillan)
* Homepage: http://jssip.net
Expand Down Expand Up @@ -226,6 +226,7 @@ function Dialog(owner, message, type, state) {
this.remote_uri = message.parseHeader('from').uri;
this.remote_target = contact.uri;
this.route_set = message.getHeaders('record-route');
this.ack_seqnum = this.remote_seqnum;
}
// RFC 3261 12.1.2
else if(type === 'UAC') {
Expand All @@ -243,6 +244,7 @@ function Dialog(owner, message, type, state) {
this.remote_uri = message.parseHeader('to').uri;
this.remote_target = contact.uri;
this.route_set = message.getHeaders('record-route').reverse();
this.ack_seqnum = null;
}

this.owner = owner;
Expand Down Expand Up @@ -302,11 +304,17 @@ Dialog.prototype = {
if(!this.remote_seqnum) {
this.remote_seqnum = request.cseq;
} else if(request.cseq < this.remote_seqnum) {
//Do not try to reply to an ACK request.
if (request.method !== JsSIP_C.ACK) {
if(request.method === JsSIP_C.ACK) {
// We are not expecting any ACK with lower seqnum than the current one.
// Or this is not the ACK we are waiting for.
if(this.ack_seqnum === null || request.cseq !== this.ack_seqnum) {
return false;
}
}
else {
request.reply(500);
return false;
}
return false;
} else if(request.cseq > this.remote_seqnum) {
this.remote_seqnum = request.cseq;
}
Expand Down Expand Up @@ -376,6 +384,15 @@ Dialog.prototype = {
return;
}

//ACK received. Cleanup this.ack_seqnum
if(request.method === JsSIP_C.ACK && this.ack_seqnum !== null) {
this.ack_seqnum = null;
}
//INVITE received. Set this.ack_seqnum
else if (request.method === JsSIP_C.INVITE) {
this.ack_seqnum = request.cseq;
}

this.owner.receiveRequest(request);
}
};
Expand Down Expand Up @@ -27417,7 +27434,7 @@ module.exports={
"name": "jssip",
"title": "JsSIP",
"description": "the Javascript SIP library",
"version": "3.0.17",
"version": "3.0.18",
"homepage": "http://jssip.net",
"author": "José Luis Millán <jmillan@aliax.net> (https://github.com/jmillan)",
"contributors": [
Expand Down
4 changes: 2 additions & 2 deletions dist/jssip.min.js

Large diffs are not rendered by default.

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": "3.0.17",
"version": "3.0.18",
"homepage": "http://jssip.net",
"author": "José Luis Millán <jmillan@aliax.net> (https://github.com/jmillan)",
"contributors": [
Expand Down

0 comments on commit 818f40a

Please sign in to comment.