Improvement of template system

Discussion in 'Ideas' started by Benedikt Machens, Feb 15, 2018.

  1. Benedikt Machens

    Feb 14, 2018
    Likes Received:

    it would be great if the template system has some more features of a basic programming language.

    The current system has some variables and an if-then-else lite version.
    What is missing: Loops, case statements, functions to reuse code snippets and those things that makes programming languages useable.

    To show you what i mean, i will explain this based on a little template example. I found this when deploying a Yealink phone and add some extension modules. If see only one extension module has BLFs and when i look into the template, i see why this happend.

    BLFs are done in the template like this


    {IF blf53}
    expansion_module.1.key.37.type = %%DKtype%%
    expansion_module.1.key.37.line = %%Line%%
    expansion_module.1.key.37.value = %%type%%
    expansion_module.1.key.37.pickup_value = %%PickupValue%%
    expansion_module.1.key.37.label = %%label%%
    expansion_module.1.key.37.xml_phonebook =
    expansion_module.1.key.37.type = 0
    #Expansion module1 key38
    {IF blf54}
    expansion_module.1.key.38.type = %%DKtype%%
    expansion_module.1.key.38.line = %%Line%%
    expansion_module.1.key.38.value = %%type%%
    expansion_module.1.key.38.pickup_value = %%PickupValue%%
    expansion_module.1.key.38.label = %%label%%
    expansion_module.1.key.38.xml_phonebook =
    expansion_module.1.key.38.type = 0
    #Expansion module1 key39


    All one by one and hey, Yealink supports up to 6 extension modules and the only thing that changes are some indecies

    So my Yealink template grows from 5098 to 11354 lines after adding the ability to support those 6 extension modules. Please dont ask why it was necessary to add that much BLFs to a hard phone (many many clicks ), customer is king.

    If i had some loops and could have created a function with the basic code snippets and just add the specifics numbers via the indicies of the loops. 70% of the code of this template is not needed with loops and it would be more update friendly. I saw some other threads, that people have problem keeping their custom templates up-to-date to get the newest template stuff without loosing their customer changes. This improvement has the potential to safe a lot working time.

    I have some experience with phone template programming (specially Yealink) and i know template systems with those basic programming features that are used in phone-systems that supports 1000+ phones (administrateable). So it is possible to have this in a template system and it is a must have to deal with this provisioning zoo provided by the phone manufacturers in an efficient way.

    If you go through the templates, you can see those improvement needs on many spots, like creating a template for Patton FXS Channel Bank (32 ports). So i think this could be a good feature to make 3CX better for big installations/customers, because if you have 500+ people on your phone system it's not done with good user features, nice looking clients and a good pricing. It must be administrateable.

    I would be happy about a little discussion and some feedback.