diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index adb3a8f..93c5cf4 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -555,6 +555,7 @@ static int dumphistory;			/*!< Dump history to verbose before destroying SIP dia
 static char global_realm[MAXHOSTNAMELEN]; 		/*!< Default realm */
 static char global_regcontext[AST_MAX_CONTEXT];		/*!< Context for auto-extensions */
 static char global_useragent[AST_MAX_EXTENSION];	/*!< Useragent for the SIP channel */
+static char global_auth_secret[80];	/*!< Default authentication scheme */
 static int allow_external_domains;	/*!< Accept calls to external SIP domains? */
 static int global_callevents;		/*!< Whether we send manager events or not */
 static int global_t1min;		/*!< T1 roundtrip time minimum */
@@ -10504,6 +10505,7 @@ static int sip_show_settings(int fd, int argc, char *argv[])
 	ast_cli(fd, "  User Agent:             %s\n", global_useragent);
 	ast_cli(fd, "  MWI checking interval:  %d secs\n", global_mwitime);
 	ast_cli(fd, "  Reg. context:           %s\n", S_OR(global_regcontext, "(not set)"));
+	ast_cli(fd, "  Auth secret:            %s\n", S_OR(global_auth_secret, "(not set)"));
 	ast_cli(fd, "  Caller ID:              %s\n", default_callerid);
 	ast_cli(fd, "  From: Domain:           %s\n", default_fromdomain);
 	ast_cli(fd, "  Record SIP history:     %s\n", recordhistory ? "On" : "Off");
@@ -16001,6 +16003,7 @@ static struct sip_peer *temp_peer(const char *name)
 	set_peer_defaults(peer);
 
 	ast_copy_string(peer->name, name, sizeof(peer->name));
+	ast_copy_string(peer->secret, global_auth_secret, sizeof(peer->secret));
 
 	ast_set_flag(&peer->flags[1], SIP_PAGE2_SELFDESTRUCT);
 	ast_set_flag(&peer->flags[1], SIP_PAGE2_DYNAMIC);
@@ -16329,6 +16332,7 @@ static int reload_config(enum channelreloadreason reason)
 	/* Reset channel settings to default before re-configuring */
 	allow_external_domains = DEFAULT_ALLOW_EXT_DOM;				/* Allow external invites */
 	global_regcontext[0] = '\0';
+	global_auth_secret[0] = '\0';
 	expiry = DEFAULT_EXPIRY;
 	global_notifyringing = DEFAULT_NOTIFYRINGING;
 	global_limitonpeers = FALSE;		/*!< Match call limit on peers only */
@@ -16482,6 +16486,12 @@ static int reload_config(enum channelreloadreason reason)
 					ast_context_create(NULL, context,"SIP");
 			}
 			ast_copy_string(global_regcontext, v->value, sizeof(global_regcontext));
+		} else if (!strcasecmp(v->name, "secret")) {
+			ast_copy_string(global_auth_secret, v->value, sizeof(global_auth_secret));
+			if (ast_validate_default_secret(global_auth_secret)) {
+				ast_log(LOG_WARNING, "Secret '%s' is not valid default secret\n", global_auth_secret);
+				global_auth_secret[0] = '\0';
+			}
 		} else if (!strcasecmp(v->name, "callerid")) {
 			ast_copy_string(default_callerid, v->value, sizeof(default_callerid));
 		} else if (!strcasecmp(v->name, "fromdomain")) {
diff --git a/include/asterisk/auth.h b/include/asterisk/auth.h
index 3fc21bb..876822e 100644
--- a/include/asterisk/auth.h
+++ b/include/asterisk/auth.h
@@ -37,6 +37,7 @@ enum {
 };
 
 int ast_parse_secret(const char*, const char *, char *);
+int ast_validate_default_secret(const char*);
 
 #ifdef HAVE_RADIUS
 #include <radiusclient-ng.h>
diff --git a/res/res_auth.c b/res/res_auth.c
index 535bc5c..b4a5fcd 100644
--- a/res/res_auth.c
+++ b/res/res_auth.c
@@ -69,7 +69,7 @@ static int get_ldap_password(const char *, char *);
 
 #ifdef HAVE_RADIUS
 AST_MUTEX_DEFINE_STATIC(rc_lock);
-#define RC_CONFIG_FILE "/usr/local/etc/radiusclient-ng/radiusclient.conf"
+static char radiuscfg[PATH_MAX] = "/usr/local/etc/radiusclient-ng/radiusclient.conf";
 static rc_handle *rh = NULL;
 #endif /* HAVE_RADIUS */
 
@@ -219,6 +219,50 @@ int ast_parse_secret(const char *username, const char *secret, char *pwd)
 	return res;
 }
 
