login | register
Tue 09 of Feb, 2010 [21:03 UTC]

voip-info.org

History

Asterisk options

Created by: oej,Last modification on Wed 01 of Oct, 2008 [14:18 UTC] by timbo

Starting Asterisk

  • -c: Console mode. Don't go into background mode, stay in foreground with a command line interface (implies -f)
  • -C <filename>: Start Asterisk with a specified configuration file
  • -d: Debug mode
  • -f: Stay in foreground mode
  • -g: Dump core in case of a crash
  • -h: Help (list all command line options).
  • -i: Initializie crypto keys at startup
  • -p: Run as pseudo-realtime thread
  • -q: Quiet mode
  • -v: The verbose command. Add more 'v':s to get more messages.


Connecting to a running Asterisk

  • -r:Connect to Asterisk running in the background and present a command line interface
  • -R:Same as -r, but will automatically reconnect to the daemon (or at least retry) if the daemon restarts
  • -x:In combination with -r, execute an Asterisk CLI command
  • -n:Disable ANSI colour support



Examples


  • asterisk -vvvvvvdr:Start a very chatty Asterisk command line interface and connect to asterisk running in the background
  • asterisk -vvvvvvc:Start Asterisk PBX, don't go background
  • asterisk -rx reload:Connect to a running Asterisk, force reload of configuration with the CLI command "reload"



Comments

Comments Filter
222

333my init.d script

by , Tuesday 31 of August, 2004 [18:42:13 UTC]
This may not be perfect, and I'm still refining it, but here's my attempt at an init.d script.


  1. !/bin/bash
  2. asterisk Startup script for the asterisk PBX Server
  3. chkconfig: - 87 15
  4. description: Asterisk is a PBX server.
  5. processname: asterisk
  6. config: /etc/asterisk/
  7. pidfile: /var/run/asterisk.pid

  1. Source function library.
. /etc/rc.d/init.d/functions

asterisk=/usr/sbin/asterisk
prog=Asterisk
pidfile=/var/run/asterisk.pid
lockfile=/var/lock/subsys/asterisk
RETVAL=0

start() {
       echo -n $"Starting $prog: "
       daemon $asterisk $OPTIONS
       RETVAL=$?
       echo
        $RETVAL = 0  && touch ${lockfile}
       return $RETVAL
}
stop() {
       echo -n $"Stopping $prog: "
       killproc $asterisk
       RETVAL=$?
       echo
        $RETVAL = 0  && rm -f ${lockfile} ${pidfile}
}
reload() {
       echo -n $"Reloading $prog config files "
       $asterisk -rx reload
       RETVAL=$?
       echo
}

  1. See how we were called.
case "$1" in
 start)
       start
       ;;
 stop)
       stop
       ;;
 restart)
       stop
       start
       ;;
 reload)
       reload
       ;;
 *)
       echo $"Usage: $prog {start|stop|restart|reload}"
       exit 1
esac

exit $RETVAL