app_image.c File Reference

App to transmit an image. More...

#include "asterisk.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/image.h"

Include dependency graph for app_image.c:

Go to the source code of this file.

Functions

 AST_MODULE_INFO_STANDARD_EXTENDED (ASTERISK_GPL_KEY,"Image Transmission Application")
static int load_module (void)
static int sendimage_exec (struct ast_channel *chan, const char *data)
static int unload_module (void)

Variables

static char * app = "SendImage"


Detailed Description

App to transmit an image.

Author:
Mark Spencer <markster@digium.com>

Definition in file app_image.c.


Function Documentation

AST_MODULE_INFO_STANDARD_EXTENDED ( ASTERISK_GPL_KEY  ,
"Image Transmission Application"   
)

static int load_module ( void   )  [static]

Definition at line 104 of file app_image.c.

References ast_register_application_xml, and sendimage_exec().

00105 {
00106    return ast_register_application_xml(app, sendimage_exec);
00107 }

static int sendimage_exec ( struct ast_channel chan,
const char *  data 
) [static]

Definition at line 76 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().

00077 {
00078 
00079    if (ast_strlen_zero(data)) {
00080       ast_log(LOG_WARNING, "SendImage requires an argument (filename)\n");
00081       return -1;
00082    }
00083 
00084    if (!ast_supports_images(chan)) {
00085       /* Does not support transport */
00086       pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "UNSUPPORTED");
00087       return 0;
00088    }
00089 
00090    if (!ast_send_image(chan, data)) {
00091       pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "SUCCESS");
00092    } else {
00093       pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "FAILURE");
00094    }
00095    
00096    return 0;
00097 }

static int unload_module ( void   )  [static]

Definition at line 99 of file app_image.c.

References ast_unregister_application().

00100 {
00101    return ast_unregister_application(app);
00102 }


Variable Documentation

char* app = "SendImage" [static]

Definition at line 40 of file app_image.c.


Generated on Thu Apr 16 06:28:30 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6