From f371a4c75654b2aaa5c12aa7a6579cf562eb3495 Mon Sep 17 00:00:00 2001
From: "Kevin P. Fleming" <kpfleming@digium.com>
Date: Fri, 25 May 2007 15:07:26 +0000
Subject: [PATCH] more minor fixes

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@66175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 channels/chan_jingle.c |   10 +
 configure              | 3155 ++++++++++++++++++++--------------------
 configure.ac           |   16 +-
 3 files changed, 1596 insertions(+), 1585 deletions(-)

diff --git a/channels/chan_jingle.c b/channels/chan_jingle.c
index 363d42a781..893a9e924f 100644
--- a/channels/chan_jingle.c
+++ b/channels/chan_jingle.c
@@ -50,6 +50,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include <arpa/inet.h>
 #include <sys/signal.h>
 #include <iksemel.h>
+#include <pthread.h>
+
+#ifdef HAVE_GNUTLS
+#include <gcrypt.h>
+GCRY_THREAD_OPTION_PTHREAD_IMPL;
+#endif /* HAVE_GNUTLS */
 
 #include "asterisk/lock.h"
 #include "asterisk/channel.h"
@@ -1674,6 +1680,10 @@ static int jingle_load_config(void)
 /*! \brief Load module into PBX, register channel */
 static int load_module(void)
 {
+#ifdef HAVE_GNUTLS	
+        gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+#endif /* HAVE_GNUTLS */
+
 	ASTOBJ_CONTAINER_INIT(&jingles);
 	if (!jingle_load_config()) {
 		ast_log(LOG_ERROR, "Unable to read config file %s. Not loading module.\n", JINGLE_CONFIG);
diff --git a/configure b/configure
index c646cb5694..b80e3514a5 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 66071 .
+# From configure.ac Revision: 66158 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61.
 #
@@ -1525,7 +1525,7 @@ Optional Packages:
   --with-cap=PATH         use POSIX 1.e capabilities files in PATH
   --with-curl=PATH        use cURL files in PATH
   --with-curses=PATH      use curses files in PATH
-  --with-crypto=PATH      use OpenSSL Cryptography Support files in PATH
+  --with-crypto=PATH      use OpenSSL Cryptography support files in PATH
   --with-gnutls=PATH      use GNU TLS support (used for iksemel only) files in
                           PATH
   --with-gsm=PATH         use GSM files in PATH , or 'internal'
@@ -1554,7 +1554,8 @@ Optional Packages:
   --with-sqlite=PATH      use SQLite files in PATH
   --with-sqlite3=PATH     use SQLite files in PATH
   --with-suppserv=PATH    use mISDN Supplemental Services files in PATH
-  --with-ssl=PATH         use OpenSSL files in PATH
+  --with-ssl=PATH         use OpenSSL Secure Sockets Layer support files in
+                          PATH
   --with-tds=PATH         use FreeTDS files in PATH
   --with-termcap=PATH     use Termcap files in PATH
   --with-tinfo=PATH       use Term Info files in PATH
@@ -7789,7 +7790,7 @@ PBX_CURSES=0
 
 
 
-CRYPTO_DESCRIP="OpenSSL Cryptography Support"
+CRYPTO_DESCRIP="OpenSSL Cryptography support"
 CRYPTO_OPTION="crypto"
 
 # Check whether --with-crypto was given.
@@ -8573,7 +8574,7 @@ PBX_SUPPSERV=0
 
 
 
-OPENSSL_DESCRIP="OpenSSL"
+OPENSSL_DESCRIP="OpenSSL Secure Sockets Layer support"
 OPENSSL_OPTION="ssl"
 
 # Check whether --with-ssl was given.
@@ -23072,30 +23073,28 @@ _ACEOF
 fi
 
 
-if test "$PBX_OPENSSL" = "1";
-then
 
-if test "x${PBX_OSPTK}" != "x1" -a "${USE_OSPTK}" != "no"; then
+if test "x${PBX_BKTR}" != "x1" -a "${USE_BKTR}" != "no"; then
    pbxlibdir=""
-   if test "x${OSPTK_DIR}" != "x"; then
-      if test -d ${OSPTK_DIR}/lib; then
-      	 pbxlibdir="-L${OSPTK_DIR}/lib"
+   if test "x${BKTR_DIR}" != "x"; then
+      if test -d ${BKTR_DIR}/lib; then
+      	 pbxlibdir="-L${BKTR_DIR}/lib"
       else
-      	 pbxlibdir="-L${OSPTK_DIR}"
+      	 pbxlibdir="-L${BKTR_DIR}"
       fi
    fi
-   pbxfuncname="OSPPCryptoDecrypt"
+   pbxfuncname="backtrace"
    if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_OSPTK_FOUND=yes
+      AST_BKTR_FOUND=yes
    else
-      as_ac_Lib=`echo "ac_cv_lib_osptk_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -losptk" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -losptk... $ECHO_C" >&6; }
+      as_ac_Lib=`echo "ac_cv_lib_execinfo_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lexecinfo" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lexecinfo... $ECHO_C" >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-losptk ${pbxlibdir} -lcrypto -lssl $LIBS"
+LIBS="-lexecinfo ${pbxlibdir} -lexecinfo $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23152,26 +23151,26 @@ ac_res=`eval echo '${'$as_ac_Lib'}'`
 	       { echo "$as_me:$LINENO: result: $ac_res" >&5
 echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
-  AST_OSPTK_FOUND=yes
+  AST_BKTR_FOUND=yes
 else
-  AST_OSPTK_FOUND=no
+  AST_BKTR_FOUND=no
 fi
 
    fi
 
-   if test "${AST_OSPTK_FOUND}" = "yes"; then
-      OSPTK_LIB="-losptk -lcrypto -lssl"
-      OSPTK_HEADER_FOUND="1"
-      if test "x${OSPTK_DIR}" != "x"; then
-         OSPTK_LIB="${pbxlibdir} ${OSPTK_LIB}"
-	 OSPTK_INCLUDE="-I${OSPTK_DIR}/include"
+   if test "${AST_BKTR_FOUND}" = "yes"; then
+      BKTR_LIB="-lexecinfo -lexecinfo"
+      BKTR_HEADER_FOUND="1"
+      if test "x${BKTR_DIR}" != "x"; then
+         BKTR_LIB="${pbxlibdir} ${BKTR_LIB}"
+	 BKTR_INCLUDE="-I${BKTR_DIR}/include"
 	 saved_cppflags="${CPPFLAGS}"
-	 CPPFLAGS="${CPPFLAGS} -I${OSPTK_DIR}/include"
-	 if test "xosp/osp.h" != "x" ; then
-	    as_ac_Header=`echo "ac_cv_header_${OSPTK_DIR}/include/osp/osp.h" | $as_tr_sh`
+	 CPPFLAGS="${CPPFLAGS} -I${BKTR_DIR}/include"
+	 if test "xexecinfo.h" != "x" ; then
+	    as_ac_Header=`echo "ac_cv_header_${BKTR_DIR}/include/execinfo.h" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${OSPTK_DIR}/include/osp/osp.h" >&5
-echo $ECHO_N "checking for ${OSPTK_DIR}/include/osp/osp.h... $ECHO_C" >&6; }
+  { echo "$as_me:$LINENO: checking for ${BKTR_DIR}/include/execinfo.h" >&5
+echo $ECHO_N "checking for ${BKTR_DIR}/include/execinfo.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
@@ -23180,8 +23179,8 @@ ac_res=`eval echo '${'$as_ac_Header'}'`
 echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${OSPTK_DIR}/include/osp/osp.h usability" >&5
-echo $ECHO_N "checking ${OSPTK_DIR}/include/osp/osp.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${BKTR_DIR}/include/execinfo.h usability" >&5
+echo $ECHO_N "checking ${BKTR_DIR}/include/execinfo.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23189,7 +23188,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${OSPTK_DIR}/include/osp/osp.h>
+#include <${BKTR_DIR}/include/execinfo.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -23221,15 +23220,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${OSPTK_DIR}/include/osp/osp.h presence" >&5
-echo $ECHO_N "checking ${OSPTK_DIR}/include/osp/osp.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${BKTR_DIR}/include/execinfo.h presence" >&5
+echo $ECHO_N "checking ${BKTR_DIR}/include/execinfo.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${OSPTK_DIR}/include/osp/osp.h>
+#include <${BKTR_DIR}/include/execinfo.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -23262,30 +23261,30 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for ${OSPTK_DIR}/include/osp/osp.h" >&5
-echo $ECHO_N "checking for ${OSPTK_DIR}/include/osp/osp.h... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for ${BKTR_DIR}/include/execinfo.h" >&5
+echo $ECHO_N "checking for ${BKTR_DIR}/include/execinfo.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -23297,28 +23296,28 @@ echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  OSPTK_HEADER_FOUND=1
+  BKTR_HEADER_FOUND=1
 else
-  OSPTK_HEADER_FOUND=0
+  BKTR_HEADER_FOUND=0
 fi
 
 
 	 fi
 	 CPPFLAGS="${saved_cppflags}"
       else
-	 if test "xosp/osp.h" != "x" ; then
-            if test "${ac_cv_header_osp_osp_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for osp/osp.h" >&5
-echo $ECHO_N "checking for osp/osp.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_osp_osp_h+set}" = set; then
+	 if test "xexecinfo.h" != "x" ; then
+            if test "${ac_cv_header_execinfo_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for execinfo.h" >&5
+echo $ECHO_N "checking for execinfo.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_execinfo_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_osp_osp_h" >&5
-echo "${ECHO_T}$ac_cv_header_osp_osp_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_execinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_execinfo_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking osp/osp.h usability" >&5
-echo $ECHO_N "checking osp/osp.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking execinfo.h usability" >&5
+echo $ECHO_N "checking execinfo.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23326,7 +23325,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <osp/osp.h>
+#include <execinfo.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -23358,15 +23357,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking osp/osp.h presence" >&5
-echo $ECHO_N "checking osp/osp.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking execinfo.h presence" >&5
+echo $ECHO_N "checking execinfo.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <osp/osp.h>
+#include <execinfo.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -23399,95 +23398,95 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: osp/osp.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: osp/osp.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: osp/osp.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: osp/osp.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: execinfo.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: execinfo.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: osp/osp.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: osp/osp.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: osp/osp.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: osp/osp.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: osp/osp.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: osp/osp.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: osp/osp.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: osp/osp.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: osp/osp.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: osp/osp.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: osp/osp.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: osp/osp.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: execinfo.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: execinfo.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: execinfo.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: execinfo.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: execinfo.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: execinfo.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: execinfo.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: execinfo.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: execinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: execinfo.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: execinfo.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: execinfo.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for osp/osp.h" >&5
-echo $ECHO_N "checking for osp/osp.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_osp_osp_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for execinfo.h" >&5
+echo $ECHO_N "checking for execinfo.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_execinfo_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_osp_osp_h=$ac_header_preproc
+  ac_cv_header_execinfo_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_osp_osp_h" >&5
-echo "${ECHO_T}$ac_cv_header_osp_osp_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_execinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_execinfo_h" >&6; }
 
 fi
-if test $ac_cv_header_osp_osp_h = yes; then
-  OSPTK_HEADER_FOUND=1
+if test $ac_cv_header_execinfo_h = yes; then
+  BKTR_HEADER_FOUND=1
 else
-  OSPTK_HEADER_FOUND=0
+  BKTR_HEADER_FOUND=0
 fi
 
 
 	 fi
       fi
-      if test "x${OSPTK_HEADER_FOUND}" = "x0" ; then
-         OSPTK_LIB=""
-         OSPTK_INCLUDE=""
+      if test "x${BKTR_HEADER_FOUND}" = "x0" ; then
+         BKTR_LIB=""
+         BKTR_INCLUDE=""
       else
          if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
-	    OSPTK_LIB=""
+	    BKTR_LIB=""
 	 fi
-         PBX_OSPTK=1
+         PBX_BKTR=1
          # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_OSPTK 1
+#define HAVE_BKTR 1
 _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_OSPTK_VERSION
+#define HAVE_BKTR_VERSION
 _ACEOF
 
       fi
    fi
 fi
 
-fi
 
+# possible places for oss definitions
 
-if test "x${PBX_BKTR}" != "x1" -a "${USE_BKTR}" != "no"; then
+if test "x${PBX_OSS}" != "x1" -a "${USE_OSS}" != "no"; then
    pbxlibdir=""
-   if test "x${BKTR_DIR}" != "x"; then
-      if test -d ${BKTR_DIR}/lib; then
-      	 pbxlibdir="-L${BKTR_DIR}/lib"
+   if test "x${OSS_DIR}" != "x"; then
+      if test -d ${OSS_DIR}/lib; then
+      	 pbxlibdir="-L${OSS_DIR}/lib"
       else
-      	 pbxlibdir="-L${BKTR_DIR}"
+      	 pbxlibdir="-L${OSS_DIR}"
       fi
    fi
-   pbxfuncname="backtrace"
+   pbxfuncname=""
    if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_BKTR_FOUND=yes
+      AST_OSS_FOUND=yes
    else
-      as_ac_Lib=`echo "ac_cv_lib_execinfo_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lexecinfo" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lexecinfo... $ECHO_C" >&6; }
+      as_ac_Lib=`echo "ac_cv_lib_ossaudio_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lossaudio" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lossaudio... $ECHO_C" >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lexecinfo ${pbxlibdir} -lexecinfo $LIBS"
+LIBS="-lossaudio ${pbxlibdir}  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23544,26 +23543,26 @@ ac_res=`eval echo '${'$as_ac_Lib'}'`
 	       { echo "$as_me:$LINENO: result: $ac_res" >&5
 echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
-  AST_BKTR_FOUND=yes
+  AST_OSS_FOUND=yes
 else
-  AST_BKTR_FOUND=no
+  AST_OSS_FOUND=no
 fi
 
    fi
 
-   if test "${AST_BKTR_FOUND}" = "yes"; then
-      BKTR_LIB="-lexecinfo -lexecinfo"
-      BKTR_HEADER_FOUND="1"
-      if test "x${BKTR_DIR}" != "x"; then
-         BKTR_LIB="${pbxlibdir} ${BKTR_LIB}"
-	 BKTR_INCLUDE="-I${BKTR_DIR}/include"
+   if test "${AST_OSS_FOUND}" = "yes"; then
+      OSS_LIB="-lossaudio "
+      OSS_HEADER_FOUND="1"
+      if test "x${OSS_DIR}" != "x"; then
+         OSS_LIB="${pbxlibdir} ${OSS_LIB}"
+	 OSS_INCLUDE="-I${OSS_DIR}/include"
 	 saved_cppflags="${CPPFLAGS}"
-	 CPPFLAGS="${CPPFLAGS} -I${BKTR_DIR}/include"
-	 if test "xexecinfo.h" != "x" ; then
-	    as_ac_Header=`echo "ac_cv_header_${BKTR_DIR}/include/execinfo.h" | $as_tr_sh`
+	 CPPFLAGS="${CPPFLAGS} -I${OSS_DIR}/include"
+	 if test "xlinux/soundcard.h" != "x" ; then
+	    as_ac_Header=`echo "ac_cv_header_${OSS_DIR}/include/linux/soundcard.h" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${BKTR_DIR}/include/execinfo.h" >&5
-echo $ECHO_N "checking for ${BKTR_DIR}/include/execinfo.h... $ECHO_C" >&6; }
+  { echo "$as_me:$LINENO: checking for ${OSS_DIR}/include/linux/soundcard.h" >&5
+echo $ECHO_N "checking for ${OSS_DIR}/include/linux/soundcard.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
@@ -23572,8 +23571,8 @@ ac_res=`eval echo '${'$as_ac_Header'}'`
 echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${BKTR_DIR}/include/execinfo.h usability" >&5
-echo $ECHO_N "checking ${BKTR_DIR}/include/execinfo.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${OSS_DIR}/include/linux/soundcard.h usability" >&5
+echo $ECHO_N "checking ${OSS_DIR}/include/linux/soundcard.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23581,7 +23580,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${BKTR_DIR}/include/execinfo.h>
+#include <${OSS_DIR}/include/linux/soundcard.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -23613,15 +23612,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${BKTR_DIR}/include/execinfo.h presence" >&5
-echo $ECHO_N "checking ${BKTR_DIR}/include/execinfo.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${OSS_DIR}/include/linux/soundcard.h presence" >&5
+echo $ECHO_N "checking ${OSS_DIR}/include/linux/soundcard.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${BKTR_DIR}/include/execinfo.h>
+#include <${OSS_DIR}/include/linux/soundcard.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -23654,30 +23653,30 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${BKTR_DIR}/include/execinfo.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${BKTR_DIR}/include/execinfo.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for ${BKTR_DIR}/include/execinfo.h" >&5
-echo $ECHO_N "checking for ${BKTR_DIR}/include/execinfo.h... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for ${OSS_DIR}/include/linux/soundcard.h" >&5
+echo $ECHO_N "checking for ${OSS_DIR}/include/linux/soundcard.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -23689,28 +23688,28 @@ echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  BKTR_HEADER_FOUND=1
+  OSS_HEADER_FOUND=1
 else
-  BKTR_HEADER_FOUND=0
+  OSS_HEADER_FOUND=0
 fi
 
 
 	 fi
 	 CPPFLAGS="${saved_cppflags}"
       else
-	 if test "xexecinfo.h" != "x" ; then
-            if test "${ac_cv_header_execinfo_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for execinfo.h" >&5
-echo $ECHO_N "checking for execinfo.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_execinfo_h+set}" = set; then
+	 if test "xlinux/soundcard.h" != "x" ; then
+            if test "${ac_cv_header_linux_soundcard_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for linux/soundcard.h" >&5
+echo $ECHO_N "checking for linux/soundcard.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_linux_soundcard_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_execinfo_h" >&5
-echo "${ECHO_T}$ac_cv_header_execinfo_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_linux_soundcard_h" >&5
+echo "${ECHO_T}$ac_cv_header_linux_soundcard_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking execinfo.h usability" >&5
-echo $ECHO_N "checking execinfo.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking linux/soundcard.h usability" >&5
+echo $ECHO_N "checking linux/soundcard.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23718,7 +23717,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <execinfo.h>
+#include <linux/soundcard.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -23750,15 +23749,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking execinfo.h presence" >&5
-echo $ECHO_N "checking execinfo.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking linux/soundcard.h presence" >&5
+echo $ECHO_N "checking linux/soundcard.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <execinfo.h>
+#include <linux/soundcard.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -23791,65 +23790,65 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: execinfo.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: execinfo.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: linux/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: linux/soundcard.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: execinfo.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: execinfo.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: execinfo.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: execinfo.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: execinfo.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: execinfo.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: execinfo.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: execinfo.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: execinfo.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: execinfo.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: execinfo.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: execinfo.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: linux/soundcard.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: linux/soundcard.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: linux/soundcard.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: linux/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: linux/soundcard.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: linux/soundcard.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for execinfo.h" >&5
-echo $ECHO_N "checking for execinfo.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_execinfo_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for linux/soundcard.h" >&5
+echo $ECHO_N "checking for linux/soundcard.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_linux_soundcard_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_execinfo_h=$ac_header_preproc
+  ac_cv_header_linux_soundcard_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_execinfo_h" >&5
-echo "${ECHO_T}$ac_cv_header_execinfo_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_linux_soundcard_h" >&5
+echo "${ECHO_T}$ac_cv_header_linux_soundcard_h" >&6; }
 
 fi
-if test $ac_cv_header_execinfo_h = yes; then
-  BKTR_HEADER_FOUND=1
+if test $ac_cv_header_linux_soundcard_h = yes; then
+  OSS_HEADER_FOUND=1
 else
-  BKTR_HEADER_FOUND=0
+  OSS_HEADER_FOUND=0
 fi
 
 
 	 fi
       fi
-      if test "x${BKTR_HEADER_FOUND}" = "x0" ; then
-         BKTR_LIB=""
-         BKTR_INCLUDE=""
+      if test "x${OSS_HEADER_FOUND}" = "x0" ; then
+         OSS_LIB=""
+         OSS_INCLUDE=""
       else
          if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
-	    BKTR_LIB=""
+	    OSS_LIB=""
 	 fi
-         PBX_BKTR=1
+         PBX_OSS=1
          # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_BKTR 1
+#define HAVE_OSS 1
 _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_BKTR_VERSION
+#define HAVE_OSS_VERSION
 _ACEOF
 
       fi
@@ -23857,8 +23856,6 @@ _ACEOF
 fi
 
 
-# possible places for oss definitions
-
 if test "x${PBX_OSS}" != "x1" -a "${USE_OSS}" != "no"; then
    pbxlibdir=""
    if test "x${OSS_DIR}" != "x"; then
@@ -23951,11 +23948,11 @@ fi
 	 OSS_INCLUDE="-I${OSS_DIR}/include"
 	 saved_cppflags="${CPPFLAGS}"
 	 CPPFLAGS="${CPPFLAGS} -I${OSS_DIR}/include"
-	 if test "xlinux/soundcard.h" != "x" ; then
-	    as_ac_Header=`echo "ac_cv_header_${OSS_DIR}/include/linux/soundcard.h" | $as_tr_sh`
+	 if test "xsys/soundcard.h" != "x" ; then
+	    as_ac_Header=`echo "ac_cv_header_${OSS_DIR}/include/sys/soundcard.h" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${OSS_DIR}/include/linux/soundcard.h" >&5
-echo $ECHO_N "checking for ${OSS_DIR}/include/linux/soundcard.h... $ECHO_C" >&6; }
+  { echo "$as_me:$LINENO: checking for ${OSS_DIR}/include/sys/soundcard.h" >&5
+echo $ECHO_N "checking for ${OSS_DIR}/include/sys/soundcard.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
@@ -23964,8 +23961,8 @@ ac_res=`eval echo '${'$as_ac_Header'}'`
 echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${OSS_DIR}/include/linux/soundcard.h usability" >&5
-echo $ECHO_N "checking ${OSS_DIR}/include/linux/soundcard.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${OSS_DIR}/include/sys/soundcard.h usability" >&5
+echo $ECHO_N "checking ${OSS_DIR}/include/sys/soundcard.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23973,7 +23970,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${OSS_DIR}/include/linux/soundcard.h>
+#include <${OSS_DIR}/include/sys/soundcard.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -24005,15 +24002,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${OSS_DIR}/include/linux/soundcard.h presence" >&5
-echo $ECHO_N "checking ${OSS_DIR}/include/linux/soundcard.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${OSS_DIR}/include/sys/soundcard.h presence" >&5
+echo $ECHO_N "checking ${OSS_DIR}/include/sys/soundcard.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${OSS_DIR}/include/linux/soundcard.h>
+#include <${OSS_DIR}/include/sys/soundcard.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -24046,30 +24043,30 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/linux/soundcard.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/linux/soundcard.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for ${OSS_DIR}/include/linux/soundcard.h" >&5
-echo $ECHO_N "checking for ${OSS_DIR}/include/linux/soundcard.h... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for ${OSS_DIR}/include/sys/soundcard.h" >&5
+echo $ECHO_N "checking for ${OSS_DIR}/include/sys/soundcard.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -24090,19 +24087,19 @@ fi
 	 fi
 	 CPPFLAGS="${saved_cppflags}"
       else
-	 if test "xlinux/soundcard.h" != "x" ; then
-            if test "${ac_cv_header_linux_soundcard_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for linux/soundcard.h" >&5
-echo $ECHO_N "checking for linux/soundcard.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_linux_soundcard_h+set}" = set; then
+	 if test "xsys/soundcard.h" != "x" ; then
+            if test "${ac_cv_header_sys_soundcard_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5
+echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sys_soundcard_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_linux_soundcard_h" >&5
-echo "${ECHO_T}$ac_cv_header_linux_soundcard_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_soundcard_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_soundcard_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking linux/soundcard.h usability" >&5
-echo $ECHO_N "checking linux/soundcard.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sys/soundcard.h usability" >&5
+echo $ECHO_N "checking sys/soundcard.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -24110,7 +24107,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <linux/soundcard.h>
+#include <sys/soundcard.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -24142,15 +24139,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking linux/soundcard.h presence" >&5
-echo $ECHO_N "checking linux/soundcard.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sys/soundcard.h presence" >&5
+echo $ECHO_N "checking sys/soundcard.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <linux/soundcard.h>
+#include <sys/soundcard.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -24183,40 +24180,40 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: linux/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: linux/soundcard.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/soundcard.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: linux/soundcard.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: linux/soundcard.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: linux/soundcard.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: linux/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: linux/soundcard.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: linux/soundcard.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: linux/soundcard.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/soundcard.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/soundcard.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/soundcard.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/soundcard.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for linux/soundcard.h" >&5
-echo $ECHO_N "checking for linux/soundcard.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_linux_soundcard_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5
+echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sys_soundcard_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_linux_soundcard_h=$ac_header_preproc
+  ac_cv_header_sys_soundcard_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_linux_soundcard_h" >&5
-echo "${ECHO_T}$ac_cv_header_linux_soundcard_h" >&6; }
-
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_soundcard_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_soundcard_h" >&6; }
+
 fi
-if test $ac_cv_header_linux_soundcard_h = yes; then
+if test $ac_cv_header_sys_soundcard_h = yes; then
   OSS_HEADER_FOUND=1
 else
   OSS_HEADER_FOUND=0
@@ -24258,7 +24255,7 @@ if test "x${PBX_OSS}" != "x1" -a "${USE_OSS}" != "no"; then
       	 pbxlibdir="-L${OSS_DIR}"
       fi
    fi
-   pbxfuncname=""
+   pbxfuncname="oss_ioctl_mixer"
    if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
       AST_OSS_FOUND=yes
    else
@@ -24341,11 +24338,11 @@ fi
 	 OSS_INCLUDE="-I${OSS_DIR}/include"
 	 saved_cppflags="${CPPFLAGS}"
 	 CPPFLAGS="${CPPFLAGS} -I${OSS_DIR}/include"
-	 if test "xsys/soundcard.h" != "x" ; then
-	    as_ac_Header=`echo "ac_cv_header_${OSS_DIR}/include/sys/soundcard.h" | $as_tr_sh`
+	 if test "xsoundcard.h" != "x" ; then
+	    as_ac_Header=`echo "ac_cv_header_${OSS_DIR}/include/soundcard.h" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${OSS_DIR}/include/sys/soundcard.h" >&5
-echo $ECHO_N "checking for ${OSS_DIR}/include/sys/soundcard.h... $ECHO_C" >&6; }
+  { echo "$as_me:$LINENO: checking for ${OSS_DIR}/include/soundcard.h" >&5
+echo $ECHO_N "checking for ${OSS_DIR}/include/soundcard.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
@@ -24354,8 +24351,8 @@ ac_res=`eval echo '${'$as_ac_Header'}'`
 echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${OSS_DIR}/include/sys/soundcard.h usability" >&5
-echo $ECHO_N "checking ${OSS_DIR}/include/sys/soundcard.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${OSS_DIR}/include/soundcard.h usability" >&5
+echo $ECHO_N "checking ${OSS_DIR}/include/soundcard.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -24363,7 +24360,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${OSS_DIR}/include/sys/soundcard.h>
+#include <${OSS_DIR}/include/soundcard.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -24395,15 +24392,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${OSS_DIR}/include/sys/soundcard.h presence" >&5
-echo $ECHO_N "checking ${OSS_DIR}/include/sys/soundcard.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${OSS_DIR}/include/soundcard.h presence" >&5
+echo $ECHO_N "checking ${OSS_DIR}/include/soundcard.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${OSS_DIR}/include/sys/soundcard.h>
+#include <${OSS_DIR}/include/soundcard.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -24436,30 +24433,30 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/sys/soundcard.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/sys/soundcard.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for ${OSS_DIR}/include/sys/soundcard.h" >&5
-echo $ECHO_N "checking for ${OSS_DIR}/include/sys/soundcard.h... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for ${OSS_DIR}/include/soundcard.h" >&5
+echo $ECHO_N "checking for ${OSS_DIR}/include/soundcard.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -24480,19 +24477,19 @@ fi
 	 fi
 	 CPPFLAGS="${saved_cppflags}"
       else
-	 if test "xsys/soundcard.h" != "x" ; then
-            if test "${ac_cv_header_sys_soundcard_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5
-echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sys_soundcard_h+set}" = set; then
+	 if test "xsoundcard.h" != "x" ; then
+            if test "${ac_cv_header_soundcard_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for soundcard.h" >&5
+echo $ECHO_N "checking for soundcard.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_soundcard_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_soundcard_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_soundcard_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_soundcard_h" >&5
+echo "${ECHO_T}$ac_cv_header_soundcard_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking sys/soundcard.h usability" >&5
-echo $ECHO_N "checking sys/soundcard.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking soundcard.h usability" >&5
+echo $ECHO_N "checking soundcard.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -24500,7 +24497,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <sys/soundcard.h>
+#include <soundcard.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -24532,15 +24529,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking sys/soundcard.h presence" >&5
-echo $ECHO_N "checking sys/soundcard.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking soundcard.h presence" >&5
+echo $ECHO_N "checking soundcard.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/soundcard.h>
+#include <soundcard.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -24573,40 +24570,40 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: sys/soundcard.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: soundcard.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: soundcard.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sys/soundcard.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/soundcard.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: sys/soundcard.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: sys/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: sys/soundcard.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: soundcard.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: soundcard.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: soundcard.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: soundcard.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: soundcard.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: soundcard.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: soundcard.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: soundcard.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: soundcard.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: soundcard.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: soundcard.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: soundcard.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5
-echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sys_soundcard_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for soundcard.h" >&5
+echo $ECHO_N "checking for soundcard.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_soundcard_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_sys_soundcard_h=$ac_header_preproc
+  ac_cv_header_soundcard_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_soundcard_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_soundcard_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_soundcard_h" >&5
+echo "${ECHO_T}$ac_cv_header_soundcard_h" >&6; }
 
 fi
-if test $ac_cv_header_sys_soundcard_h = yes; then
+if test $ac_cv_header_soundcard_h = yes; then
   OSS_HEADER_FOUND=1
 else
   OSS_HEADER_FOUND=0
@@ -24639,437 +24636,47 @@ _ACEOF
 fi
 
 
-if test "x${PBX_OSS}" != "x1" -a "${USE_OSS}" != "no"; then
-   pbxlibdir=""
-   if test "x${OSS_DIR}" != "x"; then
-      if test -d ${OSS_DIR}/lib; then
-      	 pbxlibdir="-L${OSS_DIR}/lib"
-      else
-      	 pbxlibdir="-L${OSS_DIR}"
-      fi
-   fi
-   pbxfuncname="oss_ioctl_mixer"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_OSS_FOUND=yes
-   else
-      as_ac_Lib=`echo "ac_cv_lib_ossaudio_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lossaudio" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lossaudio... $ECHO_C" >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+PG_CONFIG=No
+if test "${USE_PGSQL}" != "no"; then
+   if test "x${PGSQL_DIR}" != "x"; then
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pg_config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pg_config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PG_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lossaudio ${pbxlibdir}  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+  case $PG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PG_CONFIG="$PG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in ${PGSQL_DIR}/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ${pbxfuncname} ();
-int
-main ()
-{
-return ${pbxfuncname} ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-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_link") 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_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  eval "$as_ac_Lib=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_Lib=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-ac_res=`eval echo '${'$as_ac_Lib'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Lib'}'` = yes; then
-  AST_OSS_FOUND=yes
+PG_CONFIG=$ac_cv_path_PG_CONFIG
+if test -n "$PG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PG_CONFIG" >&5
+echo "${ECHO_T}$PG_CONFIG" >&6; }
 else
