23 #ifndef _ASTERISK_DSP_H
24 #define _ASTERISK_DSP_H
26 #define DSP_FEATURE_SILENCE_SUPPRESS (1 << 0)
27 #define DSP_FEATURE_BUSY_DETECT (1 << 1)
28 #define DSP_FEATURE_DIGIT_DETECT (1 << 3)
29 #define DSP_FEATURE_FAX_DETECT (1 << 4)
31 #define DSP_DIGITMODE_DTMF 0
32 #define DSP_DIGITMODE_MF 1
34 #define DSP_DIGITMODE_NOQUELCH (1 << 8)
35 #define DSP_DIGITMODE_MUTECONF (1 << 9)
36 #define DSP_DIGITMODE_MUTEMAX (1 << 10)
37 #define DSP_DIGITMODE_RELAXDTMF (1 << 11)
39 #define DSP_PROGRESS_TALK (1 << 16)
40 #define DSP_PROGRESS_RINGING (1 << 17)
41 #define DSP_PROGRESS_BUSY (1 << 18)
42 #define DSP_PROGRESS_CONGESTION (1 << 19)
43 #define DSP_FEATURE_CALL_PROGRESS (DSP_PROGRESS_TALK | DSP_PROGRESS_RINGING | DSP_PROGRESS_BUSY | DSP_PROGRESS_CONGESTION)
44 #define DSP_FEATURE_WAITDIALTONE (1 << 20)
46 #define DSP_FAXMODE_DETECT_CNG (1 << 0)
47 #define DSP_FAXMODE_DETECT_CED (1 << 1)
48 #define DSP_FAXMODE_DETECT_ALL (DSP_FAXMODE_DETECT_CNG | DSP_FAXMODE_DETECT_CED)
50 #define DSP_TONE_STATE_SILENCE 0
51 #define DSP_TONE_STATE_RINGING 1
52 #define DSP_TONE_STATE_DIALTONE 2
53 #define DSP_TONE_STATE_TALKING 3
54 #define DSP_TONE_STATE_BUSY 4
55 #define DSP_TONE_STATE_SPECIAL1 5
56 #define DSP_TONE_STATE_SPECIAL2 6
57 #define DSP_TONE_STATE_SPECIAL3 7
58 #define DSP_TONE_STATE_HUNGUP 8
struct ast_frame * ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp, struct ast_frame *inf)
Return AST_FRAME_NULL frames when there is silence, AST_FRAME_BUSY on busies, and call progress...
Main Channel structure associated with a channel.
void ast_dsp_free(struct ast_dsp *dsp)
int ast_dsp_get_tcount(struct ast_dsp *dsp)
Get tcount (Threshold counter)
struct ast_dsp * ast_dsp_new(void)
void ast_dsp_digitreset(struct ast_dsp *dsp)
Reset DTMF detector.
int ast_dsp_was_muted(struct ast_dsp *dsp)
Returns true if DSP code was muting any fragment of the last processed frame. Muting (squelching) hap...
int ast_dsp_init(void)
Load dsp settings from dsp.conf.
int ast_dsp_getdigits(struct ast_dsp *dsp, char *buf, int max)
Get pending DTMF/MF digits.
void ast_dsp_set_busy_count(struct ast_dsp *dsp, int cadences)
Set number of required cadences for busy.
int ast_dsp_set_faxmode(struct ast_dsp *dsp, int faxmode)
Set fax mode.
int ast_dsp_get_tstate(struct ast_dsp *dsp)
Get tstate (Tone State)
void ast_dsp_set_busy_pattern(struct ast_dsp *dsp, int tonelength, int quietlength, int fuzzy)
Set expected lengths of the busy tones.
void ast_dsp_set_threshold(struct ast_dsp *dsp, int threshold)
Set threshold value for silence.
void ast_dsp_reset(struct ast_dsp *dsp)
Reset total silence count.
void ast_dsp_set_busy_compare(struct ast_dsp *dsp, int compare)
Set if silence and noice lengths must be compared for busy.
void ast_dsp_set_features(struct ast_dsp *dsp, int features)
Select feature set.
int ast_dsp_silence(struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence)
Return non-zero if this is silence. Updates "totalsilence" with the total number of seconds of silenc...
static struct dahdi_ring_cadence cadences[NUM_CADENCE_MAX]
int ast_dsp_reload(void)
Reloads dsp settings from dsp.conf.
static int compare(const char *text, const char *template)
int ast_dsp_digitdetect(struct ast_dsp *dsp, struct ast_frame *f)
Return non-zero if DTMF hit was found.
Data structure associated with a single frame of data.
int ast_dsp_call_progress(struct ast_dsp *dsp, struct ast_frame *inf)
Scans for progress indication in audio.
int ast_dsp_busydetect(struct ast_dsp *dsp)
Return non-zero if historically this should be a busy, request that ast_dsp_silence has already been ...
int ast_dsp_get_threshold_from_settings(enum threshold which)
Get silence threshold from dsp.conf.
int ast_dsp_set_call_progress_zone(struct ast_dsp *dsp, char *zone)
Set zone for doing progress detection.
int ast_dsp_set_digitmode(struct ast_dsp *dsp, int digitmode)
Set digit mode.
int ast_dsp_noise(struct ast_dsp *dsp, struct ast_frame *f, int *totalnoise)
Return non-zero if this is noise. Updates "totalnoise" with the total number of seconds of noise...