root/modules/branches/2.7/asterisk-cli/functions.inc.php
| Revision 7470, 1.3 kB (checked in by mickecarlsson, 4 years ago) |
|---|
| Line | |
|---|---|
| 1 | <?php |
| 2 | //This file is part of FreePBX. |
| 3 | // |
| 4 | // FreePBX is free software: you can redistribute it and/or modify |
| 5 | // it under the terms of the GNU General Public License as published by |
| 6 | // the Free Software Foundation, either version 2 of the License, or |
| 7 | // (at your option) any later version. |
| 8 | // |
| 9 | // FreePBX is distributed in the hope that it will be useful, |
| 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | // GNU General Public License for more details. |
| 13 | // |
| 14 | // You should have received a copy of the GNU General Public License |
| 15 | // along with FreePBX. If not, see <http://www.gnu.org/licenses/>. |
| 16 | // |
| 17 | // Written by Diego Iastrubni <diego.iastrubni@xorcom.com> |
| 18 | // Copyright (C) 2005, Xorcom |
| 19 | // |
| 20 | // This code is derived from ASTLinux 0.3 |
| 21 | // |
| 22 | // The original author of AST linux is: |
| 23 | // Kristian Kielhofner - KrisCompanies, LLC - http://astlinux.org/ |
| 24 | // |
| 25 | |
| 26 | function cli_runcommand($txtCommand) { |
| 27 | global $astman; |
| 28 | |
| 29 | if ($astman) { |
| 30 | |
| 31 | $html_out = "<pre>"; |
| 32 | $response = $astman->send_request('Command',array('Command'=>"$txtCommand")); |
| 33 | $response = explode("\n",$response['data']); |
| 34 | unset($response[0]); //remove the Priviledge Command line |
| 35 | $response = implode("\n",$response); |
| 36 | $html_out .= $response; |
| 37 | $html_out .= "</pre>"; |
| 38 | return $html_out; |
| 39 | } |
| 40 | } |
| 41 | ?> |
| 42 |
Note: See TracBrowser for help on using the browser.
