I use the script below to connect to an external PBX server and get the call logs.
However it only returns 1 sting at a time which equals 1 log. So I need to refresh multiple times to get all the available logs.
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP) or die();
$result = socket_connect($socket, $address, $port) or die();
$out = socket_read($socket, 2048);
How do I get all the strings available without having to reinitiate the connection all the time?