Template: {if} {else} {endif} based on %%pbx_ip%?

Discussion in '3CX Phone System - General' started by 421, Feb 12, 2015.

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

    421

    Joined:
    Jan 30, 2013
    Messages:
    1
    Likes Received:
    0
    Hello,
    I want to make some "if then else"-templates based on the pbx_ip variable.
    Is it possible to use something like:
    {IF %%bpx_ip%%=1.2.3.4}
    ...
    {ELSE}
    ...
    {ENDIF}
    ?

    I tried with %%, %, without %% but the resulting CFG is not right, the {...}-statements are literally placed into the provisioning file. So 3CX is not parsing the {if else}-tags.

    Any ideas?
    Best regards,
    Boris.
     
  2. lneblett

    lneblett Well-Known Member

    Joined:
    Sep 7, 2010
    Messages:
    2,061
    Likes Received:
    56
    My take is that the template is a configuration file that is only applying a variable to a field attribute. You have to implicitly state the condition you want the attribute to assume as the phone does not have the ability to determine anything on its own relative to its configuration other than perhaps if the config file is applicable to its make/model.

    It is not a question of 3CX parsing the file. 3CX merely populates the variables in the template upon extension set-up and provisioning. There is no execution of a template file as in a program. It simply passes the field attributes into the template and ten to the applicable phone so that the phone will function in the environment it was programmed to be.
     
Thread Status:
Not open for further replies.