cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Walkthrough Wednesdays
116
Views
0
Helpful
1
Replies
Highlighted
Beginner

HTTP Error when trying to access HTTP directory on 7965G and 7965G

Good evening Everyone,
I followed the instructions on this page to setup a phone book search (installed and configured database, ...).
When entering the URL
http://192.168.178.207/cisco/menu.xml
I noticed an "HTTP error" on the phone and nothing else happened.
A tcpdump
tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -vv
to monitor port 80 on my webserver showed that the URL was altered to
http://192.168.178.207/cisco/menu.xml?locale=germany&name=SEP002155D64F77
Here's the link to the dump.
And here's the files:
menu.xml

<CiscoIPPhoneMenu>
  <Title>Asterisk Directory</Title>
  <MenuItem>
      <Name>Personensuche</Name>
      <URL>http://192.168.178.207/cisco/menu2.xml</URL>
  </MenuItem>
</CiscoIPPhoneMenu>
menu2.xml

<CiscoIPPhoneInput>
  <Title>Telefonbuch</Title>
  <Prompt>Namenssuche</Prompt>
  <URL>http://192.168.178.207/cisco/search.php</URL>
  <InputItem>
    <DisplayName>Name</DisplayName>
    <QueryStringParam>sn</QueryStringParam>
    <InputFlags>U</InputFlags>
  </InputItem>
</CiscoIPPhoneInput>
search.php

<?php
header ("content-type: text/xml");

// Change here to match the webaddress absolute path
$URL = 'http://your_web_server_ip/cisco/';

// Choose how many results to return if search term produces a lot of output
$per_page = '32';

// Change here to match your own passwords
$mysql_conn = mysql_connect('localhost', 'db_username', 'db_password');

// Dont change anything from here unless you know what you are doing
mysql_select_db('db_name', $mysql_conn );

$NAME=$_GET["sn"];
$page = $_GET['page'];

if ( ($page=='') )
{
   //check to see how many
   $result= mysql_query("SELECT count(tbl_kontakte.name) as total
                         FROM tbl_kontakte
                         WHERE tbl_kontakte.name LIKE '%$NAME%' ", $mysql_conn);
   $howmany = mysql_fetch_row($result);
   if ($howmany[0] > $per_page)
   {
      $start = 0;
      $index = 0;
      $total = $howmany[0];
      $remain = $per_page;
      print("\n");
      print("<CiscoIPPhoneDirectory>\n");
      print("<Title>Telefonbuch</Title>\n");
      print("<Prompt>Telefonbuch</Prompt>\n");
      print("<DirectoryEntry>\n");
      print("<Name>Num.coincidences > 32 </Name>\n");
      print("</DirectoryEntry>\n");
      while ($start < ($total + 1))
      {
         print("<SoftKeyItem>\n");
         print("\t<Name>");
         print($index);
         print("</Name>\n");
         print("\t<URL>");
         print($URL."search.php?page=".$index."&amp;sn=".$NAME);
         print("</URL>\n");
         print("<Position>");
         print($index+1);
         print("</Position>");
         print("</SoftKeyItem>\n");
         $start = $start + $per_page;
         $index = $index+1;
      }
      print("</CiscoIPPhoneDirectory>\n");
   } else {
      $result = mysql_query("SELECT name,telefonnummer,telefonnummer  
                             FROM tbl_kontakte
                             WHERE tbl_kontakte.name LIKE '%$NAME%'
                             ORDER BY name ", $mysql_conn);
      print("\n");
      print("<CiscoIPPhoneDirectory>\n");
      print("<Title>Telefonbuch</Title>\n");
      print("<Prompt>Telefonbuch</Prompt>\n");   
      while($row = mysql_fetch_row($result))
      {
         print("<DirectoryEntry>\n");
         print("\t<Name>");
         print($row[0]." - ".$row[1] );
         print("</Name>\n");
         print("\t<Telefon>");
         print($row[2]);
         print("</Telefon>\n");
         print("</DirectoryEntry>\n");
      }
      print("</CiscoIPPhoneDirectory>\n");
   }
} else {
   $OFFSET = $page * $per_page;
   $sql = "SELECT name,telefonnummer,telefonnummer
           FROM tbl_kontakte
           WHERE name LIKE '%$NAME%'
           ORDER BY name
           LIMIT $OFFSET, $per_page";
   $result = mysql_query($sql, $mysql_conn);
   print("\n");
   print("<CiscoIPPhoneDirectory>\n");
   print("<Title>Telefonbuch</Title>\n");
   print("<Prompt>Telefonbuch</Prompt>\n");
   while($row = mysql_fetch_row($result))
   {
      print("<DirectoryEntry>\n");
      print("\t<Name>");
      print($row[0]." - ".$row[1] );
      print("</Name>\n");
      print("\t<Telefon>");
      print($row[2]);
      print("</Telefon>\n");
      print("</DirectoryEntry>\n");
   }
   print("</CiscoIPPhoneDirectory>\n");
}
?>
I highly appreciate any help in this case.
Best regards,
Joerg
1 REPLY 1
Highlighted
Hall of Fame Cisco Employee

Might want to try asking in DevNet.

HTH

java

if this helps, please rate
Content for Community-Ad