[Openh323gk-users] web directory from status port query in php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I just whipped this up and I thought others might also have some use for it.

The output looks like this: http://www.mianos.com/vdir.php
It's pretty primitive but it quite handy for me.
I generates a netmeeting call URL when you click on the name.

It's hard limited to 1000 lines in the code but you can remove that limit
line.

As follows, see the bottom for ths hosts lists:

<?
function GetRegistrations($server) {
   $fp = fsockopen ($server, 7000, $errno, $errstr, 30);
   if (!$fp) {
      print "<tr><td>$server</td><td>not available</td></tr>";
   } else {
      fputs ($fp, "printallregistrations\n");
      for ($ii = 0; $ii < 10; $ii++) {
         if (feof($fp))
            exit(1);
         $aline = fgets($fp);
         if (strstr($aline, "AllRegistrations")) {
            break;
         }
      }
      for ($ii = 0; $ii < 1000; $ii++) {
         if (feof($fp))
            exit(1);
         $aline = fgets($fp);
         if (strstr($aline, "Number of Endpoints")) {
            break;
         }
         list($rtype, $address_port, $name_ptype, $ttype, $gkid)=
explode("|", $aline, 5);
         list($name, $ptype) = explode(":", $name_ptype, 2);
         list($address, $port) = explode(":", $address_port, 2);
         print "<tr><td>$server</td><td>";
         print "<A HREF=\"callto:$name\">$name</A>";
         print "</td><td>$ptype</td><td>$address</td><td>$port</td></tr>";

      }
      fclose ($fp);
      if ($ii == 0)
         print "<tr><td>$server</td><td>empty</td></tr>";
   }
}

   print "<html><head><title>The voip network in Mianos</title></head>";
   print  "<table columns='4' align='LC' border=1>";
   print "<p>To register, register with gatekeeper at mianos.com</p>";
   print "<tr><td>gatekeeper</td><td>Caller
Name</td><td>Protocol</td><td>Endpoint Address</td><td>Endpoint
Port</td></tr>";

   GetRegistrations("mianos.com");
   GetRegistrations("192.168.101.1");
   GetRegistrations("ap.keta.mine.nu");
   print   "</table>";
   print   "</html>";

?>



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
List: Openh323gk-users@lists.sourceforge.net
Archive: http://sourceforge.net/mailarchive/forum.php?forum_id=8549
Homepage: http://www.gnugk.org/

[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux