App to transmit a text message. More...
#include "asterisk.h"#include "asterisk/file.h"#include "asterisk/channel.h"#include "asterisk/pbx.h"#include "asterisk/module.h"#include "asterisk/app.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 | sendtext_exec (struct ast_channel *chan, void *data) |
| static int | unload_module (void) |
Variables | |
| static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Send Text Applications" , .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 const char * | app = "SendText" |
| static struct ast_module_info * | ast_module_info = &__mod_info |
App to transmit a text message.
Definition in file app_sendtext.c.
| static void __reg_module | ( | void | ) | [static] |
Definition at line 120 of file app_sendtext.c.
| static void __unreg_module | ( | void | ) | [static] |
Definition at line 120 of file app_sendtext.c.
| static int load_module | ( | void | ) | [static] |
Definition at line 115 of file app_sendtext.c.
References ast_register_application_xml, and sendtext_exec().
{
return ast_register_application_xml(app, sendtext_exec);
}
| static int sendtext_exec | ( | struct ast_channel * | chan, |
| void * | data | ||
| ) | [static] |
Definition at line 75 of file app_sendtext.c.
References AST_APP_ARG, ast_channel_lock, ast_channel_unlock, AST_DECLARE_APP_ARGS, ast_log(), ast_sendtext(), AST_STANDARD_APP_ARGS, ast_strdupa, LOG_WARNING, parse(), pbx_builtin_setvar_helper(), ast_channel_tech::send_text, status, ast_channel::tech, and text.
Referenced by load_module().
{
int res = 0;
char *status = "UNSUPPORTED";
char *parse = NULL;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(text);
);
/* NOT ast_strlen_zero, because some protocols (e.g. SIP) MUST be able to
* send a zero-length message. */
if (!data) {
ast_log(LOG_WARNING, "SendText requires an argument (text)\n");
return -1;
} else
parse = ast_strdupa(data);
AST_STANDARD_APP_ARGS(args, parse);
ast_channel_lock(chan);
if (!chan->tech->send_text) {
ast_channel_unlock(chan);
/* Does not support transport */
pbx_builtin_setvar_helper(chan, "SENDTEXTSTATUS", status);
return 0;
}
status = "FAILURE";
res = ast_sendtext(chan, args.text);
if (!res)
status = "SUCCESS";
ast_channel_unlock(chan);
pbx_builtin_setvar_helper(chan, "SENDTEXTSTATUS", status);
return 0;
}
| static int unload_module | ( | void | ) | [static] |
Definition at line 110 of file app_sendtext.c.
References ast_unregister_application().
{
return ast_unregister_application(app);
}
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Send Text Applications" , .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 120 of file app_sendtext.c.
const char* app = "SendText" [static] |
Definition at line 73 of file app_sendtext.c.
struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 120 of file app_sendtext.c.