Hello All --
Trixbox 2.6.2.2 updated as of 10/March/2009.
I recently bought a lot of Grandstream HT-502's from SunnyVOIP (http://www.sunnyvoip.com) to use in my company's switch to VoIP trunks. I was dismayed upon realizing there was no support for the HT-502 in endpoint manager. After some head smashing I figured out how to add support for the HT-502 to the Trixbox endpoint manager/configurator. Here is what I did, and my commentary about what I did. Please note that even though this is a dual-line unit, the configuration generator only supports adding the first line automatically. Also note that unless Fonality incorporates these changes into their own code base, the changes are likely going to be overwritten with an update. (nudge, nudge).
The main issue I discovered was that the HT-502 required the Authentication ID to be set or else it would not register to Asterisk properly, however Trixbox only configured the SIP User ID setting. Took me a few hours to figure this one out...
I am providing this information in hopes that it will save someone some effort in configuring their devices. I offer no warranty what-so-ever, it is your own responsibility if something goes wrong!
These instructions assume you have a working endpoint manager already, have run setup-grandstream, and that you have a basic understanding of editing text files and working your way around linux.
Remember, if using nano as your editor, launch it with the -w option to preserve line wrapping
1: Install tbm-phpmyadmin (yum install tbm-phpmyadmin)
2: Download configuration templates from Grandstream:
http://www.grandstream.com/GAPSLITE/config-template.zip
3: Download most recent GAPSLITE from Grandstream (to fix some oddities with encoding + signs.):
http://www.grandstream.com/DOWNLOAD/Configuration_Tool/Linux_Unix...
4: Extract ht502_config_1.0.1.21.txt from config-template.zip. Open it with your favorite editor and change the defaults to your environments settings. Do not configure the individual account settings, this is for the endpoint manager to do.
5: While still editing the config file, be sure to REMOVE COMPLETELY the lines for SIP User ID(P35), Authentication ID(P36), Authentication Password(P34) and (P3)Name. The file should no longer contain any of those lines. Save the modified file as /tftpboot/Grandstream_HT502_Default.txt. This file will be the template the individual device config files will be based off of.
6: Extract the GS_CFG_GEN.tar.gz file into a temporary directory. (tar zxvf GS_CFG_GEN.tar.gz) You should be have a folder called GS_CFG_GEN, wth bin, config, docs and lib subfolders within it.
7: rename the existing GAPSLITE folder to something else. (mv /usr/local/src/GAPSLITE /usr/local/src/GAPSLITE.OLD)
8: mkdir /usr/local/src/GAPSLITE
9: move the contents of the GS_CFG_GEN folder into the new GAPSLITE folder. (mv /tmp/GS_CFG_GEN/* /usr/local/src/GAPSLITE for example)
10: Change directory to /usr/local/src/GAPSLITE/bin. Edit the encode.sh file, change the JAVA_HOME variable to be /usr/local. (JAVA_HOME=/usr/local) Save the file and exit.
11: chown -R asterisk.asterisk /usr/local/src/GAPSLITE/*
12: Change directory to /var/www/html/maint/modules/endpointcfg. Edit endpoint_grandstream.php. Find the line with the phone_types array, for me it was line 21. After 'HT386' add
,'HT502' => 'HT502'
be sure to include the , (comma) before 'HT502'. Leave the file open.
13: in the same file (endpoint_grandstream.php), Find line 36 which has line1_sip_user, and create a new line below it (move the cursor to just after the ; then hit enter) Insert the following in the new line:
$phone_vars['line1_authid'] = $freepbx_device;
Save the file and exit the editor.
14: Change directory to /var/www/html/maint/modules/endpointcfg/libs. Edit trixbox.php. Find line 77, which has 'line1_password' in it, and create an empty line after it. Paste the following into this line:
$GrandstreamConvert['line1_authid'] = 36;
Save the file and exit the editor.
15: Login to the trixbox admin page. Under the System menu, you should see phpMyadmin. Open phpMyadmin.
16: BE CAREFUL. VERY VERY CAREFUL. On the left hand side, click on endpoints. When endpoints opens up, click on grandstream. This will open the field definition table on the right. Below the table is "add (1) field(s)". Make sure there is a 1 in the box, but select After and choose line1_sip_user and then press Go. Configure it as follows:
Name: line1_authid
Type: varchar
length: 255
collation: latin1_swedish_ci
Then hit Save. This should take you back to the field definitions and you should now see line1_authid in the list.
Okay. Now comes the testing. Open up the endpoint manager and add a new device, selecting HT502 from the dropdown. Set the proper mac address, and submit. Endpoint manager should create /tftpboot/cfg(MACADDRESS) Reboot your HT-502 to see if it grabs the new config file!
Tested on a secondary server using a trixbox 2.6.2.2 virtual machine, with success.
Please let me know if you have any problems, questions, complaints, etc. There are probably parts I need to elaborate on, but it is time for me to leave, I will check when I get home.
David Beauchamp
aka teKuru
Middletown, CT

Member Since:
2007-01-05