Tue Jan 2 13:24:21 MSK 2007 Pavel Shramov * configurable radius config path diff -rN -u old-res_auth/res/res_auth.c new-res_auth/res/res_auth.c --- old-res_auth/res/res_auth.c 2007-01-02 14:13:06.000000000 +0300 +++ new-res_auth/res/res_auth.c 2007-01-02 14:13:06.000000000 +0300 @@ -69,7 +69,7 @@ #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 */ @@ -461,6 +461,12 @@ 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); } @@ -502,8 +508,8 @@ 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; }