Asterisk - The Open Source Telephony Project GIT-master-27fb039
Loading...
Searching...
No Matches
Functions | Variables
func_version.c File Reference

Return the current Version strings. More...

#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/utils.h"
#include "asterisk/app.h"
#include "asterisk/ast_version.h"
#include "asterisk/build.h"
Include dependency graph for func_version.c:

Go to the source code of this file.

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
static int acf_version_exec (struct ast_channel *chan, const char *cmd, char *parse, char *buffer, size_t buflen)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
static int load_module (void)
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Get Asterisk Version/Build Info" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, }
 
static struct ast_custom_function acf_version
 
static const struct ast_module_infoast_module_info = &__mod_info
 

Detailed Description

Return the current Version strings.

Author
Steve Murphy (murf@.nosp@m.digi.nosp@m.um.co.nosp@m.m)

Definition in file func_version.c.

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 138 of file func_version.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 138 of file func_version.c.

◆ acf_version_exec()

static int acf_version_exec ( struct ast_channel chan,
const char *  cmd,
char *  parse,
char *  buffer,
size_t  buflen 
)
static

Definition at line 87 of file func_version.c.

89{
90 const char *response_char = ast_get_version();
92 AST_APP_ARG(info);
93 );
94
96
97 if (!ast_strlen_zero(args.info) ) {
98 if (!strcasecmp(args.info,"ASTERISK_VERSION_NUM"))
99 response_char = ast_get_version_num();
100 else if (!strcasecmp(args.info,"BUILD_USER"))
101 response_char = BUILD_USER;
102 else if (!strcasecmp(args.info,"BUILD_HOSTNAME"))
103 response_char = BUILD_HOSTNAME;
104 else if (!strcasecmp(args.info,"BUILD_MACHINE"))
105 response_char = BUILD_MACHINE;
106 else if (!strcasecmp(args.info,"BUILD_KERNEL"))
107 response_char = BUILD_KERNEL;
108 else if (!strcasecmp(args.info,"BUILD_OS"))
109 response_char = BUILD_OS;
110 else if (!strcasecmp(args.info,"BUILD_DATE"))
111 response_char = BUILD_DATE;
112 }
113
114 ast_debug(1, "VERSION returns %s result, given %s argument\n", response_char, args.info);
115
116 ast_copy_string(buffer, response_char, buflen);
117
118 return 0;
119}
const char * ast_get_version(void)
Retrieve the Asterisk version string.
const char * ast_get_version_num(void)
Retrieve the numeric Asterisk version.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
#define ast_debug(level,...)
Log a DEBUG message.
static struct @519 args
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Definition strings.h:65
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition strings.h:425

References args, AST_APP_ARG, ast_copy_string(), ast_debug, AST_DECLARE_APP_ARGS, ast_get_version(), ast_get_version_num(), AST_STANDARD_APP_ARGS, and ast_strlen_zero().

◆ AST_MODULE_SELF_SYM()

struct ast_module * AST_MODULE_SELF_SYM ( void  )

Definition at line 138 of file func_version.c.

◆ load_module()

static int load_module ( void  )
static

Definition at line 133 of file func_version.c.

134{
136}
static struct ast_custom_function acf_version
#define ast_custom_function_register(acf)
Register a custom function.
Definition pbx.h:1562

References acf_version, and ast_custom_function_register.

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 126 of file func_version.c.

127{
129
130 return 0;
131}
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.

References acf_version, and ast_custom_function_unregister().

Variable Documentation

◆ __mod_info

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Get Asterisk Version/Build Info" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, }
static

Definition at line 138 of file func_version.c.

◆ acf_version

struct ast_custom_function acf_version
static
Initial value:
= {
.name = "VERSION",
}
static int acf_version_exec(struct ast_channel *chan, const char *cmd, char *parse, char *buffer, size_t buflen)

Definition at line 121 of file func_version.c.

121 {
122 .name = "VERSION",
123 .read = acf_version_exec,
124};

Referenced by load_module(), and unload_module().

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 138 of file func_version.c.