Cisco 79xx phones directory services?

trafalger
Posts: 31
Member Since:
2007-01-25

Has anyone sucessfully gotten either the Phonedirectory under the Cisco services to work or the one under the xmlservices/phonedirectory.php to work.

Even after commenting out the query line I get XML Parse Error (CMXML Error)



phillip198
Posts: 40
Member Since:
2007-01-30
Re: Cisco 79xx phones directory services?

hi i have this working perfectly fine..



trafalger
Posts: 31
Member Since:
2007-01-25
Re: Cisco 79xx phones directory services?

LOL...well thats awsome..do you mind sharing what you did to get it working?

Can you provide your Phonedirectory.php or xmlservices.php file



phillip198
Posts: 40
Member Since:
2007-01-30
Re: Cisco 79xx phones directory services?

as promised here are the files for the phone directory thingy , i have modded the fies slightly for my needs, so they are not the orig that come with TB server but i beleave they will still work on any TB server ...

http://www.phillip-cooper.co.uk/cisco/cisco-phone.zip

this pulls the info from the Sugar CRM package on the TB serve so if you dont have any contacts configured there then this will not work ..



dkaussen
Posts: 21
Member Since:
2006-07-20
Re: Cisco 79xx phones directory services?

I'm experiencing the same issue. This used to work. I upgraded to v2.0 and now it's broken for me.

I'm using a Cisco 7960 (but i also upgrade the firmware to 8.4 at the same time.)

I see the script (include/xmlservices_libs.php) is attempting to detect the browsers user_string in order to format the xml properly... this is the code I get back when hitting it with a netscape browser. I can't figure out how to customize my user_agent string on firefox mac to see what it should return for cisco.

It's possible that my new 8.4 firmware is sending a different user_agent string -- thus breaking the else if tree -- and not the new trixbox 2.0 build ??


XML Services

View Phone Directory
http://10.10.220.11/xmlservices/PhoneDirectory.php




Search by name

http://10.10.220.11/xmlservices/searchDirectory.php



Help
http://10.10.220.11/xmlservices/help.php



RSS Feeds
http://10.10.220.11/xmlservices/rssfeeds.php




dkaussen
Posts: 21
Member Since:
2006-07-20
Re: Cisco 79xx phones directory services?

OK -- that reply got pretty mangled. Let me try that again...

I'm experiencing the same issue.

This used to work. I upgraded to v2.0 and now it's broken for me. I'm using a Cisco 7960 (but i also upgrade the firmware to 8.4 at the same time.)

I see the script (include/xmlservices_libs.php) is attempting to detect the browsers user_string in order to format the xml properly... this is the code I get back when hitting it with a netscape browser. I can't figure out how to customize my user_agent string on firefox mac to see what it should return for cisco.

It's possible that my new 8.4 firmware is sending a different user_agent string -- thus breaking the else if tree -- and not the new trixbox 2.0 build ??


XML Services

View Phone Directory
http://10.10.220.11/xmlservices/PhoneDirectory.php


Search by name

http://10.10.220.11/xmlservices/searchDirectory.php



Help
http://10.10.220.11/xmlservices/help.php


RSS Feeds
http://10.10.220.11/xmlservices/rssfeeds.php

(Unrelated, but I noticed the xml files have a mix of both dos and linux end-of-line markers. The one uri entry with the tags on their own lines is a mystery too...they are all coded the same in index.php)



phillip198
Posts: 40
Member Since:
2007-01-30
Re: Cisco 79xx phones directory services?

hi the files should look something like

##########################################
# Config section

$Server = "http://$SERVER_ADDR/cisco/services"; # don't add a trailing slash!

##########################################
#
# Set content type
header("Content-Type: text/xml");

$menu .= "\n";

$menu .= "\n";
$menu .= "HELP!!\n";
$menu .= "$Server/help.php\n";
$menu .= "
\n";

$menu .= "\n";
$menu .= "Search by name\n";
$menu .= "$Server/searchDirectory.php\n";
$menu .= "
\n";

$menu .= "

\n";

