ostridge
Guru
- Joined
- Jan 22, 2015
- Messages
- 1,813
- Reaction score
- 625
For those wishing to follow the tutorial for
turning-incredible-pbx-into-a-lean-mean-asterisk-machine
You probably would want to simplify the removal for the Telephone and Web Reminders and exten# 123
Subject to the usual caveats the following code follows the removal tutorial as well as adding BEGIN and END lines to the bulk of the dialplan [remind*] contexts.
Note actual removal part is untested as - well, dont really want to trash a working Incredible setup.
Does anyone want to try?
turning-incredible-pbx-into-a-lean-mean-asterisk-machine
You probably would want to simplify the removal for the Telephone and Web Reminders and exten# 123
Subject to the usual caveats the following code follows the removal tutorial as well as adding BEGIN and END lines to the bulk of the dialplan [remind*] contexts.
Note actual removal part is untested as - well, dont really want to trash a working Incredible setup.
Does anyone want to try?
Bash:
#!/bin/bash
##filename= uninstall-123+tel+web-reminders.sh
##set debug, lineno
# set -xveuo pipefail # ### this line will enable debug ###
# PS4='$LINENO: '
# cd /etc/asterisk
rm -f ~/extensions_custom.conf
cp -f /etc/asterisk/extensions_custom.conf ~/extensions_custom.conf
_linr=`grep -n "reminder\]$" ./extensions_custom.conf |cut -d':' -f1` ; echo "$_linr"
# echo "$_linr"
sed -i "$_linr s:^:;# // BEGIN reminders-contexts\n:" ./extensions_custom.conf
_linr=$( cat ~/extensions_custom.conf |grep -n "remindem\]$" |cut -d':' -f1 )
_linr=`expr "$_linr" + 36` ; echo $_linr
sed -i "$_linr s:exten => h,6,Hangup:exten => h,6,Hangup\n;# // END reminders-contexts:" ./extensions_custom.conf
echo ""
exho " You are about to remove exten 123 and the reminders-contexts (Untested code)".
read -p "To continue at your own risk press 'Enter', or 'Ctrl + C' to abort"
##set debug, lineno : comment out next 2 lines when done.
set -xveuo pipefail # ### this line enables debug ###
PS4='$LINENO: '
# 1)
sed -i '\:// BEGIN Reminders:,\:// END Reminders:d'
# 2)
cd /var/lib/asterisk/agi-bin
rm -f checkdate.php checktime.php reminder.php run_recurring run_reminders
# 3)
cd /var/lib/asterisk/sounds/custom #note: reminder* sounds are NOT in ../../sounds/en/custom/
rm -f remind*
# 4)
cd /var/www/html
rm -rf reminders
# 5)
cd /var/spool/asterisk
rm -rf recurring
rm -rf reminders
cd ~
# 6)
fwconsole ma delete reminders
# 7)
fwconsole reload
# 8)
asterisk -x "dialplan reload"
# 9)
fwconsole restart
#10) extensions_custom.conf and delete all commands within all the [remind*] contexts and then reload
sed -i '\:// BEGIN reminders-contexts:,\:// END reminders-contexts:d'
#Then reload:
asterisk -x "dialplan reload"
cd ~
echo " Done"
Last edited: