[svn-commits] trunk r24376 - in /trunk: ./ apps/ funcs/

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue May 2 15:46:13 MST 2006


Author: bweschke
Date: Tue May  2 17:46:12 2006
New Revision: 24376

URL: http://svn.digium.com/view/asterisk?rev=24376&view=rev
Log:
Introducing the REALTIME() dialplan function

Added:
    trunk/funcs/func_realtime.c   (contents, props changed)
      - copied, changed from r24375, team/bweschke/func_realtime_bug_5695/funcs/func_realtime.c
Modified:
    trunk/   (props changed)
    trunk/UPGRADE.txt
    trunk/apps/app_realtime.c

Propchange: trunk/
------------------------------------------------------------------------------
    svnmerge-integrated = /trunk:1-24344

Modified: trunk/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/trunk/UPGRADE.txt?rev=24376&r1=24375&r2=24376&view=diff
==============================================================================
--- trunk/UPGRADE.txt (original)
+++ trunk/UPGRADE.txt Tue May  2 17:46:12 2006
@@ -115,6 +115,11 @@
 * The ENUMLOOKUP() function with the 'c' option (for counting the number of records),
   but the lookup fails to match any records, the returned value will now be "0" instead of blank.
 
+* The REALTIME() function is now available in version 1.4 and app_realtime has
+  been deprecated in favor of the new function. app_realtime will be removed
+  completely with the version 1.6 release so please take the time between
+  releases to make any necessary changes
+
 The IAX2 channel:
 
 * The "mailboxdetail" option has been deprecated.  Previously, if this option

Modified: trunk/apps/app_realtime.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_realtime.c?rev=24376&r1=24375&r2=24376&view=diff
==============================================================================
--- trunk/apps/app_realtime.c (original)
+++ trunk/apps/app_realtime.c Tue May  2 17:46:12 2006
@@ -140,6 +140,8 @@
 	int res = 0, count = 0;
 	char countc[13];
 
+        ast_log(LOG_WARNING, "The RealTimeUpdate application has been deprecated in favor of the REALTIME dialplan function.\n");
+
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_ERROR,"Invalid input: usage %s\n",UUSAGE);
 		return -1;
@@ -185,6 +187,8 @@
 	char countc[13];
 	size_t len;
 		
+        ast_log(LOG_WARNING, "The RealTime application has been deprecated in favor of the REALTIME dialplan function.\n");
+
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_ERROR,"Invalid input: usage %s\n",USAGE);
 		return -1;

Copied: trunk/funcs/func_realtime.c (from r24375, team/bweschke/func_realtime_bug_5695/funcs/func_realtime.c)
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_realtime.c?p2=trunk/funcs/func_realtime.c&p1=team/bweschke/func_realtime_bug_5695/funcs/func_realtime.c&r1=24375&r2=24376&rev=24376&view=diff
==============================================================================
--- team/bweschke/func_realtime_bug_5695/funcs/func_realtime.c (original)
+++ trunk/funcs/func_realtime.c Tue May  2 17:46:12 2006
@@ -1,8 +1,11 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 2005, Digium, Inc.
- * Copyright (C) 2005, BJ Weschke <bweschke at btwtech.com> 
+ * Copyright (C) 2005-2006, BJ Weschke. All rights reserved.
+ * 
+ * BJ Weschke <bweschke at btwtech.com>
+ * 
+ * This code is released by the author with no restrictions on usage. 
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
@@ -10,21 +13,21 @@
  * the project provides a web site, mailing lists and IRC
  * channels for your use.
  *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE file
- * at the top of the source tree.
  */
 
 /*! \file
  *
- * \brief RealTime related dialplan functions
+ * \brief REALTIME dialplan function
  * 
+ * \author BJ Weschke <bweschke at btwtech.com>
+ * 
+ * \ingroup functions
  */
 
+#include <stdio.h>
 #include <stdlib.h>
-#include <stdio.h>
+#include <unistd.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/types.h>
 
 #include "asterisk.h"
@@ -40,6 +43,7 @@
 #include "asterisk/lock.h"
 #include "asterisk/logger.h"
 #include "asterisk/utils.h"
+#include "asterisk/module.h"
 #include "asterisk/app.h"
 
 LOCAL_USER_DECL;
@@ -66,6 +70,7 @@
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Syntax: REALTIME(family|fieldmatch[|value[|delim1[|delim2]]]) - missing argument!\n");
+		LOCAL_USER_REMOVE(u);
 		return -1;
 	} else
 		AST_STANDARD_APP_ARGS(args, data);
@@ -89,13 +94,13 @@
 			ast_build_string(&results, &resultslen, "%s%s%s%s", var->name, args.delim2, var->value, args.delim1);
 			var = var->next;
 		}	
+	} else {
+		LOCAL_USER_REMOVE(u);
+		return -1;
 	}
-	else
-		return -1;
 	ast_copy_string(buf, results, len);
 
 	LOCAL_USER_REMOVE(u);
-	
 	return 0;
 }
 
@@ -115,6 +120,7 @@
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Syntax: REALTIME(family|fieldmatch|value|newcol) - missing argument!\n");
+		LOCAL_USER_REMOVE(u);
 		return -1;
 	} else
 		AST_STANDARD_APP_ARGS(args, data);
@@ -126,7 +132,6 @@
 	}
 
 	LOCAL_USER_REMOVE(u);
-
 	return 0;
 }
 
@@ -148,18 +153,18 @@
 	.write = function_realtime_write,
 };
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
         int res = 0;
 
         res |= ast_custom_function_unregister(&realtime_function);
 
-        STANDARD_HANGUP_LOCALUSERS;
+	STANDARD_HANGUP_LOCALUSERS;
 
         return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
         int res = 0;
 
@@ -168,20 +173,14 @@
         return res;
 }
 
-char *description(void)
+static const char *description(void)
 {
         return tdesc;
 }
 
-int usecount(void)
-{
-        int res;
-        STANDARD_USECOUNT(res);
-        return res;
-}
-
-char *key()
+static const char *key(void)
 {
         return ASTERISK_GPL_KEY;
 }
 
+STD_MOD(MOD_1, NULL, NULL, NULL);

Propchange: trunk/funcs/func_realtime.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/funcs/func_realtime.c
------------------------------------------------------------------------------
    svn:keywords = Author Date ld Revision

Propchange: trunk/funcs/func_realtime.c
------------------------------------------------------------------------------
    svn:mime-type = text/plain



More information about the svn-commits mailing list