[asterisk-commits] seanbright: branch group/1.6.1-maintenance r264292 - in /team/group/1.6.1-mai...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed May 19 13:26:50 CDT 2010
Author: seanbright
Date: Wed May 19 13:26:47 2010
New Revision: 264292
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=264292
Log:
Merged revisions 264204,264249 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r264204 | tilghman | 2010-05-19 12:42:20 -0400 (Wed, 19 May 2010) | 9 lines
Keep track of digit duration, when we're decoding inband to pass DTMF frames.
(closes issue #17235)
Reported by: frawd
Patches:
new_dtmf_dsp_len.patch uploaded by frawd (license 610)
20100518__issue17235.diff.txt uploaded by tilghman (license 14)
Tested by: frawd
................
r264249 | tilghman | 2010-05-19 13:48:31 -0400 (Wed, 19 May 2010) | 24 lines
Merged revisions 264248 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r264248 | tilghman | 2010-05-19 12:41:29 -0500 (Wed, 19 May 2010) | 17 lines
Internal timing is now on by default, if you're using DAHDI 2.3 or above.
The reason for ensuring DAHDI 2.3 or above is that this version ensures that
a timer is always available, whereas in previous versions, it was possible
for DAHDI to be loaded, but have no drivers to actually generate timing. If
internal_timing was turned on in this circumstance, a complete lack of audio
would result. This is the reason why internal_timing was not on by default.
However, now that DAHDI ensures the availability of a timer, there is no
reason for this setting to be off (and in fact, it solves a great many initial
user problems).
(closes issue #15932)
Reported by: dimas
Patches:
20100519__issue15932.diff.txt uploaded by tilghman (license 14)
Tested by: tilghman
........
................
Modified:
team/group/1.6.1-maintenance/ (props changed)
team/group/1.6.1-maintenance/configure
team/group/1.6.1-maintenance/configure.ac
team/group/1.6.1-maintenance/include/asterisk/autoconfig.h.in
team/group/1.6.1-maintenance/include/asterisk/options.h
team/group/1.6.1-maintenance/main/dsp.c
Propchange: team/group/1.6.1-maintenance/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: team/group/1.6.1-maintenance/configure.ac
URL: http://svnview.digium.com/svn/asterisk/team/group/1.6.1-maintenance/configure.ac?view=diff&rev=264292&r1=264291&r2=264292
==============================================================================
--- team/group/1.6.1-maintenance/configure.ac (original)
+++ team/group/1.6.1-maintenance/configure.ac Wed May 19 13:26:47 2010
@@ -728,7 +728,9 @@
AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
fi
-AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h])
+AST_C_DEFINE_CHECK([DAHDI], [DAHDI_RESET_COUNTERS], [dahdi/user.h], [230])
+AST_C_DEFINE_CHECK([DAHDI], [DAHDI_DEFAULT_MTU_MRU], [dahdi/user.h], [220])
+AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h], [200])
AST_C_COMPILE_CHECK([GETIFADDRS], [struct ifaddrs *p; getifaddrs(&p)], [ifaddrs.h], , [getifaddrs() support])
Modified: team/group/1.6.1-maintenance/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/team/group/1.6.1-maintenance/include/asterisk/autoconfig.h.in?view=diff&rev=264292&r1=264291&r2=264292
==============================================================================
--- team/group/1.6.1-maintenance/include/asterisk/autoconfig.h.in (original)
+++ team/group/1.6.1-maintenance/include/asterisk/autoconfig.h.in Wed May 19 13:26:47 2010
@@ -136,6 +136,9 @@
/* Define if your system has the DAHDI headers. */
#undef HAVE_DAHDI
+/* Define DAHDI headers version */
+#undef HAVE_DAHDI_VERSION
+
/* Define to 1 if your system has /dev/urandom. */
#undef HAVE_DEV_URANDOM
@@ -662,7 +665,7 @@
/* Define to 1 if you have the `strtoq' function. */
#undef HAVE_STRTOQ
-/* Define to 1 if `st_blksize' is member of `struct stat'. */
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
/* Define to 1 if you have the mISDN Supplemental Services library. */
@@ -888,11 +891,11 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
/* Define to the version of this package. */
#undef PACKAGE_VERSION
-
-/* Define to 1 if the C compiler supports function prototypes. */
-#undef PROTOTYPES
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
@@ -912,11 +915,6 @@
/* Define to the type of arg 5 for `select'. */
#undef SELECT_TYPE_ARG5
-
-/* Define to 1 if the `setvbuf' function takes the buffering type as its
- second argument and the buffer pointer as the third, as on System V before
- release 3. */
-#undef SETVBUF_REVERSED
/* The size of `int', as computed by sizeof. */
#undef SIZEOF_INT
@@ -938,20 +936,30 @@
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
-/* Define to 1 if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
+/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
#undef _LARGEFILE_SOURCE
@@ -968,20 +976,6 @@
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
-
-/* Enable extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-
-/* Define like PROTOTYPES; this can be used by system headers. */
-#undef __PROTOTYPES
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
Modified: team/group/1.6.1-maintenance/include/asterisk/options.h
URL: http://svnview.digium.com/svn/asterisk/team/group/1.6.1-maintenance/include/asterisk/options.h?view=diff&rev=264292&r1=264291&r2=264292
==============================================================================
--- team/group/1.6.1-maintenance/include/asterisk/options.h (original)
+++ team/group/1.6.1-maintenance/include/asterisk/options.h Wed May 19 13:26:47 2010
@@ -22,6 +22,8 @@
#ifndef _ASTERISK_OPTIONS_H
#define _ASTERISK_OPTIONS_H
+
+#include "asterisk/autoconfig.h"
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
@@ -85,7 +87,11 @@
};
/*! These are the options that set by default when Asterisk starts */
+#if (defined(HAVE_DAHDI_VERSION) && HAVE_DAHDI_VERSION >= 230)
+#define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN | AST_OPT_FLAG_INTERNAL_TIMING
+#else
#define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN
+#endif
#define ast_opt_exec_includes ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC_INCLUDES)
#define ast_opt_no_fork ast_test_flag(&ast_options, AST_OPT_FLAG_NO_FORK)
Modified: team/group/1.6.1-maintenance/main/dsp.c
URL: http://svnview.digium.com/svn/asterisk/team/group/1.6.1-maintenance/main/dsp.c?view=diff&rev=264292&r1=264291&r2=264292
==============================================================================
--- team/group/1.6.1-maintenance/main/dsp.c (original)
+++ team/group/1.6.1-maintenance/main/dsp.c Wed May 19 13:26:47 2010
@@ -272,6 +272,10 @@
{
char digits[MAX_DTMF_DIGITS + 1];
int current_digits;
+ /* Store lengths separately, because next digit may begin before last has
+ * ended (because hits_to_begin may be less than misses_to_end). */
+ int digitlen[MAX_DTMF_DIGITS + 1];
+ int current_len;
int detected_digits;
int lost_digits;
@@ -507,6 +511,7 @@
static void ast_digit_detect_init(digit_detect_state_t *s, int mf)
{
s->current_digits = 0;
+ s->current_len = 0;
s->detected_digits = 0;
s->lost_digits = 0;
s->digits[0] = '\0';
@@ -623,6 +628,7 @@
{
s->detected_digits++;
if (s->current_digits < MAX_DTMF_DIGITS) {
+ s->digitlen[s->current_digits] = 0;
s->digits[s->current_digits++] = digit;
s->digits[s->current_digits] = '\0';
} else {
@@ -723,6 +729,8 @@
}
} else {
s->td.dtmf.misses = 0;
+ /* Current hit was same as last, so increment digit duration */
+ s->digitlen[s->current_len] += DTMF_GSIZE;
}
}
@@ -1353,7 +1361,7 @@
digit = dtmf_detect(dsp, &dsp->digit_state, shortdata, len, (dsp->digitmode & DSP_DIGITMODE_NOQUELCH) == 0, (dsp->digitmode & DSP_DIGITMODE_RELAXDTMF));
if (dsp->digit_state.current_digits) {
- int event = 0;
+ int event = 0, event_len = 0;
char event_digit = 0;
if (!dsp->dtmf_began) {
@@ -1370,9 +1378,12 @@
if (dsp->features & DSP_FEATURE_DIGIT_DETECT) {
event = AST_FRAME_DTMF_END;
event_digit = dsp->digit_state.digits[0];
+ event_len = dsp->digit_state.digitlen[0] * 1000 / SAMPLE_RATE;
}
- memmove(dsp->digit_state.digits, dsp->digit_state.digits + 1, dsp->digit_state.current_digits);
+ memmove(&dsp->digit_state.digits[0], &dsp->digit_state.digits[1], dsp->digit_state.current_digits);
dsp->digit_state.current_digits--;
+ memmove(&dsp->digit_state.digitlen[0], &dsp->digit_state.digitlen[1], dsp->digit_state.current_len * sizeof(dsp->digit_state.digitlen[0]));
+ dsp->digit_state.current_len--;
dsp->dtmf_began = 0;
if (dsp->features & DSP_FEATURE_BUSY_DETECT) {
@@ -1387,6 +1398,7 @@
memset(&dsp->f, 0, sizeof(dsp->f));
dsp->f.frametype = event;
dsp->f.subclass = event_digit;
+ dsp->f.len = event_len;
outf = &dsp->f;
goto done;
}
More information about the asterisk-commits
mailing list