Converting custom ringtones and adding them to Cisco VOIP SIP phones in 2020 with an ffmpeg one-liner
So, I've spent some of my free time in the last 2 days working on LasagnaTel, Lasagna Ltd's internal phone network, and did some small improvements. One of the changes I wanted to also do was fixing DTMF tones (to only have them inband).
Over the last couple months, I've been thinking on and off wondering if my specific cisco phone supports custom ringtones ever since I saw linuxgemini set their ringtone to Nokia Arabic Ringtone, but never really bothered with it, but...
While I was trying to edit the config files to fix the DTMF issue, I saw a file called
Ringtones.xml on my tftp server from the base set of files I used from an internet resource months ago, and decided to take a look. It had two “custom” ringtones in it (“custom”, as they were the default tunes I believe, but the files were hosted on the server, and weren't on the phone itself), and when I opened the ringtone menu on the phone, those were displayed, and when I hit play, those did play.
So I ended up trying to add that again.
Just like everything else with these damn phones though, resource was sparse. I ended up not finding too many resources, but with technical information (on what I need to convert my files to) from linuxgemini and this ancient cisco document (archive.lavatech.top, archive.org) and some other information on The Internets™, I was able to figure out how to convert files:
ffmpeg -i in.wav -t 00:00:20.0 -ar 8000 -ac 1 -f mulaw out.raw
As you can see, I'm cutting the files to their first 20 seconds, as that's the limit. Any longer, and it errors. That's the thing that gave me the most trouble.
After that, all I had to do was copying it to the tftp server root, adding it to the
<CiscoIPPhoneRingList> <Ring> <DisplayName>CTU 24</DisplayName> <FileName>CTU_24.raw</FileName> </Ring> <Ring> <DisplayName>Old Telephone</DisplayName> <FileName>Old_Telephone.raw</FileName> </Ring> <Ring> <DisplayName>Steins;Gate</DisplayName> <FileName>sgperfectloop3.raw</FileName> </Ring> <Ring> <DisplayName>Nokia Arabic</DisplayName> <FileName>nokia-arabic.raw</FileName> </Ring> </CiscoIPPhoneRingList>
and re-opening the ringtone menu on the phone. It does take a couple seconds for it to load, and even more seconds for it to download the ringtone the first time you hit play, but it ended up working perfectly once it downloaded it once.
Here's a video demonstration:
Anyhow, that now works! Enjoy your enterprise shitposting!