AstRecipes » Removing AsteriskIt is sometimes necessary to completely remove Asterisk for one machine, for example because you need to install a newer version. Stop Asterisk and unload its modules
The first thing you have to do is to stop Asterisk and unload the modules it may be using, e.g Zaptel's. The following lines will brutally terminate Asterisk and kill all ongoing conversation. You have to kill safe_asterisk first, otherwise it will respawn Asterisk.
Then you'll have to unload the Zaptel drivers; check which ones are loaded by issuing a:
killall -9 safe_asterisk
killall -9 asterisk
This means that the submodules wcfxo and wctdm are loaded for zaptel. We'll have to remove them in reverse order:
[root@zebru]# lsmod | grep zaptel
zaptel 214820 2 wcfxo,wctdm
crc_ccitt 2113 1 zaptel
If you repeat the lsmod | grep zaptel command now, it should find nothing. Delete Asterisk files
modprobe -r wcfxo
modprobe -r wctdm
..repeat for all zaptel submodules....
modprobe -r zaptel
By running the commands below, you will delete with no possible recovery an Asterisk system. First make a backup of things you'd like to keep, lik ethe log files or the configuration files.
Remember: once you run these commands, there's no turning back!
Now your Asterisk system has been completely removed.
rm -rf /etc/asterisk
rm -f /etc/zaptel.conf
rm -rf /var/log/asterisk
rm -rf /var/lib/asterisk
rm -rf /var/spool/asterisk
rm -rf /usr/lib/asterisk