Cisco IP Phone App Primer

Cisco IP phones have the ability to access XML based apps, these tend to be used for fairly generic things such as providing weather details. The content is delivered via HTTP, the URL to the services is provided in the phone configuration file, using the <servicesURL> element, for example:

<servicesURL>http://10.250.10.32/phonesrv</servicesURL>

The index file served, needs to specify XML as the content-type, here is a sample using PHP.

<?php
    Header("Content-type: text/xml");
?>

<CiscoIPPhoneMenu>
  <Title>Cisco XML Services Apps</Title>
  <Prompt>Select a menu item</Prompt>
  <MenuItem>
   <Name>Phone IP Address</Name>
   <URL>http://10.250.10.32/phonesrv/ip.php</URL>
  </MenuItem>
</CiscoIPPhoneMenu>

At this point the user can select the Phone IP Address menu item, which will load the ip.php file. Here is some more sample code, this will return the IP address of the phone making the query.

<?php
    Header("Content-type: text/xml");
?>

<CiscoIPPhoneText>
  <Title>IP address details</Title>
  <Prompt>The prompt text goes here</Prompt>
  <Text><?php
    $ip = $_SERVER['REMOTE_ADDR'];
    echo "IP: " . $ip;
    ?>
 </Text>
</CiscoIPPhoneText>

To set the phone to auto-refresh the page, a Refresh header can be added. The refresh value specified should be in seconds.

<?php
    Header("Content-type: text/xml");
    Header("Refresh: 10");
?>

The cisco.com development guide can be found here.