O'Reilly logo

Asterisk: The Future of Telephony by Leif Madsen, Jared Smith, Jim Van Meggelen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

TrySystem() — Tries to execute an operating system command

Synopsis

    TrySystem(command)

Attempts to execute a command in the underlying operating system. If the command itself executes but is in error, and if there exists a priority n+101 (where n is the current priority), the execution of the dialplan will continue at that priority level.

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

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

See Also

System()

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required