]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 182722 via svnmerge from
authorJeff Peeler <jpeeler@digium.com>
Tue, 17 Mar 2009 20:52:54 +0000 (20:52 +0000)
committerJeff Peeler <jpeeler@digium.com>
Tue, 17 Mar 2009 20:52:54 +0000 (20:52 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
  r182722 | jpeeler | 2009-03-17 15:47:31 -0500 (Tue, 17 Mar 2009) | 15 lines

  Allow H.323 Plus library to be used in addition to the OpenH323 library

  Chan_h323 can now be compiled against both the previously supported versions of
  OpenH323 as well as the current H.323 Plus (version 1.20.2). The configure
  script has been modified to look in the default install location of h323 to
  hopefully help avoid using the environment variables OPENH323DIR and PWLIBDIR.
  Also, the CLI command "h323 show version" has been added which indicates which
  version of h323 is in use.

  (closes issue #11261)
  Reported by: vhatz
  Patches:
        asterisk-1.6.0.6-h323plus.patch uploaded by jthurman (license 614)
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@182724 65c4cc65-6c06-0410-ace0-fbb531ad65f3

autoconf/ast_check_openh323.m4
channels/chan_h323.c
channels/h323/ast_h323.cxx
channels/h323/ast_h323.h
channels/h323/chan_h323.h
channels/h323/compat_h323.cxx
channels/h323/compat_h323.h
configure

index b3dfb925f2ab886660fe11ff5adb2d882b94e5e2..35f8a544be96b3adce54dcf8a98f8eb657e96724 100644 (file)
@@ -16,19 +16,19 @@ if test "${HAS_OPENH323:-unset}" = "unset" ; then
   else
     saved_cppflags="${CPPFLAGS}"
     CPPFLAGS="${CPPFLAGS} -I${HOME}/openh323/include -I${PWLIB_INCDIR}"
-    AC_CHECK_HEADER(${HOME}/openh323/include/h323.h, HAS_OPENH323=1, )
+    AC_CHECK_HEADER(${HOME}/openh323/include/h323.h, HAS_OPENH323=1, , [#include <ptlib.h>])
     CPPFLAGS="${saved_cppflags}"
     if test "${HAS_OPENH323:-unset}" != "unset" ; then
       OPENH323DIR="${HOME}/openh323"
     else
       saved_cppflags="${CPPFLAGS}"
       CPPFLAGS="${CPPFLAGS} -I/usr/local/include/openh323 -I${PWLIB_INCDIR}"
-      AC_CHECK_HEADER(/usr/local/include/openh323/h323.h, HAS_OPENH323=1, )
+      AC_CHECK_HEADER(/usr/local/include/openh323/h323.h, HAS_OPENH323=1, , [#include <ptlib.h>])
       CPPFLAGS="${saved_cppflags}"
       if test "${HAS_OPENH323:-unset}" != "unset" ; then
         OPENH323DIR="/usr/local/share/openh323"
         OPENH323_INCDIR="/usr/local/include/openh323"
-        if test "x$LIB64" != "x"; then
+        if test "x$LIB64" != "x" && test -d "/usr/local/lib64"; then
           OPENH323_LIBDIR="/usr/local/lib64"
         else
           OPENH323_LIBDIR="/usr/local/lib"
@@ -41,7 +41,7 @@ if test "${HAS_OPENH323:-unset}" = "unset" ; then
         if test "${HAS_OPENH323:-unset}" != "unset" ; then
           OPENH323DIR="/usr/share/openh323"
           OPENH323_INCDIR="/usr/include/openh323"
-          if test "x$LIB64" != "x"; then
+          if test "x$LIB64" != "x" && test -d "/usr/local/lib64"; then
             OPENH323_LIBDIR="/usr/lib64"
           else
             OPENH323_LIBDIR="/usr/lib"
@@ -77,7 +77,12 @@ AC_DEFUN([AST_CHECK_OPENH323_BUILD], [
                OPENH323_SUFFIX=
                prefixes="h323_${PWLIB_PLATFORM}_ h323_ openh323"
                for pfx in $prefixes; do
+                       #files=`ls -l /usr/local/lib/lib${pfx}*.so* 2>/dev/null`
                        files=`ls -l ${OPENH323_LIBDIR}/lib${pfx}*.so* 2>/dev/null`
+                       if test -z "$files"; then
+                               # check the default location
+                               files=`ls -l /usr/local/lib/lib${pfx}*.so* 2>/dev/null`
+                       fi
                        libfile=
                        if test -n "$files"; then
                                for f in $files; do
index e98f4b029937b7bc8e846c87799631fcbaac9876..e7b06456f92366d18c1261d210b41a00b073e360 100644 (file)
@@ -2735,12 +2735,34 @@ static char *handle_cli_h323_show_tokens(struct ast_cli_entry *e, int cmd, struc
        return CLI_SUCCESS;
 }
 
+static char *handle_cli_h323_show_version(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+       switch (cmd) {
+       case CLI_INIT:
+               e->command = "h323 show version";
+               e->usage =
+                       "Usage: h323 show version\n"
+                       "               Show the version of the H.323 library in use\n";
+               return NULL;
+       case CLI_GENERATE:
+               return NULL;
+       }
+
+       if (a->argc != 3)
+               return CLI_SHOWUSAGE;
+
+       h323_show_version();
+       
+       return CLI_SUCCESS;
+}
+
 static struct ast_cli_entry cli_h323[] = {
-       AST_CLI_DEFINE(handle_cli_h323_set_trace,   "Enable/Disable H.323 Stack Tracing"),
-       AST_CLI_DEFINE(handle_cli_h323_set_debug,   "Enable/Disable H.323 Debugging"),
-       AST_CLI_DEFINE(handle_cli_h323_cycle_gk,    "Manually re-register with the Gatekeper"),
-       AST_CLI_DEFINE(handle_cli_h323_hangup,      "Manually try to hang up a call"),
-       AST_CLI_DEFINE(handle_cli_h323_show_tokens, "Show all active call tokens"),
+       AST_CLI_DEFINE(handle_cli_h323_set_trace,    "Enable/Disable H.323 Stack Tracing"),
+       AST_CLI_DEFINE(handle_cli_h323_set_debug,    "Enable/Disable H.323 Debugging"),
+       AST_CLI_DEFINE(handle_cli_h323_cycle_gk,     "Manually re-register with the Gatekeper"),
+       AST_CLI_DEFINE(handle_cli_h323_hangup,       "Manually try to hang up a call"),
+       AST_CLI_DEFINE(handle_cli_h323_show_tokens,  "Show all active call tokens"),
+       AST_CLI_DEFINE(handle_cli_h323_show_version, "Show the version of the H.323 library in use"),
 };
 
 static void delete_users(void)
index 747853aa367fcf8a17d1e144a07e88085b3196ac..30ff0c5b1c9060da7908ff147a63e051fa3083bf 100644 (file)
@@ -29,6 +29,7 @@
  * Version Info: $Id$
  */
 #include "asterisk.h"
+#define VERSION(a,b,c) ((a)*10000+(b)*100+(c))
 
 #include <arpa/inet.h>
 
 #include <h323pdu.h>
 #include <h323neg.h>
 #include <mediafmt.h>
+
+/* H323 Plus */
+#if VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) > VERSION(1,19,4)
+
+#ifdef H323_H450
+#include "h450/h4501.h"
+#include "h450/h4504.h"
+#include "h450/h45011.h"
+#include "h450/h450pdu.h"
+#endif
+
+#ifdef H323_H460
+#include <h460/h4601.h>
+#endif
+
+#else /* !H323 Plus */
+
 #include <lid.h>
 #ifdef H323_H450
 #include "h4501.h"
 #include "h450pdu.h"
 #endif
 
+#endif /* H323 Plus */
+
+#include "compat_h323.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -65,15 +87,40 @@ extern "C" {
 #include "cisco-h225.h"
 #include "caps_h323.h"
 
-#if PWLIB_MAJOR * 10000 + PWLIB_MINOR * 100 + PWLIB_BUILD >= 1 * 10000 + 12 * 100 + 0
+#if VERSION(PWLIB_MAJOR, PWLIB_MINOR, PWLIB_BUILD) >= VERSION(1,12,0)
 #define SKIP_PWLIB_PIPE_BUG_WORKAROUND 1
 #endif
 
+///////////////////////////////////////////////
+/* We have to have a PProcess running for the life of the instance to give
+ * h323plus a static instance of PProcess to get system information.
+ * This class is defined with PDECLARE_PROCESS().  See pprocess.h from pwlib.
+ */
+
 /* PWlib Required Components  */
+#if VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) > VERSION(1,19,4)
+#define MAJOR_VERSION 1
+#define MINOR_VERSION 19
+#define BUILD_TYPE    ReleaseCode
+#define BUILD_NUMBER  6
+#else
 #define MAJOR_VERSION 1
 #define MINOR_VERSION 0
 #define BUILD_TYPE    ReleaseCode
 #define BUILD_NUMBER  0
+#endif
+const char *h323manufact = "The NuFone Networks";
+const char *h323product  = "H.323 Channel Driver for Asterisk";
+PDECLARE_PROCESS(MyProcess,PProcess,h323manufact,h323product,MAJOR_VERSION,MINOR_VERSION,BUILD_TYPE,BUILD_NUMBER)
+static MyProcess localProcess;  // active for the life of the DLL
+/* void MyProcess::Main()
+{
+}
+*/
+////////////////////////////////////////////////
+
 
 /** Counter for the number of connections */
 static int channelsOpen;
@@ -85,13 +132,6 @@ static int channelsOpen;
  */
 static MyH323EndPoint *endPoint = NULL;
 
-/** PWLib entry point */
-static MyProcess *localProcess = NULL;
-
-#ifndef SKIP_PWLIB_PIPE_BUG_WORKAROUND
-static int _timerChangePipe[2];
-#endif
-
 static unsigned traceOptions = PTrace::Timestamp | PTrace::Thread | PTrace::FileAndLine;
 
 class PAsteriskLog : public PObject, public iostream {
@@ -176,36 +216,6 @@ static ostream &my_endl(ostream &os)
        (logstream ? (PTrace::ClearOptions((unsigned)-1), PTrace::Begin(0, __FILE__, __LINE__)) : std::cout)
 #define endl my_endl
 
-/* Special class designed to call cleanup code on module destruction */
-class MyH323_Shutdown {
-       public:
-       MyH323_Shutdown() { };
-       ~MyH323_Shutdown()
-       {
-               h323_end_process();
-       };
-};
-
-MyProcess::MyProcess(): PProcess("The NuFone Networks",
-                       "H.323 Channel Driver for Asterisk",
-                       MAJOR_VERSION, MINOR_VERSION, BUILD_TYPE, BUILD_NUMBER)
-{
-       /* Call shutdown when module being unload or asterisk has been stopped */
-       static MyH323_Shutdown x;
-
-       /* Fix missed one in PWLib */
-       PX_firstTimeStart = FALSE;
-       Resume();
-}
-
-MyProcess::~MyProcess()
-{
-#ifndef SKIP_PWLIB_PIPE_BUG_WORKAROUND
-       _timerChangePipe[0] = timerChangePipe[0];
-       _timerChangePipe[1] = timerChangePipe[1];
-#endif
-}
-
 void MyProcess::Main()
 {
        PTrace::Initialise(PTrace::GetLevel(), NULL, traceOptions);
@@ -2060,7 +2070,7 @@ PBoolean MyH323Connection::StartControlChannel(const H225_TransportAddress & h24
                        cout << "Using " << addr << " for outbound H.245 transport" << endl;
                controlChannel = new MyH323TransportTCP(endpoint, addr);
        } else
-               controlChannel = new H323TransportTCP(endpoint);
+               controlChannel = new MyH323TransportTCP(endpoint);
        if (!controlChannel->SetRemoteAddress(h245Address)) {
                PTRACE(1, "H225\tCould not extract H245 address");
                delete controlChannel;
@@ -2249,8 +2259,7 @@ void h323_end_point_create(void)
 {
        channelsOpen = 0;
        logstream = new PAsteriskLog();
-       localProcess = new MyProcess();
-       localProcess->Main();
+       endPoint = new MyH323EndPoint();
 }
 
 void h323_gk_urq(void)
@@ -2358,6 +2367,33 @@ int h323_start_listener(int listenPort, struct sockaddr_in bindaddr)
        return 0;
 };
 
+/* Addition of functions just to make the channel driver compile with H323Plus */
+#if VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) > VERSION(1,19,4)
+/* Alternate RTP port information for Same NAT */
+BOOL MyH323_ExternalRTPChannel::OnReceivedAltPDU(const H245_ArrayOf_GenericInformation & alternate )
+{
+       return TRUE;
+}
+
+/* Alternate RTP port information for Same NAT */
+BOOL MyH323_ExternalRTPChannel::OnSendingAltPDU(H245_ArrayOf_GenericInformation & alternate) const
+{
+       return TRUE;
+}
+
+/* Alternate RTP port information for Same NAT */
+void MyH323_ExternalRTPChannel::OnSendOpenAckAlt(H245_ArrayOf_GenericInformation & alternate) const
+{
+}
+
+/* Alternate RTP port information for Same NAT */
+BOOL MyH323_ExternalRTPChannel::OnReceivedAckAltPDU(const H245_ArrayOf_GenericInformation & alternate)
+{
+       return TRUE;
+}
+#endif
+
+
 int h323_set_alias(struct oh323_alias *alias)
 {
        char *p;
@@ -2373,7 +2409,7 @@ int h323_set_alias(struct oh323_alias *alias)
 
        cout << "== Adding alias \"" << h323id << "\" to endpoint" << endl;
        endPoint->AddAliasName(h323id);
-       endPoint->RemoveAliasName(localProcess->GetUserName());
+       endPoint->RemoveAliasName(PProcess::Current().GetName());
 
        if (!e164.IsEmpty()) {
                cout << "== Adding E.164 \"" << e164 << "\" to endpoint" << endl;
@@ -2408,6 +2444,11 @@ void h323_show_tokens(void)
        cout << "Current call tokens: " << setprecision(2) << endPoint->GetAllConnections() << endl;
 }
 
+void h323_show_version(void)
+{
+    cout << "H.323 version: " << OPENH323_MAJOR << "." << OPENH323_MINOR << "." << OPENH323_BUILD << endl;
+}
+
 /** Establish Gatekeeper communiations, if so configured,
   *    register aliases for the H.323 endpoint to respond to.
   */
@@ -2625,22 +2666,10 @@ int h323_hold_call(const char *token, int is_hold)
 void h323_end_process(void)
 {
        if (endPoint) {
-               endPoint->ClearAllCalls();
-               endPoint->RemoveListener(NULL);
                delete endPoint;
                endPoint = NULL;
        }
-       if (localProcess) {
-               delete localProcess;
-               localProcess = NULL;
-#ifndef SKIP_PWLIB_PIPE_BUG_WORKAROUND
-               close(_timerChangePipe[0]);
-               close(_timerChangePipe[1]);
-#endif
-       }
        if (logstream) {
-               PTrace::SetLevel(0);
-               PTrace::SetStream(&cout);
                delete logstream;
                logstream = NULL;
        }
index afc0f3d1b59227708fbedc42e1bdbd0008e95883..b9e793c0f51867ef8cd89b5adc14f8a532f36fc8 100644 (file)
@@ -151,26 +151,24 @@ protected:
 
        PIPSocket::Address localIpAddr;
        PIPSocket::Address remoteIpAddr;
+       /* Additional functions in order to have chan_h323 compile with H323Plus */
+#if VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) > VERSION(1,19,4)
+       BOOL OnReceivedAltPDU(const H245_ArrayOf_GenericInformation & alternate );
+       BOOL OnSendingAltPDU(H245_ArrayOf_GenericInformation & alternate) const;
+       void OnSendOpenAckAlt(H245_ArrayOf_GenericInformation & alternate) const;
+       BOOL OnReceivedAckAltPDU(const H245_ArrayOf_GenericInformation & alternate);
+#endif
        WORD localPort;
        WORD remotePort;
 };
 
-/**
- * The MyProcess is a necessary descendant PProcess class so that the H323EndPoint
- * objected to be created from within that class. (Solves the who owns main() problem).
- */
-class MyProcess : public PProcess
-{
-       PCLASSINFO(MyProcess, PProcess);
-
-public:
-       MyProcess();
-       ~MyProcess();
-       void Main();
-};
-
 #ifdef H323_H450
+
+#if VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) > VERSION(1,19,4)
+#include <h450/h450pdu.h>
+#else
 #include <h450pdu.h>
+#endif
 
 class MyH4504Handler : public H4504Handler
 {
@@ -186,6 +184,4 @@ private:
 };
 #endif
 
-#include "compat_h323.h"
-
 #endif /* !defined AST_H323_H */
index 95e8c491d4f7dfaa3cbdfca2a549e29c503d7d42..e121f02fb55bca043b9298b1b486af19aeced43f 100644 (file)
@@ -242,6 +242,7 @@ extern "C" {
        int h323_set_gk(int, char *, char *);
        void h323_set_id(char *);
        void h323_show_tokens(void);
+       void h323_show_version(void);
 
        /* H323 listener related funcions */
        int h323_start_listener(int, struct sockaddr_in);
index 8eb73a98ee9725baee63dc49cd07768f01b80076..609d18e8a587e28dea0ab39ee3f758e5f1042fc9 100644 (file)
@@ -33,6 +33,7 @@
 #include <transports.h>
 
 #include "ast_h323.h"
+#include "compat_h323.h"
 
 #if VERSION(OPENH323_MAJOR,OPENH323_MINOR,OPENH323_BUILD) < VERSION(1,17,3)
 MyH323TransportTCP::MyH323TransportTCP(
index 53938350dbba86607127468951303c5027b46cb2..61076f1be9e41c90196f94836501a48e5c811e67 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef COMPAT_H323_H
 #define COMPAT_H323_H
 
+#include "ast_ptlib.h"
+
 #if VERSION(OPENH323_MAJOR,OPENH323_MINOR,OPENH323_BUILD) < VERSION(1,17,3)
 /**
  *  Workaround for broken (less than 1.17.3) OpenH323 stack to be able to
index 8f0b299f9addf348a29dea317748971a9a6e60e2..5f4402a79ffc977481a8fb0d5a0aa9ae590a081e 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 180947 .
+# From configure.ac Revision: 181457 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.6.
 #
     saved_cppflags="${CPPFLAGS}"
     CPPFLAGS="${CPPFLAGS} -I${HOME}/openh323/include -I${PWLIB_INCDIR}"
     as_ac_Header=`echo "ac_cv_header_${HOME}/openh323/include/h323.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${HOME}/openh323/include/h323.h" >&5
+{ echo "$as_me:$LINENO: checking for ${HOME}/openh323/include/h323.h" >&5
 echo $ECHO_N "checking for ${HOME}/openh323/include/h323.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 ${HOME}/openh323/include/h323.h usability" >&5
-echo $ECHO_N "checking ${HOME}/openh323/include/h323.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+  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 <ptlib.h>
+
 #include <${HOME}/openh323/include/h323.h>
 _ACEOF
 rm -f conftest.$ac_objext
@@ -42247,99 +42240,19 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
         test -z "$ac_cxx_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_header_compiler=no
+       eval "$as_ac_Header=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 ${HOME}/openh323/include/h323.h presence" >&5
-echo $ECHO_N "checking ${HOME}/openh323/include/h323.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 <${HOME}/openh323/include/h323.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_cxx_preproc_warn_flag$ac_cxx_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_cxx_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${HOME}/openh323/include/h323.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${HOME}/openh323/include/h323.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${HOME}/openh323/include/h323.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${HOME}/openh323/include/h323.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${HOME}/openh323/include/h323.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${HOME}/openh323/include/h323.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${HOME}/openh323/include/h323.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${HOME}/openh323/include/h323.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${HOME}/openh323/include/h323.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${HOME}/openh323/include/h323.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${HOME}/openh323/include/h323.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${HOME}/openh323/include/h323.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${HOME}/openh323/include/h323.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${HOME}/openh323/include/h323.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${HOME}/openh323/include/h323.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${HOME}/openh323/include/h323.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${HOME}/openh323/include/h323.h" >&5
-echo $ECHO_N "checking for ${HOME}/openh323/include/h323.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
   HAS_OPENH323=1
 fi
     else
       saved_cppflags="${CPPFLAGS}"
       CPPFLAGS="${CPPFLAGS} -I/usr/local/include/openh323 -I${PWLIB_INCDIR}"
-      if test "${ac_cv_header__usr_local_include_openh323_h323_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for /usr/local/include/openh323/h323.h" >&5
+      { echo "$as_me:$LINENO: checking for /usr/local/include/openh323/h323.h" >&5
 echo $ECHO_N "checking for /usr/local/include/openh323/h323.h... $ECHO_C" >&6; }
 if test "${ac_cv_header__usr_local_include_openh323_h323_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header__usr_local_include_openh323_h323_h" >&5
-echo "${ECHO_T}$ac_cv_header__usr_local_include_openh323_h323_h" >&6; }
 else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking /usr/local/include/openh323/h323.h usability" >&5
-echo $ECHO_N "checking /usr/local/include/openh323/h323.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+  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 <ptlib.h>
+
 #include </usr/local/include/openh323/h323.h>
 _ACEOF
 rm -f conftest.$ac_objext
@@ -42389,98 +42296,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
         test -z "$ac_cxx_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  ac_cv_header__usr_local_include_openh323_h323_h=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_header_compiler=no
+       ac_cv_header__usr_local_include_openh323_h323_h=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 /usr/local/include/openh323/h323.h presence" >&5
-echo $ECHO_N "checking /usr/local/include/openh323/h323.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 </usr/local/include/openh323/h323.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_cxx_preproc_warn_flag$ac_cxx_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_cxx_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: /usr/local/include/openh323/h323.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: /usr/local/include/openh323/h323.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: /usr/local/include/openh323/h323.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: /usr/local/include/openh323/h323.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: /usr/local/include/openh323/h323.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: /usr/local/include/openh323/h323.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: /usr/local/include/openh323/h323.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: /usr/local/include/openh323/h323.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: /usr/local/include/openh323/h323.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: /usr/local/include/openh323/h323.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: /usr/local/include/openh323/h323.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: /usr/local/include/openh323/h323.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: /usr/local/include/openh323/h323.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: /usr/local/include/openh323/h323.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: /usr/local/include/openh323/h323.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: /usr/local/include/openh323/h323.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for /usr/local/include/openh323/h323.h" >&5
-echo $ECHO_N "checking for /usr/local/include/openh323/h323.h... $ECHO_C" >&6; }
-if test "${ac_cv_header__usr_local_include_openh323_h323_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_header__usr_local_include_openh323_h323_h=$ac_header_preproc
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_header__usr_local_include_openh323_h323_h" >&5
 echo "${ECHO_T}$ac_cv_header__usr_local_include_openh323_h323_h" >&6; }
-
-fi
 if test $ac_cv_header__usr_local_include_openh323_h323_h = yes; then
   HAS_OPENH323=1
 fi
@@ -42490,7 +42317,7 @@ fi
       if test "${HAS_OPENH323:-unset}" != "unset" ; then
         OPENH323DIR="/usr/local/share/openh323"
         OPENH323_INCDIR="/usr/local/include/openh323"
-        if test "x$LIB64" != "x"; then
+        if test "x$LIB64" != "x" && test -d "/usr/local/lib64"; then
           OPENH323_LIBDIR="/usr/local/lib64"
         else
           OPENH323_LIBDIR="/usr/local/lib"
@@ -42551,7 +42378,7 @@ fi
         if test "${HAS_OPENH323:-unset}" != "unset" ; then
           OPENH323DIR="/usr/share/openh323"
           OPENH323_INCDIR="/usr/include/openh323"
-          if test "x$LIB64" != "x"; then
+          if test "x$LIB64" != "x" && test -d "/usr/local/lib64"; then
             OPENH323_LIBDIR="/usr/lib64"
           else
             OPENH323_LIBDIR="/usr/lib"
@@ -42619,7 +42446,12 @@ echo $ECHO_N "checking OpenH323 build option... $ECHO_C" >&6; }
                OPENH323_SUFFIX=
                prefixes="h323_${PWLIB_PLATFORM}_ h323_ openh323"
                for pfx in $prefixes; do
+                       #files=`ls -l /usr/local/lib/lib${pfx}*.so* 2>/dev/null`
                        files=`ls -l ${OPENH323_LIBDIR}/lib${pfx}*.so* 2>/dev/null`
+                       if test -z "$files"; then
+                               # check the default location
+                               files=`ls -l /usr/local/lib/lib${pfx}*.so* 2>/dev/null`
+                       fi
                        libfile=
                        if test -n "$files"; then
                                for f in $files; do