83 "",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
84 "",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
101 "-----",
".----",
"..---",
"...--",
"....-",
".....",
"-....",
"--...",
"---..",
"----.",
109 ".-",
"-...",
"-.-.",
"-..",
".",
"..-.",
"--.",
"....",
"..",
".---",
"-.-",
".-..",
"--",
110 "-.",
"---",
".--.",
"--.-",
".-.",
"...",
"-",
"..-",
"...-",
".--",
"-..-",
"-.--",
"--..",
117 ".-",
"-...",
"-.-.",
"-..",
".",
"..-.",
"--.",
"....",
"..",
".---",
"-.-",
".-..",
"--",
118 "-.",
"---",
".--.",
"--.-",
".-.",
"...",
"-",
"..-",
"...-",
".--",
"-..-",
"-.--",
"--..",
127 "",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
128 "",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
145 ".--.",
"..-..",
"...-.",
"....-",
"---",
"......",
"--..",
"-....",
"-..-",
"0",
153 ".-",
"-...",
".. .",
"-..",
".",
".-.",
"--.",
"....",
"..",
".-.-",
"-.-",
"L",
"--",
154 "-.",
". .",
".....",
"..-.",
". ..",
"...",
"-",
"..-",
"...-",
".--",
".-..",
".. ..",
"... .",
161 ".-",
"-...",
".. .",
"-..",
".",
".-.",
"--.",
"....",
"..",
".-.-",
"-.-",
"L",
"--",
162 "-.",
". .",
".....",
"..-.",
". ..",
"...",
"-",
"..-",
"...-",
".--",
".-..",
".. ..",
"... .",
174 snprintf(dtmf,
sizeof(dtmf),
"%d/%d", tone, len);
183 int res = 0, ditlen, tone, toneoff, digit2;
185 const char *ditlenc, *tonec, *toneb, *codetype;
195 if (
ast_strlen_zero(ditlenc) || (sscanf(ditlenc,
"%30d", &ditlen) != 1)) {
211 if (
ast_strlen_zero(toneb) || (sscanf(toneb,
"%30d", &toneoff) != 1)) {
219 if (!codetype || strcmp(codetype,
"AMERICAN")) {
220 codetype =
"INTERNATIONAL";
224 if (!strcmp(codetype,
"AMERICAN")) {
225 for (digit = data; *
digit; digit++) {
228 if (digit2 < 0 || digit2 > 127) {
232 if (*dahdit ==
'-') {
233 res =
playtone(chan, tone, 3 * ditlen);
234 }
else if (*dahdit ==
'.') {
235 res =
playtone(chan, tone, 1 * ditlen);
236 }
else if (*dahdit ==
'L') {
237 res =
playtone(chan, tone, 6 * ditlen);
238 }
else if (*dahdit ==
'0') {
239 res =
playtone(chan, tone, 9 * ditlen);
240 }
else if (*dahdit ==
' ') {
242 res =
playtone(chan, toneoff, 3 * ditlen);
245 res =
playtone(chan, toneoff, 2 * ditlen);
249 res =
playtone(chan, toneoff, 1 * ditlen);
254 res =
playtone(chan, toneoff, 3 * ditlen);
259 for (digit = data; *
digit; digit++) {
262 if (digit2 < 0 || digit2 > 127) {
266 if (*dahdit ==
'-') {
267 res =
playtone(chan, tone, 3 * ditlen);
268 }
else if (*dahdit ==
'.') {
269 res =
playtone(chan, tone, 1 * ditlen);
272 res =
playtone(chan, toneoff, 2 * ditlen);
276 res =
playtone(chan, toneoff, 1 * ditlen);
281 res =
playtone(chan, toneoff, 2 * ditlen);
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
#define ast_channel_lock(chan)
Main Channel structure associated with a channel.
Asterisk main include file. File version handling, generic pbx functions.
static int playtone(struct ast_channel *chan, int tone, int len)
static int morsecode_exec(struct ast_channel *chan, const char *data)
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_playtones_stop(struct ast_channel *chan)
Stop playing tones on a channel.
int ast_unregister_application(const char *app)
Unregister an application.
static int unload_module(void)
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
#define ast_strlen_zero(foo)
General Asterisk PBX channel definitions.
static const char *const internationalcode[]
Core PBX routines and definitions.
AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Morse code")
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static const char *const americanmorsecode[]
#define ast_channel_unlock(chan)
static int load_module(void)
static const char app_morsecode[]
int ast_playtones_start(struct ast_channel *chan, int vol, const char *tonelist, int interruptible)
Start playing a list of tones on a channel.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.