aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_rand.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-11 03:14:05 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-11 03:14:05 +0000
commit5f90b9bebddfa06f9d08b63e9c48830071480f38 (patch)
tree47f92d29e3216d69801be7bdb5d15fef7aab9a4d /funcs/func_rand.c
parent7acc893dad48c008eaced05bfbedb0d17735bc47 (diff)
build function modules independently (no more pbx_functions.so)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@9469 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_rand.c')
-rw-r--r--funcs/func_rand.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/funcs/func_rand.c b/funcs/func_rand.c
index 4b7f7b6d4..ef555e36d 100644
--- a/funcs/func_rand.c
+++ b/funcs/func_rand.c
@@ -30,23 +30,19 @@
#include "asterisk.h"
-/* ASTERISK_FILE_VERSION(__FILE__, "$Revision: 7682 $") */
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 7682 $")
+#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/logger.h"
#include "asterisk/utils.h"
#include "asterisk/app.h"
-#ifndef BUILTIN_FUNC
-#include "asterisk/module.h"
-#endif
-
STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
-
static char *acf_rand_exec(struct ast_channel *chan, char *cmd, char *data, char *buffer, size_t buflen)
{
struct localuser *u;
@@ -91,10 +87,7 @@ static char *acf_rand_exec(struct ast_channel *chan, char *cmd, char *data, char
return buffer;
}
-#ifndef BUILTIN_FUNC
-static
-#endif
-struct ast_custom_function acf_rand = {
+static struct ast_custom_function acf_rand = {
.name = "RAND",
.synopsis = "Choose a random number in a range",
.syntax = "RAND([min][,max])",
@@ -107,16 +100,12 @@ struct ast_custom_function acf_rand = {
};
-#ifndef BUILTIN_FUNC
-
-static char *tdesc = "Generate a random number";
+static char *tdesc = "Random number dialplan function";
int unload_module(void)
{
ast_custom_function_unregister(&acf_rand);
- STANDARD_HANGUP_LOCALUSERS;
-
return 0;
}
@@ -132,16 +121,10 @@ char *description(void)
int usecount(void)
{
- int res;
-
- STANDARD_USECOUNT(res);
-
- return res;
+ return 0;
}
char *key()
{
return ASTERISK_GPL_KEY;
}
-
-#endif