5-4
Cisco Unified IP Phone Services Application Development Notes
OL-18696-01
Chapter 5 HTTP Requests and Header Settings
HTTP Header Settings
MIME Type and Other HTTP Headers
Although delivering pages with the proper MIME type and other formatting items is not difficult, it
requires moderately in depth knowledge of your web server. The following code excerpt, written in
JavaScript and used with Microsoft IIS and ASP, sets these values in a few lines:
<%@ Language=JavaScript %>
<%
Response.AddHeader( "Refresh",
"3; url=http://services.cisco.com/s/q.asp");
Response.ContentType = "text/xml";
//
// Additional page content here
//
%>
Usually, you can set the MIME type for pages in any web server by simply performing an association to
the .xml file extension. Your web server documentation should explain how to accomplish this. This
action allows you to serve static pages without the need for writing script.
If you want to deliver dynamic content by using the other supported HTTP headers, you will need to
understand how to generate the HTTP headers by using the desired programming language and have
common gateway interface (CGI) or script access on the target web server.
Audio Clips
You can serve audio clips to the phone from a web server by using the “audio/basic” MIME type setting.
When this MIME type is used, the body of the response should contain raw audio data in the same format
that is used for custom Cisco Unified IP Phone rings. Refer to the chapter on “Custom Phone Rings” in
the
Cisco Unified Communications Manager System Guide
(also available in the online help).
Note
The audio file should not be longer than five seconds.
Use the following ASP sample script to set the MIME type and to serve the file that is specified in the
#include command:
<%@ Language=JavaScript%>
<%
Response.ContentType = "audio/basic";
%><!--#include file="filename.raw" --><% Response.End();%>
Using script to generate the MIME header when playing a sound provides an advantage because you may
also include a refresh header to take the phone to a subsequent URL. Usually, you can set the MIME type
for pages in any web server by simply performing an association to the .xml or .raw file extension. Your
web server documentation should explain how to accomplish this. This action allows you to serve static
pages without the need for writing script.
Content Expiration Header Setting
The expiration header can control which URLs are added to the phone URL history. This behavior differs
slightly from traditional web browsers but is implemented to perform the same function. Disable the
back button functionality to avoid calling a URL twice.