Name

System() — Executes an operating system command

Synopsis

System(command)

Executes a command in the underlying operating system. This application sets a channel variable named SYSTEMSTATUS to either FAILURE or SUCCESS, depending on whether or not Asterisk was successfully able to run the command.

This application is very similar to the TrySystem() application, except that it will return -1 if it is unable to execute the system command, whereas the TrySystem() application will always return 0.

exten => 123,1,System(echo hello > /tmp/hello.txt)

See Also

TrySystem()

Get Asterisk: The Future of Telephony, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.