Skip to content

Commit

Permalink
Fixed BYE and ACK error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillan committed Nov 14, 2012
1 parent 1b75492 commit 99243e4
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/Session.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,11 @@ JsSIP.Session = (function() {
this.send = function() {
var request_sender = new JsSIP.RequestSender(this, session.ua);
this.receiveResponse = function(response){};

this.onTransportError = function() {
session.onTransportError();
};

request_sender.send();
};
}
Expand All @@ -723,6 +728,15 @@ JsSIP.Session = (function() {
this.send = function() {
var request_sender = new JsSIP.RequestSender(this, session.ua);
this.receiveResponse = function(response){};

this.onRequestTimeout = function() {
session.onRequestTimeout();
};

this.onTransportError = function() {
session.onTransportError();
};

request_sender.send();
};
}
Expand All @@ -746,7 +760,7 @@ JsSIP.Session = (function() {
* @private
*/
Session.prototype.onTransportError = function() {
if(this.status !== JsSIP.c.TERMINATED) {
if(this.status !== JsSIP.c.SESSION_TERMINATED) {
this.ended('system', null, JsSIP.c.causes.CONNECTION_ERROR);
}
};
Expand All @@ -756,7 +770,7 @@ JsSIP.Session = (function() {
* @private
*/
Session.prototype.onRequestTimeout = function() {
if(this.status !== JsSIP.c.TERMINATED) {
if(this.status !== JsSIP.c.SESSION_TERMINATED) {
this.ended('system', null, JsSIP.c.causes.REQUEST_TIMEOUT);
}
};
Expand Down Expand Up @@ -1061,7 +1075,7 @@ JsSIP.Session = (function() {
this.session.onFailure(response);
this.onReceiveResponse(response);
} else if (status_code === '491' && response.method === JsSIP.c.INVITE) {
if(!this.reatempt && this.session.status !== JsSIP.c.TERMINATED) {
if(!this.reatempt && this.session.status !== JsSIP.c.SESSION_TERMINATED) {
this.request.cseq.value = this.request.dialog.local_seqnum += 1;
this.reatemptTimer = window.setTimeout(
function() { request_sender.send(); },
Expand Down

0 comments on commit 99243e4

Please sign in to comment.