". $callerid."\n"."".key($sip_array)."\n"."". key($sip_array)."&name=".$callerid."\n"; $index++; } next($sip_array); } # Parse iax.conf $iax_array=parse_ini_file($location."iax.conf", true); while($v=current($iax_array)) { if(isset($v['name'])) { $directory[]="".$v['name']."\n"."".key($iax_array)."\n"; $index++; } next($iax_array); } # Sort Directory sort($directory); # Retrieve last page $last=intval($index/15); if(($index-$last*15) != 0) $last++; # Retrieve current page $page=$_GET['page']; if (empty($page)) $page=1; # Display Page $output =""; $output .= "Directory ($page/$last)\n"; $index=1; foreach ($directory as $v) { if(($index>=(($page-1)*15+1)) and ($index<=$page*15)) { $output .= "\n"; $output .= $v; $output .= "\n"; } $index++; } # Dial button $output .= "\n"; $output .= "\n"; $output .= "SoftKey:Dial\n"; $output .= "\n"; # Next button if($page!=$last) { $next=$page+1; $output .= "\n"; $output .= "\n"; $output .= "$Server?page=$next\n"; $output .= "\n"; } # Previous button if($page!=1) { $previous=$page-1; $output .= "\n"; $output .= "\n"; $output .= "$Server?page=$previous\n"; $output .= "\n"; } # Exit Button $output .= "\n"; $output .= "\n"; $output .= "SoftKey:Exit\n"; $output .= "\n"; # End of the object $output .= "\n"; # HTTP header and output header("Content-Type: text/xml"); header("Content-Length: ".strlen($output)); echo $output; ?>