'error','message'=>'Session and step are required','data'=>[]]); return; } $url = rtrim((string)($PASYSCONF['RESTAPIDASH_URL'] ?? ''), '/') . '/DASH_TIMER_ACK'; if (!preg_match('~^https?://[^/]+/dash/DASH_TIMER_ACK$~i', $url)) { echo json_encode(['status'=>'error','message'=>'DASH API unavailable','data'=>[]]); return; } $ch = curl_init($url); curl_setopt_array($ch, [CURLOPT_POST=>true,CURLOPT_RETURNTRANSFER=>true, CURLOPT_HTTPHEADER=>['Content-Type: application/json'], CURLOPT_POSTFIELDS=>json_encode(['sessionId'=>$sessionId,'dashStepID'=>$dashStepID]), CURLOPT_CONNECTTIMEOUT=>5,CURLOPT_TIMEOUT=>15]); $body = curl_exec($ch); $http = curl_getinfo($ch,CURLINFO_HTTP_CODE); curl_close($ch); $result = $http === 200 && is_string($body) ? json_decode($body,true) : null; echo json_encode(is_array($result) ? $result : ['status'=>'error','message'=>'DASH API did not respond','data'=>[]]);