aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure156
-rw-r--r--configure.ac4
-rw-r--r--include/asterisk/autoconfig.h.in3
-rw-r--r--include/asterisk/options.h6
4 files changed, 168 insertions, 1 deletions
diff --git a/configure b/configure
index 28137a5fc..aff6c096c 100755
--- a/configure
+++ b/configure
@@ -21267,6 +21267,158 @@ fi
if test "x${PBX_DAHDI}" != "x1"; then
+ { echo "$as_me:$LINENO: checking for DAHDI_RESET_COUNTERS in dahdi/user.h" >&5
+echo $ECHO_N "checking for DAHDI_RESET_COUNTERS in dahdi/user.h... $ECHO_C" >&6; }
+ saved_cppflags="${CPPFLAGS}"
+ if test "x${DAHDI_DIR}" != "x"; then
+ DAHDI_INCLUDE="-I${DAHDI_DIR}/include"
+ fi
+ CPPFLAGS="${CPPFLAGS} ${DAHDI_INCLUDE}"
+
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <dahdi/user.h>
+int
+main ()
+{
+#if defined(DAHDI_RESET_COUNTERS)
+ int foo = 0;
+ #else
+ int foo = bar;
+ #endif
+ 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ PBX_DAHDI=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DAHDI 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DAHDI_VERSION 230
+_ACEOF
+
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="${saved_cppflags}"
+ fi
+
+
+
+ if test "x${PBX_DAHDI}" != "x1"; then
+ { echo "$as_me:$LINENO: checking for DAHDI_DEFAULT_MTU_MRU in dahdi/user.h" >&5
+echo $ECHO_N "checking for DAHDI_DEFAULT_MTU_MRU in dahdi/user.h... $ECHO_C" >&6; }
+ saved_cppflags="${CPPFLAGS}"
+ if test "x${DAHDI_DIR}" != "x"; then
+ DAHDI_INCLUDE="-I${DAHDI_DIR}/include"
+ fi
+ CPPFLAGS="${CPPFLAGS} ${DAHDI_INCLUDE}"
+
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <dahdi/user.h>
+int
+main ()
+{
+#if defined(DAHDI_DEFAULT_MTU_MRU)
+ int foo = 0;
+ #else
+ int foo = bar;
+ #endif
+ 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ PBX_DAHDI=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DAHDI 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DAHDI_VERSION 220
+_ACEOF
+
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="${saved_cppflags}"
+ fi
+
+
+
+ if test "x${PBX_DAHDI}" != "x1"; then
{ echo "$as_me:$LINENO: checking for DAHDI_CODE in dahdi/user.h" >&5
echo $ECHO_N "checking for DAHDI_CODE in dahdi/user.h... $ECHO_C" >&6; }
saved_cppflags="${CPPFLAGS}"
@@ -21322,6 +21474,10 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DAHDI_VERSION 200
+_ACEOF
+
else
echo "$as_me: failed program was:" >&5
diff --git a/configure.ac b/configure.ac
index 4b8051acb..57913747c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -763,7 +763,9 @@ if test "x${OSARCH}" = "xlinux-gnu" ; then
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_DEFINE_CHECK([DAHDI_HALF_FULL], [DAHDI_POLICY_HALF_FULL], [dahdi/user.h])
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in
index 48ff4e783..9bd4ca16b 100644
--- a/include/asterisk/autoconfig.h.in
+++ b/include/asterisk/autoconfig.h.in
@@ -151,6 +151,9 @@
/* Define if your system has the DAHDI_LINEREVERSE_VMWI headers. */
#undef HAVE_DAHDI_LINEREVERSE_VMWI
+/* Define DAHDI headers version */
+#undef HAVE_DAHDI_VERSION
+
/* Define to 1 if your system has /dev/urandom. */
#undef HAVE_DEV_URANDOM
diff --git a/include/asterisk/options.h b/include/asterisk/options.h
index 065d0c9a1..45b896a64 100644
--- a/include/asterisk/options.h
+++ b/include/asterisk/options.h
@@ -23,6 +23,8 @@
#ifndef _ASTERISK_OPTIONS_H
#define _ASTERISK_OPTIONS_H
+#include "asterisk/autoconfig.h"
+
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
@@ -93,7 +95,11 @@ enum ast_option_flags {
};
/*! 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)