Upgrade 3CX to v18 and get it hosted free!

OptiPoint 600 SIP – WAP based phonebook

Author image

OptiPoint 600 SIP – WAP based phonebook

The Siemens OptiPoint 600 SIP contains a WAP browser, which can be used to access a server-based phonebook.

The phone will offer to dial a number, when following a link in the form

<a href=”wtai://wp/mc;+491234567890″>+49-1234-567890</a>

inside a WML page. This example is tailored to my database setup, you will have to make some adjustments:

<?PHP
header("Content-type: text/vnd.wap.wml");
print "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="Phonebook" title="Phonebook">

<?PHP
require_once("formats.inc.php");
require_once("database.inc.php");

# Database
$dbhost             = "localhost";
$dbuser             = "www";
$dbpassword         = "xxx";

$step=5;

print "<p>\n";

if (InitDB("phonebook"))
  {
  $command = $_GET["command"];
  $start   = $_GET["start"];
  $id      = $_GET["id"];

  if ($command == "") { $command = "list"; }
  if ($start   == "") { $start = 0; }

  switch ($command)
    {
    case "list":

      $query = "SELECT persons.firstname, persons.name, persons.id FROM persons ORDER BY persons.name, persons.firstname LIMIT ".$start.",".$step.";";

      $result  = mysql_query($query);
      $matches = mysql_num_rows($result);

      if ($matches > 0)
        {
        while ($data = mysql_fetch_assoc($result))
          {
          print "<a href=\"wap.php?command=detail&id=".$data[id]."&start=".$start."\">".$data[name].", ".$data[firstname]."</a><br/>\n";
          }

        // Can anyone fix this? How can we use more than one key?
        print "<do type=\"accept\" label=\"Previous">\n";
        print "<go href=\"wap.php?command=list&start=".($start-$step)."\"/>\n";
        print "</do>\n";

        print "<do type=\"prev\" label=\"Next\">\n";
        print "<go href=\"wap.php?command=list&start=".($start+$step)."\"/>\n";
        print "</do>\n";

        }
      else
        {
        print "No entries found\n";
        }
      break;
    case "detail":
      $query = "SELECT name,firstname,address,zip,city,country FROM persons WHERE id=".$id.";";

      $result  = mysql_query($query);
      $matches = mysql_num_rows($result);

      if ($matches > 0)
        {
        $data = mysql_fetch_assoc($result);
        print $data[name].", ".$data[vorname]."<br/>\n";
        print "<small>".$data[strasse]."<br/>\n";
        print $data[plz]." ".$data[ort]."</small><br/>\n";
        }
      else
        {
        print "Person $id not found";
        }

      $query = "SELECT numbers.phone FROM numbers WHERE numbers.personid=".$id." LIMIT 10;";

      $result  = mysql_query($query);
      $matches = mysql_num_rows($result);

      if ($matches > 0)
        {

        while ($data = mysql_fetch_assoc($result))
          {
          print "<a href=\"wtai://wp/mc;".$data[phone]."\">".formatphonenumber($data[phone])."</a><br/>\n";
          }
        }
      else
        {
        print "No phone numbers found\n";
        }

      print "<do type=\"prev\" label=\"List\">\n";
      print "<go href=\"wap.php?command=list&start=".$start."\"></go>\n";
      print "</do>\n";



      break;
    }
  }
else
  {
  print "No connection to database\n";
  }
print "</p>\n";

?>
</card>
</wml>


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.
Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.