Calling a cli function from within a dialplan


I’d like to call a cli function from within the dialplan, is this possible? I want the do a logger refresh, so that my log files don’t get to big


The best way is with the Manager API: … on+Command

You may use something like an AGI to call a script to execute the command against the Manager API using:


exten => s,1,AGI(reload.agi)

Then the reload script invokes the Manager API to issue the CLI command.

you can also use the System application with the asterisk binary.

For example, System(/usr/sbin/asterisk -rx reload) sends the command ‘reload’ to the Asterisk CLI. Getting feedback from it is hard, but it works to execute stuff