@@ -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
@@ -1499,9 +1504,12 @@ dahdi_patch() {
1499
1504
1500
1505
git_patch () {
1501
1506
printf " Applying git patch: %s\n" " $1 "
1507
+ if [ " $GIT_REPO_PATH " = " " ]; then
1508
+ die " Variable GIT_REPO_PATH is empty... bug!"
1509
+ fi
1502
1510
cp " $GIT_REPO_PATH /patches/$1 " " /tmp/$1 "
1503
1511
if [ $? -ne 0 ]; then
1504
- die " File $1 does not exist"
1512
+ die " File $GIT_REPO_PATH /patches/ $ 1 does not exist"
1505
1513
fi
1506
1514
git apply " /tmp/$1 "
1507
1515
if [ $? -ne 0 ]; then
@@ -2333,8 +2341,6 @@ phreak_patches() { # $1 = $PATCH_DIR, $2 = $AST_SRC_DIR
2333
2341
# ## Inject custom PhreakNet patches to add additional functionality and features.
2334
2342
# ## If/when/as these are integrated upstream, they will be removed from this function.
2335
2343
2336
- instantiate_repo
2337
-
2338
2344
cd $AST_SOURCE_PARENT_DIR /$2
2339
2345
2340
2346
# # Add Standalone PhreakNet Modules
@@ -2959,6 +2965,9 @@ get_source() {
2959
2965
printf " chan_sip was not natively present in this version of Asterisk\n"
2960
2966
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
2967
fi
2968
+
2969
+ instantiate_repo
2970
+
2962
2971
if [ " $CHAN_SIP " = " 1" ]; then # somebody still wants chan_sip, okay...
2963
2972
if [ " $ENHANCED_CHAN_SIP " != " 1" ]; then
2964
2973
echoerr " chan_sip is deprecated and was removed in Asterisk 21. Consider migrating to chan_pjsip at your convenience."
@@ -2970,9 +2979,40 @@ get_source() {
2970
2979
./chan_sip_reinclude.sh
2971
2980
fi
2972
2981
fi
2982
+ if [ " $RPT_MODULES " = " 1" ]; then
2983
+ ALSA=1 # ALSA support in the build system is required for the USB radio channel drivers
2984
+ modprobe snd-pcm-oss # /dev/dsp1 needs to exist for chan_simpleusb and chan_usbradio to work
2985
+ grep " snd-pcm-oss" /etc/modules
2986
+ if [ $? -ne 0 ]; then
2987
+ echo " snd-pcm-oss" >> /etc/modules # load module at startup for USB
2988
+ fi
2989
+ if [ -d $AST_SOURCE_PARENT_DIR /app_rpt ]; then
2990
+ cd $AST_SOURCE_PARENT_DIR /app_rpt
2991
+ git pull
2992
+ else
2993
+ cd $AST_SOURCE_PARENT_DIR
2994
+ git clone --depth 1 https://github.com/AllStarLink/app_rpt.git
2995
+ fi
2996
+ cd $AST_SOURCE_PARENT_DIR /$AST_SRC_DIR
2997
+ # Patch in the radio modules
2998
+ git apply $AST_SOURCE_PARENT_DIR /app_rpt/apps/Makefile.diff
2999
+ git apply $AST_SOURCE_PARENT_DIR /app_rpt/channels/Makefile.diff
3000
+ git apply $AST_SOURCE_PARENT_DIR /app_rpt/res/Makefile.diff
3001
+ git apply $AST_SOURCE_PARENT_DIR /app_rpt/utils/Makefile.diff
3002
+ mkdir apps/app_rpt
3003
+ mkdir channels/xpmr
3004
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/apps/* .c apps
3005
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/apps/app_rpt/* apps/app_rpt
3006
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/channels/* .c $AST_SOURCE_PARENT_DIR /app_rpt/channels/* .h channels
3007
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/channels/xpmr/* channels/xpmr
3008
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/configs/samples/* .conf.sample configs/samples
3009
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/include/asterisk/* .h include/asterisk
3010
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/res/* .c $AST_SOURCE_PARENT_DIR /app_rpt/res/* .in res
3011
+ cp $AST_SOURCE_PARENT_DIR /app_rpt/utils/* .c utils
3012
+ fi
2973
3013
if [ " $ALSA " = " 1" ]; then
2974
3014
# 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)
3015
+ lines=$( grep " HAVE_ALSA" include/asterisk/autoconfig.h.in | wc -l)
2976
3016
if [ $lines -eq 0 ]; then
2977
3017
printf " Patching build system to detect ALSA library\n"
2978
3018
git_patch " alsa.diff"
@@ -3024,7 +3064,7 @@ else
3024
3064
fi
3025
3065
3026
3066
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 -- " $@ " )
3067
+ 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
3068
VALID_ARGUMENTS=$?
3029
3069
if [ " $VALID_ARGUMENTS " != " 0" ]; then
3030
3070
usage
@@ -3057,6 +3097,7 @@ while true; do
3057
3097
--alsa ) ALSA=1; shift ;;
3058
3098
--audit ) PKG_AUDIT=1; shift ;;
3059
3099
--cisco ) SIP_CISCO=1; shift ;;
3100
+ --rpt ) RPT_MODULES=1; shift ;;
3060
3101
--sccp ) CHAN_SCCP=1; shift ;;
3061
3102
--boilerplate ) BOILERPLATE_SOUNDS=1; shift ;;
3062
3103
--clli ) PHREAKNET_CLLI=$2 ; shift 2;;
@@ -3373,7 +3414,6 @@ elif [ "$cmd" = "install" ]; then
3373
3414
# Install Pre-Reqs
3374
3415
if [ " $PAC_MAN " = " apt-get" ]; then
3375
3416
printf " %s %d" " libvpb1 libvpb1/countrycode string" " $AST_CC " | debconf-set-selections -v
3376
- apt-get install -y libvpb1
3377
3417
fi
3378
3418
./contrib/scripts/install_prereq install
3379
3419
@@ -3558,6 +3598,19 @@ elif [ "$cmd" = "install" ]; then
3558
3598
fi
3559
3599
$AST_MAKE install # actually install modules and binary
3560
3600
3601
+ if [ " $RPT_MODULES " = " 1" ]; then
3602
+ # Also install the radio sounds
3603
+ if [ ! -d $AST_SOUNDS_DIR /rpt ]; then
3604
+ printf " RPT sounds don't exist yet, adding them now...\n"
3605
+ mkdir $AST_SOUNDS_DIR /rpt
3606
+ cd $AST_SOUNDS_DIR /rpt
3607
+ wget " http://downloads.allstarlink.org/asterisk-asl-sounds-en-ulaw.tar.gz"
3608
+ # Sounds are extracted directly into the dir
3609
+ tar -xvzf asterisk-asl-sounds-en-ulaw.tar.gz
3610
+ rm asterisk-asl-sounds-en-ulaw.tar.gz
3611
+ fi
3612
+ fi
3613
+
3561
3614
# Debugging: see where Asterisk got installed
3562
3615
which asterisk
3563
3616
which rasterisk
@@ -3774,7 +3827,7 @@ elif [ "$cmd" = "sounds" ]; then
3774
3827
cd /tmp
3775
3828
mkdir -p patfleet
3776
3829
cd patfleet
3777
- git clone https://github.com/hharte/PatFleet-asterisk/
3830
+ git clone --depth 1 https://github.com/hharte/PatFleet-asterisk/
3778
3831
cd PatFleet-asterisk/pa
3779
3832
mv dictate/* $AST_SOUNDS_DIR /dictate
3780
3833
mv digits/* $AST_SOUNDS_DIR /digits
@@ -3912,7 +3965,7 @@ elif [ "$cmd" = "mkdocs" ]; then
3912
3965
git pull
3913
3966
rm -rf /tmp/documentation/temp/site
3914
3967
else
3915
- git clone https://github.com/asterisk/documentation.git --depth 1
3968
+ git clone --depth 1 https://github.com/asterisk/documentation.git
3916
3969
cd documentation
3917
3970
fi
3918
3971
@@ -3937,7 +3990,7 @@ elif [ "$cmd" = "pubdocs" ]; then
3937
3990
if [ -d publish-docs ]; then
3938
3991
rm -rf publish-docs
3939
3992
fi
3940
- git clone https://github.com/asterisk/publish-docs.git
3993
+ git clone --depth 1 https://github.com/asterisk/publish-docs.git
3941
3994
cd publish-docs
3942
3995
echo $AST_SOURCE_PARENT_DIR
3943
3996
printf " %s\n" " Generating Confluence markup..."
0 commit comments