]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add single_command.php example
authorRaymond Chandler <intralanman@freeswitch.org>
Sat, 21 Feb 2009 03:17:58 +0000 (03:17 +0000)
committerRaymond Chandler <intralanman@freeswitch.org>
Sat, 21 Feb 2009 03:17:58 +0000 (03:17 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12216 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/esl/php/single_command.php [new file with mode: 0755]

diff --git a/libs/esl/php/single_command.php b/libs/esl/php/single_command.php
new file mode 100755 (executable)
index 0000000..76d83bc
--- /dev/null
@@ -0,0 +1,17 @@
+#!/usr/bin/php
+<?php
+require_once('ESL.php');
+
+if ($argc > 1) {
+    array_shift($argv);
+    $command = sprintf('%s', implode(' ', $argv));
+    printf("Command to run is: %s\n", $command);
+
+    $sock = new ESLconnection('localhost', '8021', 'ClueCon');
+    $res = $sock->api($command);
+    printf("%s\n", $res->getBody());
+} else {
+    printf("ERROR: You Need To Pass A Command\nUsage:\n\t%s <command>", $argv[0]);
+}
+
+?>