Skip to content

Commit 3f87130

Browse files
committed
chan_sccp: Fix compilation on Asterisk 21+.
The upstream chan_sccp code does not compile with Asterisk's HEAD anymore since it still uses macro functions; apply an umerged patch to remove macros if needed.
1 parent e1737c5 commit 3f87130

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
sudo wget https://raw.githubusercontent.com/InterLinked1/phreakscript/master/phreaknet.sh
3131
sudo chmod +x phreaknet.sh
3232
sudo ./phreaknet.sh make
33-
sudo phreaknet install -d -s -t
34-
sudo phreaknet runtests
33+
sudo phreaknet install -d -s --devmode
34+
# Skip tests on Ubuntu, since it takes the longest, and runtime doesn't vary by platform
3535
debian-stable-asterisk-lts:
3636
runs-on: ubuntu-latest
3737
container: debian:12

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PhreakScript installs:
2121
- Message Send Protocol send support
2222
- AGI `RECORD FILE` option to require noise before silence detection
2323
- Optional build enhancements
24-
- `chan_sccp` (improved community Skinny/SCCP channel driver)
24+
- `chan_sccp` (improved community Skinny/SCCP channel driver), with compilation fixes
2525
- Cisco Call Manager support for `chan_sip`
2626
- Restored and enhanced [`chan_sip`](https://github.com/InterLinked1/chan_sip) for master / versions 21+ (removed by Sangoma)
2727
- Adds the following applications:

phreaknet.sh

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ Options:
475475
--cisco install: Add full support for Cisco Call Manager phones (chan_sip only)
476476
--sccp install: Install chan_sccp channel driver (Cisco Skinny)
477477
--drivers install: Also install DAHDI drivers removed in 2018
478+
--generic install: Use generic kernel headers that do not match the installed kernel version
478479
--extcodecs install: Specify this if any external codecs are being or will be installed
479480
--freepbx install: Install FreePBX GUI (not recommended)
480481
--manselect install: Manually run menuselect yourself
@@ -784,6 +785,13 @@ install_prereq() {
784785
apt-get -y autoremove
785786
elif [ "$PAC_MAN" = "yum" ]; then
786787
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
787795
# Rocky Linux seems to be missing libedit-devel, and this package is "missing"
788796
if [ "$OS_DIST_INFO" = "Rocky Linux release 8.9 (Green Obsidian)" ]; then
789797
dnf --enablerepo=devel install -y libedit-devel
@@ -1354,8 +1362,10 @@ install_dahdi() {
13541362
apt-get install -y pkg-config m4 libtool automake autoconf git
13551363
linux_headers_install_apt
13561364
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)
13581367
dnf list installed | grep kernel-headers
1368+
rpm -qa | grep kernel
13591369
else
13601370
echoerr "Unable to install potential DAHDI prerequisites"
13611371
sleep 2
@@ -1413,13 +1423,18 @@ install_dahdi() {
14131423
exit 2
14141424
fi
14151425

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)
14171427
cd $AST_SOURCE_PARENT_DIR/$DAHDI_LIN_SRC_DIR
14181428

14191429
DAHDI_CFLAGS=""
14201430
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
14231438
DAHDI_CFLAGS="KVERS=$hdrver" # overwrite from exact match with uname -r to whatever we happen to have
14241439
printf "We do NOT have an exact kernel match: %s\n" "$hdrver"
14251440
else
@@ -2411,6 +2426,9 @@ get_source() {
24112426
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)
24122427
fi
24132428
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
24142432
# https://usecallmanager.nz/patching-asterisk.html and https://github.com/usecallmanagernz/patches
24152433
wget -q "https://raw.githubusercontent.com/usecallmanagernz/patches/master/asterisk/$CISCO_CM_SIP.patch" -O /tmp/$CISCO_CM_SIP.patch
24162434
patch --strip=1 < /tmp/$CISCO_CM_SIP.patch
@@ -2446,7 +2464,7 @@ else
24462464
fi
24472465

24482466
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 -- "$@")
24502468
VALID_ARGUMENTS=$?
24512469
if [ "$VALID_ARGUMENTS" != "0" ]; then
24522470
usage
@@ -2490,6 +2508,7 @@ while true; do
24902508
--extcodecs ) EXTERNAL_CODECS=1; shift ;;
24912509
--fast ) FAST_COMPILE=1; shift ;;
24922510
--freepbx ) FREEPBX_GUI=1; shift ;;
2511+
--generic ) GENERIC_HEADERS=1; shift ;;
24932512
--lightweight ) LIGHTWEIGHT=1; shift ;;
24942513
--api-key ) INTERLINKED_APIKEY=$2; shift 2;;
24952514
--rotate ) ASTKEYGEN=1; shift ;;
@@ -3045,6 +3064,11 @@ elif [ "$cmd" = "install" ]; then
30453064
if [ $? -eq 0 ]; then
30463065
git fetch
30473066
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
30483072
./configure --enable-conference --enable-advanced-functions --with-asterisk=../$AST_SRC_DIR
30493073
make -j$(nproc) && make install && make reload
30503074
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)