Open Source - How do I completely remove Asterisk and DAHDI installed from source?

Please note that the following process only for asterisk implementation that has been installed from source, If you have installed Asterisk or DAHDI using a Package manager (such as yum, apt-get, etc), please use the manager interface to remove it. 
 

  1. Stop all related services

[root@server ~]#
[root@server ~]# killall -9 safe_asterisk
[root@server ~]# service asterisk stop
[root@server ~]# service dahdi stop
  1. Confirm if Asterisk and Dahdi are no longer running with ps aux 

[root@server ~]# ps aux | grep asterisk
 

Note: ps aux should only return lines like these if the process was stopped successfully, example:

root@server:~# ps aux | grep asterisk
root 19616 0.0 0.0 4356 744 pts/0 S+ 22:12 0:00 grep asterisk\|dahdi
  1. Confirm DAHDI Drivers are unloaded with lsmod:

[root@server ~]# lsmod | grep dahdi

Example:

[root@server ~]# lsmod | grep -i dahdi
dahdi_voicebus         49298  2 wctdm24xxp,wcte12xp
dahdi_transcode         5272  1 wctc4xxp
dahdi                 209513  20 wcb4xxp,wcaxx,wctdm24xxp,wctdm,wcfxo,wcte13xp,wcte12xp,dahdi_voicebus,wcte11xp,wct1xxp,wcte43x,wct4xxp,oct612x,dahdi_transcode
crc_ccitt               1337  2 wctdm24xxp,dahdi

 

 

In the example above dahdi modules such wctc4xxp, wctdm24xxp, and wcte12xp are listed. for each of these modules we will need to run  modprobe -r to remove them.  Example: modprobe -r wctc4xxp

  1. Remove asterisk and dahdi files 

Note: The following commands will delete all the configuration files 
 

[root@server ~]# rm -rf /etc/asterisk [root@server ~]# rm -f /etc/dahdi.conf [root@server ~]# rm -rf /var/log/asterisk [root@server ~]# rm -rf /var/lib/asterisk [root@server ~]# rm -rf /var/spool/asterisk [root@server ~]# rm -rf /usr/lib/asterisk

 

Now your Asterisk system has been completely removed. To install DAHDI, libPRI and Asterisk reference the Asterisk wiki at https://wiki.asterisk.org/wiki/display/AST/Installing+Asterisk+From+Source

Related content