Index: build_tools/menuselect-deps.in
===================================================================
--- build_tools/menuselect-deps.in	(revision 22438)
+++ build_tools/menuselect-deps.in	(working copy)
@@ -15,7 +15,6 @@
 OGG=@PBX_LIBogg@
 OSSAUDIO=@PBX_LIBossaudio@
 PGSQL=@PBX_LIBpq@
-PTLIB=@PBX_LIBPWLIB@
 QT=@PBX_QT@
 SQLITE=@PBX_LIBsqlite@
 SSL=@PBX_LIBssl@
@@ -25,3 +24,4 @@
 ZLIB=@PBX_LIBz@
 ZAPTEL=@PBX_LIBtonezone@
 LIBGSM=@PBX_LIBgsm@
+IXJUSER=@PBX_IXJUSER@
Index: configure.ac
===================================================================
--- configure.ac	(revision 22438)
+++ configure.ac	(working copy)
@@ -160,7 +160,7 @@
 AST_EXT_LIB([asound], [snd_spcm_init], [alsa/asoundlib.h], [ALSA], [Advanced Linux Sound Architecture], [-lm -ldl])
 AST_EXT_LIB([curses], [initscr], [curses.h], [CURSES], [curses], [])
 AST_EXT_LIB([mfcr2], [mfcr2_MakeCall], [libmfcr2.h], [MFCR2], [MFCR2])
-AST_EXT_LIB([nbs], [nbs_setup], [nbs.h], [NBS], [Network Broadcast Sound])
+AST_EXT_LIB([nbs], [nbs_connect], [nbs.h], [NBS], [Network Broadcast Sound])
 AST_EXT_LIB([ncurses], [initscr], [curses.h], [NCURSES], [ncurses], [])
 AST_EXT_LIB([newt], [newtBell], [newt.h], [NEWT], [newt])
 AST_EXT_LIB([odbc], [SQLConnect], [sql.h], [UNIXODBC], [unixODBC])
@@ -298,12 +298,10 @@
 AC_SUBST([pq_LIB])
 AC_SUBST([PBX_LIBpq])
 
-PBX_H323=0
-AC_CHECK_HEADER([h323.h], [PBX_H323=1], [])
-AC_SUBST(PBX_H323)
-
 HAVE_QUICKNET=0
