Skip to content

Commit 99243e4

Browse files
committed
Fixed BYE and ACK error handling
1 parent 1b75492 commit 99243e4

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/Session.js

+17-3
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,11 @@ JsSIP.Session = (function() {
701701
this.send = function() {
702702
var request_sender = new JsSIP.RequestSender(this, session.ua);
703703
this.receiveResponse = function(response){};
704+
705+
this.onTransportError = function() {
706+
session.onTransportError();
707+
};
708+
704709
request_sender.send();
705710
};
706711
}
@@ -723,6 +728,15 @@ JsSIP.Session = (function() {
723728
this.send = function() {
724729
var request_sender = new JsSIP.RequestSender(this, session.ua);
725730
this.receiveResponse = function(response){};
731+
732+
this.onRequestTimeout = function() {
733+
session.onRequestTimeout();
734+
};
735+
736+
this.onTransportError = function() {
737+
session.onTransportError();
738+
};
739+
726740
request_sender.send();
727741
};
728742
}
@@ -746,7 +760,7 @@ JsSIP.Session = (function() {
746760
* @private
747761
*/
748762
Session.prototype.onTransportError = function() {
749-
if(this.status !== JsSIP.c.TERMINATED) {
763+
if(this.status !== JsSIP.c.SESSION_TERMINATED) {
750764
this.ended('system', null, JsSIP.c.causes.CONNECTION_ERROR);
751765
}
752766
};
@@ -756,7 +770,7 @@ JsSIP.Session = (function() {
756770
* @private
757771
*/
758772
Session.prototype.onRequestTimeout = function() {
759-
if(this.status !== JsSIP.c.TERMINATED) {
773+
if(this.status !== JsSIP.c.SESSION_TERMINATED) {
760774
this.ended('system', null, JsSIP.c.causes.REQUEST_TIMEOUT);
761775
}
762776
};
@@ -1061,7 +1075,7 @@ JsSIP.Session = (function() {
10611075
this.session.onFailure(response);
10621076
this.onReceiveResponse(response);
10631077
} else if (status_code === '491' && response.method === JsSIP.c.INVITE) {
1064-
if(!this.reatempt && this.session.status !== JsSIP.c.TERMINATED) {
1078+
if(!this.reatempt && this.session.status !== JsSIP.c.SESSION_TERMINATED) {
10651079
this.request.cseq.value = this.request.dialog.local_seqnum += 1;
10661080
this.reatemptTimer = window.setTimeout(
10671081
function() { request_sender.send(); },

0 commit comments

Comments
 (0)