#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"
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) |
static int | load_module (void) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Get Asterisk Version/Build Info" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "068e67f60f50dd9ee86464c05884a49d" , .load = load_module, .unload = unload_module, } |
static struct ast_custom_function | acf_version |
static const struct ast_module_info * | ast_module_info = &__mod_info |
Definition in file func_version.c.
static void __reg_module | ( | void | ) | [static] |
Definition at line 101 of file func_version.c.
static void __unreg_module | ( | void | ) | [static] |
Definition at line 101 of file func_version.c.
static int acf_version_exec | ( | struct ast_channel * | chan, | |
const char * | cmd, | |||
char * | parse, | |||
char * | buffer, | |||
size_t | buflen | |||
) | [static] |
Definition at line 37 of file func_version.c.
References AST_APP_ARG, ast_copy_string(), ast_debug, AST_DECLARE_APP_ARGS, ast_get_version(), ast_get_version_num(), AST_STANDARD_APP_ARGS, ast_strlen_zero(), BUILD_DATE, BUILD_HOSTNAME, BUILD_KERNEL, BUILD_MACHINE, BUILD_OS, and BUILD_USER.
00039 { 00040 const char *response_char = ast_get_version(); 00041 AST_DECLARE_APP_ARGS(args, 00042 AST_APP_ARG(info); 00043 ); 00044 00045 AST_STANDARD_APP_ARGS(args, parse); 00046 00047 if (!ast_strlen_zero(args.info) ) { 00048 if (!strcasecmp(args.info,"ASTERISK_VERSION_NUM")) 00049 response_char = ast_get_version_num(); 00050 else if (!strcasecmp(args.info,"BUILD_USER")) 00051 response_char = BUILD_USER; 00052 else if (!strcasecmp(args.info,"BUILD_HOSTNAME")) 00053 response_char = BUILD_HOSTNAME; 00054 else if (!strcasecmp(args.info,"BUILD_MACHINE")) 00055 response_char = BUILD_MACHINE; 00056 else if (!strcasecmp(args.info,"BUILD_KERNEL")) 00057 response_char = BUILD_KERNEL; 00058 else if (!strcasecmp(args.info,"BUILD_OS")) 00059 response_char = BUILD_OS; 00060 else if (!strcasecmp(args.info,"BUILD_DATE")) 00061 response_char = BUILD_DATE; 00062 } 00063 00064 ast_debug(1, "VERSION returns %s result, given %s argument\n", response_char, args.info); 00065 00066 ast_copy_string(buffer, response_char, buflen); 00067 00068 return 0; 00069 }
static int load_module | ( | void | ) | [static] |
Definition at line 96 of file func_version.c.
References acf_version, and ast_custom_function_register.
00097 { 00098 return ast_custom_function_register(&acf_version); 00099 }
static int unload_module | ( | void | ) | [static] |
Definition at line 89 of file func_version.c.
References acf_version, and ast_custom_function_unregister().
00090 { 00091 ast_custom_function_unregister(&acf_version); 00092 00093 return 0; 00094 }
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Get Asterisk Version/Build Info" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "068e67f60f50dd9ee86464c05884a49d" , .load = load_module, .unload = unload_module, } [static] |
Definition at line 101 of file func_version.c.
struct ast_custom_function acf_version [static] |
const struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 101 of file func_version.c.