IP Camera on a Cisco 7970 Phone

IP Camera on a Cisco 7970 Phone

If you own a cool Cisco 7970 IP Phone, and you have an ip webcam, then this script could be interesting for you. It is possible to show your ip camera in de serviceURL of you 7970 phone. What you need is a webserver to host you menu.xml and your cam.php script. I use a Axis 207W IP camera, but the script should work on all posible cameras.

You need to define your ServiceURL in your config-file (SEP0xxxxxxxx.cnf.xml) of your 7970 iphone.


In this file you can define the menu for your services button.To publish the cam script use this code:

  <Title>IPAS XML Services</Title>
  <Prompt>Please make your selection.</Prompt>
    <Name>Axis Netcamera </Name>

This is the actual php script wich generates the xml output and shows a png-image converted from an image of your Ip-camera. The script supports 4 different cameras and softkeys.
I created the script for use with apache and ImageMagick on linux. It is important that you have the php-pecl-imagick modules installed in your apache. This module is needed to convert the jpeg-image to png format and resize the image to match the 7970 browser. Remember to edit the variables in the script to your need.

// IP-Camera image on your Cisco 7970G IP-phone 
// This simple script downloads an image from your ip-camera (Axis) and 
// convert the image to a 7970G browser format. 
// Script by ipas 27-10-2012
// You need php-pecl-imagick installed on your apache-server 

$camtext2="Oprit - Voordeur";
//the path to the imagefile. must be world-writable! chmod 777

if ($cam==1){
  } elseif ($cam==2){
  } elseif ($cam==3){
  } elseif ($cam==4){
  } else {

  // Get the image from the camera
  $image = file_get_contents($camurl);

  // Create Imagick object
  $im = new Imagick();

  // Convert image into Imagick

  // Resize image to match a cisco 7970 browser

  // Add a subtle border
  $color=new ImagickPixel();
  $im->setImageChannelDepth(imagick::CHANNEL_RED, 5);
  $im->setImageChannelDepth(imagick::CHANNEL_GREEN, 12);
  $im->setImageChannelDepth(imagick::CHANNEL_BLUE, 12);

  // Output the image
  $output = $im->getimageblob();
  $outputtype = $im->getFormat();

// output to file
  $fp = fopen($imagepath, 'w');
  fwrite($fp, $im);

$output= "
  <Prompt>" . $camtext . "</Prompt>
  <URL>" . $imageurl . "</URL>
    <Name>" . $buttontext1 . "</Name>
    <URL>" . $camscripturl . "?cam=1</URL>
    <Name>" . $buttontext2 . "</Name>
    <URL>" . $camscripturl . "?cam=2</URL>
    <Name>" . $buttontext3 . "</Name>
    <URL>" . $camscripturl . "?cam=3</URL>
    <Name>" . $buttontext4 . "</Name>
    <URL>" . $camscripturl . "?cam=4</URL>
    <Name>" . $buttontext5 . "</Name>
    <URL>" . $camscripturl . "?cam=5</URL>

header("Content-type: text/xml");
header("Connection: close");
header("Expires: -1");
echo $output;



Leave a Comment