Repository navigation
Fix fax and voice sending under Twig 3 - #28
Merged
Merged
Conversation
Since the PHP 8.1+ move (#23) every outbound fax and voice call failed before dialing: POST /transmissions/{id}/send returned 'Unexpected "spaceless" tag' from function.twig. Twig 3 removed both {% spaceless %} and "for ... if", and the set_prefix macro used both. It renders the dial string for fax.json and voice.json, so nothing could be originated. Rewritten with whitespace control and an explicit match flag, same behaviour: the first "remove|add" provider prefix rule that changes the number wins, and a number with no matching rule passes through unchanged. Checked against nine cases under Twig 3.28 (empty and null rules, 00|, 0|92, multiple rules, |9, bare remove), and a send on the ICTFax image now reaches FreeSWITCH originate.
tahiralmas
pushed a commit
to ictinnovations/ictfax
that referenced
this pull request
Oct 10, 2026
Picks up ictinnovations/ictcore#28 (the set_prefix macro rewritten for Twig 3; every fax and voice send failed with 'Unexpected spaceless tag') and #27 (extension SIP users written on create, force-register-domain).
tahiralmas
pushed a commit
to ictinnovations/ictdialer
that referenced
this pull request
Oct 10, 2026
Picks up ictinnovations/ictcore#28 (the set_prefix macro rewritten for Twig 3; every fax and voice send failed with 'Unexpected spaceless tag') and #27 (extension SIP users written on create, force-register-domain).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every outbound fax and voice call has failed to send since the PHP 8.1+ move (#23).
POST /transmissions/{id}/sendreturns:Twig 3 removed both
{% spaceless %}and{% for ... if ... %}, and theset_prefixmacro used both. That macro renders the dial string infax.jsonandvoice.json, so nothing could be originated.The rewrite uses whitespace control and an explicit match flag, and keeps the same behaviour: the first
remove|addprovider prefix rule that changes the number wins, and a number that matches no rule passes through unchanged.Tested on the ICTFax image (Twig 3.28):
00|,0|92, multiple rules,|9, and a bare remove.GATEWAY_DOWN, where before it failed in the template.This is the only template in the repo using removed Twig syntax.
Note: the published ICTFax image on Docker Hub (built in August with the PHP 8.3 patch) likely has the same fault. It should be rebuilt once this merges.