Skip to content

Commit

Permalink
Add 'Content-Length' header to every SIP response
Browse files Browse the repository at this point in the history
..,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 f35376a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/SIPMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
};
Expand Down

0 comments on commit f35376a

Please sign in to comment.