86 "",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
87 "",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
104 "-----",
".----",
"..---",
"...--",
"....-",
".....",
"-....",
"--...",
"---..",
"----.",
112 ".-",
"-...",
"-.-.",
"-..",
".",
"..-.",
"--.",
"....",
"..",
".---",
"-.-",
".-..",
"--",
113 "-.",
"---",
".--.",
"--.-",
".-.",
"...",
"-",
"..-",
"...-",
".--",
"-..-",
"-.--",
"--..",
120 ".-",
"-...",
"-.-.",
"-..",
".",
"..-.",
"--.",
"....",
"..",
".---",
"-.-",
".-..",
"--",
121 "-.",
"---",
".--.",
"--.-",
".-.",
"...",
"-",
"..-",
"...-",
".--",
"-..-",
"-.--",
"--..",
130 "",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
131 "",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
148 ".--.",
"..-..",
"...-.",
"....-",
"---",
"......",
"--..",
"-....",
"-..-",
"0",
156 ".-",
"-...",
".. .",
"-..",
".",
".-.",
"--.",
"....",
"..",
".-.-",
"-.-",
"L",
"--",
157 "-.",
". .",
".....",
"..-.",
". ..",
"...",
"-",
"..-",
"...-",
".--",
".-..",
".. ..",
"... .",
164 ".-",
"-...",
".. .",
"-..",
".",
".-.",
"--.",
"....",
"..",
".-.-",
"-.-",
"L",
"--",
165 "-.",
". .",
".....",
"..-.",
". ..",
"...",
"-",
"..-",
"...-",
".--",
".-..",
".. ..",
"... .",
177 snprintf(dtmf,
sizeof(dtmf),
"%d/%d", tone,
len);
186 int res = 0, ditlen, tone, toneoff, digit2;
188 const char *ditlenc, *tonec, *toneb, *codetype;
198 if (
ast_strlen_zero(ditlenc) || (sscanf(ditlenc,
"%30d", &ditlen) != 1)) {
210 if (
ast_strlen_zero(toneb) || (sscanf(toneb,
"%30d", &toneoff) != 1)) {
216 if (!codetype || strcmp(codetype,
"AMERICAN")) {
217 codetype =
"INTERNATIONAL";
221 if (!strcmp(codetype,
"AMERICAN")) {
225 if (digit2 < 0 || digit2 > 127) {
229 if (*dahdit ==
'-') {
230 res =
playtone(chan, tone, 3 * ditlen);
231 }
else if (*dahdit ==
'.') {
232 res =
playtone(chan, tone, 1 * ditlen);
233 }
else if (*dahdit ==
'L' || *dahdit ==
'l') {
234 res =
playtone(chan, tone, 6 * ditlen);
235 }
else if (*dahdit ==
'0') {
236 res =
playtone(chan, tone, 9 * ditlen);
237 }
else if (*dahdit ==
' ') {
239 res =
playtone(chan, toneoff, 3 * ditlen);
242 res =
playtone(chan, toneoff, 2 * ditlen);
246 res =
playtone(chan, toneoff, 1 * ditlen);
251 res =
playtone(chan, toneoff, 3 * ditlen);
259 if (digit2 < 0 || digit2 > 127) {
263 if (*dahdit ==
'-') {
264 res =
playtone(chan, tone, 3 * ditlen);
265 }
else if (*dahdit ==
'.') {
266 res =
playtone(chan, tone, 1 * ditlen);
269 res =
playtone(chan, toneoff, 2 * ditlen);
273 res =
playtone(chan, toneoff, 1 * ditlen);
278 res =
playtone(chan, toneoff, 2 * ditlen);
static const char app_morsecode[]
AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Morse code")
static int morsecode_exec(struct ast_channel *chan, const char *data)
static int playtone(struct ast_channel *chan, int tone, int len)
static const char *const internationalcode[]
static int load_module(void)
static int unload_module(void)
static const char *const americanmorsecode[]
Asterisk main include file. File version handling, generic pbx functions.
General Asterisk PBX channel definitions.
#define ast_channel_lock(chan)
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
#define ast_channel_unlock(chan)
Generic File Format Support. Should be included by clients of the file handling routines....
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.
void ast_playtones_stop(struct ast_channel *chan)
Stop playing tones on a channel.
Asterisk module definitions.
#define ASTERISK_GPL_KEY
The text the key() function should return.
int ast_unregister_application(const char *app)
Unregister an application.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
Core PBX routines and definitions.
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)
Main Channel structure associated with a channel.