Ejemplo n.º 1
0
    print "The ip address format is incorrect";
    exit;
}
if (!verifyTuner($tuner)) {
    print "Could not find the tuner for this receiver";
    exit;
}
$result = exec("\"" . $SOAP_DIR . "reboot.pl\" " . $receiver);
if (preg_match("/Receiver is rebooting/", $result)) {
    print "Receiver is rebooting.  Please allow 10 minutes for the receiver to come back online.";
} else {
    print "There was an error rebooting the receiver.";
}
$r1 = new MulticastReceiver();
$r2 = new MulticastReceiver();
if (($r1 = findMulticastReceiver($receiver, $tuner)) == null) {
    exit;
}
if ($r1->getTuner() == 1) {
    $r2 = findMulticastReceiver($receiver, 0);
} else {
    $r2 = findMulticastReceiver($receiver, 1);
}
if ($r1 != null) {
    $r1->setIsStreaming(0);
    logStatus($r1);
}
if ($r2 != null) {
    $r2->setIsStreaming(0);
    logStatus($r2);
}
if (preg_match("/RTSP\\/1\\.0 200 OK/", $result)) {
    $r1 = new MulticastReceiver();
    $r2 = new MulticastReceiver();
    if (($r1 = findMulticastReceiver($obj->getIP(), $obj->getTuner())) == null) {
        exit;
    }
    if ($r1->getTuner() == 1) {
        $r2 = findMulticastReceiver($obj->getIP(), 0);
    } else {
        $r2 = findMulticastReceiver($obj->getIP(), 1);
    }
    if ($r1 != null && $r1->getTuner() == $obj->getTuner()) {
        $r1->setIsStreaming(1);
        logStatus($r1);
    }
    if ($r2 != null && $r2->getTuner() == $obj->getTuner()) {
        $r2->setIsStreaming(1);
        logStatus($r2);
    }
    print "Stream was successfully restarted.";
} else {
    $r1 = new MulticastReceiver();
    if (($r1 = findMulticastReceiver($obj->getIP(), $obj->getTuner())) == null) {
        exit;
    }
    if ($r1 != null && $r1->getTuner() == $obj->getTuner()) {
        $r1->setIsStreaming(0);
        logStatus($r1);
    }
    print "There was an error restarting the stream:\n{$result}";
}