Morsecode application.
More...
Go to the source code of this file.
|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Morse code" , .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 = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, } |
|
static const char | app_morsecode [] = "Morsecode" |
|
static struct ast_module_info * | ast_module_info = &__mod_info |
|
static const char *const | morsecode [] |
|
static void __reg_module |
( |
void |
| ) |
|
|
static |
static void __unreg_module |
( |
void |
| ) |
|
|
static |
static int load_module |
( |
void |
| ) |
|
|
static |
Definition at line 184 of file app_morsecode.c.
References ast_register_application_xml, and morsecode_exec().
static int morsecode_exec(struct ast_channel *chan, const char *data)
static const char app_morsecode[]
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
static int morsecode_exec |
( |
struct ast_channel * |
chan, |
|
|
const char * |
data |
|
) |
| |
|
static |
Definition at line 126 of file app_morsecode.c.
References ast_channel_lock, ast_channel_unlock, ast_log(), ast_strlen_zero(), LOG_WARNING, pbx_builtin_getvar_helper(), and playtone().
Referenced by load_module().
128 int res=0, ditlen, tone;
130 const char *ditlenc, *tonec;
140 if (
ast_strlen_zero(ditlenc) || (sscanf(ditlenc,
"%30d", &ditlen) != 1)) {
153 for (digit = data; *digit; digit++) {
159 for (dahdit =
morsecode[digit2]; *dahdit; dahdit++) {
160 if (*dahdit ==
'-') {
162 }
else if (*dahdit ==
'.') {
#define ast_channel_lock(chan)
static void playtone(struct ast_channel *chan, int tone, int len)
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
static const char *const morsecode[]
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...
#define ast_channel_unlock(chan)
static void playtone |
( |
struct ast_channel * |
chan, |
|
|
int |
tone, |
|
|
int |
len |
|
) |
| |
|
static |
Definition at line 117 of file app_morsecode.c.
References ast_playtones_start(), ast_playtones_stop(), and ast_safe_sleep().
Referenced by action_bridge(), and morsecode_exec().
120 snprintf(dtmf,
sizeof(dtmf),
"%d/%d", tone,
len);
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
void ast_playtones_stop(struct ast_channel *chan)
Stop playing tones on a channel.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
int ast_playtones_start(struct ast_channel *chan, int vol, const char *tonelist, int interruptible)
Start playing a list of tones on a channel.
static int unload_module |
( |
void |
| ) |
|
|
static |
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Morse code" , .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 = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, } |
|
static |
const char app_morsecode[] = "Morsecode" |
|
static |
const char* const morsecode[] |
|
static |