Introduction
The new Cisco IP Phones (7920, 7940, 7960, 7970, 7971) all support showing content located on a web server. This content needs to be formatted using the Cisco proprietary format using XML.
This article will walk you through creating a small Hello World using the library I created.
Cisco SDK
If you take the time to open the SDK, you will see that if you want to create content, you basically have to write an XML file. For static content, this works pretty well,
but if you want to create dynamic content using ASP.NET, a library would be useful. The library provided here is partially complete and you are welcome to send updates.
The size of the screen being small, possibilities are limited but still the applications that can be developed are interesting. The SDK freely available from
the Cisco website includes various examples (weather, stock, etc.) that will demonstrate the possibilities.
Cisco SDK.
Using the Code
Now let's go and create our Hello World. First create an ASP.NET project and then add the DLL to your reference.
Create a WebForm and delete all HTML from the ASPX file and leave only the first line (Page
tag) at the top.
Your ASPX file should look like that:
<%@ Page language="c#" Codebehind="hello.aspx.cs"
AutoEventWireup="false" Inherits="IPPhone.hello" %>
Then in the Page_Load
function, write the following:
Response.ContentType = "text/xml";
CiscoIPPhoneText t = new CiscoIPPhoneText("Hello World",
"Hello World","Hello World");
t.AddSoftKey(new CiscoSoftKey("Hello","",1));
Response.Write(t.ToString());
Here you first need to set the Content Type to XML and then you can use the CiscoIPPhoneText
object of the library.
Creating a new CiscoIPPhoneText
will require three parameters: Title
, Prompt
, and Text
.
Once the object is created, you can then send it to the browser with a Response.Write
. Optionally, you can add a soft key using the AddSoftKey
method.
Note: Please refer to the SDK documentation to see where those strings will be displayed.
Testing the Code
OK, now if you open this same page in your web browser, you can see an XML file that will look like:
<CiscoIPPhoneText>
<Title>Hello World</Title>
<Prompt>Hello World</Prompt>
<Text>Hello World</Text>
<SoftKeyItem>
<Name>Hello</Name>
<URL></URL>
<Position>1</Position>
</SoftKeyItem>
</CiscoIPPhoneText>
But how do we get the screenshot?
Well, unless you have a Cisco IP Phone, you will need to use an emulator; Aptigen is providing one.
They have a trial version that will allow you to test your Hello World and get a screen just like the one above...
History