#include "asterisk.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/logger.h"
#include "asterisk/utils.h"
#include "asterisk/app.h"
#include "asterisk/options.h"
#include "asterisk/version.h"
#include "asterisk/build.h"

Go to the source code of this file.
Defines | |
| #define | STRING_IT(vernum) STRING_IT2(vernum) |
| #define | STRING_IT2(vernum) #vernum |
Functions | |
| static void | __reg_module (void) |
| static void | __unreg_module (void) |
| static int | acf_version_exec (struct ast_channel *chan, 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 | AST_MODFLAG_BUILDSUM, .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 = AST_BUILDOPT_SUM, .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.
| #define STRING_IT | ( | vernum | ) | STRING_IT2(vernum) |
| #define STRING_IT2 | ( | vernum | ) | #vernum |
Definition at line 44 of file func_version.c.
| static void __reg_module | ( | void | ) | [static] |
Definition at line 118 of file func_version.c.
| static void __unreg_module | ( | void | ) | [static] |
Definition at line 118 of file func_version.c.
| static int acf_version_exec | ( | struct ast_channel * | chan, | |
| char * | cmd, | |||
| char * | parse, | |||
| char * | buffer, | |||
| size_t | buflen | |||
| ) | [static] |
Definition at line 46 of file func_version.c.
References AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log(), ast_module_user_add, ast_module_user_remove, AST_STANDARD_APP_ARGS, ast_strlen_zero(), LOG_DEBUG, option_debug, and STRING_IT.
00048 { 00049 struct ast_module_user *u; 00050 char *response_char = ASTERISK_VERSION; 00051 AST_DECLARE_APP_ARGS(args, 00052 AST_APP_ARG(info); 00053 ); 00054 00055 u = ast_module_user_add(chan); 00056 00057 AST_STANDARD_APP_ARGS(args, parse); 00058 00059 if (!ast_strlen_zero(args.info) ) { 00060 if (strcasecmp(args.info,"ASTERISK_VERSION_NUM") == 0) 00061 response_char = STRING_IT(ASTERISK_VERSION_NUM); 00062 else if (strcasecmp(args.info,"BUILD_USER") == 0) 00063 response_char = BUILD_USER; 00064 else if (strcasecmp(args.info,"BUILD_HOSTNAME") == 0) 00065 response_char = BUILD_HOSTNAME; 00066 else if (strcasecmp(args.info,"BUILD_MACHINE") == 0) 00067 response_char = BUILD_MACHINE; 00068 else if (strcasecmp(args.info,"BUILD_KERNEL") == 0) 00069 response_char = BUILD_KERNEL; 00070 else if (strcasecmp(args.info,"BUILD_OS") == 0) 00071 response_char = BUILD_OS; 00072 else if (strcasecmp(args.info,"BUILD_DATE") == 0) 00073 response_char = BUILD_DATE; 00074 00075 } 00076 00077 00078 if (option_debug) 00079 ast_log(LOG_DEBUG, "VERSION returns %s result, given %s argument\n", 00080 response_char, args.info); 00081 snprintf(buffer, buflen, "%s", response_char); 00082 00083 ast_module_user_remove(u); 00084 00085 return 0; 00086 }
| static int load_module | ( | void | ) | [static] |
Definition at line 113 of file func_version.c.
References ast_custom_function_register().
00114 { 00115 return ast_custom_function_register(&acf_version); 00116 }
| static int unload_module | ( | void | ) | [static] |
Definition at line 106 of file func_version.c.
References ast_custom_function_unregister().
00107 { 00108 ast_custom_function_unregister(&acf_version); 00109 00110 return 0; 00111 }
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT | AST_MODFLAG_BUILDSUM, .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 = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, } [static] |
Definition at line 118 of file func_version.c.
struct ast_custom_function acf_version [static] |
Definition at line 88 of file func_version.c.
const struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 118 of file func_version.c.
1.5.9