@@ -475,6 +475,7 @@ Options:
475
475
--cisco install: Add full support for Cisco Call Manager phones (chan_sip only)
476
476
--sccp install: Install chan_sccp channel driver (Cisco Skinny)
477
477
--drivers install: Also install DAHDI drivers removed in 2018
478
+ --generic install: Use generic kernel headers that do not match the installed kernel version
478
479
--extcodecs install: Specify this if any external codecs are being or will be installed
479
480
--freepbx install: Install FreePBX GUI (not recommended)
480
481
--manselect install: Manually run menuselect yourself
@@ -784,6 +785,13 @@ install_prereq() {
784
785
apt-get -y autoremove
785
786
elif [ " $PAC_MAN " = " yum" ]; then
786
787
yum install -y git patch
788
+ # Stop on RHEL systems without an active subscription
789
+ if ! which git > /dev/null; then
790
+ if [ -f /etc/redhat-release ]; then
791
+ echoerr " Subscription required to use RHEL package manager"
792
+ fi
793
+ die " Git does not appear to be installed"
794
+ fi
787
795
# Rocky Linux seems to be missing libedit-devel, and this package is "missing"
788
796
if [ " $OS_DIST_INFO " = " Rocky Linux release 8.9 (Green Obsidian)" ]; then
789
797
dnf --enablerepo=devel install -y libedit-devel
@@ -1354,8 +1362,10 @@ install_dahdi() {
1354
1362
apt-get install -y pkg-config m4 libtool automake autoconf git
1355
1363
linux_headers_install_apt
1356
1364
elif [ " $PAC_MAN " = " yum" ]; then
1357
- dnf install -y m4 libtool automake autoconf kernel-devel kernel-headers-$( uname -r)
1365
+ dnf install -y m4 libtool automake autoconf kernel-devel kernel-headers
1366
+ # dnf install -y kernel-headers-$(uname -r)
1358
1367
dnf list installed | grep kernel-headers
1368
+ rpm -qa | grep kernel
1359
1369
else
1360
1370
echoerr " Unable to install potential DAHDI prerequisites"
1361
1371
sleep 2
@@ -1413,13 +1423,18 @@ install_dahdi() {
1413
1423
exit 2
1414
1424
fi
1415
1425
1416
- # DAHDI Linux (generally recommended to install DAHDI Linux and DAHDI Tools separately, as oppose to bundled)
1426
+ # DAHDI Linux (generally recommended to install DAHDI Linux and DAHDI Tools separately, as opposed to bundled)
1417
1427
cd $AST_SOURCE_PARENT_DIR /$DAHDI_LIN_SRC_DIR
1418
1428
1419
1429
DAHDI_CFLAGS=" "
1420
1430
if [ " $GENERIC_HEADERS " = " 1" ]; then
1421
- ls -la /lib/modules/
1422
- hdrver=` ls /lib/modules`
1431
+ if [ -f /etc/redhat-release ]; then
1432
+ ls /usr/src/kernels
1433
+ hdrver=` ls /usr/src/kernels`
1434
+ else
1435
+ ls -la /lib/modules/
1436
+ hdrver=` ls /lib/modules`
1437
+ fi
1423
1438
DAHDI_CFLAGS=" KVERS=$hdrver " # overwrite from exact match with uname -r to whatever we happen to have
1424
1439
printf " We do NOT have an exact kernel match: %s\n" " $hdrver "
1425
1440
else
@@ -2411,6 +2426,9 @@ get_source() {
2411
2426
ENHANCED_CHAN_SIP=1 # chan_sip isn't present anymore, we need to readd it ourselves (if we're going to build chan_sip at all)
2412
2427
fi
2413
2428
if [ " $SIP_CISCO " = " 1" ]; then # ASTERISK-13145 (https://issues.asterisk.org/jira/browse/ASTERISK-13145)
2429
+ if [ ! -f channels/chan_sip.c ]; then
2430
+ die " chan_sip is not present in this source, please add the --sip option"
2431
+ fi
2414
2432
# https://usecallmanager.nz/patching-asterisk.html and https://github.com/usecallmanagernz/patches
2415
2433
wget -q " https://raw.githubusercontent.com/usecallmanagernz/patches/master/asterisk/$CISCO_CM_SIP .patch" -O /tmp/$CISCO_CM_SIP .patch
2416
2434
patch --strip=1 < /tmp/$CISCO_CM_SIP .patch
@@ -2446,7 +2464,7 @@ else
2446
2464
fi
2447
2465
2448
2466
FLAG_TEST=0
2449
- PARSED_ARGUMENTS=$( getopt -n phreaknet -o bc:u:dfhostu:v:w -l backtraces,cc:,dahdi,force,flag-test,help,sip,testsuite,user:,version:,weaktls,alsa,cisco,sccp,clli:,debug:,devmode,disa:,drivers,experimental,extcodecs,fast,freepbx,lightweight,api-key:,rotate,audit,boilerplate,upstream:,manselect,minimal,vanilla,wanpipe -- " $@ " )
2467
+ PARSED_ARGUMENTS=$( getopt -n phreaknet -o bc:u:dfhostu:v:w -l backtraces,cc:,dahdi,force,flag-test,help,sip,testsuite,user:,version:,weaktls,alsa,cisco,sccp,clli:,debug:,devmode,disa:,drivers,experimental,extcodecs,fast,freepbx,generic, lightweight,api-key:,rotate,audit,boilerplate,upstream:,manselect,minimal,vanilla,wanpipe -- " $@ " )
2450
2468
VALID_ARGUMENTS=$?
2451
2469
if [ " $VALID_ARGUMENTS " != " 0" ]; then
2452
2470
usage
@@ -2490,6 +2508,7 @@ while true; do
2490
2508
--extcodecs ) EXTERNAL_CODECS=1; shift ;;
2491
2509
--fast ) FAST_COMPILE=1; shift ;;
2492
2510
--freepbx ) FREEPBX_GUI=1; shift ;;
2511
+ --generic ) GENERIC_HEADERS=1; shift ;;
2493
2512
--lightweight ) LIGHTWEIGHT=1; shift ;;
2494
2513
--api-key ) INTERLINKED_APIKEY=$2 ; shift 2;;
2495
2514
--rotate ) ASTKEYGEN=1; shift ;;
@@ -3045,6 +3064,11 @@ elif [ "$cmd" = "install" ]; then
3045
3064
if [ $? -eq 0 ]; then
3046
3065
git fetch
3047
3066
git pull
3067
+ if [ $AST_MAJOR_VER -ge 21 ]; then
3068
+ # Remove macros, or it won't even compile
3069
+ $WGET " https://github.com/chan-sccp/chan-sccp/commit/3c90b6447b17639c52b47ed61cfb154b15ee84ec.patch"
3070
+ git apply " 3c90b6447b17639c52b47ed61cfb154b15ee84ec.patch"
3071
+ fi
3048
3072
./configure --enable-conference --enable-advanced-functions --with-asterisk=../$AST_SRC_DIR
3049
3073
make -j$( nproc) && make install && make reload
3050
3074
if [ $? -ne 0 ]; then
0 commit comments