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)) {
207 if (
ast_strlen_zero(toneb) || (sscanf(toneb,
"%30d", &toneoff) != 1)) {
213 if (!codetype || strcmp(codetype,
"AMERICAN")) {
214 codetype =
"INTERNATIONAL";
218 if (!strcmp(codetype,
"AMERICAN")) {
222 if (digit2 < 0 || digit2 > 127) {
226 if (*dahdit ==
'-') {
227 res =
playtone(chan, tone, 3 * ditlen);
228 }
else if (*dahdit ==
'.') {
229 res =
playtone(chan, tone, 1 * ditlen);
230 }
else if (*dahdit ==
'L' || *dahdit ==
'l') {
231 res =
playtone(chan, tone, 6 * ditlen);
232 }
else if (*dahdit ==
'0') {
233 res =
playtone(chan, tone, 9 * ditlen);
234 }
else if (*dahdit ==
' ') {
236 res =
playtone(chan, toneoff, 3 * ditlen);
239 res =
playtone(chan, toneoff, 2 * ditlen);
243 res =
playtone(chan, toneoff, 1 * ditlen);
248 res =
playtone(chan, toneoff, 3 * ditlen);
256 if (digit2 < 0 || digit2 > 127) {
260 if (*dahdit ==
'-') {
261 res =
playtone(chan, tone, 3 * ditlen);
262 }
else if (*dahdit ==
'.') {
263 res =
playtone(chan, tone, 1 * ditlen);
266 res =
playtone(chan, toneoff, 2 * ditlen);
270 res =
playtone(chan, toneoff, 1 * ditlen);
275 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.