Problem with viewing xml files on Cisco phones

Status
Not open for further replies.

maxioml

Joined
Jan 12, 2012
Messages
26
Reaction score
0
Hi Comrades,

I`ve just installed Elastix and this is list of my packages:

Elastix
elastix-2.2.0-22
elastix-agenda-2.2.0-8
elastix-im-2.2.0-2
elastix-pbx-2.2.0-19
elastix-firstboot-2.2.0-9
elastix-security-2.2.0-10
elastix-reports-2.2.0-8
elastix-email_admin-2.2.0-11
elastix-addons-2.2.0-8
elastix-extras-2.2.0-1
elastix-a2billing-1.9.4-1
elastix-system-2.2.0-17
elastix-framework-2.2.0-23
elastix-my_extension-2.2.0-6
elastix-vtigercrm-5.2.1-1
elastix-asterisk-sounds-1.2.3-1
elastix-fax-2.2.0-6
FreePBX
freePBX-2.8.1-9
Asterisk
asterisk-1.8.7.0-0
asterisk-perl-0.10-2
asterisk-addons-1.8.7.0-0

Everything looks cool, I registered Cisco Phones 7940 and 7960 with elastix. Trunk between my cisco router works fine.
But at this moment I am struggling with creating Directory and Services pages and logo pics for my phones.
I was using this link to gain some knowledge in this area. http://www.voip-info.org/wiki/view/Aste ... L+Services

This is what I did:

1. PHP file for retrieving information about all local extensions.

<?
header("Content-type: text/xml");
header("Connection: close");
header("Expires: -1");

$mysql_conn = mysql_connect("localhost", "user", "password");
mysql_select_db("asterisk", $mysql_conn);
$result = mysql_query("SELECT field,field FROM table", $mysql_conn);

print("<CiscoIPPhoneDirectory>\n");
print("\t<Title>Panbet Directory</Title>\n");
print("\t<Prompt>Press Enter</Prompt>\n");

while($row = mysql_fetch_row($result))
{
print("\t<DirectoryEntry>\n");

print("\t\t<Name>");
print($row[0]);
print("</Name>\n");


print("\t\t<Telephone>");
print($row[1]);
print("</Telephone>\n");

print("\t</DirectoryEntry>\n");
}
print("</CiscoIPPhoneDirectory>\n");

?>

From here I can create directory file using this command "php /etc/asterisk/directory.php > /var/www/html/directory.xml"

This is my directory file, which automatically creates after lunching php script.

<CiscoIPPhoneDirectory>
<Title>Panbet Directory</Title>
<Prompt>Press to Enter</Prompt>
<DirectoryEntry>
<Name>Receptionist</Name>
<Telephone>3000</Telephone>
</DirectoryEntry>
<DirectoryEntry>
<Name>Maxim Abramov</Name>
<Telephone>3033</Telephone>
</DirectoryEntry>
</CiscoIPPhoneDirectory>

This is my services file.

<?xml version="1.0" encoding="ISO-8859-1" ?>

<CiscoIPPhoneMenu>
<Title>Information Services</Title>
<Prompt>Press to Enter</Prompt>
<MenuItem>
<Name>Extension Directory</Name>
<URL>http://xx.xx.xx.xx/elastix/directory.xml</URL>
</MenuItem>
<SoftKeyItem>
<Name>Dir</Name>
<URL></URL>
<Position></Position>
</SoftKeyItem>

<Prompt>Press to Enter</Prompt>
<MenuItem>
<Name>System Speed Dial</Name>
<URL>http://xx.xx.xx.xx/elastix/speeddial.xml</URL>
</MenuItem>
<SoftKeyItem>
<Name>Dir</Name>
<URL></URL>
<Position></Position>
</SoftKeyItem>

</CiscoIPPhoneMenu>


Next step is add links to the file SIPDefault.cnf.
logo_url: "http://xx.xx.xx.xx/elastix/logo.bmp"
directory_url: "http://xx.xx.xx.xx/elastix/directory.xml"
services_url: "http://xx.xx.xx.xx/elastix/services.xml"

Looks fine for me, but when I am trying to open this directory/services on my handsets there is message "Connecting to HTTP server" and nothing happening ...

If anybody have any thoughts ? Check particular logs or may be network configurations ? Or configuration of my extensions ?
 
Hiya,

I tried your script and I get the following error:

php /etc/asterisk/directory.php > /var/www/html/directory.xml
PHP Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /etc/asterisk/directory.php on line 14

I am using elastix

Linux(x86_64) 2.6.18 348.1.1.el5
Name Package Name Version Release
Elastix
elastix 2.4.0 1
elastix-portknock 0.0.1 0
elastix-agenda 2.4.0 1
elastix-email_admin 2.4.0 1
elastix-addons 2.4.0 1
elastix-fax 2.4.0 1
elastix-firstboot 2.4.0 1
elastix-framework 2.4.0 1
elastix-reports 2.4.0 1
elastix-my_extension 2.4.0 1
elastix-extras 2.4.0 1
elastix-vtigercrm 5.2.1 7
elastix-system 2.4.0 1
elastix-security 2.4.0 1
elastix-im 2.4.0 1
elastix-a2billing 1.9.4 5
elastix-asterisk-sounds 1.2.3 1
elastix-pbx 2.4.0 1

Asterisk
asterisk 1.8.20.0 0
asterisk-perl 0.10 2
asterisk-addons 1.8.20.0 0

Cheers for the help.

Raj
 
Ok,

I managed to get it sorted so here is the script for anyone to use:

<?
header("Content-type: text/xml");
header("Connection: close");
header("Expires: -1");

$mysql_conn = mysql_connect("localhost", "db user", "db password");
mysql_select_db("asterisk", $mysql_conn);
$result = mysql_query("SELECT extension,name FROM users", $mysql_conn);

print("<CiscoIPPhoneDirectory>\n");
print("\t<Title>Panbet Directory</Title>\n");
print("\t<Prompt>Press Enter</Prompt>\n");

while($row = mysql_fetch_row($result))
{
print("\t<DirectoryEntry>\n");

print("\t\t<Name>");
print($row[0]);
print("</Name>\n");


print("\t\t<Telephone>");
print($row[1]);
print("</Telephone>\n");

print("\t</DirectoryEntry>\n");
}
print("</CiscoIPPhoneDirectory>\n");

?>



Hope this can help someone else.

Cheers,

Raj
 
Status
Not open for further replies.

Members Online Now

Forum statistics

Threads
111,859
Messages
589,434
Members
164,699
Latest member
CLTedu