Skip to content
Permalink
Browse files

Add 'Content-Length' header to every SIP response

..,whether or not it carries a body

- For interaction with implementations that require responses to have this header.
  • Loading branch information
jmillan committed Jan 30, 2013
1 parent 7bcb2c0 commit f35376a1857210438dc2d3739163b834472f0cb5
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/SIPMessage.js
@@ -398,7 +398,7 @@ JsSIP.IncomingRequest.prototype.reply = function(code, reason, extraHeaders, bod
response += 'Content-Length: ' + length + '\r\n\r\n';
response += body;
} else {
response += '\r\n';
response += 'Content-Length: ' + 0 + '\r\n\r\n';
}

this.server_transaction.receiveResponse(code, response, onSuccess, onFailure);
@@ -442,7 +442,8 @@ JsSIP.IncomingRequest.prototype.reply_sl = function(code, reason) {
response += 'To: ' + to + '\r\n';
response += 'From: ' + this.getHeader('From') + '\r\n';
response += 'Call-ID: ' + this.call_id + '\r\n';
response += 'CSeq: ' + this.cseq + ' ' + this.method + '\r\n\r\n';
response += 'CSeq: ' + this.cseq + ' ' + this.method + '\r\n';
response += 'Content-Length: ' + 0 + '\r\n\r\n';

this.transport.send(response);
};

0 comments on commit f35376a

Please sign in to comment.
You can’t perform that action at this time.