-  AST_OSS_FOUND=no
-fi
-
-   fi
-
-   if test "${AST_OSS_FOUND}" = "yes"; then
-      OSS_LIB="-lossaudio "
-      OSS_HEADER_FOUND="1"
-      if test "x${OSS_DIR}" != "x"; then
-         OSS_LIB="${pbxlibdir} ${OSS_LIB}"
-	 OSS_INCLUDE="-I${OSS_DIR}/include"
-	 saved_cppflags="${CPPFLAGS}"
-	 CPPFLAGS="${CPPFLAGS} -I${OSS_DIR}/include"
-	 if test "xsoundcard.h" != "x" ; then
-	    as_ac_Header=`echo "ac_cv_header_${OSS_DIR}/include/soundcard.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${OSS_DIR}/include/soundcard.h" >&5
-echo $ECHO_N "checking for ${OSS_DIR}/include/soundcard.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${OSS_DIR}/include/soundcard.h usability" >&5
-echo $ECHO_N "checking ${OSS_DIR}/include/soundcard.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${OSS_DIR}/include/soundcard.h>
-_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
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${OSS_DIR}/include/soundcard.h presence" >&5
-echo $ECHO_N "checking ${OSS_DIR}/include/soundcard.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${OSS_DIR}/include/soundcard.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-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_cpp conftest.$ac_ext") 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); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${OSS_DIR}/include/soundcard.h" >&5
-echo $ECHO_N "checking for ${OSS_DIR}/include/soundcard.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  OSS_HEADER_FOUND=1
-else
-  OSS_HEADER_FOUND=0
-fi
-
-
-	 fi
-	 CPPFLAGS="${saved_cppflags}"
-      else
-	 if test "xsoundcard.h" != "x" ; then
-            if test "${ac_cv_header_soundcard_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for soundcard.h" >&5
-echo $ECHO_N "checking for soundcard.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_soundcard_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_soundcard_h" >&5
-echo "${ECHO_T}$ac_cv_header_soundcard_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking soundcard.h usability" >&5
-echo $ECHO_N "checking soundcard.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <soundcard.h>
-_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
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking soundcard.h presence" >&5
-echo $ECHO_N "checking soundcard.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <soundcard.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-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_cpp conftest.$ac_ext") 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); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: soundcard.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: soundcard.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: soundcard.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: soundcard.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: soundcard.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: soundcard.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: soundcard.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: soundcard.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: soundcard.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: soundcard.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: soundcard.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: soundcard.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: soundcard.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: soundcard.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for soundcard.h" >&5
-echo $ECHO_N "checking for soundcard.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_soundcard_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_header_soundcard_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_soundcard_h" >&5
-echo "${ECHO_T}$ac_cv_header_soundcard_h" >&6; }
-
-fi
-if test $ac_cv_header_soundcard_h = yes; then
-  OSS_HEADER_FOUND=1
-else
-  OSS_HEADER_FOUND=0
-fi
-
-
-	 fi
-      fi
-      if test "x${OSS_HEADER_FOUND}" = "x0" ; then
-         OSS_LIB=""
-         OSS_INCLUDE=""
-      else
-         if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
-	    OSS_LIB=""
-	 fi
-         PBX_OSS=1
-         # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_OSS 1
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_OSS_VERSION
-_ACEOF
-
-      fi
-   fi
-fi
-
-
-PG_CONFIG=No
-if test "${USE_PGSQL}" != "no"; then
-   if test "x${PGSQL_DIR}" != "x"; then
-      if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}pg_config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pg_config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_PG_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $PG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PG_CONFIG="$PG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in ${PGSQL_DIR}/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_PG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-PG_CONFIG=$ac_cv_path_PG_CONFIG
-if test -n "$PG_CONFIG"; then
-  { echo "$as_me:$LINENO: result: $PG_CONFIG" >&5
-echo "${ECHO_T}$PG_CONFIG" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
 
@@ -27342,43 +26949,411 @@ echo "${ECHO_T}${OPENH323_BUILD}" >&6; }
 
 
 
-	fi
+	fi
+
+	PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
+
+	if test "${HAS_OPENH323:-unset}" != "unset"; then
+	   { echo "$as_me:$LINENO: checking OpenH323 installation validity" >&5
+echo $ECHO_N "checking OpenH323 installation validity... $ECHO_C" >&6; }
+
+	   saved_cppflags="${CPPFLAGS}"
+	   saved_libs="${LIBS}"
+	   if test "${OPENH323_LIB:-unset}" != "unset"; then
+	      LIBS="${LIBS} ${OPENH323_LIB} ${PWLIB_LIB}"
+	   else
+    	      LIBS="${LIBS} -L${OPENH323_LIBDIR} -l${PLATFORM_OPENH323} ${PWLIB_LIB}"
+	   fi
+	   CPPFLAGS="${CPPFLAGS} -I${OPENH323_INCDIR} ${PWLIB_INCLUDE}"
+
+	   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+	   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "ptlib.h"
+		#include "h323.h"
+		#include "h323ep.h"
+int
+main ()
+{
+H323EndPoint ep = H323EndPoint();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+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_link") 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_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  	{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+			ac_cv_lib_OPENH323="yes"
+
+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; }
+			ac_cv_lib_OPENH323="no"
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
+	   ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+	   LIBS="${saved_libs}"
+	   CPPFLAGS="${saved_cppflags}"
+
+	   if test "${ac_cv_lib_OPENH323}" = "yes"; then
+	      if test "${OPENH323_LIB:-undef}" = "undef"; then
+	         if test "${OPENH323_LIBDIR}" != "" -a "${OPENH323_LIBDIR}" != "/usr/lib"; then
+	            OPENH323_LIB="-L${OPENH323_LIBDIR} -l${PLATFORM_OPENH323}"
+	         else
+	            OPENH323_LIB="-l${PLATFORM_OPENH323}"
+	         fi
+	      fi
+	      if test "${OPENH323_INCDIR}" != "" -a "${OPENH323_INCDIR}" != "/usr/include"; then
+	         OPENH323_INCLUDE="-I${OPENH323_INCDIR}"
+	      fi
+	   	  PBX_OPENH323=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_OPENH323 1
+_ACEOF
+
+	   fi
+	fi
+
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+if test "${USE_QT}" != "no"; then
+   { echo "$as_me:$LINENO: checking for QDate in -lqt" >&5
+echo $ECHO_N "checking for QDate in -lqt... $ECHO_C" >&6; }
+   saved_libs="${LIBS}"
+   saved_cppflags="${CPPFLAGS}"
+   if test "x${QT_DIR}" != "x"; then
+      LIBS="${LIBS} -L${QT_DIR}/lib"
+      CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
+   fi
+   LIBS="${LIBS} -lqt"
+   qtlib="qt"
+   cat >conftest.$ac_ext <<_ACEOF
+
+		/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <qt3/qdatetime.h>
+int
+main ()
+{
+QDate date();
+  ;
+  return 0;
+}
+
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+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_link") 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_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_qt_qt_date="yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_qt_qt_date="no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+   LIBS="${saved_libs}"
+   CPPFLAGS="${saved_cppflags}"
+
+   if test "${ac_cv_lib_qt_qt_date}" = "no"; then
+      saved_libs="${LIBS}"
+      saved_cppflags="${CPPFLAGS}"
+      if test "x${QT_DIR}" != "x"; then
+      	 LIBS="${LIBS} -L${QT_DIR}/lib"
+	 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
+      fi
+      LIBS="${LIBS} -lqt-mt"
+      qtlib="qt-mt"
+      cat >conftest.$ac_ext <<_ACEOF
+
+			/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <qt3/qdatetime.h>
+int
+main ()
+{
+QDate date();
+  ;
+  return 0;
+}
+
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+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_link") 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_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_qt_qt_date="yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_qt_qt_date="no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+      LIBS="${saved_libs}"
+      CPPFLAGS="${saved_cppflags}"
+   fi
+
+   if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
+      { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+   else
+      { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+   fi
+
+   if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
+      QT_LIB="-l${qtlib}"
+      if test "${QT_DIR}" != ""; then
+      	 QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
+	 QT_INCLUDE="-I${QT_DIR}/include"
+      fi
+      PBX_QT=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_QT 1
+_ACEOF
+
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}moc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}moc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_QTMOC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $QTMOC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_QTMOC="$QTMOC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_QTMOC="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+QTMOC=$ac_cv_path_QTMOC
+if test -n "$QTMOC"; then
+  { echo "$as_me:$LINENO: result: $QTMOC" >&5
+echo "${ECHO_T}$QTMOC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-	PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
 
-	if test "${HAS_OPENH323:-unset}" != "unset"; then
-	   { echo "$as_me:$LINENO: checking OpenH323 installation validity" >&5
-echo $ECHO_N "checking OpenH323 installation validity... $ECHO_C" >&6; }
+fi
+if test -z "$ac_cv_path_QTMOC"; then
+  ac_pt_QTMOC=$QTMOC
+  # Extract the first word of "moc", so it can be a program name with args.
+set dummy moc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ac_pt_QTMOC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_QTMOC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_QTMOC="$ac_pt_QTMOC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_QTMOC="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-	   saved_cppflags="${CPPFLAGS}"
-	   saved_libs="${LIBS}"
-	   if test "${OPENH323_LIB:-unset}" != "unset"; then
-	      LIBS="${LIBS} ${OPENH323_LIB} ${PWLIB_LIB}"
-	   else
-    	      LIBS="${LIBS} -L${OPENH323_LIBDIR} -l${PLATFORM_OPENH323} ${PWLIB_LIB}"
-	   fi
-	   CPPFLAGS="${CPPFLAGS} -I${OPENH323_INCDIR} ${PWLIB_INCLUDE}"
+  ;;
+esac
+fi
+ac_pt_QTMOC=$ac_cv_path_ac_pt_QTMOC
+if test -n "$ac_pt_QTMOC"; then
+  { echo "$as_me:$LINENO: result: $ac_pt_QTMOC" >&5
+echo "${ECHO_T}$ac_pt_QTMOC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-	   ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+  if test "x$ac_pt_QTMOC" = x; then
+    QTMOC="No"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    QTMOC=$ac_pt_QTMOC
+  fi
+else
+  QTMOC="$ac_cv_path_QTMOC"
+fi
 
+   fi
+fi
 
-	   cat >conftest.$ac_ext <<_ACEOF
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+if test "x${PBX_RADIUS}" != "x1" -a "${USE_RADIUS}" != "no"; then
+   pbxlibdir=""
+   if test "x${RADIUS_DIR}" != "x"; then
+      if test -d ${RADIUS_DIR}/lib; then
+      	 pbxlibdir="-L${RADIUS_DIR}/lib"
+      else
+      	 pbxlibdir="-L${RADIUS_DIR}"
+      fi
+   fi
+   pbxfuncname="rc_read_config"
+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+      AST_RADIUS_FOUND=yes
+   else
+      as_ac_Lib=`echo "ac_cv_lib_radiusclient-ng_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lradiusclient-ng" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lradiusclient-ng... $ECHO_C" >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lradiusclient-ng ${pbxlibdir}  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include "ptlib.h"
-		#include "h323.h"
-		#include "h323ep.h"
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ${pbxfuncname} ();
 int
 main ()
 {
-H323EndPoint ep = H323EndPoint();
+return ${pbxfuncname} ();
   ;
   return 0;
 }
