Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Cisco IP Phone Services

0.00/5 (No votes)
23 Aug 2006 1  
A small example on how to produce content for Cisco IP Phones in ASP.NET.

Sample Image - CiscoIPPhoneServices.jpg

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

  • 2006-Aug-23: v0.1.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here