Skip to content

Commit

Permalink
install: Make wanpipe optional, use mirror if needed.
Browse files Browse the repository at this point in the history
Currently, the ftp.sangoma.com server is not being
responsive, so this makes two improvements:

* Only install wanpipe if directed to, since most
  installations don't need this anyways
* If ftp.sangoma.com is unresponsive, don't keep
  retrying, since with 20 retries of 4 minutes each,
  this will retry up to 80 minutes, for no reason.
  Instead, fall back to using the Wayback Machine's
  copy of the tarball if needed.
  • Loading branch information
InterLinked1 committed Mar 17, 2024
1 parent 07b69f8 commit 013e5c5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
wget https://raw.githubusercontent.com/InterLinked1/phreakscript/master/phreaknet.sh
chmod +x phreaknet.sh
./phreaknet.sh make
phreaknet install -d -s -t
phreaknet install -d -s -t --drivers --wanpipe
phreaknet runtests
debian-stable-asterisk-latest-unpatched:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions phreaknet.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ directories if necessary.
**-v**, **--version**
: Specific version of Asterisk to install (M.m.b e.g. 18.8.0). Also, see **--vanilla**.

**--wanpipe**
: Also install the Wanpipe drivers, needed for Sangoma cards

The following options may be used with the **sounds** command.

**--boilerplate**
Expand Down
20 changes: 15 additions & 5 deletions phreaknet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# PhreakScript
# (C) 2021-2023 Naveen Albert, PhreakNet, and others - https://github.com/InterLinked1/phreakscript ; https://portal.phreaknet.org ; https://docs.phreaknet.org
# v1.1.2 (2024-03-09)
# v1.1.3 (2024-03-17)

# Setup (as root):
# cd /usr/local/src
Expand All @@ -12,7 +12,8 @@
# phreaknet update
# phreaknet install

## Begin Change Log:'
## Begin Change Log:
# 2024-03-17 1.1.3 DAHDI: Only build wanpipe if requested
# 2024-03-09 1.1.2 Asterisk: fix broken patches that no longer applied
# 2024-01-12 1.1.1 Asterisk: target Asterisk 21.1.0-rc1, fix 'phreaknet restart' command
# 2023-10-26 1.1.0 Asterisk/DAHDI: target Asterisk 21, DAHDI 3.3.0-rc1
Expand Down Expand Up @@ -244,6 +245,7 @@ SIP_CISCO=0
CHAN_SCCP=0
CHAN_DAHDI=0
DAHDI_OLD_DRIVERS=0
DAHDI_WANPIPE=0 # wanpipe only needed for Sangoma cards
DEVMODE=0
TEST_SUITE=0
FORCE_INSTALL=0
Expand Down Expand Up @@ -1403,7 +1405,9 @@ install_dahdi() {
make && make install

# Wanpipe
install_wanpipe
if [ "$DAHDI_WANPIPE" = "1" ]; then
install_wanpipe
fi

service dahdi restart
}
Expand Down Expand Up @@ -1437,7 +1441,12 @@ install_wanpipe() {
done

cd $AST_SOURCE_PARENT_DIR
wget https://ftp.sangoma.com/linux/current_wanpipe/${WANPIPE_SOURCE_NAME}.tgz
# Sangoma clearly doesn't know how to run a web server, since their server keeps going down.
# Pull tarball from Wayback Machine if Sangoma's is unresponsive
wget --tries=1 https://ftp.sangoma.com/linux/current_wanpipe/${WANPIPE_SOURCE_NAME}.tgz
if [ $? -ne 0 ]; then
wget https://web.archive.org/web/20240103031741/https://ftp.sangoma.com/linux/current_wanpipe/${WANPIPE_SOURCE_NAME}.tgz
fi
tar xvfz ${WANPIPE_SOURCE_NAME}.tgz
WANPIPE_DIR=`tar -tzf $WANPIPE_SOURCE_NAME.tgz | head -1 | cut -f1 -d"/"`
cd ${WANPIPE_DIR}
Expand Down Expand Up @@ -2261,7 +2270,7 @@ else
fi

FLAG_TEST=0
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 -- "$@")
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 -- "$@")
VALID_ARGUMENTS=$?
if [ "$VALID_ARGUMENTS" != "0" ]; then
usage
Expand Down Expand Up @@ -2312,6 +2321,7 @@ while true; do
--manselect ) MANUAL_MENUSELECT=1; shift ;;
--minimal ) ENHANCED_INSTALL=0; shift ;;
--vanilla ) EXTRA_FEATURES=0; shift ;;
--wanpipe ) DAHDI_WANPIPE=1; shift ;;
# -- means the end of the arguments; drop this, and break out of the while loop
--) shift; break ;;
# If invalid options were passed, then getopt should have reported an error,
Expand Down

0 comments on commit 013e5c5

Please sign in to comment.