@@ -27397,338 +27372,361 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
+	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
-  	{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-			ac_cv_lib_OPENH323="yes"
-
+  eval "$as_ac_Lib=yes"
 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; }
-			ac_cv_lib_OPENH323="no"
-
-
+	eval "$as_ac_Lib=no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-
-	   ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-	   LIBS="${saved_libs}"
-	   CPPFLAGS="${saved_cppflags}"
-
-	   if test "${ac_cv_lib_OPENH323}" = "yes"; then
-	      if test "${OPENH323_LIB:-undef}" = "undef"; then
-	         if test "${OPENH323_LIBDIR}" != "" -a "${OPENH323_LIBDIR}" != "/usr/lib"; then
-	            OPENH323_LIB="-L${OPENH323_LIBDIR} -l${PLATFORM_OPENH323}"
-	         else
-	            OPENH323_LIB="-l${PLATFORM_OPENH323}"
-	         fi
-	      fi
-	      if test "${OPENH323_INCDIR}" != "" -a "${OPENH323_INCDIR}" != "/usr/include"; then
-	         OPENH323_INCLUDE="-I${OPENH323_INCDIR}"
-	      fi
-	   	  PBX_OPENH323=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_OPENH323 1
-_ACEOF
-
-	   fi
-	fi
-
+LIBS=$ac_check_lib_save_LIBS
+fi
+ac_res=`eval echo '${'$as_ac_Lib'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+  AST_RADIUS_FOUND=yes
+else
+  AST_RADIUS_FOUND=no
 fi
 
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-if test "${USE_QT}" != "no"; then
-   { echo "$as_me:$LINENO: checking for QDate in -lqt" >&5
-echo $ECHO_N "checking for QDate in -lqt... $ECHO_C" >&6; }
-   saved_libs="${LIBS}"
-   saved_cppflags="${CPPFLAGS}"
-   if test "x${QT_DIR}" != "x"; then
-      LIBS="${LIBS} -L${QT_DIR}/lib"
-      CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
    fi
-   LIBS="${LIBS} -lqt"
-   qtlib="qt"
-   cat >conftest.$ac_ext <<_ACEOF
 
-		/* confdefs.h.  */
+   if test "${AST_RADIUS_FOUND}" = "yes"; then
+      RADIUS_LIB="-lradiusclient-ng "
+      RADIUS_HEADER_FOUND="1"
+      if test "x${RADIUS_DIR}" != "x"; then
+         RADIUS_LIB="${pbxlibdir} ${RADIUS_LIB}"
+	 RADIUS_INCLUDE="-I${RADIUS_DIR}/include"
+	 saved_cppflags="${CPPFLAGS}"
+	 CPPFLAGS="${CPPFLAGS} -I${RADIUS_DIR}/include"
+	 if test "xradiusclient-ng.h" != "x" ; then
+	    as_ac_Header=`echo "ac_cv_header_${RADIUS_DIR}/include/radiusclient-ng.h" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for ${RADIUS_DIR}/include/radiusclient-ng.h" >&5
+echo $ECHO_N "checking for ${RADIUS_DIR}/include/radiusclient-ng.h... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking ${RADIUS_DIR}/include/radiusclient-ng.h usability" >&5
+echo $ECHO_N "checking ${RADIUS_DIR}/include/radiusclient-ng.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <qt3/qdatetime.h>
-int
-main ()
-{
-QDate date();
-  ;
-  return 0;
-}
-
+$ac_includes_default
+#include <${RADIUS_DIR}/include/radiusclient-ng.h>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+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_link") 2>conftest.er1
+  (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_cxx_werror_flag" ||
+	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_qt_qt_date="yes"
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_qt_qt_date="no"
+	ac_header_compiler=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-   LIBS="${saved_libs}"
-   CPPFLAGS="${saved_cppflags}"
-
-   if test "${ac_cv_lib_qt_qt_date}" = "no"; then
-      saved_libs="${LIBS}"
-      saved_cppflags="${CPPFLAGS}"
-      if test "x${QT_DIR}" != "x"; then
-      	 LIBS="${LIBS} -L${QT_DIR}/lib"
-	 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
-      fi
-      LIBS="${LIBS} -lqt-mt"
-      qtlib="qt-mt"
-      cat >conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-			/* confdefs.h.  */
+# Is the header present?
+{ echo "$as_me:$LINENO: checking ${RADIUS_DIR}/include/radiusclient-ng.h presence" >&5
+echo $ECHO_N "checking ${RADIUS_DIR}/include/radiusclient-ng.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <qt3/qdatetime.h>
-int
-main ()
-{
-QDate date();
-  ;
-  return 0;
-}
-
+#include <${RADIUS_DIR}/include/radiusclient-ng.h>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
 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_link") 2>conftest.er1
+  (eval "$ac_cpp conftest.$ac_ext") 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_cxx_werror_flag" ||
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_qt_qt_date="yes"
+       }; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_qt_qt_date="no"
+  ac_header_preproc=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-      LIBS="${saved_libs}"
-      CPPFLAGS="${saved_cppflags}"
-   fi
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-   if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
-      { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-   else
-      { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-   fi
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: in the future, the compiler will take precedence" >&2;}
 
-   if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
-      QT_LIB="-l${qtlib}"
-      if test "${QT_DIR}" != ""; then
-      	 QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
-	 QT_INCLUDE="-I${QT_DIR}/include"
-      fi
-      PBX_QT=1
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for ${RADIUS_DIR}/include/radiusclient-ng.h" >&5
+echo $ECHO_N "checking for ${RADIUS_DIR}/include/radiusclient-ng.h... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_QT 1
-_ACEOF
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  RADIUS_HEADER_FOUND=1
+else
+  RADIUS_HEADER_FOUND=0
+fi
 
-      if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}moc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}moc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_QTMOC+set}" = set; then
+
+	 fi
+	 CPPFLAGS="${saved_cppflags}"
+      else
+	 if test "xradiusclient-ng.h" != "x" ; then
+            if test "${ac_cv_header_radiusclient_ng_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for radiusclient-ng.h" >&5
+echo $ECHO_N "checking for radiusclient-ng.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_radiusclient_ng_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_radiusclient_ng_h" >&5
+echo "${ECHO_T}$ac_cv_header_radiusclient_ng_h" >&6; }
 else
-  case $QTMOC in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_QTMOC="$QTMOC" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_QTMOC="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking radiusclient-ng.h usability" >&5
+echo $ECHO_N "checking radiusclient-ng.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <radiusclient-ng.h>
+_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
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
 fi
-QTMOC=$ac_cv_path_QTMOC
-if test -n "$QTMOC"; then
-  { echo "$as_me:$LINENO: result: $QTMOC" >&5
-echo "${ECHO_T}$QTMOC" >&6; }
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking radiusclient-ng.h presence" >&5
+echo $ECHO_N "checking radiusclient-ng.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <radiusclient-ng.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+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_cpp conftest.$ac_ext") 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); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
 fi
 
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-fi
-if test -z "$ac_cv_path_QTMOC"; then
-  ac_pt_QTMOC=$QTMOC
-  # Extract the first word of "moc", so it can be a program name with args.
-set dummy moc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_ac_pt_QTMOC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $ac_pt_QTMOC in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_QTMOC="$ac_pt_QTMOC" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_ac_pt_QTMOC="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: radiusclient-ng.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: radiusclient-ng.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: radiusclient-ng.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: radiusclient-ng.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: radiusclient-ng.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: radiusclient-ng.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: radiusclient-ng.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: radiusclient-ng.h: in the future, the compiler will take precedence" >&2;}
 
-  ;;
+    ;;
 esac
-fi
-ac_pt_QTMOC=$ac_cv_path_ac_pt_QTMOC
-if test -n "$ac_pt_QTMOC"; then
-  { echo "$as_me:$LINENO: result: $ac_pt_QTMOC" >&5
-echo "${ECHO_T}$ac_pt_QTMOC" >&6; }
+{ echo "$as_me:$LINENO: checking for radiusclient-ng.h" >&5
+echo $ECHO_N "checking for radiusclient-ng.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_radiusclient_ng_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  ac_cv_header_radiusclient_ng_h=$ac_header_preproc
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_radiusclient_ng_h" >&5
+echo "${ECHO_T}$ac_cv_header_radiusclient_ng_h" >&6; }
 
-  if test "x$ac_pt_QTMOC" = x; then
-    QTMOC="No"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
-    QTMOC=$ac_pt_QTMOC
-  fi
+fi
+if test $ac_cv_header_radiusclient_ng_h = yes; then
+  RADIUS_HEADER_FOUND=1
 else
-  QTMOC="$ac_cv_path_QTMOC"
+  RADIUS_HEADER_FOUND=0
 fi
 
+
+	 fi
+      fi
+      if test "x${RADIUS_HEADER_FOUND}" = "x0" ; then
+         RADIUS_LIB=""
+         RADIUS_INCLUDE=""
+      else
+         if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
+	    RADIUS_LIB=""
+	 fi
+         PBX_RADIUS=1
+         # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_RADIUS 1
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_RADIUS_VERSION
+_ACEOF
+
+      fi
    fi
 fi
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
 
 
-if test "x${PBX_RADIUS}" != "x1" -a "${USE_RADIUS}" != "no"; then
+if test "x${PBX_SPEEX}" != "x1" -a "${USE_SPEEX}" != "no"; then
    pbxlibdir=""
-   if test "x${RADIUS_DIR}" != "x"; then
-      if test -d ${RADIUS_DIR}/lib; then
-      	 pbxlibdir="-L${RADIUS_DIR}/lib"
+   if test "x${SPEEX_DIR}" != "x"; then
+      if test -d ${SPEEX_DIR}/lib; then
+      	 pbxlibdir="-L${SPEEX_DIR}/lib"
       else
