Skip to content

Commit 880c3e0

Browse files
committed
- Add Expires header into REGISTER requests to deal with not very cool registrar servers.
- Set initial CSeq number to 1 in REGISTER requests.
1 parent fa17bee commit 880c3e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Registrator.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Registrator = function(ua, transport) {
2424

2525
// Call-ID and CSeq values RFC3261 10.2
2626
this.call_id = JsSIP.Utils.createRandomToken(22);
27-
this.cseq = 80;
27+
this.cseq = 0;
2828

2929
// this.to_uri
3030
this.to_uri = ua.configuration.uri;
@@ -67,6 +67,7 @@ Registrator.prototype = {
6767

6868
extraHeaders = this.extraHeaders.slice();
6969
extraHeaders.push('Contact: '+ this.contact + ';expires=' + this.expires);
70+
extraHeaders.push('Expires: '+ this.expires);
7071

7172
this.request = new JsSIP.OutgoingRequest(JsSIP.C.REGISTER, this.registrar, this.ua, {
7273
'to_uri': this.to_uri,
@@ -221,6 +222,7 @@ Registrator.prototype = {
221222
}, extraHeaders);
222223
} else {
223224
extraHeaders.push('Contact: '+ this.contact + ';expires=0');
225+
extraHeaders.push('Expires: 0');
224226

225227
this.request = new JsSIP.OutgoingRequest(JsSIP.C.REGISTER, this.registrar, this.ua, {
226228
'to_uri': this.to_uri,

0 commit comments

Comments
 (0)