@@ -242,6 +242,7 @@ CHAN_SIP=0
242
242
ENHANCED_CHAN_SIP=0
243
243
SIP_CISCO=0
244
244
CHAN_SCCP=0
245
+ RPT_MODULES=0
245
246
CHAN_DAHDI=0
246
247
DAHDI_OLD_DRIVERS=0
247
248
EMPULSE=1 # Automatically enable EMPULSE, cause why not?
@@ -606,6 +607,7 @@ Options:
606
607
--lightweight install: Only install basic, required modules for basic Asterisk functionality
607
608
--alsa install: Ensure ALSA library detection exists in the build system. This does NOT readd the deprecated/removed chan_alsa module.
608
609
--cisco install: Add full support for Cisco Call Manager phones (chan_sip only)
610
+ --rpt install: Add radio repeater modules
609
611
--sccp install: Install chan_sccp channel driver (Cisco Skinny)
610
612
--drivers install: Also install DAHDI drivers removed in 2018
611
613
--generic install: Use generic kernel headers that do not match the installed kernel version
@@ -951,13 +953,16 @@ install_prereq() {
951
953
PREREQ_PACKAGES=" $PREREQ_PACKAGES libnewt-dev dwarves"
952
954
fi
953
955
if [ " $1 " = " 1" ]; then
954
- PREREQ_PACKAGES=" $PREREQ_PACKAGES curl subversion libcurl4-openssl-dev"
956
+ PREREQ_PACKAGES=" $PREREQ_PACKAGES curl subversion libcurl4-openssl-dev libvpb1 "
955
957
if [ " $ENHANCED_INSTALL " = " 1" ]; then
956
958
PREREQ_PACKAGES=" $PREREQ_PACKAGES dnsutils bc mpg123 ntp tcpdump festival"
957
959
fi
958
960
if [ " $DEVMODE " = " 1" ]; then
959
961
PREREQ_PACKAGES=" $PREREQ_PACKAGES xmlstarlet" # only needed in developer mode for doc validation.
960
962
fi
963
+ if [ " $RPT_MODULES " = " 1" ]; then
964
+ PREREQ_PACKAGES=" $PREREQ_PACKAGES libusb-dev"
965
+ fi
961
966
fi
962
967
PREREQ_PACKAGES=" $PREREQ_PACKAGES libedit-dev" # Ubuntu also needs this package
963
968
# apt-get install libcurl3-gnutls=7.64.0-4+deb10u2 # fix git clone not working: upvoted comment at https://superuser.com/a/1642989
@@ -1378,6 +1383,12 @@ install_testsuite_itself() {
1378
1383
fi
1379
1384
1380
1385
add_phreak_testsuite
1386
+ if [ " $RPT_MODULES " = " 1" ]; then
1387
+ # Add radio tests
1388
+ cd $AST_SOURCE_PARENT_DIR /testsuite
1389
+ git apply $AST_SOURCE_PARENT_DIR /app_rpt/tests/apps/tests_apps.diff
1390
+ cp -r $AST_SOURCE_PARENT_DIR /app_rpt/tests/apps/rpt tests/apps
1391
+ fi
1381
1392
printf " %s\n" " Asterisk Test Suite installation complete"
1382
1393
}
1383
1394
@@ -1499,9 +1510,12 @@ dahdi_patch() {
1499
1510
1500
1511
git_patch () {
1501
1512
printf " Applying git patch: %s\n" " $1 "
1513
+ if [ " $GIT_REPO_PATH " = " " ]; then
1514
+ die " Variable GIT_REPO_PATH is empty... bug!"
1515
+ fi
1502
1516
cp " $GIT_REPO_PATH /patches/$1 " " /tmp/$1 "
1503
1517
if [ $? -ne 0 ]; then
1504
- die " File $1 does not exist"
1518
+ die " File $GIT_REPO_PATH /patches/ $ 1 does not exist"
1505
1519
fi
1506
1520
git apply " /tmp/$1 "
1507
1521
if [ $? -ne 0 ]; then
@@ -2333,8 +2347,6 @@ phreak_patches() { # $1 = $PATCH_DIR, $2 = $AST_SRC_DIR
2333
2347
# ## Inject custom PhreakNet patches to add additional functionality and features.
2334
2348
# ## If/when/as these are integrated upstream, they will be removed from this function.
2335
2349
2336
- instantiate_repo
2337
-
2338
2350
cd $AST_SOURCE_PARENT_DIR /$2
2339
2351
2340
2352
# # Add Standalone PhreakNet Modules
@@ -2959,6 +2971,9 @@ get_source() {
2959
2971
printf " chan_sip was not natively present in this version of Asterisk\n"
2960
2972
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)
2961
2973
fi
2974
+
2975
+ instantiate_repo
2976
+
2962
2977
if [ " $CHAN_SIP " = " 1" ]; then # somebody still wants chan_sip, okay...
2963
2978
if [ " $ENHANCED_CHAN_SIP " != " 1" ]; then
2964
2979
echoerr " chan_sip is deprecated and was removed in Asterisk 21. Consider migrating to chan_pjsip at your convenience."
@@ -2970,9 +2985,40 @@ get_source() {
2970
2985
./chan_sip_reinclude.sh
2971
2986
fi
2972
2987
fi
2988
+ if [ " $RPT_MODULES " = " 1" ]; then
2989
+ ALSA=1 # ALSA support in the build system is required for the USB radio channel drivers
2990
+ modprobe snd-pcm-oss # /dev/dsp1 needs to exist for chan_simpleusb and chan_usbradio to work
2991
+ grep " snd-pcm-oss" /etc/modules
2992
+ if [ $? -ne 0 ]; then
2993
+ echo " snd-pcm-oss" >> /etc/modules # load module at startup for USB
2994
+ fi
2995
+ if [ -d $AST_SOURCE_PARENT_DIR /app_rpt ]; then
2996
+ cd $AST_SOURCE_PARENT_DIR /app_rpt
2997
+ git pull
2998
+ else
2999
+ cd $AST_SOURCE_PARENT_DIR
3000
+ git clone --depth 1 https://github.com/AllStarLink/app_rpt.git
3001
+ fi
3002
+ cd $AST_SOURCE_PARENT_DIR /$AST_SRC_DIR
3003
+ # Patch in the radio modules
3004
+ git apply $AST_SOURCE_PARENT_DIR /app_rpt/apps/Makefile.diff
3005
+ git apply $AST_SOURCE_PARENT_DIR /app_rpt/channels/Makefile.diff
3006
+ git apply $AST_SOURCE_PARENT_DIR /app_rpt/res/Makefile.diff
3007
+ git apply $AST_SOURCE_PARENT_DIR /app_rpt/utils/Makefile.diff
3008
+ mkdir apps/app_rpt
3009
+ mkdir channels/xpmr
3010
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/apps/* .c apps
3011
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/apps/app_rpt/* apps/app_rpt
3012
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/channels/* .c $AST_SOURCE_PARENT_DIR /app_rpt/channels/* .h channels
3013
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/channels/xpmr/* channels/xpmr
3014
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/configs/samples/* .conf.sample configs/samples
3015
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/include/asterisk/* .h include/asterisk
3016
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/res/* .c $AST_SOURCE_PARENT_DIR /app_rpt/res/* .in res
3017
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/utils/* .c utils
3018
+ fi
2973
3019
if [ " $ALSA " = " 1" ]; then
2974
3020
# chan_alsa was removed in Asterisk 21, and with it, the support for ALSA lib detection in the build system. Add it back if needed.
2975
- lines=$( grep " HAVE_ALSA" include/asterisk/autoconfig.h | wc -l)
3021
+ lines=$( grep " HAVE_ALSA" include/asterisk/autoconfig.h.in | wc -l)
2976
3022
if [ $lines -eq 0 ]; then
2977
3023
printf " Patching build system to detect ALSA library\n"
2978
3024
git_patch " alsa.diff"
@@ -3024,7 +3070,7 @@ else
3024
3070
fi
3025
3071
3026
3072
FLAG_TEST=0
3027
- 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,autokvers,lightweight,api-key:,rotate,audit,boilerplate,upstream:,manselect,minimal,vanilla,wanpipe -- " $@ " )
3073
+ 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,rpt, sccp,clli:,debug:,devmode,disa:,drivers,experimental,extcodecs,fast,freepbx,generic,autokvers,lightweight,api-key:,rotate,audit,boilerplate,upstream:,manselect,minimal,vanilla,wanpipe -- " $@ " )
3028
3074
VALID_ARGUMENTS=$?
3029
3075
if [ " $VALID_ARGUMENTS " != " 0" ]; then
3030
3076
usage
@@ -3057,6 +3103,7 @@ while true; do
3057
3103
--alsa ) ALSA=1; shift ;;
3058
3104
--audit ) PKG_AUDIT=1; shift ;;
3059
3105
--cisco ) SIP_CISCO=1; shift ;;
3106
+ --rpt ) RPT_MODULES=1; shift ;;
3060
3107
--sccp ) CHAN_SCCP=1; shift ;;
3061
3108
--boilerplate ) BOILERPLATE_SOUNDS=1; shift ;;
3062
3109
--clli ) PHREAKNET_CLLI=$2 ; shift 2;;
@@ -3373,7 +3420,6 @@ elif [ "$cmd" = "install" ]; then
3373
3420
# Install Pre-Reqs
3374
3421
if [ " $PAC_MAN " = " apt-get" ]; then
3375
3422
printf " %s %d" " libvpb1 libvpb1/countrycode string" " $AST_CC " | debconf-set-selections -v
3376
- apt-get install -y libvpb1
3377
3423
fi
3378
3424
./contrib/scripts/install_prereq install
3379
3425
@@ -3466,7 +3512,7 @@ elif [ "$cmd" = "install" ]; then
3466
3512
# Now explicitly enable things we probably want.
3467
3513
# Core
3468
3514
menuselect/menuselect --enable app_bridgeaddchan --enable app_channelredirect --enable app_chanspy --enable app_confbridge --enable app_dial --enable app_exec menuselect.makeopts
3469
- menuselect/menuselect --enable app_flash --enable app_mixmonitor --enable app_originate --enable app_playback --enable app_playtones --enable app_read menuselect.makeopts
3515
+ menuselect/menuselect --enable app_flash --enable app_mixmonitor --enable app_originate --enable app_playback --enable app_playtones --enable app_read --enable app_userevent menuselect.makeopts
3470
3516
menuselect/menuselect --enable chan_bridge_media --enable chan_dahdi --enable chan_iax2 --enable chan_pjsip menuselect.makeopts
3471
3517
menuselect/menuselect --enable codec_a_mu --enable codec_dahdi --enable codec_ulaw menuselect.makeopts
3472
3518
menuselect/menuselect --enable format_pcm --enable format_sln --enable format_wav menuselect.makeopts
@@ -3558,6 +3604,19 @@ elif [ "$cmd" = "install" ]; then
3558
3604
fi
3559
3605
$AST_MAKE install # actually install modules and binary
3560
3606
3607
+ if [ " $RPT_MODULES " = " 1" ]; then
3608
+ # Also install the radio sounds
3609
+ if [ ! -d $AST_SOUNDS_DIR /rpt ]; then
3610
+ printf " RPT sounds don't exist yet, adding them now...\n"
3611
+ mkdir $AST_SOUNDS_DIR /rpt
3612
+ cd $AST_SOUNDS_DIR /rpt
3613
+ wget " http://downloads.allstarlink.org/asterisk-asl-sounds-en-ulaw.tar.gz"
3614
+ # Sounds are extracted directly into the dir
3615
+ tar -xvzf asterisk-asl-sounds-en-ulaw.tar.gz
3616
+ rm asterisk-asl-sounds-en-ulaw.tar.gz
3617
+ fi
3618
+ fi
3619
+
3561
3620
# Debugging: see where Asterisk got installed
3562
3621
which asterisk
3563
3622
which rasterisk
@@ -3774,7 +3833,7 @@ elif [ "$cmd" = "sounds" ]; then
3774
3833
cd /tmp
3775
3834
mkdir -p patfleet
3776
3835
cd patfleet
3777
- git clone https://github.com/hharte/PatFleet-asterisk/
3836
+ git clone --depth 1 https://github.com/hharte/PatFleet-asterisk/
3778
3837
cd PatFleet-asterisk/pa
3779
3838
mv dictate/* $AST_SOUNDS_DIR /dictate
3780
3839
mv digits/* $AST_SOUNDS_DIR /digits
@@ -3912,7 +3971,7 @@ elif [ "$cmd" = "mkdocs" ]; then
3912
3971
git pull
3913
3972
rm -rf /tmp/documentation/temp/site
3914
3973
else
3915
- git clone https://github.com/asterisk/documentation.git --depth 1
3974
+ git clone --depth 1 https://github.com/asterisk/documentation.git
3916
3975
cd documentation
3917
3976
fi
3918
3977
@@ -3937,7 +3996,7 @@ elif [ "$cmd" = "pubdocs" ]; then
3937
3996
if [ -d publish-docs ]; then
3938
3997
rm -rf publish-docs
3939
3998
fi
3940
- git clone https://github.com/asterisk/publish-docs.git
3999
+ git clone --depth 1 https://github.com/asterisk/publish-docs.git
3941
4000
cd publish-docs
3942
4001
echo $AST_SOURCE_PARENT_DIR
3943
4002
printf " %s\n" " Generating Confluence markup..."
0 commit comments