-      	 pbxlibdir="-L${RADIUS_DIR}"
+      	 pbxlibdir="-L${SPEEX_DIR}"
       fi
    fi
-   pbxfuncname="rc_read_config"
+   pbxfuncname="speex_encode"
    if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_RADIUS_FOUND=yes
+      AST_SPEEX_FOUND=yes
    else
-      as_ac_Lib=`echo "ac_cv_lib_radiusclient-ng_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lradiusclient-ng" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lradiusclient-ng... $ECHO_C" >&6; }
+      as_ac_Lib=`echo "ac_cv_lib_speex_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lspeex" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lspeex... $ECHO_C" >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lradiusclient-ng ${pbxlibdir}  $LIBS"
+LIBS="-lspeex ${pbxlibdir} -lm $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -27785,26 +27783,26 @@ ac_res=`eval echo '${'$as_ac_Lib'}'`
 	       { echo "$as_me:$LINENO: result: $ac_res" >&5
 echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
-  AST_RADIUS_FOUND=yes
+  AST_SPEEX_FOUND=yes
 else
-  AST_RADIUS_FOUND=no
+  AST_SPEEX_FOUND=no
 fi
 
    fi
 
-   if test "${AST_RADIUS_FOUND}" = "yes"; then
-      RADIUS_LIB="-lradiusclient-ng "
-      RADIUS_HEADER_FOUND="1"
-      if test "x${RADIUS_DIR}" != "x"; then
-         RADIUS_LIB="${pbxlibdir} ${RADIUS_LIB}"
-	 RADIUS_INCLUDE="-I${RADIUS_DIR}/include"
+   if test "${AST_SPEEX_FOUND}" = "yes"; then
+      SPEEX_LIB="-lspeex -lm"
+      SPEEX_HEADER_FOUND="1"
+      if test "x${SPEEX_DIR}" != "x"; then
+         SPEEX_LIB="${pbxlibdir} ${SPEEX_LIB}"
+	 SPEEX_INCLUDE="-I${SPEEX_DIR}/include"
 	 saved_cppflags="${CPPFLAGS}"
-	 CPPFLAGS="${CPPFLAGS} -I${RADIUS_DIR}/include"
-	 if test "xradiusclient-ng.h" != "x" ; then
-	    as_ac_Header=`echo "ac_cv_header_${RADIUS_DIR}/include/radiusclient-ng.h" | $as_tr_sh`
+	 CPPFLAGS="${CPPFLAGS} -I${SPEEX_DIR}/include"
+	 if test "xspeex/speex.h" != "x" ; then
+	    as_ac_Header=`echo "ac_cv_header_${SPEEX_DIR}/include/speex/speex.h" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${RADIUS_DIR}/include/radiusclient-ng.h" >&5
-echo $ECHO_N "checking for ${RADIUS_DIR}/include/radiusclient-ng.h... $ECHO_C" >&6; }
+  { echo "$as_me:$LINENO: checking for ${SPEEX_DIR}/include/speex/speex.h" >&5
+echo $ECHO_N "checking for ${SPEEX_DIR}/include/speex/speex.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
@@ -27813,8 +27811,8 @@ ac_res=`eval echo '${'$as_ac_Header'}'`
 echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${RADIUS_DIR}/include/radiusclient-ng.h usability" >&5
-echo $ECHO_N "checking ${RADIUS_DIR}/include/radiusclient-ng.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${SPEEX_DIR}/include/speex/speex.h usability" >&5
+echo $ECHO_N "checking ${SPEEX_DIR}/include/speex/speex.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -27822,7 +27820,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${RADIUS_DIR}/include/radiusclient-ng.h>
+#include <${SPEEX_DIR}/include/speex/speex.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -27854,15 +27852,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${RADIUS_DIR}/include/radiusclient-ng.h presence" >&5
-echo $ECHO_N "checking ${RADIUS_DIR}/include/radiusclient-ng.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${SPEEX_DIR}/include/speex/speex.h presence" >&5
+echo $ECHO_N "checking ${SPEEX_DIR}/include/speex/speex.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${RADIUS_DIR}/include/radiusclient-ng.h>
+#include <${SPEEX_DIR}/include/speex/speex.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -27895,30 +27893,30 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for ${RADIUS_DIR}/include/radiusclient-ng.h" >&5
-echo $ECHO_N "checking for ${RADIUS_DIR}/include/radiusclient-ng.h... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for ${SPEEX_DIR}/include/speex/speex.h" >&5
+echo $ECHO_N "checking for ${SPEEX_DIR}/include/speex/speex.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -27930,28 +27928,28 @@ echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  RADIUS_HEADER_FOUND=1
+  SPEEX_HEADER_FOUND=1
 else
-  RADIUS_HEADER_FOUND=0
+  SPEEX_HEADER_FOUND=0
 fi
 
 
 	 fi
 	 CPPFLAGS="${saved_cppflags}"
       else
-	 if test "xradiusclient-ng.h" != "x" ; then
-            if test "${ac_cv_header_radiusclient_ng_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for radiusclient-ng.h" >&5
-echo $ECHO_N "checking for radiusclient-ng.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_radiusclient_ng_h+set}" = set; then
+	 if test "xspeex/speex.h" != "x" ; then
+            if test "${ac_cv_header_speex_speex_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for speex/speex.h" >&5
+echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_speex_speex_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_radiusclient_ng_h" >&5
-echo "${ECHO_T}$ac_cv_header_radiusclient_ng_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_speex_speex_h" >&5
+echo "${ECHO_T}$ac_cv_header_speex_speex_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking radiusclient-ng.h usability" >&5
-echo $ECHO_N "checking radiusclient-ng.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking speex/speex.h usability" >&5
+echo $ECHO_N "checking speex/speex.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -27959,7 +27957,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <radiusclient-ng.h>
+#include <speex/speex.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -27991,15 +27989,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking radiusclient-ng.h presence" >&5
-echo $ECHO_N "checking radiusclient-ng.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking speex/speex.h presence" >&5
+echo $ECHO_N "checking speex/speex.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <radiusclient-ng.h>
+#include <speex/speex.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -28032,65 +28030,65 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: radiusclient-ng.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: radiusclient-ng.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: speex/speex.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: speex/speex.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: radiusclient-ng.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: radiusclient-ng.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: radiusclient-ng.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: radiusclient-ng.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: radiusclient-ng.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: radiusclient-ng.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: radiusclient-ng.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: speex/speex.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: speex/speex.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: speex/speex.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: speex/speex.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: speex/speex.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: speex/speex.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: speex/speex.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: speex/speex.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: speex/speex.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: speex/speex.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: speex/speex.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: speex/speex.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for radiusclient-ng.h" >&5
-echo $ECHO_N "checking for radiusclient-ng.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_radiusclient_ng_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for speex/speex.h" >&5
+echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_speex_speex_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_radiusclient_ng_h=$ac_header_preproc
+  ac_cv_header_speex_speex_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_radiusclient_ng_h" >&5
-echo "${ECHO_T}$ac_cv_header_radiusclient_ng_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_speex_speex_h" >&5
+echo "${ECHO_T}$ac_cv_header_speex_speex_h" >&6; }
 
 fi
-if test $ac_cv_header_radiusclient_ng_h = yes; then
-  RADIUS_HEADER_FOUND=1
+if test $ac_cv_header_speex_speex_h = yes; then
+  SPEEX_HEADER_FOUND=1
 else
-  RADIUS_HEADER_FOUND=0
+  SPEEX_HEADER_FOUND=0
 fi
 
 
 	 fi
       fi
-      if test "x${RADIUS_HEADER_FOUND}" = "x0" ; then
-         RADIUS_LIB=""
-         RADIUS_INCLUDE=""
+      if test "x${SPEEX_HEADER_FOUND}" = "x0" ; then
+         SPEEX_LIB=""
+         SPEEX_INCLUDE=""
       else
          if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
-	    RADIUS_LIB=""
+	    SPEEX_LIB=""
 	 fi
-         PBX_RADIUS=1
+         PBX_SPEEX=1
          # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_RADIUS 1
+#define HAVE_SPEEX 1
 _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_RADIUS_VERSION
+#define HAVE_SPEEX_VERSION
 _ACEOF
 
       fi
@@ -28099,27 +28097,27 @@ fi
 
 
 
-if test "x${PBX_SPEEX}" != "x1" -a "${USE_SPEEX}" != "no"; then
+if test "x${PBX_SQLITE}" != "x1" -a "${USE_SQLITE}" != "no"; then
    pbxlibdir=""
-   if test "x${SPEEX_DIR}" != "x"; then
-      if test -d ${SPEEX_DIR}/lib; then
-      	 pbxlibdir="-L${SPEEX_DIR}/lib"
+   if test "x${SQLITE_DIR}" != "x"; then
+      if test -d ${SQLITE_DIR}/lib; then
+      	 pbxlibdir="-L${SQLITE_DIR}/lib"
       else
-      	 pbxlibdir="-L${SPEEX_DIR}"
+      	 pbxlibdir="-L${SQLITE_DIR}"
       fi
    fi
-   pbxfuncname="speex_encode"
+   pbxfuncname="sqlite_exec"
    if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_SPEEX_FOUND=yes
+      AST_SQLITE_FOUND=yes
    else
-      as_ac_Lib=`echo "ac_cv_lib_speex_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lspeex" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lspeex... $ECHO_C" >&6; }
+      as_ac_Lib=`echo "ac_cv_lib_sqlite_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lsqlite" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lsqlite... $ECHO_C" >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lspeex ${pbxlibdir} -lm $LIBS"
+LIBS="-lsqlite ${pbxlibdir}  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28176,26 +28174,26 @@ ac_res=`eval echo '${'$as_ac_Lib'}'`
 	       { echo "$as_me:$LINENO: result: $ac_res" >&5
 echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
-  AST_SPEEX_FOUND=yes
+  AST_SQLITE_FOUND=yes
 else
-  AST_SPEEX_FOUND=no
+  AST_SQLITE_FOUND=no
 fi
 
    fi
 
-   if test "${AST_SPEEX_FOUND}" = "yes"; then
-      SPEEX_LIB="-lspeex -lm"
-      SPEEX_HEADER_FOUND="1"
-      if test "x${SPEEX_DIR}" != "x"; then
-         SPEEX_LIB="${pbxlibdir} ${SPEEX_LIB}"
-	 SPEEX_INCLUDE="-I${SPEEX_DIR}/include"
+   if test "${AST_SQLITE_FOUND}" = "yes"; then
+      SQLITE_LIB="-lsqlite "
+      SQLITE_HEADER_FOUND="1"
+      if test "x${SQLITE_DIR}" != "x"; then
+         SQLITE_LIB="${pbxlibdir} ${SQLITE_LIB}"
+	 SQLITE_INCLUDE="-I${SQLITE_DIR}/include"
 	 saved_cppflags="${CPPFLAGS}"
-	 CPPFLAGS="${CPPFLAGS} -I${SPEEX_DIR}/include"
-	 if test "xspeex/speex.h" != "x" ; then
-	    as_ac_Header=`echo "ac_cv_header_${SPEEX_DIR}/include/speex/speex.h" | $as_tr_sh`
+	 CPPFLAGS="${CPPFLAGS} -I${SQLITE_DIR}/include"
+	 if test "xsqlite.h" != "x" ; then
+	    as_ac_Header=`echo "ac_cv_header_${SQLITE_DIR}/include/sqlite.h" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${SPEEX_DIR}/include/speex/speex.h" >&5
-echo $ECHO_N "checking for ${SPEEX_DIR}/include/speex/speex.h... $ECHO_C" >&6; }
+  { echo "$as_me:$LINENO: checking for ${SQLITE_DIR}/include/sqlite.h" >&5
+echo $ECHO_N "checking for ${SQLITE_DIR}/include/sqlite.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
@@ -28204,8 +28202,8 @@ ac_res=`eval echo '${'$as_ac_Header'}'`
 echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${SPEEX_DIR}/include/speex/speex.h usability" >&5
-echo $ECHO_N "checking ${SPEEX_DIR}/include/speex/speex.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${SQLITE_DIR}/include/sqlite.h usability" >&5
+echo $ECHO_N "checking ${SQLITE_DIR}/include/sqlite.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28213,7 +28211,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${SPEEX_DIR}/include/speex/speex.h>
+#include <${SQLITE_DIR}/include/sqlite.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -28245,15 +28243,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${SPEEX_DIR}/include/speex/speex.h presence" >&5
-echo $ECHO_N "checking ${SPEEX_DIR}/include/speex/speex.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${SQLITE_DIR}/include/sqlite.h presence" >&5
+echo $ECHO_N "checking ${SQLITE_DIR}/include/sqlite.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${SPEEX_DIR}/include/speex/speex.h>
+#include <${SQLITE_DIR}/include/sqlite.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -28286,30 +28284,30 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for ${SPEEX_DIR}/include/speex/speex.h" >&5
-echo $ECHO_N "checking for ${SPEEX_DIR}/include/speex/speex.h... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for ${SQLITE_DIR}/include/sqlite.h" >&5
+echo $ECHO_N "checking for ${SQLITE_DIR}/include/sqlite.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -28321,28 +28319,28 @@ echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  SPEEX_HEADER_FOUND=1
+  SQLITE_HEADER_FOUND=1
 else
-  SPEEX_HEADER_FOUND=0
+  SQLITE_HEADER_FOUND=0
 fi
 
 
 	 fi
 	 CPPFLAGS="${saved_cppflags}"
       else
-	 if test "xspeex/speex.h" != "x" ; then
-            if test "${ac_cv_header_speex_speex_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for speex/speex.h" >&5
-echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_speex_speex_h+set}" = set; then
+	 if test "xsqlite.h" != "x" ; then
+            if test "${ac_cv_header_sqlite_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for sqlite.h" >&5
+echo $ECHO_N "checking for sqlite.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sqlite_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_speex_speex_h" >&5
-echo "${ECHO_T}$ac_cv_header_speex_speex_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite_h" >&5
+echo "${ECHO_T}$ac_cv_header_sqlite_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking speex/speex.h usability" >&5
-echo $ECHO_N "checking speex/speex.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sqlite.h usability" >&5
+echo $ECHO_N "checking sqlite.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28350,7 +28348,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <speex/speex.h>
+#include <sqlite.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -28382,15 +28380,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking speex/speex.h presence" >&5
-echo $ECHO_N "checking speex/speex.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sqlite.h presence" >&5
+echo $ECHO_N "checking sqlite.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <speex/speex.h>
+#include <sqlite.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -28423,65 +28421,65 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: speex/speex.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: speex/speex.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sqlite.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sqlite.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: speex/speex.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: speex/speex.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: speex/speex.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: speex/speex.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: speex/speex.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: speex/speex.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: speex/speex.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: speex/speex.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: speex/speex.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: speex/speex.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: speex/speex.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: speex/speex.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sqlite.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sqlite.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sqlite.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sqlite.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sqlite.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sqlite.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for speex/speex.h" >&5
-echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_speex_speex_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for sqlite.h" >&5
+echo $ECHO_N "checking for sqlite.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sqlite_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_speex_speex_h=$ac_header_preproc
+  ac_cv_header_sqlite_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_speex_speex_h" >&5
-echo "${ECHO_T}$ac_cv_header_speex_speex_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite_h" >&5
+echo "${ECHO_T}$ac_cv_header_sqlite_h" >&6; }
 
 fi