-AC_CHECK_HEADER([ixjuser.h], [HAVE_QUICKNET=1],[])
+AC_CHECK_HEADER([linux/ixjuser.h], [HAVE_QUICKNET=1
+PBX_IXJUSER=1],[PBX_IXJUSER=0])
+AC_SUBST(PBX_IXJUSER)
 AC_SUBST(HAVE_QUICKNET)
 
 AC_ARG_WITH([vpb], AC_HELP_STRING([--with-vpb=PATH],[use vpb files in PATH]),[
@@ -363,6 +361,13 @@
 
 
 AC_LANG_PUSH(C++)
+AST_OPENH323
+if test $ast_cv_openh323 = true; then
+  PBX_H323=1
+else
+  PBX_H323=0
+fi
+AC_SUBST(PBX_H323)
 
 AC_ARG_WITH([qt], AC_HELP_STRING([--with-qt=PATH],[use Qt files in PATH]),[
 case ${withval} in
@@ -521,64 +526,6 @@
 AC_SUBST(GTK_INCLUDE)
 AC_SUBST(GTK_LIBS)
 
-PLATFORM_PTLIB="ptlib_${OSTYPE}_${MACHTYPE}_r"
-
-AC_ARG_WITH([pwlib], AC_HELP_STRING([--with-pwlib=PATH],[use PWLib files in PATH]),[
-case ${withval} in
-     n|no)
-     USE_PWLIB=no
-     ;;
-     y|ye|yes)
-     ;;
-     *)
-     PWLIB_DIR="${withval}"
-     ;;
-esac
-])
-if test "${USE_PWLIB}" != "no"; then
-	echo -n "checking for existence of pwlib..."
-	
-	saved_ldflags="${LDFLAGS}"
-	LDFLAGS="${LDFLAGS} -L${PWLIB_DIR} -l${PLATFORM_PTLIB}"
-	
-	AC_LINK_IFELSE(
-	[
-	AC_LANG_PROGRAM(
-	[#include "${PWDIR_DIR}ptime.h"],
-	[int q = PTime::IsDaylightSaving();])
-	],
-	[	AC_MSG_RESULT(yes) 
-		ac_cv_lib_pwlib="yes" 
-	],
-	[	AC_MSG_RESULT(no) 
-		ac_cv_lib_pwlib="no" 
-	]
-	)
-	LDFLAGS="${saved_ldflags}"
-
-	PBX_LIBPWLIB=0
-   
-   if test "${ac_cv_lib_pwlib}" = "yes"; then
-      PWLIB_LIB="-l{PLATFORM_PWLIB}"
-      if test "${PWLIB_DIR}" != ""; then
-         PWLIB_LIB="-L${PWLIB_DIR}/lib ${PWLIB_LIB}"
-	 		PWLIB_INCLUDE="-I${PWLIB_DIR}/include"
-	 		AC_SUBST([PWLIB_INCLUDE])
-      fi
-   	AC_SUBST([PWLIB_LIB])
-   	PBX_LIBPWLIB=1
-   	AC_DEFINE([HAVE_LIBPWLIB], 1, [Define if your system has the pwlib libraries.])
-   elif test ! -z "${PWLIB_DIR}"; 
-   then
-      echo "***"
-      echo "*** The PWLIB installation on this system appears to be broken."
-      echo "*** Either correct the installation, or run configure"
-      echo "*** including --without-pwlib"
-      exit 1
-   fi
-fi
-AC_SUBST([PBX_LIBPWLIB])
-
 PBX_CURL=0
 AC_PATH_TOOL([CURL], [curl-config], No)
 if test ! x"${CURL}" = xNo; then
Index: acinclude.m4
===================================================================
--- acinclude.m4	(revision 22438)
+++ acinclude.m4	(working copy)
@@ -66,7 +66,6 @@
 AC_SUBST([PBX_LIB$1])
 ])
 
-
 AC_DEFUN(
 [AST_CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make, GNU_MAKE,
    GNU_MAKE='Not Found' ;
@@ -84,3 +83,106 @@
 fi
 AC_SUBST([GNU_MAKE])
 ] )
