Posted on Monday, 22nd March 2010 by Michael
After months of research of a simple way to create custom ringtones for Cisco IP phones I have come up with the following methods based on the Cisco documentation located at : http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/admin/3_0_9/a3rings.html . Cisco requires that the custom ringtones meet strict guidelines. This baffles me as my cell phone can play full length mp3 files as a custom ringtones and costs a fraction of a Cisco IP phone. Oh well I digress. To accomplish this I chose to use the “sox” application. Sox is like a Swiss army knife for sound editing and the best part it is free.
I have created a simple shell script below that will automate the process for you. This script was written to run on the Linux based PBX (Trixbox, PBX in a Flash, Asterisk and so on). Though with a little editing of the script you can use it to just create the ringtones and not install them.
- Make sure you have sox installed: which sox and if you don’t you can install it with either apt-get or yum.
- Download the wav files or mp3 that you want to convert to your PBX but. I suggest using Google or another means to find files you want to use. Remember mp3 support may not work.
- Copy the code below and paste it into a file on your Linux box using your favorite editor.
- Open the shell script and edit the variables if your paths are different. If you don’t know what to put here leave it blank. These are the paths on your PBX where the phone will pull its configurations from.
- Save the changes and chmod the file so you can execute it.
- Excute the script:
- When prompted for the path and name of file you want to convert enter it like this: /music/ring.wav
- When prompted for the path and name of the output file it enter it like this: /music/ring (no extension)
- Watch for errors and correct where needed.
- If you are running this on a Linux PBX it will copy the file to the /tftpboot dir and edit the RINGLIST.DAT file for you.
- Once the script is done reboot your phone
#!/bin/bash
#####################################
## Create custom cisco ringtones ##
## Created by Michael LaSalvia ##
## http://www.digitaloffensive.com ##
## Tested on cisco 7940 and 7960 ##
## Running SIP ##
#####################################
#Variables
dtftp=/tftpboot
fring=$dtftp/RINGLIST.DAT
#My current sox install does not support mp3. Most do not by default.
echo "Enter the path and name of the file you want to convert: "
read inRing
echo "Enter the path and name of the output file: "
read oRing
echo "#############################################"
echo "Converting the file"
echo "#############################################"
#Not all sox installs support -b without a positive integer
sox $inRing -t raw -r 8000 -U -b -c 1 $oRing.raw resample -ql
echo "#############################################"
echo "Resizing the file(16080B) and saving to $dtftp"
echo "#############################################"
dd if=oRing.raw of=$dtftp/$oRing.raw bs=1005 count=16
echo "#############################################"
echo "Editing the RINGLIST"
echo "#############################################"
echo "$oRing $oRing.raw" >> $dtftp/$fring
echo "#############################################"
echo "If there was no errors above, please reset your phone and choose your new ring"
echo "#############################################"
Posted in Code | Comments (2)
October 8th, 2011 at 11:58 pm
Thank you!
Your script worked perfectly.
I’d been messing around for ages trying to create and upload a custom ringtone to a WIP310.
October 9th, 2011 at 12:19 pm
Glad I could help.