-if test $ac_cv_header_speex_speex_h = yes; then
-  SPEEX_HEADER_FOUND=1
+if test $ac_cv_header_sqlite_h = yes; then
+  SQLITE_HEADER_FOUND=1
 else
-  SPEEX_HEADER_FOUND=0
+  SQLITE_HEADER_FOUND=0
 fi
 
 
 	 fi
       fi
-      if test "x${SPEEX_HEADER_FOUND}" = "x0" ; then
-         SPEEX_LIB=""
-         SPEEX_INCLUDE=""
+      if test "x${SQLITE_HEADER_FOUND}" = "x0" ; then
+         SQLITE_LIB=""
+         SQLITE_INCLUDE=""
       else
          if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
-	    SPEEX_LIB=""
+	    SQLITE_LIB=""
 	 fi
-         PBX_SPEEX=1
+         PBX_SQLITE=1
          # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SPEEX 1
+#define HAVE_SQLITE 1
 _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SPEEX_VERSION
+#define HAVE_SQLITE_VERSION
 _ACEOF
 
       fi
@@ -28490,27 +28488,27 @@ fi
 
 
 
-if test "x${PBX_SQLITE}" != "x1" -a "${USE_SQLITE}" != "no"; then
+if test "x${PBX_SQLITE3}" != "x1" -a "${USE_SQLITE3}" != "no"; then
    pbxlibdir=""
-   if test "x${SQLITE_DIR}" != "x"; then
-      if test -d ${SQLITE_DIR}/lib; then
-      	 pbxlibdir="-L${SQLITE_DIR}/lib"
+   if test "x${SQLITE3_DIR}" != "x"; then
+      if test -d ${SQLITE3_DIR}/lib; then
+      	 pbxlibdir="-L${SQLITE3_DIR}/lib"
       else
-      	 pbxlibdir="-L${SQLITE_DIR}"
+      	 pbxlibdir="-L${SQLITE3_DIR}"
       fi
    fi
-   pbxfuncname="sqlite_exec"
+   pbxfuncname="sqlite3_open"
    if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_SQLITE_FOUND=yes
+      AST_SQLITE3_FOUND=yes
    else
