I am starting to use the Endpoint manager to setup my GXP2000 phones, but I would like to allow my end users to set their BLF buttons if they want. Is there a way that I can choose to not set the BLF/Speed dial buttons so that whatever they put in there doesn't get overwritten when they reboot the phone?
Endpoint, GXP2000 and not setting BLF buttons
Not with the endpoint manager no, but what I did when I used Grandstreams was I would use the Endpoint Manager to create the configs and then once everything was setup, I moved the mac.cfg files to a /tftpboot/grandstream/ directory so the phones do not see the config files.
This allows the users to change settings as they like (BLFs or other). When I need to reconfig something I just pull that mac.cfg back to /tftpboot and reboot the phone.
Ok I have edited the grandstream template to add a selection that lets me pick if I want to edit the keys or not, and I have found the code in the endpoint php script that writes the keys out, but I don't really know how to check for my new input field.
If anyone wants to tell me how to modify this so that it tests the value of my key before it writes the multipurpose keys out:
foreach ($phone_vars as $key => $value) {
$querytxt1 .= $key. ",";
$querytxt2 .= "'".trim($value)."'". ",";
}
$querytxt .= $querytxt1. "EditDate) VALUES(". $querytxt2." NOW())";
$error = getSQL($querytxt,'endpoints');
}
I would appreciate it. It seems like a really valid thing to add to the pages.
foreach ($phone_vars as $key => $value) {
if($value == "") continue;
$querytxt1 .= $key. ",";
$querytxt2 .= "'".trim($value)."'". ",";
}
$querytxt .= $querytxt1. "EditDate) VALUES(". $querytxt2." NOW())";
$error = getSQL($querytxt,'endpoints');
Add the line in bold and the config won't take care of the empty Value fields, however I haven't tested if the Grandstream config will like that...
So can anyone that actually works on the Trixbox end give me a official solution to this? It seems like it should be a really easy fix for someone that know what the code is doing and how it is doing it. Any chance it will be included in future releases?
Ok I have sorted it out I believe. It required edits to the endpoint_grandstream.php file to get it working. Basically I had to add a button type for null on line 22:
$smarty->assign("key_mode_list", array('2' => ' ','0' => 'Speed Dial','1' => 'Asterisk BLF'));
then on line 131 I had to test for that button, and for empty Mulitpurpose button fields:
if($key!= 'mac_address' && $key!='freepbx_device' && $key!='phone_type' && $key!='phone_label' && $value!='2' && $value!='') { //don't put mac or freepbx device in config file
That will keep the script form adding those fields to the configuration file before it generates it. It will also allow whatever is in the DB to show up if there is something in there. In my limited testing it seems to work ok for me. If anyone from Trixbox or whomever actually wrote the endpoint script wants to pick that up, then that is fine with me.
I also changed line 127 in libs/trixbox.php so that it sorts the configured endpoints by extension number, which is a better way to display them then just the order they were added to the database. It now looks like this:
$query = getSQL('SELECT * from '.$type.' order by line1_sip_user ASC;' ,'endpoints');
Because that change is in the called function it should make all of the endpoint managers sort more logically. I just don't have any other phones to try it with.
Member Since:
2006-06-12