I have been in the process of implementing Asterisk into my home entertainment system so that caller id can be seen when watching TV, the ability to answer incoming calls and even make outgoing calls via MediaBox.
But before doing all that I had never come across asterisk in my various undertakings in the past so I thought it would be a good idea to get used to how it works and how to setup a VoIP system. Since this was something that had been on the cards for a while at work, I volunteered to do it.
Follow up:
Well a few days into the change over from an old POTS system to VoIP I had 13 extensions to manage with various Grandstream phones, mainly GXP-1200’s but also a few GXP-2000’s. One thing that I wanted to be able to do it provision the phones automatically. The Grandstream phones all have the ability to be provisioned automatically via TFTP or HTTP. I have seen provisioning tools within Trixbox but it still didn’t quite do what I wanted it to do. So I have written my own PHP provisioning script that automatically generates the configuration on the fly as the phones request it. Here is the list of features that this script currently handles.
- Reads in a default Grandstream configuration file for the default settings that are constant for all phones
- Generates the configuration file on the fly (no need to regenerate configuration files after a change to the general default config file)
- Pulls the name of the extension, SIP id and password from the FreePBX database and assigns it to account 1 on the phone in question.
So I am supplying the script here which will hopefully help others too in their asterisk adventures.
Pages: 1 · 2

I modified the php for my needs and used a slightly different apache directive with mod_rewrite, as I have firmware in a sub directory of /prov.
One issue I came across is the DST rule. This wont be a problem if you are in the USA, but in the UK (and others no doubt) the rule is different from the default. (Why didn't GS embed the rules in the firmware?) Unfortunately, you can't send the rule as you would write it in the config file, because it has commas and semi-colons, which have special meaning in the request format of the config data. I used a str_replace to swap them for hex codes. It doesn't like the dashes encoded for some reason and don't use url_encode - I tried that and it screwed up the data and killed one of my phones! Good job they are cheap...
Thanks again.
You can find more information here
http://www.voip-info.org/wiki/view/Grandstream+Configuration+Tool