-      as_ac_Lib=`echo "ac_cv_lib_sqlite_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lsqlite" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lsqlite... $ECHO_C" >&6; }
+      as_ac_Lib=`echo "ac_cv_lib_sqlite3_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lsqlite3" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lsqlite3... $ECHO_C" >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsqlite ${pbxlibdir}  $LIBS"
+LIBS="-lsqlite3 ${pbxlibdir}  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28567,26 +28565,26 @@ ac_res=`eval echo '${'$as_ac_Lib'}'`
 	       { echo "$as_me:$LINENO: result: $ac_res" >&5
 echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
-  AST_SQLITE_FOUND=yes
+  AST_SQLITE3_FOUND=yes
 else
-  AST_SQLITE_FOUND=no
+  AST_SQLITE3_FOUND=no
 fi
 
    fi
 
-   if test "${AST_SQLITE_FOUND}" = "yes"; then
-      SQLITE_LIB="-lsqlite "
-      SQLITE_HEADER_FOUND="1"
-      if test "x${SQLITE_DIR}" != "x"; then
-         SQLITE_LIB="${pbxlibdir} ${SQLITE_LIB}"
-	 SQLITE_INCLUDE="-I${SQLITE_DIR}/include"
+   if test "${AST_SQLITE3_FOUND}" = "yes"; then
+      SQLITE3_LIB="-lsqlite3 "
+      SQLITE3_HEADER_FOUND="1"
+      if test "x${SQLITE3_DIR}" != "x"; then
+         SQLITE3_LIB="${pbxlibdir} ${SQLITE3_LIB}"
+	 SQLITE3_INCLUDE="-I${SQLITE3_DIR}/include"
 	 saved_cppflags="${CPPFLAGS}"
-	 CPPFLAGS="${CPPFLAGS} -I${SQLITE_DIR}/include"
-	 if test "xsqlite.h" != "x" ; then
-	    as_ac_Header=`echo "ac_cv_header_${SQLITE_DIR}/include/sqlite.h" | $as_tr_sh`
+	 CPPFLAGS="${CPPFLAGS} -I${SQLITE3_DIR}/include"
+	 if test "xsqlite3.h" != "x" ; then
+	    as_ac_Header=`echo "ac_cv_header_${SQLITE3_DIR}/include/sqlite3.h" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${SQLITE_DIR}/include/sqlite.h" >&5
-echo $ECHO_N "checking for ${SQLITE_DIR}/include/sqlite.h... $ECHO_C" >&6; }
+  { echo "$as_me:$LINENO: checking for ${SQLITE3_DIR}/include/sqlite3.h" >&5
+echo $ECHO_N "checking for ${SQLITE3_DIR}/include/sqlite3.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
@@ -28595,8 +28593,8 @@ ac_res=`eval echo '${'$as_ac_Header'}'`
 echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${SQLITE_DIR}/include/sqlite.h usability" >&5
-echo $ECHO_N "checking ${SQLITE_DIR}/include/sqlite.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${SQLITE3_DIR}/include/sqlite3.h usability" >&5
+echo $ECHO_N "checking ${SQLITE3_DIR}/include/sqlite3.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28604,7 +28602,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${SQLITE_DIR}/include/sqlite.h>
+#include <${SQLITE3_DIR}/include/sqlite3.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -28636,15 +28634,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${SQLITE_DIR}/include/sqlite.h presence" >&5
-echo $ECHO_N "checking ${SQLITE_DIR}/include/sqlite.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${SQLITE3_DIR}/include/sqlite3.h presence" >&5
+echo $ECHO_N "checking ${SQLITE3_DIR}/include/sqlite3.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${SQLITE_DIR}/include/sqlite.h>
+#include <${SQLITE3_DIR}/include/sqlite3.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -28677,30 +28675,30 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for ${SQLITE_DIR}/include/sqlite.h" >&5
-echo $ECHO_N "checking for ${SQLITE_DIR}/include/sqlite.h... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for ${SQLITE3_DIR}/include/sqlite3.h" >&5
+echo $ECHO_N "checking for ${SQLITE3_DIR}/include/sqlite3.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -28712,28 +28710,28 @@ echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  SQLITE_HEADER_FOUND=1
+  SQLITE3_HEADER_FOUND=1
 else
-  SQLITE_HEADER_FOUND=0
+  SQLITE3_HEADER_FOUND=0
 fi
 
 
 	 fi
 	 CPPFLAGS="${saved_cppflags}"
       else
-	 if test "xsqlite.h" != "x" ; then
-            if test "${ac_cv_header_sqlite_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for sqlite.h" >&5
-echo $ECHO_N "checking for sqlite.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sqlite_h+set}" = set; then
+	 if test "xsqlite3.h" != "x" ; then
+            if test "${ac_cv_header_sqlite3_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for sqlite3.h" >&5
+echo $ECHO_N "checking for sqlite3.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sqlite3_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite_h" >&5
-echo "${ECHO_T}$ac_cv_header_sqlite_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite3_h" >&5
+echo "${ECHO_T}$ac_cv_header_sqlite3_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking sqlite.h usability" >&5
-echo $ECHO_N "checking sqlite.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sqlite3.h usability" >&5
+echo $ECHO_N "checking sqlite3.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28741,7 +28739,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <sqlite.h>
+#include <sqlite3.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -28773,15 +28771,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking sqlite.h presence" >&5
-echo $ECHO_N "checking sqlite.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sqlite3.h presence" >&5
+echo $ECHO_N "checking sqlite3.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sqlite.h>
+#include <sqlite3.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -28814,65 +28812,65 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: sqlite.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: sqlite.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sqlite.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: sqlite.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite3.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sqlite3.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: sqlite.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sqlite.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sqlite.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sqlite.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sqlite.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: sqlite.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sqlite.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: sqlite.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sqlite.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sqlite.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sqlite.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: sqlite.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite3.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sqlite3.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite3.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sqlite3.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite3.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sqlite3.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite3.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sqlite3.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite3.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sqlite3.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sqlite3.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sqlite3.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for sqlite.h" >&5
-echo $ECHO_N "checking for sqlite.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sqlite_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for sqlite3.h" >&5
+echo $ECHO_N "checking for sqlite3.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sqlite3_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_sqlite_h=$ac_header_preproc
+  ac_cv_header_sqlite3_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite_h" >&5
-echo "${ECHO_T}$ac_cv_header_sqlite_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite3_h" >&5
+echo "${ECHO_T}$ac_cv_header_sqlite3_h" >&6; }
 
 fi
-if test $ac_cv_header_sqlite_h = yes; then
-  SQLITE_HEADER_FOUND=1
+if test $ac_cv_header_sqlite3_h = yes; then
+  SQLITE3_HEADER_FOUND=1
 else
-  SQLITE_HEADER_FOUND=0
+  SQLITE3_HEADER_FOUND=0
 fi
 
 
 	 fi
       fi
-      if test "x${SQLITE_HEADER_FOUND}" = "x0" ; then
-         SQLITE_LIB=""
-         SQLITE_INCLUDE=""
+      if test "x${SQLITE3_HEADER_FOUND}" = "x0" ; then
+         SQLITE3_LIB=""
+         SQLITE3_INCLUDE=""
       else
          if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
-	    SQLITE_LIB=""
+	    SQLITE3_LIB=""
 	 fi
-         PBX_SQLITE=1
+         PBX_SQLITE3=1
          # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SQLITE 1
+#define HAVE_SQLITE3 1
 _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SQLITE_VERSION
+#define HAVE_SQLITE3_VERSION
 _ACEOF
 
       fi
@@ -28881,27 +28879,27 @@ fi
 
 
 
-if test "x${PBX_SQLITE3}" != "x1" -a "${USE_SQLITE3}" != "no"; then
+if test "x${PBX_CRYPTO}" != "x1" -a "${USE_CRYPTO}" != "no"; then
    pbxlibdir=""
-   if test "x${SQLITE3_DIR}" != "x"; then
-      if test -d ${SQLITE3_DIR}/lib; then
-      	 pbxlibdir="-L${SQLITE3_DIR}/lib"
+   if test "x${CRYPTO_DIR}" != "x"; then
+      if test -d ${CRYPTO_DIR}/lib; then
+      	 pbxlibdir="-L${CRYPTO_DIR}/lib"
       else
-      	 pbxlibdir="-L${SQLITE3_DIR}"
+      	 pbxlibdir="-L${CRYPTO_DIR}"
       fi
    fi
-   pbxfuncname="sqlite3_open"
+   pbxfuncname="AES_encrypt"
    if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_SQLITE3_FOUND=yes
+      AST_CRYPTO_FOUND=yes
    else
-      as_ac_Lib=`echo "ac_cv_lib_sqlite3_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lsqlite3" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lsqlite3... $ECHO_C" >&6; }
+      as_ac_Lib=`echo "ac_cv_lib_crypto_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lcrypto" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lcrypto... $ECHO_C" >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsqlite3 ${pbxlibdir}  $LIBS"
+LIBS="-lcrypto ${pbxlibdir}  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28958,26 +28956,26 @@ ac_res=`eval echo '${'$as_ac_Lib'}'`
 	       { echo "$as_me:$LINENO: result: $ac_res" >&5
 echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
-  AST_SQLITE3_FOUND=yes
+  AST_CRYPTO_FOUND=yes
 else
-  AST_SQLITE3_FOUND=no
+  AST_CRYPTO_FOUND=no
 fi
 
    fi
 
-   if test "${AST_SQLITE3_FOUND}" = "yes"; then
-      SQLITE3_LIB="-lsqlite3 "
-      SQLITE3_HEADER_FOUND="1"
-      if test "x${SQLITE3_DIR}" != "x"; then
-         SQLITE3_LIB="${pbxlibdir} ${SQLITE3_LIB}"
-	 SQLITE3_INCLUDE="-I${SQLITE3_DIR}/include"
+   if test "${AST_CRYPTO_FOUND}" = "yes"; then
+      CRYPTO_LIB="-lcrypto "
+      CRYPTO_HEADER_FOUND="1"
+      if test "x${CRYPTO_DIR}" != "x"; then
+         CRYPTO_LIB="${pbxlibdir} ${CRYPTO_LIB}"
+	 CRYPTO_INCLUDE="-I${CRYPTO_DIR}/include"
 	 saved_cppflags="${CPPFLAGS}"
-	 CPPFLAGS="${CPPFLAGS} -I${SQLITE3_DIR}/include"
-	 if test "xsqlite3.h" != "x" ; then
-	    as_ac_Header=`echo "ac_cv_header_${SQLITE3_DIR}/include/sqlite3.h" | $as_tr_sh`
+	 CPPFLAGS="${CPPFLAGS} -I${CRYPTO_DIR}/include"
+	 if test "xopenssl/aes.h" != "x" ; then
+	    as_ac_Header=`echo "ac_cv_header_${CRYPTO_DIR}/include/openssl/aes.h" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${SQLITE3_DIR}/include/sqlite3.h" >&5
-echo $ECHO_N "checking for ${SQLITE3_DIR}/include/sqlite3.h... $ECHO_C" >&6; }
+  { echo "$as_me:$LINENO: checking for ${CRYPTO_DIR}/include/openssl/aes.h" >&5
+echo $ECHO_N "checking for ${CRYPTO_DIR}/include/openssl/aes.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
@@ -28986,8 +28984,8 @@ ac_res=`eval echo '${'$as_ac_Header'}'`
 echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${SQLITE3_DIR}/include/sqlite3.h usability" >&5
-echo $ECHO_N "checking ${SQLITE3_DIR}/include/sqlite3.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${CRYPTO_DIR}/include/openssl/aes.h usability" >&5
+echo $ECHO_N "checking ${CRYPTO_DIR}/include/openssl/aes.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28995,7 +28993,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${SQLITE3_DIR}/include/sqlite3.h>
+#include <${CRYPTO_DIR}/include/openssl/aes.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -29027,15 +29025,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${SQLITE3_DIR}/include/sqlite3.h presence" >&5
-echo $ECHO_N "checking ${SQLITE3_DIR}/include/sqlite3.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${CRYPTO_DIR}/include/openssl/aes.h presence" >&5
+echo $ECHO_N "checking ${CRYPTO_DIR}/include/openssl/aes.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${SQLITE3_DIR}/include/sqlite3.h>
+#include <${CRYPTO_DIR}/include/openssl/aes.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -29065,33 +29063,33 @@ rm -f conftest.err conftest.$ac_ext
 { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: proceeding with the compiler's result" >&2;}
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${SQLITE3_DIR}/include/sqlite3.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for ${SQLITE3_DIR}/include/sqlite3.h" >&5
-echo $ECHO_N "checking for ${SQLITE3_DIR}/include/sqlite3.h... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for ${CRYPTO_DIR}/include/openssl/aes.h" >&5
+echo $ECHO_N "checking for ${CRYPTO_DIR}/include/openssl/aes.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -29103,28 +29101,28 @@ echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  SQLITE3_HEADER_FOUND=1
+  CRYPTO_HEADER_FOUND=1
 else
-  SQLITE3_HEADER_FOUND=0
+  CRYPTO_HEADER_FOUND=0
 fi
 
 
 	 fi
 	 CPPFLAGS="${saved_cppflags}"
       else
-	 if test "xsqlite3.h" != "x" ; then
-            if test "${ac_cv_header_sqlite3_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for sqlite3.h" >&5
-echo $ECHO_N "checking for sqlite3.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sqlite3_h+set}" = set; then
+	 if test "xopenssl/aes.h" != "x" ; then
+            if test "${ac_cv_header_openssl_aes_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for openssl/aes.h" >&5
+echo $ECHO_N "checking for openssl/aes.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_openssl_aes_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite3_h" >&5
-echo "${ECHO_T}$ac_cv_header_sqlite3_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_aes_h" >&5
+echo "${ECHO_T}$ac_cv_header_openssl_aes_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking sqlite3.h usability" >&5
-echo $ECHO_N "checking sqlite3.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking openssl/aes.h usability" >&5
+echo $ECHO_N "checking openssl/aes.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29132,7 +29130,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <sqlite3.h>
+#include <openssl/aes.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -29164,15 +29162,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking sqlite3.h presence" >&5
-echo $ECHO_N "checking sqlite3.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking openssl/aes.h presence" >&5
+echo $ECHO_N "checking openssl/aes.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sqlite3.h>
+#include <openssl/aes.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -29205,65 +29203,65 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sqlite3.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: sqlite3.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/aes.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: openssl/aes.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/aes.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: openssl/aes.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: sqlite3.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sqlite3.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sqlite3.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sqlite3.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sqlite3.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: sqlite3.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sqlite3.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: sqlite3.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sqlite3.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sqlite3.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sqlite3.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: sqlite3.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/aes.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: openssl/aes.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/aes.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: openssl/aes.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/aes.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: openssl/aes.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/aes.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: openssl/aes.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/aes.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: openssl/aes.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/aes.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: openssl/aes.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for sqlite3.h" >&5
-echo $ECHO_N "checking for sqlite3.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sqlite3_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for openssl/aes.h" >&5
+echo $ECHO_N "checking for openssl/aes.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_openssl_aes_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_sqlite3_h=$ac_header_preproc
+  ac_cv_header_openssl_aes_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite3_h" >&5
-echo "${ECHO_T}$ac_cv_header_sqlite3_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_aes_h" >&5
+echo "${ECHO_T}$ac_cv_header_openssl_aes_h" >&6; }
 
 fi
-if test $ac_cv_header_sqlite3_h = yes; then
-  SQLITE3_HEADER_FOUND=1
+if test $ac_cv_header_openssl_aes_h = yes; then
+  CRYPTO_HEADER_FOUND=1
 else
-  SQLITE3_HEADER_FOUND=0
+  CRYPTO_HEADER_FOUND=0
 fi
 
 
 	 fi
       fi
-      if test "x${SQLITE3_HEADER_FOUND}" = "x0" ; then
-         SQLITE3_LIB=""
-         SQLITE3_INCLUDE=""
+      if test "x${CRYPTO_HEADER_FOUND}" = "x0" ; then
+         CRYPTO_LIB=""
+         CRYPTO_INCLUDE=""
       else
          if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
-	    SQLITE3_LIB=""
+	    CRYPTO_LIB=""
 	 fi
-         PBX_SQLITE3=1
+         PBX_CRYPTO=1
          # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SQLITE3 1
+#define HAVE_CRYPTO 1
 _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SQLITE3_VERSION
+#define HAVE_CRYPTO_VERSION
 _ACEOF
 
       fi
@@ -29271,28 +29269,30 @@ _ACEOF
 fi
 
 
+if test "$PBX_CRYPTO" = "1";
+then
 
-if test "x${PBX_CRYPTO}" != "x1" -a "${USE_CRYPTO}" != "no"; then
+if test "x${PBX_OPENSSL}" != "x1" -a "${USE_OPENSSL}" != "no"; then
    pbxlibdir=""
-   if test "x${CRYPTO_DIR}" != "x"; then
-      if test -d ${CRYPTO_DIR}/lib; then
-      	 pbxlibdir="-L${CRYPTO_DIR}/lib"
+   if test "x${OPENSSL_DIR}" != "x"; then
+      if test -d ${OPENSSL_DIR}/lib; then
+      	 pbxlibdir="-L${OPENSSL_DIR}/lib"
       else
-      	 pbxlibdir="-L${CRYPTO_DIR}"
+      	 pbxlibdir="-L${OPENSSL_DIR}"
       fi
    fi
-   pbxfuncname="AES_encrypt"
+   pbxfuncname="ssl2_connect"
    if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_CRYPTO_FOUND=yes
+      AST_OPENSSL_FOUND=yes
    else
-      as_ac_Lib=`echo "ac_cv_lib_crypto_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lcrypto" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lcrypto... $ECHO_C" >&6; }
+      as_ac_Lib=`echo "ac_cv_lib_ssl_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lssl" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lssl... $ECHO_C" >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto ${pbxlibdir}  $LIBS"
+LIBS="-lssl ${pbxlibdir} -lcrypto $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29349,26 +29349,26 @@ ac_res=`eval echo '${'$as_ac_Lib'}'`
 	       { echo "$as_me:$LINENO: result: $ac_res" >&5
 echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
-  AST_CRYPTO_FOUND=yes
+  AST_OPENSSL_FOUND=yes
 else
-  AST_CRYPTO_FOUND=no
+  AST_OPENSSL_FOUND=no
 fi
 
    fi
 
-   if test "${AST_CRYPTO_FOUND}" = "yes"; then
-      CRYPTO_LIB="-lcrypto "
-      CRYPTO_HEADER_FOUND="1"
-      if test "x${CRYPTO_DIR}" != "x"; then
-         CRYPTO_LIB="${pbxlibdir} ${CRYPTO_LIB}"
-	 CRYPTO_INCLUDE="-I${CRYPTO_DIR}/include"
+   if test "${AST_OPENSSL_FOUND}" = "yes"; then
+      OPENSSL_LIB="-lssl -lcrypto"
+      OPENSSL_HEADER_FOUND="1"
+      if test "x${OPENSSL_DIR}" != "x"; then
+         OPENSSL_LIB="${pbxlibdir} ${OPENSSL_LIB}"
+	 OPENSSL_INCLUDE="-I${OPENSSL_DIR}/include"
 	 saved_cppflags="${CPPFLAGS}"
-	 CPPFLAGS="${CPPFLAGS} -I${CRYPTO_DIR}/include"
-	 if test "xopenssl/aes.h" != "x" ; then
-	    as_ac_Header=`echo "ac_cv_header_${CRYPTO_DIR}/include/openssl/aes.h" | $as_tr_sh`
+	 CPPFLAGS="${CPPFLAGS} -I${OPENSSL_DIR}/include"
+	 if test "xopenssl/ssl.h" != "x" ; then
+	    as_ac_Header=`echo "ac_cv_header_${OPENSSL_DIR}/include/openssl/ssl.h" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${CRYPTO_DIR}/include/openssl/aes.h" >&5
-echo $ECHO_N "checking for ${CRYPTO_DIR}/include/openssl/aes.h... $ECHO_C" >&6; }
+  { echo "$as_me:$LINENO: checking for ${OPENSSL_DIR}/include/openssl/ssl.h" >&5
+echo $ECHO_N "checking for ${OPENSSL_DIR}/include/openssl/ssl.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
@@ -29377,8 +29377,8 @@ ac_res=`eval echo '${'$as_ac_Header'}'`
 echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${CRYPTO_DIR}/include/openssl/aes.h usability" >&5
-echo $ECHO_N "checking ${CRYPTO_DIR}/include/openssl/aes.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${OPENSSL_DIR}/include/openssl/ssl.h usability" >&5
+echo $ECHO_N "checking ${OPENSSL_DIR}/include/openssl/ssl.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29386,7 +29386,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${CRYPTO_DIR}/include/openssl/aes.h>
+#include <${OPENSSL_DIR}/include/openssl/ssl.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -29418,15 +29418,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${CRYPTO_DIR}/include/openssl/aes.h presence" >&5
-echo $ECHO_N "checking ${CRYPTO_DIR}/include/openssl/aes.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${OPENSSL_DIR}/include/openssl/ssl.h presence" >&5
+echo $ECHO_N "checking ${OPENSSL_DIR}/include/openssl/ssl.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${CRYPTO_DIR}/include/openssl/aes.h>
+#include <${OPENSSL_DIR}/include/openssl/ssl.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -29459,30 +29459,30 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${CRYPTO_DIR}/include/openssl/aes.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for ${CRYPTO_DIR}/include/openssl/aes.h" >&5
-echo $ECHO_N "checking for ${CRYPTO_DIR}/include/openssl/aes.h... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for ${OPENSSL_DIR}/include/openssl/ssl.h" >&5
+echo $ECHO_N "checking for ${OPENSSL_DIR}/include/openssl/ssl.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -29494,28 +29494,28 @@ echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  CRYPTO_HEADER_FOUND=1
+  OPENSSL_HEADER_FOUND=1
 else
-  CRYPTO_HEADER_FOUND=0
+  OPENSSL_HEADER_FOUND=0
 fi
 
 
 	 fi
 	 CPPFLAGS="${saved_cppflags}"
       else
-	 if test "xopenssl/aes.h" != "x" ; then
-            if test "${ac_cv_header_openssl_aes_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for openssl/aes.h" >&5
-echo $ECHO_N "checking for openssl/aes.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_openssl_aes_h+set}" = set; then
+	 if test "xopenssl/ssl.h" != "x" ; then
+            if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
+echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_aes_h" >&5
-echo "${ECHO_T}$ac_cv_header_openssl_aes_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5
+echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking openssl/aes.h usability" >&5
-echo $ECHO_N "checking openssl/aes.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking openssl/ssl.h usability" >&5
+echo $ECHO_N "checking openssl/ssl.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29523,7 +29523,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <openssl/aes.h>
+#include <openssl/ssl.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -29555,15 +29555,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking openssl/aes.h presence" >&5
-echo $ECHO_N "checking openssl/aes.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking openssl/ssl.h presence" >&5
+echo $ECHO_N "checking openssl/ssl.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <openssl/aes.h>
+#include <openssl/ssl.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -29596,96 +29596,97 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: openssl/aes.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: openssl/aes.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/aes.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: openssl/aes.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: openssl/aes.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: openssl/aes.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/aes.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: openssl/aes.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/aes.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: openssl/aes.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/aes.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: openssl/aes.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/aes.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: openssl/aes.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/aes.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: openssl/aes.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: openssl/ssl.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: openssl/ssl.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: openssl/ssl.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: openssl/ssl.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for openssl/aes.h" >&5
-echo $ECHO_N "checking for openssl/aes.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_openssl_aes_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
+echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_openssl_aes_h=$ac_header_preproc
+  ac_cv_header_openssl_ssl_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_aes_h" >&5
-echo "${ECHO_T}$ac_cv_header_openssl_aes_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5
+echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6; }
 
 fi
-if test $ac_cv_header_openssl_aes_h = yes; then
-  CRYPTO_HEADER_FOUND=1
+if test $ac_cv_header_openssl_ssl_h = yes; then
+  OPENSSL_HEADER_FOUND=1
 else
-  CRYPTO_HEADER_FOUND=0
+  OPENSSL_HEADER_FOUND=0
 fi
 
 
 	 fi
       fi
-      if test "x${CRYPTO_HEADER_FOUND}" = "x0" ; then
-         CRYPTO_LIB=""
-         CRYPTO_INCLUDE=""
+      if test "x${OPENSSL_HEADER_FOUND}" = "x0" ; then
+         OPENSSL_LIB=""
+         OPENSSL_INCLUDE=""
       else
          if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
-	    CRYPTO_LIB=""
+	    OPENSSL_LIB=""
 	 fi
-         PBX_CRYPTO=1
+         PBX_OPENSSL=1
          # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_CRYPTO 1
+#define HAVE_OPENSSL 1
 _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_CRYPTO_VERSION
+#define HAVE_OPENSSL_VERSION
 _ACEOF
 
       fi
    fi
 fi
 
+fi
 
-if test "${PBX_CRYPTO}" != "0";
+if test "$PBX_OPENSSL" = "1";
 then
 
-if test "x${PBX_OPENSSL}" != "x1" -a "${USE_OPENSSL}" != "no"; then
+if test "x${PBX_OSPTK}" != "x1" -a "${USE_OSPTK}" != "no"; then
    pbxlibdir=""
-   if test "x${OPENSSL_DIR}" != "x"; then
-      if test -d ${OPENSSL_DIR}/lib; then
-      	 pbxlibdir="-L${OPENSSL_DIR}/lib"
+   if test "x${OSPTK_DIR}" != "x"; then
+      if test -d ${OSPTK_DIR}/lib; then
+      	 pbxlibdir="-L${OSPTK_DIR}/lib"
       else
-      	 pbxlibdir="-L${OPENSSL_DIR}"
+      	 pbxlibdir="-L${OSPTK_DIR}"
       fi
    fi
-   pbxfuncname="ssl2_connect"
+   pbxfuncname="OSPPCryptoDecrypt"
    if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_OPENSSL_FOUND=yes
+      AST_OSPTK_FOUND=yes
    else
-      as_ac_Lib=`echo "ac_cv_lib_ssl_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lssl" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lssl... $ECHO_C" >&6; }
+      as_ac_Lib=`echo "ac_cv_lib_osptk_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -losptk" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -losptk... $ECHO_C" >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lssl ${pbxlibdir} -lcrypto $LIBS"
+LIBS="-losptk ${pbxlibdir} -lcrypto -lssl $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29742,26 +29743,26 @@ ac_res=`eval echo '${'$as_ac_Lib'}'`
 	       { echo "$as_me:$LINENO: result: $ac_res" >&5
 echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
-  AST_OPENSSL_FOUND=yes
+  AST_OSPTK_FOUND=yes
 else
-  AST_OPENSSL_FOUND=no
+  AST_OSPTK_FOUND=no
 fi
 
    fi
 
-   if test "${AST_OPENSSL_FOUND}" = "yes"; then
-      OPENSSL_LIB="-lssl -lcrypto"
-      OPENSSL_HEADER_FOUND="1"
-      if test "x${OPENSSL_DIR}" != "x"; then
-         OPENSSL_LIB="${pbxlibdir} ${OPENSSL_LIB}"
-	 OPENSSL_INCLUDE="-I${OPENSSL_DIR}/include"
+   if test "${AST_OSPTK_FOUND}" = "yes"; then
+      OSPTK_LIB="-losptk -lcrypto -lssl"
+      OSPTK_HEADER_FOUND="1"
+      if test "x${OSPTK_DIR}" != "x"; then
+         OSPTK_LIB="${pbxlibdir} ${OSPTK_LIB}"
+	 OSPTK_INCLUDE="-I${OSPTK_DIR}/include"
 	 saved_cppflags="${CPPFLAGS}"
-	 CPPFLAGS="${CPPFLAGS} -I${OPENSSL_DIR}/include"
-	 if test "xopenssl/ssl.h" != "x" ; then
-	    as_ac_Header=`echo "ac_cv_header_${OPENSSL_DIR}/include/openssl/ssl.h" | $as_tr_sh`
+	 CPPFLAGS="${CPPFLAGS} -I${OSPTK_DIR}/include"
+	 if test "xosp/osp.h" != "x" ; then
+	    as_ac_Header=`echo "ac_cv_header_${OSPTK_DIR}/include/osp/osp.h" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${OPENSSL_DIR}/include/openssl/ssl.h" >&5
-echo $ECHO_N "checking for ${OPENSSL_DIR}/include/openssl/ssl.h... $ECHO_C" >&6; }
+  { echo "$as_me:$LINENO: checking for ${OSPTK_DIR}/include/osp/osp.h" >&5
+echo $ECHO_N "checking for ${OSPTK_DIR}/include/osp/osp.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
@@ -29770,8 +29771,8 @@ ac_res=`eval echo '${'$as_ac_Header'}'`
 echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${OPENSSL_DIR}/include/openssl/ssl.h usability" >&5
-echo $ECHO_N "checking ${OPENSSL_DIR}/include/openssl/ssl.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${OSPTK_DIR}/include/osp/osp.h usability" >&5
+echo $ECHO_N "checking ${OSPTK_DIR}/include/osp/osp.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29779,7 +29780,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${OPENSSL_DIR}/include/openssl/ssl.h>
+#include <${OSPTK_DIR}/include/osp/osp.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -29811,15 +29812,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${OPENSSL_DIR}/include/openssl/ssl.h presence" >&5
-echo $ECHO_N "checking ${OPENSSL_DIR}/include/openssl/ssl.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${OSPTK_DIR}/include/osp/osp.h presence" >&5
+echo $ECHO_N "checking ${OSPTK_DIR}/include/osp/osp.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${OPENSSL_DIR}/include/openssl/ssl.h>
+#include <${OSPTK_DIR}/include/osp/osp.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -29852,30 +29853,30 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for ${OPENSSL_DIR}/include/openssl/ssl.h" >&5
-echo $ECHO_N "checking for ${OPENSSL_DIR}/include/openssl/ssl.h... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for ${OSPTK_DIR}/include/osp/osp.h" >&5
+echo $ECHO_N "checking for ${OSPTK_DIR}/include/osp/osp.h... $ECHO_C" >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -29887,28 +29888,28 @@ echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  OPENSSL_HEADER_FOUND=1
+  OSPTK_HEADER_FOUND=1
 else
-  OPENSSL_HEADER_FOUND=0
+  OSPTK_HEADER_FOUND=0
 fi
 
 
 	 fi
 	 CPPFLAGS="${saved_cppflags}"
       else
-	 if test "xopenssl/ssl.h" != "x" ; then
-            if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
-echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
+	 if test "xosp/osp.h" != "x" ; then
+            if test "${ac_cv_header_osp_osp_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for osp/osp.h" >&5
+echo $ECHO_N "checking for osp/osp.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_osp_osp_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5
-echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_osp_osp_h" >&5
+echo "${ECHO_T}$ac_cv_header_osp_osp_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking openssl/ssl.h usability" >&5
-echo $ECHO_N "checking openssl/ssl.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking osp/osp.h usability" >&5
+echo $ECHO_N "checking osp/osp.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29916,7 +29917,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <openssl/ssl.h>
+#include <osp/osp.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -29948,15 +29949,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking openssl/ssl.h presence" >&5
-echo $ECHO_N "checking openssl/ssl.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking osp/osp.h presence" >&5
+echo $ECHO_N "checking osp/osp.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <openssl/ssl.h>
+#include <osp/osp.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -29989,65 +29990,65 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: osp/osp.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: osp/osp.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: osp/osp.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: osp/osp.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: openssl/ssl.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: openssl/ssl.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: openssl/ssl.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: openssl/ssl.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: osp/osp.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: osp/osp.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: osp/osp.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: osp/osp.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: osp/osp.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: osp/osp.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: osp/osp.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: osp/osp.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: osp/osp.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: osp/osp.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: osp/osp.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: osp/osp.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
-echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for osp/osp.h" >&5
+echo $ECHO_N "checking for osp/osp.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_osp_osp_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_openssl_ssl_h=$ac_header_preproc
+  ac_cv_header_osp_osp_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5
-echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_osp_osp_h" >&5
+echo "${ECHO_T}$ac_cv_header_osp_osp_h" >&6; }
 
 fi
-if test $ac_cv_header_openssl_ssl_h = yes; then
-  OPENSSL_HEADER_FOUND=1
+if test $ac_cv_header_osp_osp_h = yes; then
+  OSPTK_HEADER_FOUND=1
 else
-  OPENSSL_HEADER_FOUND=0
+  OSPTK_HEADER_FOUND=0
 fi
 
 
 	 fi
       fi
-      if test "x${OPENSSL_HEADER_FOUND}" = "x0" ; then
-         OPENSSL_LIB=""
-         OPENSSL_INCLUDE=""
+      if test "x${OSPTK_HEADER_FOUND}" = "x0" ; then
+         OSPTK_LIB=""
+         OSPTK_INCLUDE=""
       else
          if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
-	    OPENSSL_LIB=""
+	    OSPTK_LIB=""
 	 fi
-         PBX_OPENSSL=1
+         PBX_OSPTK=1
          # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_OPENSSL 1
+#define HAVE_OSPTK 1
 _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_OPENSSL_VERSION
+#define HAVE_OSPTK_VERSION
 _ACEOF
 
       fi
diff --git a/configure.ac b/configure.ac
index 1e85808a9e..22206d4f6e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -186,7 +186,7 @@ AST_EXT_LIB_SETUP([BKTR], [Stack Backtrace support], [execinfo])
 AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
-AST_EXT_LIB_SETUP([CRYPTO], [OpenSSL Cryptography Support], [crypto])
+AST_EXT_LIB_SETUP([CRYPTO], [OpenSSL Cryptography support], [crypto])
 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
@@ -214,7 +214,7 @@ AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
 AST_EXT_LIB_SETUP([SQLITE3], [SQLite], [sqlite3])
 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
-AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
+AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL Secure Sockets Layer support], [ssl])
 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
@@ -675,11 +675,6 @@ AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
 
 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
 
-if test "$PBX_OPENSSL" = "1";
-then
-    AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
-fi
-
 AST_EXT_LIB_CHECK([BKTR], [execinfo], [backtrace], [execinfo.h], [-lexecinfo])
 
 # possible places for oss definitions
@@ -849,11 +844,16 @@ AST_EXT_LIB_CHECK([SQLITE3], [sqlite3], [sqlite3_open], [sqlite3.h])
 
 AST_EXT_LIB_CHECK([CRYPTO], [crypto], [AES_encrypt], [openssl/aes.h])
 
-if test "${PBX_CRYPTO}" != "0";
+if test "$PBX_CRYPTO" = "1";
 then
     AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
 fi
 
+if test "$PBX_OPENSSL" = "1";
+then
+    AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
+fi
+
 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
 if test "${PBX_FREETDS}" != "0";
 then
-- 
GitLab