[asterisk-commits] twilson: trunk r105733 - /trunk/res/res_phoneprov.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 4 14:32:55 CST 2008


Author: twilson
Date: Tue Mar  4 14:32:55 2008
New Revision: 105733

URL: http://svn.digium.com/view/asterisk?view=rev&rev=105733
Log:
Set username to default to the category name if it isn't overridden by a usernmae= setting in users.conf

Modified:
    trunk/res/res_phoneprov.c

Modified: trunk/res/res_phoneprov.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_phoneprov.c?view=diff&rev=105733&r1=105732&r2=105733
==============================================================================
--- trunk/res/res_phoneprov.c (original)
+++ trunk/res/res_phoneprov.c Tue Mar  4 14:32:55 2008
@@ -705,7 +705,13 @@
 	for (i = 0; i < PP_VAR_LIST_LENGTH; i++) {
 		tmp = ast_variable_retrieve(cfg, name, pp_variable_list[i].user_var);
 
-		if (i == PP_TIMEZONE) {
+		/* If we didn't get a USERNAME variable, set it to the user->name */
+		if (i == PP_USERNAME && !tmp) {
+			if ((var = ast_var_assign(pp_variable_list[PP_USERNAME].template_var, user->name))) {
+				AST_LIST_INSERT_TAIL(user->headp, var, entries);
+			}
+			continue;
+		} else if (i == PP_TIMEZONE) {
 			/* perfectly ok if tmp is NULL, will set variables based on server's time zone */
 			set_timezone_variables(user->headp, tmp);
 		}




More information about the asterisk-commits mailing list