Creating Grandstream GXP-2000 Ring Tones
One of the great features of the Grandstream GXP-2000 VoIP phone is that you can create and upload custom ring tones to your phone. The sad part is that the utility to do so on their web site only exists for Solaris and Linux.
This article will show you how to create compatible ringer files using an open-source utility called SoX. Mac OSX users can download a version of SoX here. You’ll also need this Perl script:
#!/usr/bin/perl
#——————————————————————————
# Create ringtone file for Grandstream BT100 phone, using uLaw input.
#
# Author: Tony Mountifield
# Date: 28 May 2004
# File: makering.pl
# History:
# 28/05/2004 Initial version.
# 29/05/2004 Added checks for input file size being even and not too large.
# 30/05/2004 Phone will not accept files larger than 65536 bytes.
# 06/06/2004 Modified for the 1.05.00 firmware, probably doesn’t support
# older firmware any longer
#——————————————————————————
#
# Usage:
# Use sox to convert any audio input file to uLaw and pipe to this prog, e.g.
#
# sox inputfile -r 8000 -c 1 -t ul - rate | makering.pl ring1.bin
#
# (try using /usr/share/sounds/phone.wav for the inputfile)
#
# Check the output file by using the following command:
#
# tail +513c ring1.bin | play -t ul -
#
# Finally, put the ring file in /tftpboot on the phone’s TFTP server,
# and reboot the phone.
#
#——————————————————————————
#
# Credits:
# Based on analysis by Stephen R. Besch
#
# Copyright: placed into the public domain by the author
#
# Warranty: none!
#
#——————————————————————————$filename = shift or die “need output filename\n”;
undef $/; # slurp whole file at once…
$audio = <>; # … like this
$filesize = 512 + length $audio;
if ($filesize & 1) {
# length odd, add a zero byte (should never happen)
$audio .= chr(0);
}if ($filesize >= (2 * 65536)) {
print STDERR “Warning: $filesize is bigger than 2 bytes, trouble may be ahead.”
}# this is the format for the header
$headerfmt = “N n C4 n C C C C a16 C C x4 n n x214 n n N x72 a176″;# get the current date and time
($min, $hour, $day, $month, $year) = (localtime)[1..5];
$year += 1900;
$month += 1;# create the header, with zero for the checksum
$header = pack $headerfmt,
$filesize/2, # 00 - filesize/2
# FIXME: I’m guessing that the 0000 we
# always see at the beginning of
# the files are an extended file size
0, # 04 - put checksum in later
1,0,0,1, # 06 - version
$year, # 0a - year
$month, # 0c - month
$day, # 0d - day
$hour, # 0e - hour
$min, # 0f - min
“ring.bin”, # 10 - name, seems to always be ring.bin
# FIXME: Assumption 1: always ring.bin
# FIXME: Assumption 2: name field is 16 chars
0, # 20 - ?
0, # 21 - ? 0 (ring1.bin) or 9 (ring2.bin) - Codec?
# 22 - 4 NULL bytes, unknown
0xc8, # 26 - ? 00C8 (0 sometimes seen before)
0, # 28 - 0000 (ring2.bin) or 0001 (ring1.bin) - why?
# 2a - 214 null bytes
0, # 100 - ? 0
256, # 102 - ? 0×0100
$filesize/2, # 104 -
# Next comes an array of positions, which seems
# to be a sort of ‘play until’ set of instructions
# 150 - Description
“Grandstream standard music ring”;# sanity check
$headerlen = length $header;
die “header length wrong ($headerlen)\n” unless $headerlen == 512;# add the audio
$header .= $audio;# compute the checksum
$checksum = unpack “%16n*”, $header;
printf “checksum before = %04x\n”, $checksum;# insert it in the correct place
substr($header,4,2) = pack “n”,-$checksum;# ensure the new checksum is zero
$checksum = unpack “%16n*”, $header;
printf “checksum after = %04x\n”, $checksum;
die “checksum failed\n” unless $checksum == 0;# write the file
open F, “>$filename” or die “can’t open output file $filename: $!\n”;
print F $header;
close F;# end
Just like the script instructions say, you execute the following command:
sox inputfile -r 8000 -c 1 -t ul - rate | makering.pl outputfile
Depending on your system configuration, you might have to use this:
sox inputfile -r 8000 -c 1 -t ul - rate | perl makering.pl outputfile
That’s all! SoX converts your file to the proper format and the Perl script modifies the file header information to be acceptable to the Grandstream phone. Your output files must be named ring1.bin, ring2.bin, or ring3.bin. The file name will replace that particular custom ring tone in the telephone when uploaded.
To upload the files to your phone, simply place them in the HTTP or TFTP directory your phone updates and proceed with a normal firmware update process.
Here are some sample ringers that I converted for you to try out:
Horse - the sound of a horse neighing
Owl - the hooting of an owl. I wonder hoo could be calling?
Bell Ringer 1 - an old style telephone ringer
Bell Ringer 2 - another old style bell ringer
8 Responses to “Creating Grandstream GXP-2000 Ring Tones”
Leave a Reply
You must be logged in to post a comment.

Grandstream GXP-2000 Ring Tones…
This post explains how to create ringtones for the Grandstream GXP-2000…….
Hi,
Using your script as is in the posting to convert a WAV file which all works fine with no errors.
When I upload the the ring1.bin to the phone it is a blank (no sound) ringtone.
I have 1.0.1.9 version of the firmware in a GXP-2000 phone.
Any ideas?
Have you tried using one of the sample files above? I occasionally generated files that wouldn’t play. At first I thought it might be the file size, but some smaller file sizes didn’t work either. There is a size limit, of course, but I’m not sure what it is. The lack of documentation for this feature on Grandstream’s part makes it all the more vague.
If the sample files above work on your phone, I’d try making a different ringtone. For what it’s worth, I’m running firmware version 1.0.2.13. With the previous beta, none of my uploaded ringtones would work.
If you want to try the beta firmware, make sure you have a new hardware revision. Apparently phones with MAC addresses beginning with 00.0B.82.03. are experiencing some problems with the beta firmware.
My phone’s MAC address begins with 00.0B.82.05 and I haven’t had any problems whatsoever.
Good luck!
Hi! Thanks for posting this tutorial. Unfortunately I get the following error when trying to run:
sox Mike_Bleep.mp3 -r 8000 -c 1 -t ul - rate | perl makering.pl ring1.ring
Unrecognized character \xE2 at makering.pl line 41.
Any ideas? Any help is greatly appreciated.
I realized the error of my ways: I had to replace your double-quotes with the standard ones.
seems to work now! Thanks.
I was wondering if there is anywhere to get the original ring tones back to replace back into the phone?
Thanks
Tom
You can find Windows and Linux tools from Grandstream at
http://www.grandstream.com/y-ringtone.htm
i can’t upload the that folder because i can’t access it