71 if (!chan || !chan->
tech)
82 res = stat(filename, &st);
90 if (filename[0] ==
'/') {
92 snprintf(buf, len,
"%s-%s.%s", filename, preflang, ext);
94 snprintf(buf, len,
"%s.%s", filename, ext);
120 e =
strsep(&stringp,
"|");
132 e =
strsep(&stringp,
"|");
140 fd = open(buf, O_RDONLY);
144 lseek(fd, 0, SEEK_SET);
175 #define FORMAT "%10s %10s %50s %10s\n"
176 #define FORMAT2 "%10s %10s %50s %10s\n"
182 e->
command =
"core show image formats";
184 "Usage: core show image formats\n"
185 " Displays currently registered image formats (if any).\n";
200 ast_cli(a->
fd,
"\n%d image format%s registered.\n", count_fmt, count_fmt == 1 ?
"" :
"s");
structure associated with registering an image format
Main Channel structure associated with a channel.
#define AST_CLI_DEFINE(fn, txt,...)
Asterisk locking-related definitions:
static void image_shutdown(void)
Asterisk main include file. File version handling, generic pbx functions.
static int file_exists(char *filename)
int(*const send_image)(struct ast_channel *chan, struct ast_frame *frame)
Display or send an image.
static struct ast_cli_entry cli_image[]
char * strsep(char **str, const char *delims)
int ast_image_init(void)
Initialize image stuff Initializes all the various image stuff. Basically just registers the cli stuf...
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized...
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
Support for translation of data formats. translate.c.
struct ast_frame * ast_read_image(const char *filename, const char *preflang, int format)
Make an image.
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
descriptor for a cli entry.
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
static char * handle_core_show_image_formats(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
void ast_cli(int fd, const char *fmt,...)
static void make_filename(char *buf, int len, const char *filename, const char *preflang, char *ext)
#define ast_verb(level,...)
int ast_image_register(struct ast_imager *imgdrv)
Register image format.
int ast_send_image(struct ast_channel *chan, const char *filename)
Sends an image.
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
#define AST_RWLIST_INSERT_HEAD
General Asterisk channel definitions for image handling.
General Asterisk PBX channel definitions.
Asterisk file paths, configured in asterisk.conf.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define AST_RWLIST_TRAVERSE
Scheduler Routines (derived from cheops)
int ast_register_atexit(void(*func)(void))
Register a function to be executed before Asterisk exits.
const char * ast_config_AST_DATA_DIR
int ast_supports_images(struct ast_channel *chan)
Check for image support on a channel.
char * ast_getformatname(format_t format)
Get the name of a format.
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...
struct ast_frame *(* read_image)(int fd, int len)
Standard Command Line Interface.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
int ast_cli_register_multiple(struct ast_cli_entry *e, int len)
Register multiple commands.
Data structure associated with a single frame of data.
#define AST_RWLIST_REMOVE
void ast_image_unregister(struct ast_imager *imgdrv)
Unregister an image format.
static snd_pcm_format_t format
struct ast_channel_tech * tech
const ast_string_field language
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.