App to transmit an image. More...
#include "asterisk.h"#include "asterisk/pbx.h"#include "asterisk/module.h"#include "asterisk/image.h"
Go to the source code of this file.
Functions | |
| static void | __reg_module (void) |
| static void | __unreg_module (void) |
| static int | load_module (void) |
| static int | sendimage_exec (struct ast_channel *chan, void *data) |
| static int | unload_module (void) |
Variables | |
| static struct ast_module_info __MODULE_INFO_SECTION | __mod_info = { __MODULE_INFO_GLOBALS .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Image Transmission Application" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, } |
| static char * | app = "SendImage" |
| static struct ast_module_info * | ast_module_info = &__mod_info |
App to transmit an image.
Definition in file app_image.c.
| static void __reg_module | ( | void | ) | [static] |
Definition at line 105 of file app_image.c.
| static void __unreg_module | ( | void | ) | [static] |
Definition at line 105 of file app_image.c.
| static int load_module | ( | void | ) | [static] |
Definition at line 100 of file app_image.c.
References ast_register_application_xml, and sendimage_exec().
{
return ast_register_application_xml(app, sendimage_exec);
}
| static int sendimage_exec | ( | struct ast_channel * | chan, |
| void * | data | ||
| ) | [static] |
Definition at line 72 of file app_image.c.
References ast_log(), ast_send_image(), ast_strlen_zero(), ast_supports_images(), LOG_WARNING, and pbx_builtin_setvar_helper().
Referenced by load_module().
{
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "SendImage requires an argument (filename)\n");
return -1;
}
if (!ast_supports_images(chan)) {
/* Does not support transport */
pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "UNSUPPORTED");
return 0;
}
if (!ast_send_image(chan, data)) {
pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "SUCCESS");
} else {
pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "FAILURE");
}
return 0;
}
| static int unload_module | ( | void | ) | [static] |
Definition at line 95 of file app_image.c.
References ast_unregister_application().
{
return ast_unregister_application(app);
}
struct ast_module_info __MODULE_INFO_SECTION __mod_info = { __MODULE_INFO_GLOBALS .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Image Transmission Application" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, } [static] |
Definition at line 105 of file app_image.c.
char* app = "SendImage" [static] |
Definition at line 36 of file app_image.c.
struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 105 of file app_image.c.