echo $menu;

?>

this is for the cisco phones ...
the other was for astra phones .....



Rager
Posts: 78
Member Since:
2006-11-30
Re: Cisco 79xx phones directory services?

Hi is there a way to not use Sugar but the Trixbox Databse to search for users?

Thanks

Ryan



phillip198
Posts: 40
Member Since:
2007-01-30
Re: Cisco 79xx phones directory services?

can you confirm that this is for extensions and not as a phone book for users located with in the company of is this for people out side the company as well?

not sure if there are any hacks out there for this ... people of the forum please help me out here...

if there are no hacks for this currently, i will create one, as i do a lot of php,xml and database work, but i will only do this is there are no hacks out there currently...



Admiral_TH
Posts: 8
Member Since:
2007-02-16
Re: Cisco 79xx phones directory services?

I found that that the phone was being sent the wrong info so it was looking in the wrong spot for the data try changing the SIPDefault.cnf you send your phone so that the following lines are correct, they are wrong by default I think

services_url: http://YOUR_SERVERS_ADDRESS/cisco/services/index_cisco.php
directory_url: http://YOUR_SERVERS_ADDRESS/cisco/services/PhoneDirectory.php

After changing those settings and rebooting my phone it now pulls the data correctly from SugarCRM

You could edit the files so it pulled the info from another DB if you show choose



doubleno
Posts: 39
Member Since:
2007-02-01
I was trying to get this to

I was trying to get this to work and I get XML Error [4]: Parse Error. I first tried the cisco/services that came on my box then tried Phillip's and still receive the same error when I try and query the database.

Using a batch of 7941s with SIP 8-2-2SR1 firmware if that helps



blakekrone
Posts: 54
Member Since:
2006-05-31
What happens when you browse

What happens when you browse to the URL via your browser? Typically if you are getting an XML Parse Error on your phone trying to view the URL in a normal browser like FireFox or IE will give you an idea of what the problem is.



pkaplan
Posts: 209
Member Since:
2007-02-28
On the default Trixbox 2.0

On the default Trixbox 2.0 install there is an errant code snippet that needs to be changed.

In the file:xmlservices/include/xmlservices_lib.php lines 40 & 41 need to be commented out.

Change:
$browser = "Aastra";
$content_format = "aastraxml";

To:
// $browser = "Aastra";
// $content_format = "aastraxml";

What they are doing is saying regardless of what type of browser you are act like you are an astra phone.



doubleno
Posts: 39
Member Since:
2007-02-01
Thanks Pkaplan!

Thanks Pkaplan!

Its working. Only problem now is its putting 91 in front the contacts, I'm guessing that's in SugarCRM.... no?

//edit - Found its the $LongDistanceExtension = "91" at the beginning of a few of the PHP files

Anyhow, now how does one query the database to return a listing that is simply users under a certain account?



andrew
Posts: 730
Member Since:
2006-05-30
Enhancements and bug fixes for the xml services in 2.2

There are quite a few enhancements and bug fixes for the xml services in 2.2. Try trixbox 2.2 and report back if the xml services work better.



doubleno
Posts: 39
Member Since:
2007-02-01
We'll install on a dummy box

We'll install on a dummy box 2.2. What sort of endpoint management does the new system have?



mike_keller0
Posts: 8
Member Since:
2007-05-19
Office Number?

Thank You pkaplan, this worked for me. I only have one other "issue". The contact from SugarCRM is displayed, however, the Office Number wont display. Home, Mobile, and Other will list in the 7960G directory, but not the office number. I am running trixbox 2.2. Any help is appreciated.



electronicsuk
Posts: 15
Member Since:
2007-05-28
Does anyone have any

Does anyone have any specific information on getting this to work with a Cisco 7912G with the SIP firmware? The phone did used to request XMLDefault.cnf.xml from my TFTP server before I updated the firmware, but it no longer asks for the file since I upgraded to 8.0.1, which has me very confused!



netelligen
Posts: 3
Member Since:
2007-04-10
Fix for Office Number

Found the fix for this.

