gs_phone – Ruby program to remotely configure Grandstream Voip phone

I have just released version 0.0.2 of my gs_phone Ruby program but I have not yet written about it yet so think of this as your introduction to my program.

What is it?

It is a set of Ruby scripts that can be used from the command line to administer a group of Grandstream Voip phones. It started as a small project at my work, which I was later allowed to Open Source. Currently it is just a pretty wrapper for a Perl program gsutil written by Charles Howes. Later on I hope to replace his utility with a pure Ruby implementation.

Why not just use the Perl one?

One, it is in Perl and I can’t hack Perl that good. Two, gsutil is good for one phone or a few phones but if you need to manage more phones than that, it becomes a chore. So gs_phone uses gsutil to communicate with the phone but gs_phone has it’s own features outside that gsutil does not.

What Features?

  • YAML database that stores the ip address, extension, username, and MAC address of the phone.
  • Group commands, like rebooting all of the phones at once.
  • Simple command syntax, modeled after Subversion

The TODO.txt and ROADMAP.txt offer a more detailed list of upcoming features.

How do I get it?

There are three ways to get gs_phone.

  1. (Recommended) Grab the gem from Rubyforge. It is packaged like many other Ruby libraries and this will let you keep up to date and any changes to the program.

    gem install gs_phone
  2. Grab the archive file from Rubyforge.

  3. Get the latest Subversion copy. The repository is public for reading so a quick checkout should work.

    svn checkout https://svn.www.freelancingdigest.com/public/gs_phone/trunk/ gs_phone

    You can also get the release code in the tags folders

     svn checkout https://svn.www.freelancingdigest.com/public/gs_phone/tags/release-0.0.2/ gs_phone-0.0.2

In order to use gs_phone you will also need to download gsutil from Charles Howes. The main file we are looking for is called gsutil

How do I use it?

  1. First you will need to run gs_phone to have it setup a folder and some files for you. Currenly they are hardcoded to HOME/.gs_phone but they could change soon. Just run gs_phone and it should notice you need the files and create them for you.
  2. Next you need to point gs_phone to your gsutil program. You can either copy gsutil into HOME/.gs_phone or modify the config.yml for gs_phone to point to the correct location.
  3. gs_phone should now work. Run the help command to get an idea of some of the functions. You can also run help on a command to see what a specific command does.

Examples:

$ gs_phone help
Usage: COMMAND [options]

COMMANDS       DESCRIPTION
new            Add new user and setup their phone 
add            Adds a user to the phone database
make           Generates a config file from the template
update         Uploads the configuration file to the phone
reboot         Reboots a phone 
find           Find the ip address in the configuration file

$ gs_phone help update
Usage: update IP_ADDRESS [CURRENT_ADDRESS] [ADMIN_PASSWORD]

Sends the updated configuration file for IP_ADDRESS to the phone.

Optionally, a phone configuration can be sent to a phone that currently has
a different ip address by using CURRENT_ADDRESS

The admin password from the configuration file can also be overridden

Ex:
  update 192.168.1.200
  update 192.168.1.200 192.168.1.10  <= Send '200's update to the phone at '10'
  update 192.168.1.200 192.168.1.10 admin <= Also uses the factory password

Eric Davis