Module system

Access to operating system commands.

This module provides access to various commands available at the operating system level.

Info:

  • Copyright: 2011-2015 Chad Phillips
  • Author: Chad Phillips

Actions

shell_command Execute a shell command.
shell_command_with_output Execute a shell command, saving the output.


Actions

shell_command
Execute a shell command.

This action executes a system shell command, storing the return code in the 'return_code' key of the specificed storage area. The environment the shell command runs in is the same environment FreeSWITCH provides to Lua.

This action is preferred over the shell_command_with_output action if the output of the command is not needed.

  • action string shell_command
  • command string The shell command to run. Arguments can be provided if needed.
  • storage_area string The storage area to store the return code. Default is 'system'.

Usage:

    {
      action = "shell_command",
      command = "service foo start",
      storage_area = "service_return_code",
    }
shell_command_with_output
Execute a shell command, saving the output.

This action executes a system shell command, storing the return code in the 'return_code' key, and the command output in the 'output' key of the specificed storage area. The environment the shell command runs in is the same environment FreeSWITCH provides to Lua.

If the command output is not needed, the shell_command action is preferred.

NOTE: Due to limitations in Lua 5.x, this action has a slightly hackish implementation -- it's not portable, doubtful it will work on Windows, mileage may vary.

  • action string shell_command_with_output
  • command string The shell command to run. Arguments can be provided if needed.
  • storage_area string The storage area to store the return code and output. Default is 'system'.

Usage:

    {
      action = "shell_command_with_output",
      command = "ls -1 /tmp/*.wav",
      storage_area = "ls_return",
    }
generated by LDoc 1.4.6 Last updated 2021-04-08 08:59:59