From 8a411ccf839654d3c15452c2f25831693e741baf Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Wed, 5 Mar 2008 16:23:44 +0000 Subject: Create a centralized configuration option for silencethreshold (closes issue #11236) Reported by: philipps Patches: 20080218__bug11236.diff.txt uploaded by Corydon76 (license 14) Tested by: philipps git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106072 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- include/asterisk/dsp.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include') diff --git a/include/asterisk/dsp.h b/include/asterisk/dsp.h index 10ed53d1b..1235c3ae0 100644 --- a/include/asterisk/dsp.h +++ b/include/asterisk/dsp.h @@ -58,6 +58,13 @@ struct ast_dsp; +enum threshold { + /* Array offsets */ + THRESHOLD_SILENCE = 0, + /* Always the last */ + THRESHOLD_MAX = 1, +}; + struct ast_dsp *ast_dsp_new(void); void ast_dsp_free(struct ast_dsp *dsp); @@ -84,6 +91,10 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp, number of seconds of silence */ int ast_dsp_silence(struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence); +/*! \brief Return non-zero if this is noise. Updates "totalnoise" with the total + number of seconds of noise */ +int ast_dsp_noise(struct ast_dsp *dsp, struct ast_frame *f, int *totalnoise); + /*! \brief Return non-zero if historically this should be a busy, request that ast_dsp_silence has already been called */ int ast_dsp_busydetect(struct ast_dsp *dsp); @@ -115,4 +126,12 @@ int ast_dsp_get_tstate(struct ast_dsp *dsp); /*! \brief Get tcount (Threshold counter) */ int ast_dsp_get_tcount(struct ast_dsp *dsp); +/*! \brief Get silence threshold from dsp.conf*/ +int ast_dsp_get_threshold_from_settings(enum threshold which); + +/* \brief Reloads dsp settings from dsp.conf*/ +int ast_dsp_reload(void); + +int ast_dsp_init(void); + #endif /* _ASTERISK_DSP_H */ -- cgit v1.2.3