[asterisk-commits] markster: branch markster/usersconf r40827 - in /team/markster/usersconf: con...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Aug 21 21:25:23 MST 2006


Author: markster
Date: Mon Aug 21 23:25:22 2006
New Revision: 40827

URL: http://svn.digium.com/view/asterisk?rev=40827&view=rev
Log:
Fix up users config, fix manager to support reload again and make 'n' 
revert to #1 when changing extensions

Modified:
    team/markster/usersconf/configs/users.conf.sample
    team/markster/usersconf/main/manager.c
    team/markster/usersconf/pbx/pbx_config.c

Modified: team/markster/usersconf/configs/users.conf.sample
URL: http://svn.digium.com/view/asterisk/team/markster/usersconf/configs/users.conf.sample?rev=40827&r1=40826&r2=40827&view=diff
==============================================================================
--- team/markster/usersconf/configs/users.conf.sample (original)
+++ team/markster/usersconf/configs/users.conf.sample Mon Aug 21 23:25:22 2006
@@ -40,47 +40,3 @@
 ;hasmanager = no
 ;hascallwaiting = no
 ;context = international
-
-;
-; User configuration
-;
-; Creating entries in users.conf is a "shorthand" for creating individual
-; entries in each configuration file.  Using users.conf is not intended to 
-; provide you with as great of flexibility as using the separate configuration
-; files (e.g. sip.conf, iax.conf, etc) but is intended to accellerate the
-; simple task of adding users.  Note that creating individual items (e.g.
-; custom sip peers, iax friends, etc) will allow you to override specific 
-; parameters within this file.
-;
-
-[general]
-fullname = New User
-phone = none
-userbase = 6000
-hasvoicemail = yes
-hassip = yes
-hasiax = yes
-hasmanager = no
-callwaiting = yes
-threewaycalling = yes
-callwaitingcallerid = yes
-transfer = yes
-canpark = yes
-cancallforward = yes
-callreturn = yes
-callgroup = 1
-pickupgroup = 1
-
-
-;[6000]
-;fullname = Joe User
-;email = joe at foo.bar
-;secret = 1234
-;zapchan = 1
-;hasvoicemail = yes
-;hassip = yes
-;hasiax = no
-;hasmanager = no
-;hascallwaiting = no
-;context = international
-

Modified: team/markster/usersconf/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/markster/usersconf/main/manager.c?rev=40827&r1=40826&r2=40827&view=diff
==============================================================================
--- team/markster/usersconf/main/manager.c (original)
+++ team/markster/usersconf/main/manager.c Mon Aug 21 23:25:22 2006
@@ -947,6 +947,7 @@
 "Variables (X's represent 6 digit number beginning with 000000):\n"
 "   SrcFilename:   Configuration filename to read(e.g. foo.conf)\n"
 "   DstFilename:   Configuration filename to write(e.g. foo.conf)\n"
+"   Reload:        Whether or not a reload should take place (or name of specific module)\n"
 "   Action-XXXXXX: Action to Take (NewCat,RenameCat,DelCat,Update,Delete,Append)\n"
 "   Cat-XXXXXX:    Category to operate on\n"
 "   Var-XXXXXX:    Variable to work on\n"
@@ -961,6 +962,7 @@
 	int res;
 	char idText[256] = "";
 	char *id = astman_get_header(m, "ActionID");
+	char *rld = astman_get_header(m, "Reload");
 
 	if (!ast_strlen_zero(id))
 		snprintf(idText, sizeof(idText), "ActionID: %s\r\n", id);
@@ -981,6 +983,11 @@
 		return 0;
 	}
 	astman_append(s, "Response: Success\r\n%s\r\n", idText);
+	if (!ast_strlen_zero(rld)) {
+		if (ast_true(rld))
+			rld = NULL;
+		ast_module_reload(rld); 
+	}
 	return 0;
 }
 

Modified: team/markster/usersconf/pbx/pbx_config.c
URL: http://svn.digium.com/view/asterisk/team/markster/usersconf/pbx/pbx_config.c?rev=40827&r1=40826&r2=40827&view=diff
==============================================================================
--- team/markster/usersconf/pbx/pbx_config.c (original)
+++ team/markster/usersconf/pbx/pbx_config.c Mon Aug 21 23:25:22 2006
@@ -1336,6 +1336,7 @@
 	char *end;
 	char *label;
 	char realvalue[256];
+	char lastexten[AST_MAX_EXTENSION] = "";
 	int lastpri = -2;
 	struct ast_context *con;
 	struct ast_variable *v;
@@ -1363,7 +1364,7 @@
 		pbx_builtin_setvar_helper(NULL, v->name, realvalue);
 	}
 	for (cxt = NULL; (cxt = ast_category_browse(cfg, cxt)); ) {
-
+		lastexten[0] = '\0';
 		/* All categories but "general" or "globals" are considered contexts */
 		if (!strcasecmp(cxt, "general") || !strcasecmp(cxt, "globals"))
 			continue;
@@ -1404,6 +1405,11 @@
 					plus = strchr(pri, '+');
 					if (plus)
 						*plus++ = '\0';
+					if (strcmp(lastexten, realext)) {
+						/* Reset last priority */
+						lastpri = 0;
+						ast_copy_string(lastexten, realext, sizeof(lastexten));
+					}
 					if (!strcmp(pri,"hint"))
 						ipri=PRIORITY_HINT;
 					else if (!strcmp(pri, "next") || !strcmp(pri, "n")) {



More information about the asterisk-commits mailing list