Skip to content

Snom line keys (BLF) not applied due to Twig regex check in snom.tmpl #7931

@Stell0

Description

@Stell0

When provisioning Snom phones, configuring BLF under Configuration → Users → edit phone (pencil) → LINE KEY provisions the phone but the physical line keys are not configured (BLF not shown/applied).

Issue reproduced on a Snom D715; reseller reports the same on Snom D785 and that it previously worked. Logs show linekey_type_* / value / label are correctly generated, but the Snom template uses a Twig matches regex check that fails, causing linekey_count to be evaluated as 0 and skipping line key rendering.

Steps to reproduce

  1. Provision a Snom phone (e.g., D715 / D785) via Tancredi/NethVoice provisioning.
  2. In the provisioning UI, open Configuration → Users → edit phone (pencil).
  3. Set at least one BLF under LINE KEY (e.g., key 3 → BLF to extension 203 with label Alice).
  4. Apply changes / reprovision the phone.
  5. Check the phone’s line keys.

Expected behavior

Configured BLF entries are rendered in the generated XML and applied to the phone’s physical line keys.

Actual behavior

The phone reprovisions successfully, but the physical line keys remain unconfigured (BLF not applied), even though provisioning logs show the BLF data is present (example sanitized):

... provisioning.DEBUG: Rendered template "snom.tmpl" with data: {
  ...
  "cap_linekey_count":"5",
  ...
  "linekey_type_3":"blf",
  "linekey_value_3":"203",
  "linekey_label_3":"Alice",
  ...
}

In data/templates/snom.tmpl, the line key count is computed via a regex matches check:

{% set linekey_count = (cap_linekey_count | default('')) matches '/^\d+$/' ? cap_linekey_count : 0 %}

This check can fail in Twig, resulting in linekey_count = 0 and no <functionKeys> line keys being rendered.

Suggested workaround/fix (from internal discussion): replace the above line with:

{% set linekey_count = (cap_linekey_count | default(0)) %}

Metadata

Metadata

Assignees

Labels

nethvoiceBug or features releted to the NethVoice projectverifiedAll test cases were verified successfully

Type

Projects

Status

Verified

Relationships

None yet

Development

No branches or pull requests

Issue actions