Asterisk func shell
Description:
SHELL(command)Runs command and returns its output
Notes
Uses /bin/sh , regardless of what shell you actually set for Asterisk.Return value
The output of the commandFor single line output, you often will need to trim the last character, which may be a newline character. Depending on your script, if the script sends a newline, you will need to use something like:
${SHELL(echo 123):0:-1}
Example
In AEL2 script, variable result is valued to 1 if /etc/asterisk/asterisk.conf file exists, or 0 otherwise :Set(result=${SHELL(test -f /etc/asterisk/asterisk.conf && echo -n 1 || echo -n 0)});
NoOp(result is ${result});
See also
- Asterisk cmd System
- Asterisk cmd ReadFile - Read contents of a file into a dialplan variable
- Asterisk func CURL - Retrieve the contens of a URL
- Asterisk cmd backticks - An external application that implemented similar functionality
- Asterisk variables
- Asterisk functions
Featured -
Search:

Page Changes















