• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

3CX V14SP2 - Phone Templates + Conditional Statements

Status
Not open for further replies.

Futureweb

Customer
Joined
Jun 29, 2015
Messages
159
Reaction score
22
Hello,
is it possible to query for Extension Number within Phone Templates?

I tried it like:
Code:
{IF extension_number=7400}
here commands ...
{ENDIF}
{IF %%extension_number%%=7400}
here commands ...
{ENDIF}

{IF mac_address=000000000000}
here commands ...
{ENDIF}
{IF %%mac_address%%=000000000000}
here commands ...
{ENDIF}

But it won't work ... What's in the IF will never be in the final Template ...
Hope someone can help me on this?

Thx, bye from Austria
Andreas Schnederle-Wagner
 
Re: 3CX V14SP2 - Phone Templates

The templates constitute a form in which variables are applied in order to get the phone to respond to actions that have preprogrammed functionalities. The phones are not able to respond to anything other than what the firmware allows, so they will not respond to a set of programmed logic such as that as you have outlined.

WHat extension are you wanting to query? What phone make and model?
 
Re: 3CX V14SP2 - Phone Templates

Hi lneblett,

I'm not asking about the Phone Capabilities to understand conditional statements - I'm asking if the Template Parser of 3CX is capable of doing this.

I know it's working with some Variables ... as those work:
Code:
{IF network=LOCALLAN} ... {ENDIF}
{IF network=REMOTESTUN} ... {ENDIF}
{IF network=REMOTESPM} ... {ENDIF}

But no chance to get it to work with mac_address, extension_number or any other of those Variables ...
And I want to know if I'm doing anything wrong here or if the Template Parser simply is to dumb to understand such conditional statements.

Andreas
 
Re: 3CX V14SP2 - Phone Templates

Hey Andreas,

Its no a case of if the Template Parser is dumb or not, it simply was not programmed to read other parameters other than the ones you see.
I can understand what you want to do it, not why however as I would just create a new custom template for each Group of extensions, but sadly I cannot either find or think of a way to do this.
 
Re: 3CX V14SP2 - Phone Templates

Hi Nick,

there would be several Usecases for conditional Statements within Phone TPLs - just a few:

- Phone Lock PINs
- several Departements got 100% identical Phone Templates - we would just need to set the Unlock Pin different for some Phones ... not really practicable to use a dedicated TPL for each Phone ... would be Horror to maintain if something changes within TPL and I need to correct it in dozens of TPLs ...
- Softkey Configuration
- identically for most of the Phones - except for 2 or 3 which need *Lock Keypad* as Softkey (Hotel-Reception) - if i could query for MAC / IP or EXT this could be solved more pretty
- External Phonebook
- Reception needs other Phonebook than Office than Management ... right now we need 3 Templates for this Scenario - if i could Query for Extension-Group I would just need 1 Template
- Network Settings
- Reception Phones need to be VLAN Tagged - Office/Management Phones not as they are in a seperate Network - again multiple Templates which could be reduced to 1 if we would have conditional Statements

There are dozens of useful things one could do with conditional Statements within the Templates. And since your TPL-Parser is already capable of understanding conditional Statements (if/else) it would just need to be able to access those additional Variables ... ;-)

bye from Austria
Andreas
 
Re: 3CX V14SP2 - Phone Templates

Well, I was pretty much thinking of the same things you indicated and personally I would still do it with different templates even if I had the choice, the only thing you would loose is if you had to make a change one thing that is common for all, in that case yes, it would be convenient.

Unfortunately though, the option is not there though...
 
Re: 3CX V14SP2 - Phone Templates

Hi all,

also for me its an important request. Thanks Futureweb for the listing of some examples.

The most important advantage is the unification of different provision tempates to one.

The chance to do something wrong is high, if we need to maintain a couple of templates for one phone type. The difference between the provision templates ar mostly marginal. It is not usefull to have two templates, in which only 1 value is different.

We only talk about conditional statements and not about loops (which could be also very nice).

If you just want to test something you can use one developement template. I Think that is not a problem. It's quite easy to switch the templates of one developement phone.

I hope you can consider to expand the conditional statements in the phone templates.

thanks
 
  • Like
Reactions: brhscmc
Re: 3CX V14SP2 - Phone Templates

I already opened a Feature Request for that - you can comment / upvote it here: http://www.3cx.com/forums/phone-emplates-conditional-statements-43782.html

Hope they see the advantages of conditional Statements within Templates .... ;-)

Andreas
 
Re: 3CX V14SP2 - Phone Templates

I was just writing the same thing Futureweb wrote.

I can see this is getting quite a few hits, so yes, up-vote this.
 
great idea,

i was thinking about this for some time, too.

Maybe for the time being you could repurpose some parameters which currently are processed for IF statements.

So you add additional option values, like for BLFs or for codecs. And than you use those.

This would work, wouldn't it? Of course it makes understanding and maintaining the template more confusing.

For Yealink phones there is another work around: You can use the common-template to manage general settings (which you would have to create manually and not have created by the template as it currently is) and the MAC specific file with different templates for different goup of phones. This way you still have several templates, but you have one common one, to change things, which effect all phones.

Best regards Frank
 
Status
Not open for further replies.
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.