Physician's Directory on a Cisco 7960 Series IP Phone

I finally rolled out my solution for a Physician Directory on our Cisco VOIP system. The staff appears to be pleased with this added functionality. This has also opened up more ideas on how we can continue to leverage our knowledge in ASP.NET to provide services on our phone system.

The Cisco phone system operates entirely off of XML. For the most part, it is a glorified XML reader!

Guillaume Gros provided the foundation for a .NET class that I was able to add functionality to.

Now I have my most common functions that I would need (for instance “give me a button”) in managed code. In the code-behind on my aspx page I include the class, call a function, and supply a minimum set of parameters. The class returns the necessary XML to be rendered. Neat!

Let me give you an example (VB):

 

Dim btnSubmit As New CiscoSoftKey(“Search”, “SoftKey:Submit”, 1)

 

This declares a new CiscoSoftKey button specifying that the text of the button will be “Search” and “SoftKey:Submit” is a URL parameter that the Cisco phone interprets as “submit the following parameters”. 1 indicates the position of the button (out of 4 available).

The class accepts the parameters and returns the XML required to be display a Cisco Soft Key on the phone.

Simply Response.Write the XML that is returned and the Cisco phone (for the most part) does all the rest. Below is the code I wrote to build the screen shot you see above (search for physician):

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Response.ContentType = “text/xml”

‘Create an Array of CiscoInput items
Dim Inputs As New ArrayList
Dim LName As New CiscoInput(“Last Name”, “lname”, “U”, “”)
Dim FName As New CiscoInput(“First Name”, “fname”, “U”, “”)
Inputs.Add(LName)
Inputs.Add(FName)

‘Create and array of CiscoSoftKeyItems
Dim SoftKeys As New ArrayList
Dim btnSubmit As New CiscoSoftKey(“Search”, “SoftKey:Submit”, 1)
Dim btnBack As New CiscoSoftKey(“<<”, “SoftKey:<<”, 2)
Dim btnEROnCall As New CiscoSoftKey(“EROnCall”, “http://<hidden.com>/physdir/eroncall.aspx”, 3)
Dim btnExit As New CiscoSoftKey(“Exit”, “SoftKey:Exit”, 4)
SoftKeys.Add(btnSubmit)
SoftKeys.Add(btnBack)
SoftKeys.Add(btnEROnCall)
SoftKeys.Add(btnExit)

‘Send the array and other information to the .dll to retrieve xml result

Dim CPI As New CiscoIPPhoneInput(“Physician Directory Search”, “Enter search criteria”, “<hidden.com>.aspx”, Inputs, SoftKeys)

‘Write out the XML Code
Response.Write(CPI)

End Sub

And the two methods handled in the class:

public class CiscoInput

{

public string DisplayName;
public string QueryStringParam;
public string InputFlags;
public string DefaultValue;

public CiscoInput(string DisplayName, string QueryStringParam, string InputFlags, string DefaultValue)

{
this.DisplayName = DisplayName;
this.QueryStringParam = QueryStringParam;
this.InputFlags = InputFlags;
this.DefaultValue = DefaultValue;
}
public override string ToString()
{
return “<InputItem>\r\n<DisplayName>” + this.DisplayName + “</DisplayName>\r\n<QueryStringParam>” + this.QueryStringParam + “</QueryStringParam>\r\n<InputFlags>” + this.InputFlags + “</InputFlags>\r\n<DefaultValue>”+this.DefaultValue+“</DefaultValue>\r\n</InputItem>\r\n”;
}
}

public class CiscoSoftKey
{
public string Name;
public string URL;
public string URLDown;
public int position;
public CiscoSoftKey(string Name, string URL, int position)
{
this.Name = Name;
this.URL = URL;
this.position = position;
}

public override string ToString()
{

return “<SoftKeyItem>\r\n<Name>” + this.Name + “</Name>\r\n<URL>” + this.URL + “</URL>\r\n<Position>” + this.position + “</Position>\r\n</SoftKeyItem>\r\n”;
}
}

Attached is the source code for the class. Also, I would recommend the book Developing Cisco IP Phone Services.

 

Here’s the code you mooch!

Cisco IP Phone Services Class