+/*! \brief  Validates the secret default configuration string for Asterisk resources 
+  The user credentials format should be in the form : 
+  <auth_proxy>:[auth_db:[password]]
+
+  For full description of secret format see ast_parse_secret
+
+  \param secret the string that needs validating
+
+  \return 0 if validation succeded, 1 if supplied secret is not valid template
+*/
+int ast_validate_default_secret(const char *secret)
+{
+	char buf[256];
+	const char *auth_proxy = NULL;
+	const char *auth_db = NULL;
+	const char *password = NULL;
+
+	ast_copy_string(buf, secret, sizeof(buf));
+
+	auth_proxy = buf;
+
+	/* split the auth string into pieces */
+	auth_db = strchr(buf, ':');
+
+	if (auth_db) {
+		auth_db++;
+		password = strchr(auth_db, ':');
+		if (password)
+			password ++;
+	}
+
+	if (password && *password != '\0') {
+		//XXX: Error, password 
+		ast_log(LOG_ERROR, "Failed to validate default secret: local secret is present\n");
+		return 1;
+	}
+	if (!auth_db) {
+		//XXX: Error, old formatted secret
+		ast_log(LOG_ERROR, "Failed to validate default secret: old formatted secret\n");
+		return 1;
+	}
+	return 0;
+}
+
 #ifdef HAVE_OPENLDAP
 /*!\brief Connects to the configured LDAP server
 
@@ -412,7 +456,7 @@ int ast_digest_authenticate(const char* user, struct digest_parameters *params)
 
 static int parse_config(void)
 {
-	const struct ast_config *config;
+	struct ast_config *config;
 	const char *s;
 
 	config = ast_config_load(RES_AUTH_CONF);
@@ -459,9 +503,18 @@ static int parse_config(void)
 			ast_log(LOG_ERROR, "user_password_attribute is needed.\n");
 		} else 
 			ast_copy_string(userpw_attr, s, sizeof(userpw_attr));
+#endif /* HAVE_OPENLDAP */
 
+#ifdef HAVE_RADIUS
+		// As in cdr/cdr_radius.c
+		if ((s = ast_variable_retrieve(config, "radius", "radiuscfg")))
+			ast_copy_string(radiuscfg, s, sizeof(radiuscfg));
+#endif /* HAVE_RADIUS */
+
+		ast_config_destroy(config);
 	}
 
+#ifdef HAVE_OPENLDAP
 	ast_log(LOG_NOTICE, "LDAP Host: %s\n", dbhost);
 	ast_log(LOG_NOTICE, "LDAP Port: %i\n", dbport);
 	ast_log(LOG_NOTICE, "LDAP User: %s\n", dbuser);
@@ -471,14 +524,15 @@ static int parse_config(void)
 	ast_log(LOG_NOTICE, "LDAP User password attribute: %s\n", userpw_attr);
 #endif /* HAVE_OPENLDAP */
 
-	ast_config_destroy(config);
 	return 1;
 }
 
 
 static int unload_module(void)
 {
+#ifdef HAVE_OPENLDAP
 	ldap_disconnect();
+#endif /* HAVE_OPENLDAP */
 	ast_log(LOG_NOTICE, "res_auth unloaded.\n");
 	return 0;
 }
@@ -498,8 +552,8 @@ static int load_module(void)
 	rc_openlog("asterisk");
 
 	/* read radiusclient-ng config file */
-	if ((rh = rc_read_config(RC_CONFIG_FILE)) == NULL) {
-		ast_log(LOG_ERROR, "Cannot load radiusclient-ng configuration file %s.\n", RC_CONFIG_FILE);
+	if ((rh = rc_read_config(radiuscfg)) == NULL) {
+		ast_log(LOG_ERROR, "Cannot load radiusclient-ng configuration file %s.\n", radiuscfg);
 		return -1;
 	}
 
