/dev/null 2>&1 &"); // echo $result . '
'; // echo str_repeat("\n",7024); // flush(); sleep(2); $fp = fsockopen($ip, $port, $errno, $error, 5); if (!$fp) { printf('ERROR'); } else { socket_set_timeout( $fp, 50); //one should set the number of the longest test, so we can define the timeout fwrite($fp, "START TEST"); //send command to start the tests if(!feof($fp)) { while(!feof($fp)) { $received = fgets($fp, 128); if ($received == "CONFIRM\n") { //echo 'CONFIRM CONNECTION
'; echo ''; echo str_repeat("\n",7024); flush(); } elseif ($received == "TEST DONE\n") { echo '
Table concept for our results
From: To: Message: Status:
'; //echo 'DISCONNECT
'; echo str_repeat("\n",7024); flush(); usleep(100); fwrite($fp, 'DISCONNECT'); break; } else { echo ' SIP GSM1 '. $received . ' 200 '; //echo $received . '
'; echo str_repeat("\n",7024); flush(); usleep(100); fwrite($fp, "CONTINUE"); } } } fclose($fp); } ?>