mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
build function modules independently (no more pbx_functions.so)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user