Skip to content

Commit

Permalink
'status_code' type of incoming SIP messages changed from String to Nu…
Browse files Browse the repository at this point in the history
…mber.
  • Loading branch information
jmillan committed Nov 14, 2012
1 parent 99243e4 commit 58c4c52
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 73 deletions.
2 changes: 1 addition & 1 deletion src/DigestAuthentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ JsSIP.DigestAuthentication = function (ua, request, response) {
password: ua.configuration.password
};

if(response.status_code === '401') {
if(response.status_code === 401) {
authenticate = response.parseHeader('www-authenticate');
} else {
authenticate = response.parseHeader('proxy-authenticate');
Expand Down
4 changes: 2 additions & 2 deletions src/RequestSender.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ JsSIP.RequestSender.prototype = {
* Authentication
* Authenticate once. _challenged_ flag used to avoid infinite authentications.
*/
if ((status_code === '401' || status_code === '407') && !this.challenged && this.ua.configuration.password !== null) {
if ((status_code === 401 || status_code === 407) && !this.challenged && this.ua.configuration.password !== null) {
authorization = JsSIP.DigestAuthentication(this.ua, this.request, response);

if (status_code === '401') {
if (status_code === 401) {
this.request.setHeader('authorization', authorization);
} else {
this.request.setHeader('proxy-authorization', authorization);
Expand Down
4 changes: 2 additions & 2 deletions src/Session.js
Original file line number Diff line number Diff line change
Expand Up @@ -1070,11 +1070,11 @@ JsSIP.Session = (function() {

// RFC3261 14.1.
// Terminate the dialog if a 408 or 481 is received from a re-Invite.
if (status_code === '408' || status_code === '481') {
if (status_code === 408 || status_code === 481) {
this.session.ended('remote', null, JsSIP.c.causes.IN_DIALOG_408_OR_481);
this.session.onFailure(response);
this.onReceiveResponse(response);
} else if (status_code === '491' && response.method === JsSIP.c.INVITE) {
} else if (status_code === 491 && response.method === JsSIP.c.INVITE) {
if(!this.reatempt && this.session.status !== JsSIP.c.SESSION_TERMINATED) {
this.request.cseq.value = this.request.dialog.local_seqnum += 1;
this.reatemptTimer = window.setTimeout(
Expand Down
4 changes: 2 additions & 2 deletions src/grammar/dist/grammar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

126 changes: 63 additions & 63 deletions src/grammar/dist/grammar.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/grammar/src/grammar.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ extension_method = token

Status_Line = SIP_Version SP Status_Code SP Reason_Phrase

Status_Code = extension_code {
data.status_code = input.substring(pos, offset); }
Status_Code = status_code: extension_code {
data.status_code = parseInt(status_code.join("")); }

extension_code = DIGIT DIGIT DIGIT

Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ JsSIP.utils = {
var cause;

for (cause in JsSIP.c.SIP_ERROR_CAUSES) {
if (JsSIP.c.SIP_ERROR_CAUSES[cause].indexOf(parseInt(status_code, 10)) !== -1) {
if (JsSIP.c.SIP_ERROR_CAUSES[cause].indexOf(status_code) !== -1) {
return cause;
}
}
Expand Down

0 comments on commit 58c4c52

Please sign in to comment.