Go to /var/www/html/xmlservices/templates and replace all instances of phone_office with phone_work

There should be three files that need to have this change made:

PhoneDirectory_entry_html.tpl
PhoneDirectory_entry_ciscoxml3.tpl
PhoneDirectory_entry_ciscoxml4.tpl

Took some debugging to find, but the changes are simple to do with vi:
%s/phone_office/phone_work/g

Works like a charm for me now using 7970 phones with 8.0.2s firmware.

Also, thanks again pkaplan for your help. It got me started on getting all of this services stuff working and now my customers are much happier!



netelligen
Posts: 3
Member Since:
2007-04-10
rss feeds fix

One other thing I found was that the WSJ feed did not work under the xmlservices directory even though it diffs out to be the same as what is under the cisco/services directory. I modified the rssfeeds.php in the xmlservices directory as follows:

Change
$Server = "http://$SERVER_ADDR/xmlservices"; # don't add a trailing slash!
to
$Server = "http://$SERVER_ADDR/cisco/services"; # don't add a trailing slash!

Obviously this only works for the cisco phones, but there must be a difference between the two rss directories in /xmlservices and /cisco/services... it must be hidden deep down in the DOMIT stuff because I diffed everywhere else.



dkaussen
Posts: 21
Member Since:
2006-07-20
If you changed the default

If you changed the default password of your mysql database, you'll **may** need to xmlservices_lib.php file with that info as well. (I didn't change it on my inhouse build. YMMV)

near the bottom of the file:xmlservices/include/xmlservices_lib.php you can find two functions which have the password hard coded in them.

function getRowSQL($querytxt,$database) {
$db = DB::connect('mysql://root:passw0rd@localhost/'.$database);
$db->setFetchMode(DB_FETCHMODE_ASSOC);
$query = $db->getRow($querytxt);
return $query;
}



wtodd
Posts: 304
Member Since:
2007-04-29
/cisco/services =

/cisco/services = 7940/7960
/xmlservices = 7970/79x1



wtodd
Posts: 304
Member Since:
2007-04-29
changes for XML file for complete data using cisco 797x or 79x1

In configuring the cisco 7970 directory i found a line flaw in the following file which doesnt allow the office code to display as someone mistakenly renamed the appropriate file.

/var/www/html/xmlservices/templates --> PhoneDirectory_entry_ciscoxml4.tpl

office directory should read: (ignore my comments to side marked comment: and brackets; also i had to place a space immediately each < in order to have it show up on forum, so if you cut and paste, remove the spaces)

(comment: what follows MUST SAY phone_work as it comes from the Database)

{if $ContactNumbers.phone_work}
< DirectoryEntry>
< Name>Work:< /Name> (comment: THIS CAN BE ANYTHING INSTEAD OF WORK:)
< Telephone>{$ContactNumbers.phone_work|regex_replace:"/[\s()-]+/":""}< /Telephone>

Once this one little detail is resolved, the work number should begin showing up.



wtodd
Posts: 304
Member Since:
2007-04-29
Cisco 7940/7960 search repair

There is a flaw in the text code of the search directory preventing the phones from searching the directory. The following should be changed to have it function:

var/www/html/cisco/services
searchDirectory.php

the querystring parameter should read:

$menu .= "< QueryStringParam>LastName< /QueryStringParam>\n";

(please remove the spaces after each < if you cut and paste)



MDMitchell12
Posts: 1
Member Since:
2007-04-08
Cisco 7970 Phone and Phone Directory

I cannot seem to get the Phone Directory to work on the 7970 Phone.

TB Build 2.2.9
Cisco FW SIP70.8-3-3SR2S

Can any one give me some pointers on what is needed on the SugarCRM and config for the PHP files to get this working?



ricknieves
Posts: 16
Member Since:
2008-01-08
Configuring Cisco 7960 directories

I got the zip file phillip198 posted, but have no idea what to do with it. Were do I have to place it on the TB serve directory? And what else do I have to change on the phones?

Any detail help for a total lost user, will be definitely appreciated.

Rick Nieves



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.