Package: asterisk / 1:13.14.1~dfsg-2+deb9u4

radcli-detection.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
From: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Date: Sat, 12 Nov 2016 20:15:12 +0200
Origin: https://gerrit.asterisk.org/4404
Bug: https://issues.asterisk.org/jira/browse/ASTERISK-26540
Subject: Add support for building RADUIS with radcli

Radcli is yet another RADIUS client library, generally compatible with
freeradius and radiusclient-ng.

This commit adds autoconf option for detecting it as well and changes
cdr_radius and cel_radius to use its header file in that case.

ASTERISK-26540 #close

diff --git a/cdr/cdr_radius.c b/cdr/cdr_radius.c
index af434f6..f6b311d 100644
--- a/cdr/cdr_radius.c
+++ b/cdr/cdr_radius.c
@@ -41,11 +41,7 @@
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
-#ifdef FREERADIUS_CLIENT
-#include <freeradius-client.h>
-#else
-#include <radiusclient-ng.h>
-#endif
+#include RADIUS_HEADER_STR
 
 #include "asterisk/channel.h"
 #include "asterisk/cdr.h"
diff --git a/cel/cel_radius.c b/cel/cel_radius.c
index e31cb5e..250d6a7 100644
--- a/cel/cel_radius.c
+++ b/cel/cel_radius.c
@@ -35,11 +35,7 @@
 
 ASTERISK_FILE_VERSION(__FILE__, "$Rev$")
 
-#ifdef FREERADIUS_CLIENT
-#include <freeradius-client.h>
-#else
-#include <radiusclient-ng.h>
-#endif
+#include RADIUS_HEADER_STR
 
 #include "asterisk/channel.h"
 #include "asterisk/cel.h"
diff --git a/configure.ac b/configure.ac
index ea55df4..3bdf140 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2339,9 +2339,17 @@ AST_EXT_LIB_CHECK([LUA], [lua], [luaL_openlib], [lua.h], [-lm])
 # just different header filenames and different SONAMEs
 AST_EXT_LIB_CHECK([RADIUS], [freeradius-client], [rc_read_config], [freeradius-client.h])
 if test "x${PBX_RADIUS}" = "x1"; then
-	AC_DEFINE(FREERADIUS_CLIENT, [], [Use the FreeRADIUS-client library])
+	AC_DEFINE(RADIUS_HEADER_STR, [<freeradius-client.h>], [Name of RADIUS library include header])
 else
 	AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
+	if test "x${PBX_RADIUS}" = "x1"; then
+		AC_DEFINE(RADIUS_HEADER_STR, [<radiusclient-ng.h>], [Name of RADIUS library include header])
+	else
+		AST_EXT_LIB_CHECK([RADIUS], [radcli], [rc_read_config], [radcli/radcli.h])
+		if test "x${PBX_RADIUS}" = "x1"; then
+			AC_DEFINE(RADIUS_HEADER_STR, [<radcli/radcli.h>], [Name of RADIUS library include header])
+		fi
+	fi
 fi
 
 AST_EXT_LIB_CHECK([COROSYNC], [cpg], [cpg_join], [corosync/cpg.h], [-lcfg])
-- 
2.10.2