Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
SF 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 | SF_BETWEEN 600 |
#define | SF_MIN_DETECT 50 |
#define | SF_MIN_OFF 25 |
#define | SF_ON 67 |
Enumerations | |
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, "SF Sender and Receiver Applications") | |
static int | load_module (void) |
static int | read_sf_digits (struct ast_channel *chan, char *buf, int buflen, int timeout, int maxdigits, int freq, int features, int extrapulses) |
Detects SF digits on channel using DSP. More... | |
static int | read_sf_exec (struct ast_channel *chan, const char *data) |
static int | sendsf_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 }, [ 'e' ] = { .flag = OPT_EXTRAPULSES }, [ 'm' ] = { .flag = OPT_MUTE }, [ 'q' ] = { .flag = OPT_QUELCH }, [ 'r' ] = { .flag = OPT_RELAXED }, } |
static const char * | readsf_name = "ReceiveSF" |
static const char | sendsf_name [] = "SendSF" |
SF sender and receiver applications.
Definition in file app_sf.c.
#define BUFFER_SIZE 256 |
#define SF_BETWEEN 600 |
#define SF_MIN_DETECT 50 |
#define SF_MIN_OFF 25 |
#define SF_ON 67 |
enum read_option_flags |
Definition at line 149 of file app_sf.c.
AST_MODULE_INFO_STANDARD_EXTENDED | ( | ASTERISK_GPL_KEY | , |
"SF Sender and Receiver Applications" | |||
) |
|
static |
Definition at line 457 of file app_sf.c.
References ast_register_application_xml, read_sf_exec(), readsf_name, sendsf_exec(), and sendsf_name.
|
static |
Detects SF digits on channel using DSP.
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 |
maxdigits | Maximum number of digits |
freq | Frequency to use |
features | DSP features |
extrapulses | Whether to recognize extra pulses |
0 | if successful |
-1 | if unsuccessful (including hangup). |
Definition at line 183 of file app_sf.c.
References ast_channel_name(), ast_debug, ast_dsp_free(), ast_dsp_new(), ast_dsp_process(), ast_dsp_set_features(), ast_dsp_set_freqmode(), AST_FRAME_DTMF, AST_FRAME_VOICE, ast_frfree, ast_log, ast_read(), ast_remaining_ms(), ast_tvnow(), ast_waitfor(), buf, DSP_FEATURE_FREQ_DETECT, ast_frame::frametype, ast_frame_subclass::integer, LOG_WARNING, NULL, pbx_builtin_setvar_helper(), result, SF_BETWEEN, SF_MIN_DETECT, SF_MIN_OFF, str, and ast_frame::subclass.
Referenced by read_sf_exec().
|
static |
Definition at line 320 of file app_sf.c.
References AST_APP_ARG, ast_app_parse_options(), AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_str_to_int(), 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_DELAY, OPT_EXTRAPULSES, OPT_MUTE, OPT_QUELCH, OPT_RELAXED, options, pbx_builtin_setvar_helper(), read_app_options, read_sf_digits(), and tmp().
Referenced by load_module().
|
static |
Definition at line 400 of file app_sf.c.
References args, AST_APP_ARG, ast_channel_cleanup, ast_channel_get_by_name(), AST_DECLARE_APP_ARGS, ast_log, ast_sf_stream(), AST_STANDARD_APP_ARGS, ast_str_to_int(), ast_strdupa, ast_strlen_zero(), ast_channel::data, LOG_WARNING, and NULL.
Referenced by load_module().
|
static |
Definition at line 447 of file app_sf.c.
References ast_unregister_application(), readsf_name, and sendsf_name.
|
static |
Definition at line 163 of file app_sf.c.
Referenced by read_sf_exec().
|
static |
Definition at line 165 of file app_sf.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 166 of file app_sf.c.
Referenced by load_module(), and unload_module().