Asterisk - The Open Source Telephony Project GIT-master-d5a0626
|
MF sender and receiver applications. More...
#include "asterisk.h"
#include "asterisk/file.h"
#include "asterisk/pbx.h"
#include "asterisk/channel.h"
#include "asterisk/dsp.h"
#include "asterisk/app.h"
#include "asterisk/module.h"
#include "asterisk/indications.h"
#include "asterisk/conversions.h"
Go to the source code of this file.
Macros | |
#define | BUFFER_SIZE 256 |
#define | MF_BETWEEN_MS 50 |
#define | MF_DURATION 55 |
#define | MF_KP_DURATION 120 |
#define | MF_ST_DURATION 65 |
Enumerations | |
enum | { OPT_ARG_MAXDIGITS , OPT_ARG_ARRAY_SIZE } |
enum | read_option_flags { OPT_DELAY = (1 << 0) , OPT_MUTE = (1 << 1) , OPT_QUELCH = (1 << 2) , OPT_RELAXED = (1 << 3) , OPT_LAX_KP = (1 << 4) , OPT_PROCESS = (1 << 5) , OPT_NO_KP = (1 << 6) , OPT_NO_ST = (1 << 7) , OPT_KP_OVERRIDE = (1 << 8) , OPT_MAXDIGITS = (1 << 9) , OPT_SKIP = (1 << 0) , OPT_INDICATION = (1 << 1) , OPT_NOANSWER = (1 << 2) , OPT_TERMINATOR = (1 << 3) , OPT_KEEP_TERMINATOR = (1 << 4) , OPT_ANSWER = (1 << 0) , OPT_DELAY = (1 << 0) , OPT_MUTE = (1 << 1) , OPT_QUELCH = (1 << 2) , OPT_RELAXED = (1 << 3) , OPT_EXTRAPULSES = (1 << 4) } |
Functions | |
AST_MODULE_INFO_STANDARD_EXTENDED (ASTERISK_GPL_KEY, "MF Sender and Receiver Applications") | |
static int | load_module (void) |
static int | manager_play_mf (struct mansession *s, const struct message *m) |
static int | read_mf_digits (struct ast_channel *chan, char *buf, int buflen, int timeout, int features, int laxkp, int override, int no_kp, int no_st, int maxdigits) |
Detects MF digits on channel using DSP, terminated by ST, STP, ST2P, or ST3P. More... | |
static int | read_mf_exec (struct ast_channel *chan, const char *data) |
static int | sendmf_exec (struct ast_channel *chan, const char *vdata) |
static int | unload_module (void) |
Variables | |
static const struct ast_app_option | read_app_options [128] = { [ 'd' ] = { .flag = OPT_DELAY }, [ 'l' ] = { .flag = OPT_LAX_KP }, [ 'k' ] = { .flag = OPT_NO_KP }, [ 'm' ] = { .flag = OPT_MUTE }, [ 'n' ] = { .flag = OPT_MAXDIGITS , .arg_index = OPT_ARG_MAXDIGITS + 1 }, [ 'o' ] = { .flag = OPT_KP_OVERRIDE }, [ 'p' ] = { .flag = OPT_PROCESS }, [ 'q' ] = { .flag = OPT_QUELCH }, [ 'r' ] = { .flag = OPT_RELAXED }, [ 's' ] = { .flag = OPT_NO_ST }, } |
static const char * | readmf_name = "ReceiveMF" |
static const char | sendmf_name [] = "SendMF" |
MF sender and receiver applications.
Definition in file app_mf.c.
#define BUFFER_SIZE 256 |
anonymous enum |
Enumerator | |
---|---|
OPT_ARG_MAXDIGITS | |
OPT_ARG_ARRAY_SIZE |
enum read_option_flags |
Definition at line 190 of file app_mf.c.
AST_MODULE_INFO_STANDARD_EXTENDED | ( | ASTERISK_GPL_KEY | , |
"MF Sender and Receiver Applications" | |||
) |
|
static |
Definition at line 536 of file app_mf.c.
References ast_manager_register_xml, ast_register_application_xml, EVENT_FLAG_CALL, manager_play_mf(), read_mf_exec(), readmf_name, sendmf_exec(), and sendmf_name.
|
static |
Definition at line 484 of file app_mf.c.
References ast_channel_get_by_name(), ast_channel_unref, ast_mf_stream(), ast_strlen_zero(), astman_get_header(), astman_send_ack(), astman_send_error(), digit, MF_DURATION, MF_KP_DURATION, MF_ST_DURATION, and NULL.
Referenced by load_module().
|
static |
Detects MF digits on channel using DSP, terminated by ST, STP, ST2P, or ST3P.
chan | channel on which to read digits |
buf | Buffer in which to store digits |
buflen | Size of buffer |
timeout | ms to wait for all digits before giving up |
features | Any additional DSP features to use |
laxkp | Receive digits even if KP not received |
override | Start over if we receive additional KPs |
no_kp | Don't include KP in the output |
no_st | Don't include start digits in the output |
maxdigits | If greater than 0, only read this many digits no matter what |
0 | if successful |
-1 | if unsuccessful (including hangup). |
Definition at line 247 of file app_mf.c.
References ast_channel_name(), ast_debug, ast_dsp_free(), ast_dsp_new(), ast_dsp_process(), ast_dsp_set_digitmode(), ast_dsp_set_features(), AST_FRAME_DTMF, AST_FRAME_VOICE, ast_frfree, ast_log, ast_read(), ast_remaining_ms(), ast_tvnow(), ast_waitfor(), buf, DSP_DIGITMODE_MF, DSP_FEATURE_DIGIT_DETECT, ast_frame::frametype, ast_frame_subclass::integer, LOG_WARNING, NULL, pbx_builtin_setvar_helper(), result, str, and ast_frame::subclass.
Referenced by read_mf_exec().
|
static |
Definition at line 346 of file app_mf.c.
References AST_APP_ARG, ast_app_parse_options(), AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), ast_test_flag, ast_verb, BUFFER_SIZE, DSP_DIGITMODE_MUTECONF, DSP_DIGITMODE_MUTEMAX, DSP_DIGITMODE_NOQUELCH, DSP_DIGITMODE_RELAXDTMF, ast_flags::flags, LOG_WARNING, NULL, OPT_ARG_ARRAY_SIZE, OPT_ARG_MAXDIGITS, OPT_DELAY, OPT_KP_OVERRIDE, OPT_LAX_KP, OPT_MAXDIGITS, OPT_MUTE, OPT_NO_KP, OPT_NO_ST, OPT_QUELCH, OPT_RELAXED, options, pbx_builtin_setvar_helper(), read_app_options, read_mf_digits(), and tmp().
Referenced by load_module().
|
static |
Definition at line 424 of file app_mf.c.
References args, AST_APP_ARG, ast_app_parse_timelen(), ast_channel_cleanup, ast_channel_get_by_name(), AST_DECLARE_APP_ARGS, ast_log, ast_mf_stream(), AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), ast_channel::data, LOG_WARNING, MF_BETWEEN_MS, MF_DURATION, MF_KP_DURATION, MF_ST_DURATION, NULL, and TIMELEN_MILLISECONDS.
Referenced by load_module().
|
static |
Definition at line 525 of file app_mf.c.
References ast_manager_unregister(), ast_unregister_application(), readmf_name, and sendmf_name.
|
static |
Definition at line 220 of file app_mf.c.
Referenced by read_mf_exec().
|
static |
Definition at line 222 of file app_mf.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 223 of file app_mf.c.
Referenced by load_module(), and unload_module().