userdoc:tt_ast_startup

This is an old revision of the document!


Asterisk Startup Commands

Since Asterisk 1.6.0 there is a config file cli.conf where you can add CLI commands, which will be executed, when Asterisk starts. With the originate you can also trigger a “call” at startup. A call to a local dummy extension can trigger a context, where you can e.g. initialize custom lamp states from a database or something else.

cli.conf

;
; Asterisk CLI configuration
;

[startup_commands]
;
; Any commands listed in this section will get automatically executed
; when Asterisk starts as a daemon or foreground process (-c).
;
;sip set debug on = yes
;core set verbose 3 = yes
;core set debug 1 = yes

originate local/ast-startup extension s@asterisk-startup = yes

In this example the local extension ast-startup call extension s in context asterisk-startup (don't forget the “= yes” at the end of the line).

extensions.conf

; Ast-Startup Dummy Extension
exten => ast-startup,1,Answer()
exten => ast-startup,n,Wait(3)
exten => ast-startup,n,Hangup()

[asterisk-startup]
exten => s,1,NoOp(Asterisk Startup Script)
exten => s,n,NoOp(Do whatever you want)
exten => s,n,Set(DEVICE_STATE(Custom:My-custom-lamp)=NOT_INUSE)
exten => s,n,Hangup()
  • userdoc/tt_ast_startup.1335177036.txt.gz
  • Last modified: 2012/04/23 05:30
  • by droemel