Add RSS Feeds and Web Pages to Cisco IP Phone
Posted by matthew | Posted in Tutorial | Posted on 02-12-2009
Tags: Cisco, Perl, XML
2
Adding RSS feeds and webpages to your Cisco IP phone can be very useful. RSS feeds can display the local weather, breaking news or your companies Twitter feed. The option of adding web pages means you can bring interactivity to your Cisco phones, creating surveys, contact forms and so much more, find out how after the jump.
First of all you need both a web server your phones can access and you will need Perl installed. If you have a Windows server you will need to install ActivePerl and then allow the Perl Extensions in IIS. For both Windows servers and Nix based servers you will require all of the following Perl modules:
LWP::Simple
HTML::Parser
HTML::Tagset
URI
XML::RAI
Date::Format
XML::RSS::Parser
XML::Elemental
XML::NamespaceSupport
Class::ErrorHandler
Class::XPath
For Windows servers replace (::) with a dash (-) to search the ActivePerl directory classes and modules list. Make sure you not only mark the modules for installation, but also install them too.
Once you have all of the modules create a page called ‘cisco.pl’ on your servers default website and paste the contents of this text file in.
Once you have this file on your server, ensure it has execture permissions for all users and that it is accessible. If it is working correctly you should be able to browse to it from your web browser and it should present an XML file to you. If it doesn’t check the file has copied correctly and check your server settings.
If this is working then login into your Cisco call manager and add a new service called ‘News’ for example. Then assign this service to the user profiles you require (make sure you do not delete the logout button like our service manager did) and get these users to logout and log back in again.
If it has worked you should see a new option under the services button on your phone. We have designed the script so that you can read the titles off the feed items and click to read the body, you can also go back and forwards between feed items within one feed. Now that you have RSS feeds working on to webpages.
Within the Perl file there is a list of RSS feeds you can change and below that a list of websites. You must use the IP address of the website (or local server) for this to work. You can present the phones with any type of page (ASPX, JSP, PL etc…) however the phone will only display text so if you include any tags it will just print these to the screen. This means you must do all of the workings server side and instead just spit out a raw text feed, no headers or anything. The phones cannot interpolate anything other than text and XML.
This can be useful for showing for instance latest sale figures (the server crunches the numbers and displays the results as text), but wait theres more!
Using XML you can be a bit more clever, take this for example:
<CiscoIPPhoneInput> <Title>Your Details</Title> <Prompt>Please enter your details</Prompt> <URL>http://127.0.0.1/email.aspx</URL> <InputItem> <DisplayName>Your Username</DisplayName> <QueryStringParam>name</QueryStringParam> <DefaultValue>domain\</DefaultValue> <InputFlags>L</InputFlags> </InputItem> <InputItem> <DisplayName>Your PC Asset Tag</DisplayName> <QueryStringParam>assest</QueryStringParam> <DefaultValue></DefaultValue> <InputFlags>N</InputFlags> </InputItem> <InputItem> <DisplayName>Your Current Room Number</DisplayName> <QueryStringParam>room</QueryStringParam> <DefaultValue></DefaultValue> <InputFlags>N</InputFlags> </InputItem> </CiscoIPPhoneInput>
Save this code snippet as an XML file to your web server and add it to the list in the Perl file. This will present the phone with various prompts and post the result as a POST value to the URL you specify at the top of the XML file (URL). In our example we use this as a contact form, all of the params are passed to an ASPX page which deals with the response and displays a message stating wheter the email was sent or not and if there were any errors.
The input flags tells the phone to restrict what can be input into the field – “L” means lowercase only, “N” means number only. Other you may have are:
A – Any text
T – Telephone Number (allows # and * also)
E – Equation (numbers and math symbols)
U – Uppercase
P – Password (can be combined with other flags eg AP, TP or UP)
The display name value is the question to ask for that input and the default value can be anything you want to prepolate the field with.
You can also display images on the phone, for example:
<CiscoIPPhoneImageFile> <Title>A Cat</Title> <Prompt>cute!</Prompt> <LocationX>0</LocationX> <LocationY>0</LocationY> <URL>http://127.0.0.1/test.png</URL> </CiscoIPPhoneImageFile>
This will display a PNG image on the phones display at the location you set. The image must be a PNG with 8 bit colour in RGB at 72DPI, however it tends to down-sample images anyway.
This is an example showing how to create new softkeys:
<CiscoIPPhoneText> <Title>What is your favourite colour</Title> <Prompt>Take Your Pick</Prompt> <Text>Sometimes important questions need to be asked, this is one of those times.</Text> <SoftKeyItem> <Name>Red</Name> <URL>http://127.0.0.1/results.aspx</URL> <Position>1</Position> </SoftKeyItem> <SoftKeyItem> <Name>Yellow</Name> <URL>http://127.0.0.1/results.aspx</URL> <Position>2</Position> </SoftKeyItem> <SoftKeyItem> <Name>Pink</Name> <URL>http://127.0.0.1/results.aspx</URL> <Position>3</Position> </SoftKeyItem> <SoftKeyItem> <Name>Back</Name> <URL>http://127.0.0.1/cisco.pl</URL> <Position>4</Position> </SoftKeyItem> </CiscoIPPhoneText>
This XML file does nothing other than asking questions however you may choose to combine this with the previous code snippet to create a working survey function.
Finally you may wish to execute a phone function for example:
<CiscoIPPhoneExecute> <ExecuteItem Priority="0" URL="Play:24CTU.raw"/> </CiscoIPPhoneExecute>
This will play the ringtone called “24CTU” from the TFTP server.
This article should give you a good start into adding cool features to your Cisco phone, but for full documentation visit the official developer site.




I want to quote your post in my blog. It can?
And you et an account on Twitter?
RSS Feeds are really very helpful and you could get site and news updates from it.~-: