View | Details | Raw Unified | Return to bug 238252 | Differences between
and this patch

Collapse All | Expand All

(-)files/patch-fix-new-asterisk-include (+85 lines)
Line 0 Link Here
1
From 9684efb7709c1be23c99f555f61b5a3ad15b0675 Mon Sep 17 00:00:00 2001
2
From: Diederik de Groot <dkgroot@talon.nl>
3
Date: Thu, 16 May 2019 17:48:55 +0200
4
Subject: [PATCH] Add support for new asterisk mwi.h header file
5
6
---
7
 autoconf/asterisk.m4 |  6 ++++++
8
 configure            | 13 +++++++++++++
9
 src/config.h.in      |  3 +++
10
 src/sccp_mwi.c       |  4 ++++
11
 4 files changed, 26 insertions(+)
12
13
diff --git a/autoconf/asterisk.m4 b/autoconf/asterisk.m4
14
index 52c6ef70e..67969940a 100644
15
--- autoconf/asterisk.m4
16
+++ autoconf/asterisk.m4
17
@@ -1120,6 +1120,12 @@ dnl 	CFLAGS="${CFLAGS_saved} -Werror=implicit-function-declaration"
18
 		],,[ 
19
 			$HEADER_INCLUDE
20
 		])
21
+		AC_CHECK_HEADER([asterisk/mwi.h],
22
+		[
23
+			AC_DEFINE([HAVE_PBX_MWI_H],1,[Found 'asterisk/mwi.h'])
24
+		],,[ 
25
+			$HEADER_INCLUDE
26
+		])
27
 		AC_CHECK_HEADER([asterisk/utils.h],
28
 		[
29
 			AC_DEFINE([HAVE_PBX_UTILS_H],1,[Found 'asterisk/utils.h'])
30
diff --git a/configure b/configure
31
index 8cff697c7..182f27ac4 100755
32
--- configure
33
+++ configure
34
@@ -28852,6 +28852,19 @@ if test "x$ac_cv_header_asterisk_message_h" = xyes; then :
35
 $as_echo "#define HAVE_PBX_MESSAGE_H 1" >>confdefs.h
36
 
37
 
38
+fi
39
+
40
+
41
+		ac_fn_c_check_header_compile "$LINENO" "asterisk/mwi.h" "ac_cv_header_asterisk_mwi_h" "
42
+			$HEADER_INCLUDE
43
+
44
+"
45
+if test "x$ac_cv_header_asterisk_mwi_h" = xyes; then :
46
+
47
+
48
+$as_echo "#define HAVE_PBX_MWI_H 1" >>confdefs.h
49
+
50
+
51
 fi
52
 
53
 
54
diff --git a/src/config.h.in b/src/config.h.in
55
index e5ba1bfec..ad7d25efc 100644
56
--- src/config.h.in
57
+++ src/config.h.in
58
@@ -583,6 +583,9 @@
59
 /* Found 'asterisk/message.h' */
60
 #undef HAVE_PBX_MESSAGE_H
61
 
62
+/* Found 'asterisk/mwi.h' */
63
+#undef HAVE_PBX_MWI_H
64
+
65
 /* Found 'asterisk/pbx.h' */
66
 #undef HAVE_PBX_PBX_H
67
 
68
diff --git a/src/sccp_mwi.c b/src/sccp_mwi.c
69
index d21c43c7f..5238f506c 100644
70
--- src/sccp_mwi.c
71
+++ src/sccp_mwi.c
72
@@ -25,9 +25,13 @@ SCCP_FILE_VERSION(__FILE__, "");
73
 #elif HAVE_PBX_STASIS_H
74
 #include <asterisk/stasis.h>
75
 #endif
76
+#ifdef HAVE_PBX_MWI_H				// ast_mwi_state_type
77
+#include <asterisk/mwi.h>
78
+#else
79
 #ifdef HAVE_PBX_APP_H				// ast_mwi_state_type
80
 #include <asterisk/app.h>
81
 #endif
82
+#endif
83
 #include <asterisk/cli.h>
84
 
85
 pbx_mutex_t subscriptions_lock;

Return to bug 238252