start/stop via api
bombolini opened this issue · 1 comments
Hello Emre,
Could you please let us know how to integrate stream.php or api.php to start/stop a channel via command line?
How to stop ch_id = 1 , which its server_id is 1:
http://ip:port/api.php?action=stream&sub=stop&stream_id=1&server_id=1
This works only on Chrome/mozilla etc but not in terminal
Can't get return when I send request via curl on a remote server.
Thank you
Bombolini
idk, if you look into admin/api.php, you can see this,
if (in_array($rSub, Array("start", "stop"))) {
echo APIRequest(Array("action" => "stream", "sub" => $rSub, "stream_ids" => Array($rStreamID), "servers" => Array($rServerID)));exit;
it uses 2 arrays with 2 "get" arguments, "stream_ids" and "servers"
"stream_ids" => Array($rStreamID),
"servers" => Array($rServerID)
it may work like this, but i just don't know how to use those array things in curl command.
curl -v "http://127.0.0.1:25461/api.php?action=stream&sub=start&stream_ids[]=1&servers[]=1"