Add autoconf checks for extra suppserv definitions that are not present in releases...
authorJoshua Colp <jcolp@digium.com>
Mon, 29 Oct 2007 16:34:45 +0000 (16:34 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 29 Oct 2007 16:34:45 +0000 (16:34 +0000)
(closes issue #11103)
Reported by: IgorG

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

channels/chan_misdn.c
configure
configure.ac
include/asterisk/autoconfig.h.in

index 55f41d9..1297c3c 100644 (file)
@@ -452,13 +452,17 @@ static char *bearer2str(int cap) {
 static void print_facility(struct FacParm *fac, struct misdn_bchannel *bc)
 {
        switch (fac->Function) {
+#ifdef HAVE_MISDN_FAC_RESULT
                case Fac_RESULT:
                        chan_misdn_log(0, bc->port," --> Received RESULT Operation\n");
                        break;
+#endif
+#ifdef HAVE_MISDN_FAC_ERROR
                case Fac_ERROR:
                        chan_misdn_log(0, bc->port," --> Received Error Operation\n");
                        chan_misdn_log(0, bc->port," --> Value:%d Error:%s\n",fac->u.ERROR.errorValue, fac->u.ERROR.error);
                        break;
+#endif
                case Fac_CD:
                        chan_misdn_log(1,bc->port," --> calldeflect to: %s, screened: %s\n", fac->u.CDeflection.DeflectedToNumber,
                                        fac->u.CDeflection.PresentationAllowed ? "yes" : "no");
@@ -4908,8 +4912,10 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
                print_facility(&(bc->fac_in), bc);
                
                switch (bc->fac_in.Function) {
+#ifdef HAVE_MISDN_FAC_RESULT
                case Fac_RESULT:
                break;
+#endif
                case Fac_CD:
                        if (ch) {
                                struct ast_channel *bridged = ast_bridged_channel(ch->ast);
@@ -4946,7 +4952,9 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
                        }
                        break;
                case Fac_None:
+#ifdef HAVE_MISDN_FAC_ERROR
                case Fac_ERROR:
+#endif
                break;
                default:
                        chan_misdn_log(0, bc->port," --> not yet handled: facility type:%p\n", bc->fac_in.Function);
index 887437f..daca340 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 85542 .
+# From configure.ac Revision: 87247 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61.
 #
@@ -39647,6 +39647,144 @@ _ACEOF
    fi
 fi
 
+
+    if test "x${PBX_MISDN_FAC_RESULT}" != "x1" -a "${USE_MISDN_FAC_RESULT}" != "no"; then
+       { echo "$as_me:$LINENO: checking for Fac_RESULT in mISDNuser/suppserv.h" >&5
+echo $ECHO_N "checking for Fac_RESULT in mISDNuser/suppserv.h... $ECHO_C" >&6; }
+       saved_cppflags="${CPPFLAGS}"
+       if test "x${MISDN_FAC_RESULT_DIR}" != "x"; then
+           MISDN_FAC_RESULT_INCLUDE="-I${MISDN_FAC_RESULT_DIR}/include"
+       fi
+       CPPFLAGS="${CPPFLAGS} ${MISDN_FAC_RESULT_INCLUDE}"
+
+       cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <mISDNuser/suppserv.h>
+int
+main ()
+{
+int foo = Fac_RESULT;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+     { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+               PBX_MISDN_FAC_RESULT=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MISDN_FAC_RESULT 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MISDN_FAC_RESULT_VERSION
+_ACEOF
+
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+              { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       CPPFLAGS="${saved_cppflags}"
+    fi
+
+
+    if test "x${PBX_MISDN_FAC_ERROR}" != "x1" -a "${USE_MISDN_FAC_ERROR}" != "no"; then
+       { echo "$as_me:$LINENO: checking for Fac_ERROR in mISDNuser/suppserv.h" >&5
+echo $ECHO_N "checking for Fac_ERROR in mISDNuser/suppserv.h... $ECHO_C" >&6; }
+       saved_cppflags="${CPPFLAGS}"
+       if test "x${MISDN_FAC_ERROR_DIR}" != "x"; then
+           MISDN_FAC_ERROR_INCLUDE="-I${MISDN_FAC_ERROR_DIR}/include"
+       fi
+       CPPFLAGS="${CPPFLAGS} ${MISDN_FAC_ERROR_INCLUDE}"
+
+       cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <mISDNuser/suppserv.h>
+int
+main ()
+{
+int foo = Fac_ERROR;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+     { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+               PBX_MISDN_FAC_ERROR=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MISDN_FAC_ERROR 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MISDN_FAC_ERROR_VERSION
+_ACEOF
+
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+              { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       CPPFLAGS="${saved_cppflags}"
+    fi
+
    if test "${ac_cv_header_linux_mISDNdsp_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for linux/mISDNdsp.h" >&5
 echo $ECHO_N "checking for linux/mISDNdsp.h... $ECHO_C" >&6; }
index d76e6b7..1f20ecf 100644 (file)
@@ -783,6 +783,8 @@ AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
 if test "${PBX_MISDN}" = 1; then
    AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
    AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
+   AST_C_DEFINE_CHECK([MISDN_FAC_RESULT], [Fac_RESULT], [mISDNuser/suppserv.h])
+   AST_C_DEFINE_CHECK([MISDN_FAC_ERROR], [Fac_ERROR], [mISDNuser/suppserv.h])
    AC_CHECK_HEADER([linux/mISDNdsp.h], [AC_DEFINE_UNQUOTED([MISDN_1_2], 1, [Build chan_misdn for mISDN 1.2 or later.])])
 fi
 
index 900d25a..1862c78 100644 (file)
 /* Define this to indicate the ${MISDN_DESCRIP} library */
 #undef HAVE_MISDN
 
+/* Define if your system has the MISDN_FAC_ERROR headers. */
+#undef HAVE_MISDN_FAC_ERROR
+
+/* Define MISDN_FAC_ERROR headers version */
+#undef HAVE_MISDN_FAC_ERROR_VERSION
+
+/* Define if your system has the MISDN_FAC_RESULT headers. */
+#undef HAVE_MISDN_FAC_RESULT
+
+/* Define MISDN_FAC_RESULT headers version */
+#undef HAVE_MISDN_FAC_RESULT_VERSION
+
 /* Define to indicate the ${MISDN_DESCRIP} library version */
 #undef HAVE_MISDN_VERSION