Saving/Reloading User Preferences

Discussion in '3CX Phone System - General' started by dhaggard, Feb 2, 2012.

Thread Status:
Not open for further replies.
  1. dhaggard

    Joined:
    Jan 30, 2012
    Messages:
    2
    Likes Received:
    0
    I don't know if this is a 3CX issue or a GrandStream issue. I think it's a combination of BOTH. A case of the left hand not knowing what the right is doing. So I'm posting this on both forums.

    I see in the provisioning folder on the server, that there are a bunch of files named "cfg<macaddress>," where <macaddress> is the mac address of the individual phones. Example:
    "cfg000B823313EE"
    From here on, I will refer to this as "the cfg file." These files contain a string of parameter/value pairs containing settings for the phones.

    Apparently these are generated only from the "Phone Provisioning" tab of the "Edit Extension" screen in System Administration.
    What are they for? Or rather, what good are they for user preferences?

    • Set user preferences like display brightness and contrast, and the settings take effect immediately without a reboot.
    • They are NOT saved to the cfg file.
    • Reboot the phone, and these settings are lost.

    • Set BLF button settings in "Edit Extension" in System Management, and save changes. The cfg file is updated.
    • Reboot the phone and the changes take effect.
    • Manually edit the cfg file to set the BLF buttons. Reboot the phone and the changes are not loaded.

    • Use "Edit Extension" to set the BLF buttons, save changes.
    • Manually edit the cfg file with different contrast/brightness settings.
    • Reboot the phone.
    • NONE of the settings take effect.

    • Use "Edit Extension" to make a change, save changes.
    • The contrast/brightness values in the cfg file are reset to the defaults from the main provisioning file.

    Apparently, there is a flag set, or a date/time comparison is made, to determine if the cfg file is applied when the phone is booted. This is totally controlled by the "Edit Extension" page of System Administration. Also, "Edit Extension" apparently reads the default provisioning file, gets the values from there, adds its own changes, then saves the whole thing, overwriting any manual entries.

    This works properly:
    • Set BLF's in "Edit Extension."
    • Save changes.
    • Reboot the phone.
    • The BLF's are applied.

    But then, this one is really great:
    • Set a BLF in the phone's own Web UI.
    • Save the change.
    • The new BLF is applied.
    • Reboot the phone.
    • ALL BLF's are gone.
    • Reprovision the phone.
    • The original BLF's are applied, but the one set in the phone's web UI is gone.

    Pardon me for shouting, but--

    NOT BEING ABLE TO SAVE AND RELOAD USER PREFERENCES AFTER A REBOOT IS NOT ACCEPTABLE!
    BEING FORCED TO SET PERSISTENT BLF ENTRIES ONLY IN SYSTEM MANAGEMENT IS NOT ACCEPTABLE!


    I mention brightness and contrast because these are not consistent between GrandStream phones, even of the same model. Two phones, same model, same contrast/brightness settings. One looks great. The other may be unreadable. If we do a firmware upgrade, or for any reason have to reboot phones, these settings must be re-entered.

    The same goes for BLF's. The worst part of it is, we have a few hundred phones, and we are only four in the IT department. We should not have to set every single phone's BLF's in System Administration! No, we have too many users in too many departments with too much variation in their jobs, to give everybody the same BLF's. Neither should the user be forced to re-enter preferences and BLF's because we had to do some maintenance.

    It would not be so bad if one could manually edit the cfg file. In that case, we could write a simple application for our users to enter these preferences, and save them to the cfg file. But if the cfg file is modified OUTSIDE of the "Edit Extension" screen, it is not used on reboot or in reprovisioning.

    Unless there is something very basic that I'm missing, there needs to be some upgrades put into both 3CX and GrandStream phones.
     
  2. efounco

    efounco New Member

    Joined:
    Sep 28, 2011
    Messages:
    148
    Likes Received:
    4
    Here it goes...

    The config files you mention are used for auto provisioning of your phones. If your phones support auto provisioning and option 66 in DHCP server is setup correctly, the phone will automatically download these files from the server and program themselves without any user intervention. These files are created individually for each and every phone because they contain user names, extensions, passwords and voicemail settings specific to each and every phone/extension. Usually they are named in correspondence to the model and/or mac address of the phone. These config files are actually generated by the 3CX phone system based off of the provisioning template assigned to extension/phone and settings stored inside of the 3CX database.

    These files are not for individual modification. If you modify one of these files, the 3CX system will detect a discrepancy between the provisioning template and/or database and recreate the file. Instead, you should be creating your own custom provisioning template.

    Inside the %ProgramData%\3CX\Data\Http\Templates\phones\ folder you will find several .ph.xml files for each of the supported phone types. These are provisioning templates. Make a copy of the file that corresponds to your phone model (using a different file name) and edit it using a text editor.

    Find the tag near the top that reads:
    <models>
    <model>GrandStream xxx</model>
    <model>GrandStream xxx</model>
    ...
    </models>

    Remove all the models except for 1 and give it a custom name. For example:
    <models>
    <model>Custom GrandStream LED Fix</model>
    </models>

    Customize the provision template to your liking by setting the LCD contrast, etc. and save the changes.

    Inside of 3CX, edit the extension(s). Click on the phone provisioning tab and select the custom model from the drop down list (Custom GrandStream LED Fix). Click apply and re-provision the phone.
     
  3. dhaggard

    Joined:
    Jan 30, 2012
    Messages:
    2
    Likes Received:
    0
    Thanks for the response.

    I have already done as you described, setting up a custom provisioning template for each model of phone. This works great for as far as it goes.

    However, this only handles customization per phone model.

    As I stated in my original post, the contrast and brightness settings are not consistent from phone to phone:
    This is obviously a limitation of the GrandStream phones. It should not be that way if their hardware is consistent. But apparently it is not.

    Also, in our business it is totally unsuitable to set BLF's, speed dials, etc., on a per model basis. This needs to be done per user.. The only way we can do this for the users and keep their settings persistent is to do it ourselves, phone by phone, in the "Edit Extension > Provisioning" page of the System Management. This is an additional workload on the IT department, doing something that the users should be able to do themselves.

    And therein is the problem. If the 3CX system did not check for discrepancies with the provisioning template, or had an admin-level option not to do so (check for discrepancies by default), then we could write a utility to let users set persistent preferences themselves. Problem solved. The cfg file is just an ampersand-delimited string of name/value pairs. I could write such a utility in an afternoon.

    Or if the phones had an option not to change certain settings like those mentioned, when they are rebooted. I'm taking this up with GrandStream.

    Thanks for being a sounding board on this. Please consider making it optional to edit (and preserve the edits) in those cfg files.
     
  4. efounco

    efounco New Member

    Joined:
    Sep 28, 2011
    Messages:
    148
    Likes Received:
    4
    I've never dealt with GrandStream phones, but I do know that our Cisco phones retain their individual settings as long as those settings aren't had coded inside the provisioning template. In the event they are, the template always overwrites the custom settings when the phone reboots/re-provisions itself:

    Browsing through the GrandStream template I found this:

    # LCD Backlight Always On. 0 - no, 1 - yes
    # For GXP2000/1200 Only
    P322 = 0

    # LCD Backlight Brightness. (0-8, where 0 is off and 8 is brightest)
    # For GXP2020/2010 Only
    P334 = 4
    P335 = 0

    I don't know if these settings apply to your phones or not. If they do, the static values will always overwrite the custom settings on the phone upon reboot/re-provision. If that's what's happening, comment this section out in the template so that it doesn't get overwritten...

    The "config" files used for provisioning phones are designed to be an integral part of 3CX. They are suppose to work seamlessly with the 3CX interface and the database so that when changes are made, the file is updated to reflect the changes. Asking for an option to break this integration is not feasible. Instead, you can simply create a script that relocates these file to a different folder on the server upon creation (or a different server). Then, reconfigure option 66 in the DHCP server to point to this location instead of the other. From there you can modify these files to you heart's content.
     
Thread Status:
Not open for further replies.