+
+
+dnl Ripped off from Bayonne without shame
+
+AC_DEFUN(AST_OPENH323,[
+	OPENH323_FLAGS=
+	OPENH323_LIBS=
+	AC_PATH_PROG(PTCONFIG, ptlib-config, no)
+	ast_cv_openh323=false
+	AC_MSG_CHECKING([for openh323 libraries])
+	if test -z "$OPENH323DIR" ; then
+		if test -d /usr/openh323 ; then
+			export OPENH323DIR=/usr/openh323
+		elif test -d /usr/include/openh323 ; then
+			export OPENH323DIR=/usr/include/openh323
+		elif test -d /usr/local/include/openh323 ; then
+			export OPENH323DIR=/usr/local/include/openh323
+		else
+			export OPENH323DIR=~/openh323
+		fi
+	fi
+	if test "$PTCONFIG" == "no" ; then
+		AC_ARG_WITH(pwlibdir,
+			[  --with-pwlibdir=<path> where openh323 pwlib is],
+			[PWLIBDIR="$with_pwlibdir"],
+			[if test -d /sw/lib/pwlib ; then
+				PWLIBDIR=/sw/lib/pwlib; fi])
+		AC_ARG_WITH(openh323dir,
+			[  --with-openh323dir=<path> where openh323 is],
+			[export OPENH323DIR="$with_openh323dir"],
+			[if test -d /sw/lib/openh323 ; then
+				OPENH323DIR=/sw/lib/openh323; fi])
+	fi
+	if test "$PTCONFIG" != "no" ; then
+		ptlib_prefix=`$PTCONFIG --prefix`
+		OPENH323_FLAGS="-I$ptlib_prefix/include/ptlib/unix -I$ptlib_prefix/include/ptlib "`$PTCONFIG --ccflags`
+		OPENH323_LIBS="-lopenh323 -lpt "`$PTCONFIG --libs`
+		ast_cv_openh323=true
+	elif test -z "$PWLIBDIR" ; then
+		if test -d /usr/share/pwlib ; then
+			export PWLIBDIR=~/pwlib
+		else
+			export PWLIBDIR=~/pwlib
+		fi
+		if test -d $PWLIBDIR/include ; then
+			OPENH323_FLAGS="-I$PWLIBDIR/include/unix -I$PWLIBDIR/include"
+		elif test -d /usr/include/ptlib ; then
+			OPENH323_FLAGS="-I/usr/include/ptlib/unix -I/usr/include/ptlib"
+		fi
+	elif test -d "$PWLIBDIR/include/unix" ; then
+		OPENH323_FLAGS="-I$PWLIBDIR/include/unix -I$PWLIBDIR/include"
+	elif test -d "$PWLIBDIR/include/ptlib" ; then
+		OPENH323_FLAGS="-I$PWLIBDIR/include/ptlib/unix -I$PWLIBDIR/include"
+	fi
+	if test -d "$OPENH323DIR" ; then
+		ast_cv_openh323=true
+		if test -d /usr/include/openh323 ; then
+ 			OPENH323_FLAGS="$OPENH323_FLAGS -I/usr/include/openh323"
+		elif test -d $OPENH323DIR/include ; then
+			OPENH323_FLAGS="$OPENH323_FLAGS -I$OPENH323DIR/include"
+		else
+			OPENH323_FLAGS="$OPENH323_FLAGS -I$OPENH323DIR"
+		fi
+#		OPENH323_FLAGS="$OPENH323_FLAGS"
+		if test -f $OPENH323DIR/lib/libopenh323.so ; then
+			libh323="-L$OPENH323DIR/lib -lopenh323"
+		elif test -d $OPENH323DIR/lib ; then
+			libh323=`ls $OPENH323DIR/lib/*.a`
+		else
+			if test -f /usr/lib/libopenh323.so ; then
+				libh323="-lopenh323"
+			elif test -f /usr/local/lib/libopenh323.so ; then
+				libh323="-lopenh323"
+			else
+				libh323="-lh323_"`ls /usr/lib/libh323_* | sed -e "s/.*libh323_//" -e "s/[.]so.*$//" | uniq` 
+			fi
+		fi
+		if test "$PTCONFIG" != "no" ; then
+			OPENH323_LIBS="-lopenh323 -lpt "`$PTCONFIG --libs`
+		else
+			if test -d $PWLIBDIR/lib/obj* ; then
+				OPENH323_LIBS="$OPENH323_LIBS -L"`echo $PWLIBDIR/lib/obj*`
+			fi
+			if test -d $PWLIBDIR/lib ; then
+				libpt=`ls $PWLIBDIR/lib/*.a`
+			else
+				libpt="-lpt"
+			fi
+			OPENH323_LIBS="$OPENH323_LIBS $libh323 $libpt"
+			if test -f $PWLIBDIR/make/ptlib-config ; then
+				OPENH323_FLAGS="$OPENH323_FLAGS "`sh $PWLIBDIR/make/ptlib-config --ccflags`
+				OPENH323_LIBS="$OPENH323_LIBS "`sh $PWLIBDIR/make/ptlib-config --ldflags`" "`sh $PWLIBDIR/make/ptlib-config --libs`
+			fi
+		fi
+	fi
+	if test $ast_cv_openh323 = true ; then
+		AC_MSG_RESULT(found)
+	else
+		AC_MSG_RESULT(missing)
+	fi
+	AC_SUBST(OPENH323_FLAGS)
+	AC_SUBST(OPENH323_LIBS)
+])
