a successful Polycom IP 501 deployment model

Those who have embraced asterisk or other VoIP systems have a large choice of phones to deploy on the desks throughout their organization. I’ve personally ordered quite a few phones, and I’ve seen some that are very very bad from a user’s perspective. One particular model was horrible, to the extent of needing to be reset regularly. But one of the models I tested was actually recommended by a user on the asterisk IRC channel… the Polycom IP 501. It’s a multi-line SIP phone with all of the features you would expect to find in a solid desktop phone meant for business. They have a large screen, a very good full-duplex speakerphone, and a built-in switch… so you don’t have to run extra cabling.

Polycom IP 501One place they do fall short, however, is in the configuration. Many people actually shun Polycom because they refuse to provide reliable support unless you are an actual dealer. The configuration files aren’t well documented, and the firmware is fairly hard to find. That, my friend, is the reason I’m writing this post. I’m going to detail everything you need in order to get a quick deployment model setup in your company. By the end of this, you should be able to add a new phone to your network within about 15 minutes.

By the way, some of those who read this may question why I’m not even glancing in the direction of configuring the phones via the built-in webserver. I’ve taken this route for a few reasons… 1) the built-in webserver is hideously slow, 2) when you change the configuration enough, you have to wait for the phone to reboot (which takes a short eternity) before you can continue configuration, 3) it doesn’t make sense to do all of your configuration manually on every phone, especially if you have more than 2-3 users.

So now that we’ve made our decision, let’s start with the firmware. You can find the latest firmware and bootrom files right here. I suggest you get:

  • SoundPointIP_BootROM_2_6_2.zip
  • SoundPoint_IP_SIP_1_6_2.zip

Just unzip those files onto your local drive, and try to keep from editing anything in that directory… just so you have clean files to reference.

Now is the time to install an FTP server. Unfortunately, as much as I hate these words, the details are beyond the scope of this article. The main point is that you’ll need a working FTP server that is accessible from your local network. Whether you decide to install it on a local Linux server following my instructions here, or you just install Filezilla Server on a Windows machine, you should be fine. On your FTP server, create a new user by the name of ‘PlcmSpIp’, case IS sensitive. One suggestion, when setting your password you should remember that you’ll be entering the password several times on a telephone keypad, so sticking to a fairly short numeric password might be a good idea. ;)

At this point, revisit the directory of files you unzipped. You’re going to need to copy the following files to your FTP user’s home directory:

  • bootrom.ld
  • bootrom.ver
  • sip.cfg
  • sip.ld
  • sip.ver
  • SoundPointIPWelcome.wav
  • The entire SoundPointIPLocalization directory

Also, you’ll need to create a directory called ‘logs’ in the user’s home directory. We’ll configure the phones to upload their log files to this location so that things are fairly tidy.

Take a look at the files you unzipped on your harddrive. You’ll find 000000000000.cfg, 000000000000-phone.cfg, and 000000000000-sip.cfg. These are the primary configuration files that will control every aspect of the way your phone behaves. We’re going to make these into template files, specifically for a program that we write to parse and create proper config files out of. Neat, eh? If you’d like to just use my template files, you can download them, or you can just use them for reference:

You’ll notice in each file I inserted various placemarks using the format “{ATTRIBUTE}”. These are in the 3 config files, and match up with the columns in the MySQL table. We’re going to create a Python script that will read in the data and create custom configs for each phone in the table. So let’s say we have the following information:

id server fname lname extension mac ringtone linekeys acdline acdlabel chirp
1 Joe Smith 1000 0a1b2c3d4e5f 4 2 2000 IT silence
2 Jane Doe 1001 0a1b2c3e4f5g 4 3 silence

So we’ve got the main server, the users’ names, their extensions and phone MAC addresses. Notice we also have the ‘linekeys’ column. The 501 has the ability to assign a line number to one or multiple lines on the phone. Since the 501 only has 3 physical line keys, I don’t want to mess with any more than that. As you can see, though, Joe is in the IT group. The idea is that all of your agents who are in queues will only want one line dedicated to that queue, that way Asterisk isn’t going to ring their phone if they’re already on a queue call. So by setting ‘linekeys’ to 2, and assigning an ‘acdline’ number and ‘acdlabel’, we set up the third line to be a separate extension number. Naturally, you’ll need to configure this properly in your Asterisk box. As far as Jane Doe goes, she just gets the same extension for all three lines, since she’s not a member of any queues.

Ok, so now we have our database set up with the user data, we’ve got template config files, and we have an FTP server set up. Only a few more steps to go. On the next page, we’re going to build the Python script that will tie it all together. I’ll see you there!

So to recap, we need to bring the FTP server, the configuration template files, and the phone user database all together into a fairly easy to use system. The way I did it was with a Python script. Is there anything Python can’t do? :)

Here’s the script:

import MySQLdb, os, shutil
print ” Connecting to Database”
db=MySQLdb.connect(host=”host”, user=”user”, passwd=”pass”, db=””)
c = db.cursor()

print ” Creating Company Directory”
output = open(“c:\\phones\\000000000000-directory.xml”,”w”)
c.execute(‘select fname,extension,ringtone from PBX.phones’)
for rec in c.fetchall():
fname,extension,ringtone = rec

print ” Creating CFG Files”
c.execute(‘select server,fname,lname,extension,mac,ringtone,linekeys,acdline,acdlabel,chirp from PBX.phones’)
for rec in c.fetchall():
server,fname,lname,extension,mac,ringtone,lines,acdline,acdlabel,chirp = rec
print ” ” + fname + ” ” + lname
password = “ae”+extension[::-1]
password2 = “ae”+acdline[::-1]
template = open(“c:\\phones\\000000000000.cfg”,”r”)
output = open(“Q:\\PlcmSpip\\”+mac+”.cfg”,”w”)
for line in template.readlines():
line = line.replace(“{SERVER}”,server)
line = line.replace(“{FNAME}”,fname)
line = line.replace(“{LNAME}”,lname)
line = line.replace(“{EXTENSION}”,str(extension))
line = line.replace(“{MAC}”,mac)
line = line.replace(“{LINES}”,str(lines))
line = line.replace(“{RINGTONE}”,str(ringtone))
line = line.replace(“{PASSWORD}”,password)
line = line.replace(“{PASSWORD2}”,password2)
line = line.replace(“{ACDLINE}”,str(acdline))
line = line.replace(“{ACDLABEL}”,str(acdlabel))
template = open(“c:\\phones\\000000000000-phone.cfg”,”r”)
output = open(“Q:\\PlcmSpip\\”+mac+”-phone.cfg”,”w”)
for line in template.readlines():
line = line.replace(“{SERVER}”,server)
line = line.replace(“{FNAME}”,fname)
line = line.replace(“{LNAME}”,lname)
line = line.replace(“{EXTENSION}”,str(extension))
line = line.replace(“{MAC}”,mac)
line = line.replace(“{LINES}”,str(lines))
line = line.replace(“{RINGTONE}”,str(ringtone))
line = line.replace(“{PASSWORD}”,password)
line = line.replace(“{PASSWORD2}”,password2)
line = line.replace(“{ACDLINE}”,str(acdline))
line = line.replace(“{ACDLABEL}”,str(acdlabel))
template = open(“c:\\phones\\000000000000-sip.cfg”,”r”)
output = open(“Q:\\PlcmSpip\\”+mac+”-sip.cfg”,”w”)
for line in template.readlines():
line = line.replace(“{CHIRP}”,str(chirp))


Remember, any time you use code from my site, you’ll need to remove the line numbers.

One thing you’re going to need to do is either have Samba installed on your local FTP server, or use something like NetDrive to map a remote FTP directory. Both options work great, though NetDrive would certainly be the slowest of the two. In any event, as you can see, I mapped my FTP directory to my Q: drive in Windows.

