Skip to content

Commit

Permalink
Make 'password' configuration parameter optional
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillan committed Nov 1, 2012
1 parent 6748d48 commit 24e32c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/RequestSender.js
Expand Up @@ -72,7 +72,7 @@ JsSIP.RequestSender.prototype = {
* Authentication * Authentication
* Authenticate once. _challenged_ flag used to avoid infinite authentications. * Authenticate once. _challenged_ flag used to avoid infinite authentications.
*/ */
if ((status_code === '401' || status_code === '407') && !this.challenged) { if ((status_code === '401' || status_code === '407') && !this.challenged && this.ua.configuration.password !== null) {
authorization = JsSIP.DigestAuthentication(this.ua, this.request, response); authorization = JsSIP.DigestAuthentication(this.ua, this.request, response);


if (status_code === '401') { if (status_code === '401') {
Expand Down
19 changes: 11 additions & 8 deletions src/UA.js
Expand Up @@ -552,6 +552,9 @@ JsSIP.UA.prototype.loadConfig = function(configuration) {
*/ */
via_host: Math.random().toString(36).substr(2, 12) + '.invalid', via_host: Math.random().toString(36).substr(2, 12) + '.invalid',


// Password
password: null,

// Registration parameters // Registration parameters
register_expires: 600, register_expires: 600,
register_min_expires: 120, register_min_expires: 120,
Expand Down Expand Up @@ -708,14 +711,14 @@ JsSIP.UA.configuration_skeleton = (function() {


// Mandatory user configurable parameters // Mandatory user configurable parameters
"outbound_proxy_set", "outbound_proxy_set",
"password",
"uri", "uri",


// Optional user configurable parameters // Optional user configurable parameters
"authorization_user", "authorization_user",
"display_name", "display_name",
"hack_via_tcp", // false. "hack_via_tcp", // false.
"hack_ip_in_contact", //false "hack_ip_in_contact", //false
"password",
"stun_server", "stun_server",
"no_answer_timeout", // 30 seconds. "no_answer_timeout", // 30 seconds.
"register_expires", // 600 seconds. "register_expires", // 600 seconds.
Expand Down Expand Up @@ -797,13 +800,6 @@ JsSIP.UA.configuration_check = {
} else { } else {
return true; return true;
} }
},
password: function(password) {
if(JsSIP.grammar.parse(password, 'password') === -1) {
return false;
} else {
return true;
}
} }
}, },
optional: { optional: {
Expand Down Expand Up @@ -843,6 +839,13 @@ JsSIP.UA.configuration_check = {
return true; return true;
} }
}, },
password: function(password) {
if(JsSIP.grammar.parse(password, 'password') === -1) {
return false;
} else {
return true;
}
},
stun_server: function(stun_server) { stun_server: function(stun_server) {
var parsed; var parsed;


Expand Down

1 comment on commit 24e32c0

@ibc
Copy link
Member

@ibc ibc commented on 24e32c0 Nov 1, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah

Please sign in to comment.