Hello!
Prompt how to realize the general book of LDAP or MYSQL on this device without CUCM?
At present when pressing the notebook button I have a Contacts Inquiry window, and occurs further nothing.
setup cisco:
<directoryURL>http://192.168.0.11/cisco/menu.xml</directoryURL>
server:
menu.xml:
<?xml version="1.0"?>
<CiscoIPPhoneMenu>
<Title>Asterisk Directory</Title>
<MenuItem>
<Name>Search person..</Name>
<URL>http://192.168.0.11/cisco/menu2.xml</URL>
</MenuItem>
</CiscoIPPhoneMenu>
menu2.xml:
<?xml version="1.0"?>
<CiscoIPPhoneMenu>
<Title>Asterisk Directory</Title>
<MenuItem>
<Name>Search person..</Name>
<URL>http://192.168.0.11/cisco/search.php</URL>
</MenuItem>
</CiscoIPPhoneMenu>
search.php:
<?php
header ("content-type: text/xml");
// Change here to match the webaddress absolute path
$URL = 'http://192.168.0.11/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', 'cisco', '*****');
// Dont change anything from here unless you know what you are doing
mysql_select_db('cisco', $mysql_conn );
$NAME=$_GET["sn"];
$page = $_GET['page'];
if ( ($page=='') )
{
//check to see how many
$result= mysql_query("SELECT count(users.name) as total
FROM users
WHERE users.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>Directorio FSM</Title>\n");
print("<Prompt>Directorio FSM</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."&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,extension,extension
FROM users
WHERE users.name LIKE '%$NAME%'
ORDER BY name ", $mysql_conn);
print("\n");
print("<CiscoIPPhoneDirectory>\n");
print("<Title>Directorio FSM</Title>\n");
print("<Prompt>Directorio FSM</Prompt>\n");
while($row = mysql_fetch_row($result))
{
print("<DirectoryEntry>\n");
print("\t<Name>");
print($row[0]."- ".$row[1] );
print("</Name>\n");
print("\t<Telephone>");
print($row[2]);
print("</Telephone>\n");
print("</DirectoryEntry>\n");
}
print("</CiscoIPPhoneDirectory>\n");
}
} else {
$OFFSET = $page * $per_page;
$sql = "SELECT name,extension,extension
FROM users
WHERE name LIKE '%$NAME%'
ORDER BY name
LIMIT $OFFSET, $per_page";
$result = mysql_query($sql, $mysql_conn);
print("\n");
print("<CiscoIPPhoneDirectory>\n");
print("<Title>Directorio FSM</Title>\n");
print("<Prompt>Directorio FSM</Prompt>\n");
while($row = mysql_fetch_row($result))
{
print("<DirectoryEntry>\n");
print("\t<Name>");
print($row[0]."- ".$row[1] );
print("</Name>\n");
print("\t<Telephone>");
print($row[2]);
print("</Telephone>\n");
print("</DirectoryEntry>\n");
}
print("</CiscoIPPhoneDirectory>\n");
}
?>