So the basic flow of this program is to first read in all of the users from the PBX.phones table and build a “directory” XML file. This is the file that the phone uses for the speed dials. If you’d like to leave it out, feel free. Then the script reads in the data again and goes through each template file, replacing the relevant placemarks with good data. The files are then saved to the FTP server using the MAC provided in the table.

At this point, we’re done. In all, it takes about 10-15 minutes to setup a brand new phone out of the box… and that includes the time the phone spends downloading the latest firmware. It’s an insanely easy process at this point to setup an entire office fairly quickly.

I hope this information is useful to someone out there. If so, please let me know!

12 Responses to “a successful Polycom IP 501 deployment model”

  1. Andrew Says:

    Thanks alot for the info. I have a 60 handset install coming up and was dreading creating the config files! I’m not a programming at heart but within a couple of hours had python and MySQL going. The only thing you might add that I got stuck on was you have to remove the line numbers in your code for Python to digest it. unless there is some setting somewhere I missed.

    thanks again!!

  2. pr Says:

    That’s great to hear! Thanks for letting me know!

    Someday I’m going to build a python-based server that’ll make the whole process even easier. When I do, I’ll post it here.

    And thanks for the mention of the line numbers… I’ll make a note about it in the article.

  3. Steve Totaro Says:

    Thanks for the tutorial. It makes sense but I am not clear on a couple of things.

    Are you running the Python script on a Windows box? If so, what package do you recommend?

    I guess the database is created on a Linux box?

    Couldn’t this whole thing be done on the Linux box with no Windows included?

    Steve Totaro

  4. pr Says:


    Absolutely, you don’t need to run the script on Windows at all. In fact, the only reason it was done that way before was to make it easy for other people to make the changes without me.

    In fact, this was all meant to be a sort of framework, just to show a possible way of doing it and letting others build on it.

    The python-based server I mentioned in the comment above would actually be entirely on the Linux server, with no real user interaction. If you’re really (really!) interested, and you convince me of that, I’ll see if I can write that software in the next week or so. Otherwise, I might take another few months. ;)

  5. Jack Says:

    i opened the file “000000000000.cfg” from the folder “SoundPoint_IP_SIP_1_6_2.zip”

    but it does not have the {Attributes} in them.
    i am trying to create a configuration file for Polycom IP 501
    the python script replaces all those variables that are not in the cnf file.

    is there another file i need to be looking at?


  6. pr Says:


    Those were inserted by me… Just replace those attributes that you want to replace with the {} markers, and then modify the script accordingly. Everyone’s template could be different. :)

  7. Jack Says:

    that is not getting displayed here for some reason. let me remove the comments in that

    Default Master SIP Configuration File
    Edit and rename this file to .cfg for each phone.
    $Revision: 1.13 $ $Date: 2004/11/26 23:30:44 $

  8. pr Says:

    Jack, that’s correct… you need to add those bracketed areas as you see fit. In my case, in the file you mentioned, I decided to replace the filenames with {} place holders.

  9. Eric Says:

    Hi, i,m testing a polycom 501, but in the booting, the system hangs about 5 min in to load, is that normal in polycom phones? or i´m doing some wrong?, before that the sistem is perfectly, i can make and recive calls, but for my costumers is a problem to wait, about 5 minutes for to wait until the phone is ready. some advices?

  10. RobH Says:


    The polycom phones can take up to 5 minutes to program their initial software (most ship with older software, as they were sitting in vendor warehouses and such.)

    While its programming, it will take awhile. After that program load, any future reboots are a two minute or so process.

  11. Sam Says:

    This web site does a good job showing the web side of configuration for the Polycom voip phones. –>

    I have used to for an IP430.

  12. Max Says:

    How does one go about editing the 00000000000.cfg files? I cannot find a program…or just change it to .txt then change back after edit?