root/modules/branches/2.5/asterisk-cli/functions.inc.php

Revision 6016, 409 bytes (checked in by p_lindheimer, 5 years ago)

#2917 run CLI commands through the manager to avoid secrity issues trying to exec commands

Line 
1 <?php
2
3 function cli_runcommand($txtCommand) {
4     global $astman;
5
6     if ($astman) {
7
8         $html_out = "<pre>";
9         $response = $astman->send_request('Command',array('Command'=>"$txtCommand"));
10         $response = explode("\n",$response['data']);
11         unset($response[0]); //remove the Priviledge Command line
12         $response = implode("\n",$response);
13         $html_out .= $response;
14         $html_out .= "</pre>";
15         return $html_out;
16     }
17 }
18 ?>
19
Note: See TracBrowser for help on using the browser.