[asterisk-commits] branch oej/test-this-branch r11985 - in /team/oej/test-this-branch: ./ channe...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Mar 6 02:47:34 MST 2006


Author: oej
Date: Mon Mar  6 03:47:30 2006
New Revision: 11985

URL: http://svn.digium.com/view/asterisk?rev=11985&view=rev
Log:
Fixes by Luigi

Modified:
    team/oej/test-this-branch/channels/chan_sip.c
    team/oej/test-this-branch/funcs/func_realtime.c
    team/oej/test-this-branch/include/asterisk/manager.h
    team/oej/test-this-branch/manager.c

Modified: team/oej/test-this-branch/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_sip.c?rev=11985&r1=11984&r2=11985&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_sip.c (original)
+++ team/oej/test-this-branch/channels/chan_sip.c Mon Mar  6 03:47:30 2006
@@ -6858,10 +6858,11 @@
 			in the container at all here to avoid this check 
 			when we have no registry entries */
 		if (!strncmp(uri, REG_MAGICMARKER, strlen(REG_MAGICMARKER))) {
+			int found = FALSE;
+
 			if (option_debug)
 				ast_log(LOG_DEBUG, "Checking for %s in registry\n", uri);
 			/* Traverse the registry to find something */
-			int found = FALSE;
 			ASTOBJ_CONTAINER_TRAVERSE(&regl, !found, do {
 				ASTOBJ_RDLOCK(iterator);
 				if (!strcmp(uri, iterator->contact)) {

Modified: team/oej/test-this-branch/funcs/func_realtime.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/funcs/func_realtime.c?rev=11985&r1=11984&r2=11985&view=diff
==============================================================================
--- team/oej/test-this-branch/funcs/func_realtime.c (original)
+++ team/oej/test-this-branch/funcs/func_realtime.c Mon Mar  6 03:47:30 2006
@@ -42,7 +42,7 @@
 #include "asterisk/utils.h"
 #include "asterisk/app.h"
 
-static char *function_realtime_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) 
+static int function_realtime_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) 
 {
 
 	struct ast_variable *var=NULL,*head=NULL;
@@ -58,7 +58,7 @@
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Syntax: REALTIME(family|metamatch[|value[|delim1[|delim2]]]) - missing argument!\n");
-		return NULL;
+		return -1;
 	} else
 		AST_STANDARD_APP_ARGS(args, data);
 
@@ -83,13 +83,13 @@
 		}	
 	}
 	else
-		return NULL;
+		return -1;
 	ast_copy_string(buf, results, len);
 	
-	return buf;
+	return 0;
 }
 
-static void function_realtime_write(struct ast_channel *chan, char *cmd, char *data, const char *value)
+static int function_realtime_write(struct ast_channel *chan, char *cmd, char *data, const char *value)
 {
 	int res = 0;
 	AST_DECLARE_APP_ARGS(args,
@@ -101,7 +101,7 @@
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Syntax: REALTIME(family|metamatch|value|newcol) - missing argument!\n");
-		return;
+		return -1;
 	} else
 		AST_STANDARD_APP_ARGS(args, data);
 
@@ -111,12 +111,9 @@
 		ast_log(LOG_WARNING, "Failed to update. Check the debug log for possible data repository related entries.\n");
 	}
 
-	return;
+	return 0;
 }
 
-#ifndef BUILTIN_FUNC
-static
-#endif
 struct ast_custom_function realtime_function = {
 	.name = "REALTIME",
 	.synopsis = "RealTime Read/Write Functions",

Modified: team/oej/test-this-branch/include/asterisk/manager.h
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/include/asterisk/manager.h?rev=11985&r1=11984&r2=11985&view=diff
==============================================================================
--- team/oej/test-this-branch/include/asterisk/manager.h (original)
+++ team/oej/test-this-branch/include/asterisk/manager.h Mon Mar  6 03:47:30 2006
@@ -103,7 +103,7 @@
 */
 
 /*! \brief Manager Helper Function for custom AMI hooks.  See AMIhooks */
-typedef int (*manager_hook_t)(int, char *, char *); 
+typedef int (*manager_hook_t)(int, const char *, char *); 
 
 struct manager_custom_hook {
 	char *file;		/*!< Identifier */

Modified: team/oej/test-this-branch/manager.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/manager.c?rev=11985&r1=11984&r2=11985&view=diff
==============================================================================
--- team/oej/test-this-branch/manager.c (original)
+++ team/oej/test-this-branch/manager.c Mon Mar  6 03:47:30 2006
@@ -1730,9 +1730,10 @@
 	ast_mutex_unlock(&sessionlock);
 	if (manager_hooks) {
 		struct manager_custom_hook *hookp;
-		ast_mutex_lock(&hooklock);
 		char *p;
 		int len;
+
+		ast_mutex_lock(&hooklock);
 		snprintf(tmp, sizeof(tmp), "event: %s\r\nprivilege: %s\r\n", event, authority_to_str(category, tmp, sizeof(tmp)));
 		len = strlen(tmp);
 		p = tmp + len;
@@ -1942,17 +1943,19 @@
 	}
 
 	cat = ast_category_browse(cfg, NULL);
-	amus=NULL; /* Resetting the boss */
+	amus = NULL; /* Resetting the boss */
 	while(cat) {
+		struct ast_manager_user *amu;
+		struct ast_variable *var;
+
 		if (!strcasecmp(cat, "general")) { 
-			ast_log(LOG_NOTICE, "ignoring the cat general\n");
+			ast_log(LOG_NOTICE, "Ignoring the configuration category general\n");
 			cat = ast_category_browse(cfg, cat);
 			continue;
 		}
 		
-		struct ast_manager_user *amu = malloc(sizeof(struct ast_manager_user));
-		memset(amu, 0, sizeof(struct ast_manager_user));
-		struct ast_variable *var;
+
+		amu = ast_calloc(1, sizeof(struct ast_manager_user));
 		var = ast_variable_browse(cfg, cat);
 
 		while (var) {



More information about the asterisk-commits mailing list