37 #include "asterisk/file.h"
78 char *s, *varname=NULL, *file=NULL, *length=NULL, *returnvar=NULL;
80 static int deprecation_warning = 0;
93 if (deprecation_warning++ % 10 == 0)
94 ast_log(
LOG_WARNING,
"ReadFile has been deprecated in favor of Set(%s=${FILE(%s,0,%s)})\n", varname, file, length);
96 if (!varname || !file) {
102 if ((sscanf(length,
"%30d", &len) != 1) || (len < 0)) {
103 ast_log(
LOG_WARNING,
"%s is not a positive number, defaulting length to max\n", length);
110 if (len < strlen(returnvar))
113 ast_log(
LOG_WARNING,
"%s is longer than %d, and %d \n", file, len, (
int)strlen(returnvar));
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
char * strsep(char **str, const char *delims)
static char * app_readfile
static int readfile_exec(struct ast_channel *chan, const char *data)
int ast_unregister_application(const char *app)
Unregister an application.
static int unload_module(void)
General Asterisk PBX channel definitions.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Core PBX routines and definitions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name...
static int load_module(void)
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
char * ast_read_textfile(const char *file)
Read a file into asterisk.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.