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

Revision 6022, 409 bytes (checked in by p_lindheimer, 4 years ago)

Merged revisions 6019-6020 via svnmerge from
http://svn.freepbx.org/modules/branches/2.4

................

r6019 | p_lindheimer | 2008-07-15 14:05:37 -0700 (Tue, 15 Jul 2008) | 13 lines


Merged revisions 6016-6017 via svnmerge from
http://svn.freepbx.org/modules/branches/2.5


........

r6016 | p_lindheimer | 2008-07-15 13:59:17 -0700 (Tue, 15 Jul 2008) | 1 line


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

........

r6017 | p_lindheimer | 2008-07-15 14:02:03 -0700 (Tue, 15 Jul 2008) | 1 line


Module Publish Script: asterisk-cli 2.5.0

........

................

r6020 | p_lindheimer | 2008-07-15 14:06:00 -0700 (Tue, 15 Jul 2008) | 1 line


Module Publish Script: asterisk-cli 2.4.1

................

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 ?>
Note: See TracBrowser for help on using the browser.