How To: Auto-Restart Asterisk

Posted by Ahsan Tasneem | 8:57 AM | , , , | 0 comments »

Configure your inittab file to restart Asterisk automatically if it ever crashes.
This tutorial assumes you have root access and you are running your asterisk server as user “asterisk” instead of “root”.
1. Configure your inittab file for asterisk.
[root@localhost]#vi /etc/inittab
.
.
.
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6


ax:2345:respawn:/usr/sbin/asterisk -qf -U asterisk -G asterisk
.
.

2. Instruct init to re-read the inittab file.
[root@localhost]#init q
3. Now try to connect to the asterisk process.
[root@localhost]#asterisk -r
You should get the asterisk CLI at this pointlocalhost*CLI>
4. In order to hard restart asterisk, use this command.
[root@localhost]#asterisk -rx “stop now”
5. In order to completely stop the asterisk process,
  • You have to go back to step 1 and comment the asterisk line out.
  • Then issue the ‘init q‘ command
  • Then issue the ‘asterisk -rx “stop now‘ command

0 comments

Related Posts Plugin for WordPress, Blogger...