Skip to content
Permalink
Browse files

Make 'password' configuration parameter optional

  • Loading branch information
jmillan committed Nov 1, 2012
1 parent 6748d48 commit 24e32c0d16ff5fcefd2319fc445a59d6fc2bcb59
Showing with 12 additions and 9 deletions.
  1. +1 −1 src/RequestSender.js
  2. +11 −8 src/UA.js
@@ -72,7 +72,7 @@ JsSIP.RequestSender.prototype = {
* Authentication
* 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);

if (status_code === '401') {
@@ -552,6 +552,9 @@ JsSIP.UA.prototype.loadConfig = function(configuration) {
*/
via_host: Math.random().toString(36).substr(2, 12) + '.invalid',

// Password
password: null,

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

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

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

1 comment on commit 24e32c0

@ibc

This comment has been minimized.

Copy link
Member

ibc commented on 24e32c0 Nov 1, 2012

yeah

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