summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi-base.c
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-01-05 15:52:03 +0000
committerShaun Ruffell <sruffell@digium.com>2011-01-05 15:52:03 +0000
commit8daf097eb584c934e742eb69bcf6fd199cc3f2b9 (patch)
treedad5ca10fa3702f79a2579c3768bb3106d95d70f /drivers/dahdi/dahdi-base.c
parent7c9c1faac5932dd42aa0c270289be0ae36fbdf57 (diff)
dahdi: Move the default tone lengths into include/dahdi/dahdi_config.h
The default tone lengths are compile time options and they were in digits.h to make it easy for users to patch. Most of these settings are potentially overridden from user space via the DAHDI_SET_DIALPARAMS ioctl currently regardless of these settings. In r9597 I moved digits.h directly into dahdi-base.c since I thought it was broken out for sharing between compilation units as opposed to ease patching. I also changed the units of the default options to ms instead of in samples. This way if the sampling frequency changes the user will not need to update the defaults. Signed-off-by: Shaun Ruffell <sruffell@digium.com> asterisk-dev-reference: 4D236FD7.30707@digium.com git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9616 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi-base.c')
-rw-r--r--drivers/dahdi/dahdi-base.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index b86cd97..1ff5089 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -287,35 +287,30 @@ enum dahdi_digit_mode {
DIGIT_MODE_MFR2_REV,
};
-#define DEFAULT_DTMF_LENGTH (100 * DAHDI_CHUNKSIZE)
-#define DEFAULT_MFR1_LENGTH (68 * DAHDI_CHUNKSIZE)
-#define DEFAULT_MFR2_LENGTH (100 * DAHDI_CHUNKSIZE)
-#define PAUSE_LENGTH (500 * DAHDI_CHUNKSIZE)
-
/* At the end of silence, the tone stops */
static struct dahdi_tone dtmf_silence = {
- .tonesamples = DEFAULT_DTMF_LENGTH,
+ .tonesamples = DAHDI_MS_TO_SAMPLES(DAHDI_CONFIG_DEFAULT_DTMF_LENGTH),
};
/* At the end of silence, the tone stops */
static struct dahdi_tone mfr1_silence = {
- .tonesamples = DEFAULT_MFR1_LENGTH,
+ .tonesamples = DAHDI_MS_TO_SAMPLES(DAHDI_CONFIG_DEFAULT_MFR1_LENGTH),
};
/* At the end of silence, the tone stops */
static struct dahdi_tone mfr2_silence = {
- .tonesamples = DEFAULT_MFR2_LENGTH,
+ .tonesamples = DAHDI_MS_TO_SAMPLES(DAHDI_CONFIG_DEFAULT_MFR2_LENGTH),
};
/* A pause in the dialing */
static struct dahdi_tone tone_pause = {
- .tonesamples = PAUSE_LENGTH,
+ .tonesamples = DAHDI_MS_TO_SAMPLES(DAHDI_CONFIG_PAUSE_LENGTH),
};
static struct dahdi_dialparams global_dialparams = {
- .dtmf_tonelen = DEFAULT_DTMF_LENGTH,
- .mfv1_tonelen = DEFAULT_MFR1_LENGTH,
- .mfr2_tonelen = DEFAULT_MFR2_LENGTH,
+ .dtmf_tonelen = DAHDI_MS_TO_SAMPLES(DAHDI_CONFIG_DEFAULT_DTMF_LENGTH),
+ .mfv1_tonelen = DAHDI_MS_TO_SAMPLES(DAHDI_CONFIG_DEFAULT_MFR1_LENGTH),
+ .mfr2_tonelen = DAHDI_MS_TO_SAMPLES(DAHDI_CONFIG_DEFAULT_MFR2_LENGTH),
};
static int dahdi_chan_ioctl(struct file *file, unsigned int cmd, unsigned long data);