Push background image to Cisco IP Phones

Hi there,

I came up with the following script to push background image files to Cisco IP Phones. Took me less than a day to write the code, so it’s not great in terms of efficiency but it does the job.

I am not looking to enhance its capabilities as I want to port this from Perl and to Python as a way to learn a new language. If people are interested in this I might create a full App to push images to Device Pool(s) or Location(s)  etc …

Some things to be aware of before using this application:

  • Script will push the image to phones in a define subnet. It does not check the phone type before pushing the image. Workaround to this is to associate the CUCM user with only the phones needing to be updated.
  • Script does not check that image is the correct size and format for the phone type (if  image format is incorrect Phone will respond with “400 Bad Request”)
  • User’s name and password are transmitted in clear text
  • Currently only tested with CUCM 9.x but should be applicable on CUCM 6/7/8. (If the script runs and it works on these versions please let me know and I will add it here)
  • Currently only tested with IP Phone 7945 and 7965 but again I don’t see why this will not work with all phones
  • Need to have Perl 5.5+ installed on your PC

Quick guide to Cisco IP Phones image format requirements

Cisco IP Phone 7906/7911
Full size image:  95 pixels x 34 pixels
Thumbnail image:  23 pixels x 8 pixels
Cisco IP Phone 7940/7960
Background images are not supported.
Cisco IP Phone 7941/7961
Full size image:  320 pixels x 196 pixels
Thumbnail image:  80 pixels x 49 pixels
Cisco IP Phone 7942/7962
Full size image:  320 pixels x 196 pixels
Thumbnail image:  80 pixels x 49 pixels
Cisco IP Phone 7945/7965
Full size image:  320 pixels x 212 pixels
Thumbnail image:  80 pixels x 53 pixels
Cisco IP Phone 7970/7971
Full size image:  320 pixels x 212 pixels
Thumbnail image:  80 pixels x 53 pixels
Cisco IP Phone 7975
Full size image:  320 pixels x 216 pixels
Thumbnail image:  80 pixels x 53 pixels
Cisco IP Phone 8961/9951/9971
Full size image:  640 pixels x 480 pixels
Thumbnail image:  123 pixels x 111 pixels
Cisco IP Communicator
Full size image:  320 pixels x 212 pixels
Thumbnail image:  80 pixels x 53 pixels

All of the above must be in .PNG format.

Check Perl requirements

Type of the following cmd in the dos prompt “perl -version”. The output should look like the picture below:

Perl version

Perl version

If the output is not the same as above you can download and install Perl from here

After the install is complete you need to start Perl Package Manager (PPM)

  • Search for the package “Net-Ping”
  • When found right click on it and select “Install Net-Ping 2.36”. A green icon will appear next to package
  • Do the same for  package “NetAddr”
  • Click on “Run Mark Action”
Perl Package Manager (PPM)

Perl Package Manager (PPM)

Web server for images

The phones will sent out an http request to download the image so we need to store the files on http capable server which the phones will have access to. I have used and tested with “HFS – HTTP File Server”. Its only 600kByte in size and runs as a standalone, no install needed. Can be downloaded here

HFS - HTTP File Server

HFS – HTTP File Server

Please note from the image that the server is listening on port “80”. This should not be changed. Also note the IP address of the server “http://10.64.164.230”. This will be needed later on in the “Config.txt” file. In terms of configuration all that is needed is “Menu > Add Folder” to add the folder that all the images are stored under.  In this case the folder is “7945-65”

Running the Script

  1. Log into CUCM and under “User Management > User” select a user and assign the phones you want to update the background to:
  2. CM User

    CM User

  3. Download the script Script-v0_1.
  4. UnZip the folder
  5. In the folder open the Config.txt file and edit the values after the ‘=’. Lines starting with ‘#’ are comments used to guide you. When done save and close the file
  6. Open a ms-dos prompt and cd into the uz-zip folder where file pushDesktop.pl can be found.
  7. Type command “perl -w pushDesktop.pl
  8. Config values are displayed. If correct type Y (case sensitive) and press Enter
  9. Running Script

    Running Script

  10. When done open the file log.txt and see full details of work been done.

Any issues please let me know

Thanks
Alexis

About Alexis Katsavras

Working as Freelance Cisco Unified Communications Consultant in the UK. www.NetPacket.co.uk