Add Your Own Phone Brand: Custom Template Guide
- What a Custom Template Does
- Prerequisites
- Procedure
- Template Structure
- Header Tag
- BlfType and Data Tags
- 3CX Variables: Quick Reference
- Identity & Provisioning
- Extension / SIP Account
- Network
- Options Exposed by the Header
- Codecs
- BLF / Function Keys
- Conditional Logic
- Network Mode
- BLF Slots
- System Parameters
- Testing and Verification
- Set Your Time Zone Automatically with Your Department
- Sample Template
- Troubleshooting
- Next Steps
- See Also
3CX ships with built-in templates for the supported phone vendors. If your brand or model is not on that list, you can add support by creating a Custom Template. This guide walks through the process using a working sample template you can adapt.
What a Custom Template Does
A template is an XML file that tells 3CX how to generate a provisioning configuration for a specific phone model. When a phone provisions, 3CX:
- Loads the template assigned to the device.
- Replaces 3CX variables (e.g. %%extension_number%%) with real values.
- Evaluates conditional blocks (e.g. {IF network=SBC}).
- Writes the resulting configuration file to the provisioning URL the phone fetches.
Your job when adapting the sample is to map your vendor's configuration syntax to the 3CX variables that supply the data.
Prerequisites
- Admin access to 3CX (Admin > Advanced > Templates).
- Your vendor's provisioning documentation, specifically the parameter names for SIP credentials, codecs, BLF keys, NTP, time zone, VLAN, and any feature your phone exposes; some vendors will provide their technical documentation only upon request; for online resources, here are some practical examples:
- The phone's User-Agent string (visible in the device's SIP REGISTER, or in 3CX phone logs once the device contacts the PBX).
- The provisioning URL format your phone expects.
Procedure
- Go to Admin > Advanced > Templates > Phone Templates.
- Select a template close to your vendor's syntax and click Create Copy. Name the copy after your brand (e.g. phonetel-custom.ph).
- Open the new template and replace its contents with the Sample Template below.
- Edit the <header> section: set the template name, model ua (User-Agent), logo, codecs, and capabilities to match your device.
- Edit the <deviceconfig> CDATA section. Replace every your_*_variable placeholder with your vendor's real parameter name. Keep the %%...%% 3CX variables on the right-hand side — these are substituted at provisioning time.
- Save the template.
- Add a phone in 3CX and select your custom template when prompted for the model.
- Enter the provisioning URL provided by 3CX into the phone (manually or via DHCP option 66 / PNP) and trigger provisioning.
Template Structure
The XML has two top-level sections.
Header Tag
The <header> tag declares the template metadata and the UI controls 3CX shows for this phone:
Element | Purpose |
<type>, <version>, <time>, <name>, <url>,<description> | Template type, identity and version. |
<templatetype> | One of preferred, supported, vendor, custom. |
<models> | One <model> per device variant. ua matches the phone's SIP User-Agent. canbesbc enables remote SBC provisioning for phones that have a built-in 3CX SBC. defaultlogo sets a brand image filename. The logowidth, logoheight, logobitdepth describes the logo file attributes, and the element text defines the name of the model as it will appear in 3CX. |
<parsers> | Feature parsers — e.g. BLF enables busy-lamp-field key generation. |
<rebootParams>, <resyncParams>, <firmwareParams> | SIP NOTIFY event names used to remotely reboot, resync config, or trigger firmware update. |
<rps> | Set to 1 if the vendor supports a Redirection and Provisioning Service. |
<hotdesking> | Set to 1 if the phone supports hot-desking. |
<AllowedNetworkConfig> | Which network modes are valid: LOCALLAN, REMOTESTUN, SBC. |
<interfaceLink> | The phone's web console login URL (shown in 3CX when the phone is registered). |
<xfertype> | Blind vs. attended transfer values for DSS keys. |
<languages>, <ringtones>, <queueringtones>, <dateformat>, <timeformat>, <powerled>, <backlight>, <screensaver>, <vlan>, <lldp>, <timezoneParams> | UI dropdowns. Each one can contain <option> which defines what the admin sees and what variables are exposed when selected, and ultimately sent to the phone during provisioning. |
<Codecspriorities> | Codec ordering. The first option in each <Codecspriority> is the default for that slot. |
BlfType and Data Tags
- <blftype> — defines the key formats for each BLF function (extension monitor, line key, speed dial, queue login, park, profile status). 3CX iterates these when an admin assigns BLFs in the extension UI.
- <data><device> — wraps the <deviceconfig> CDATA block. The CDATA contains your vendor's literal configuration syntax with 3CX variables embedded. It can contain IF statements that 3CX parses to give different variables for different models and conditions.
3CX Variables: Quick Reference
These are the most common variables used inside the CDATA section. Variables are written as %%name%% and are substituted at provisioning time.
Identity & Provisioning
Variable | Meaning |
%%mac_address%% | Phone MAC. Often used in the config filename. |
%%PROVLINK%% | Full provisioning URL the phone should use. |
%%firmware%% | Firmware filename declared in the template. |
%%PHONE_IP%% | Phone's discovered IP address. |
%%PHONE_WEB_PASSWORD%% | Generated web admin password. For the <interfaceLink> |
%%DESKPHONE_PASSWORD%% | Phone-side password. For the <device> CDATA section |
%%PROVLINK.HOST%%, %%PROVLINK.PATH%%, %%PROVLINK.PORT%% | Components (FQDN, path, and HTTP port) used to manually construct the full provisioning URL if your phone needs a specific format. |
%%param::time_ntp_server%% | Network Time Protocol (NTP) server address for phones to use. |
Extension / SIP Account
Variable | Meaning |
%%extension_number%% | Extension number. |
%%extension_first_name%%, %%extension_last_name%% | User name. |
%%extension_auth_id%%, %%extension_auth_pw%% | SIP authentication credentials. |
%%vm_number%% | Voicemail access number. |
Network
Variable | Meaning |
%%pbx_ip%% | PBX internal IP (LAN mode). |
%%param::pbxpublicip%% | PBX public IP (SBC mode). |
%%param::sipport%% | PBX SIP listening port. |
%%local_sbc_ip%%, %%local_sbc_port%% | SBC address for remote phones. |
%%phonesipport%% | The phone’s local SIP port (Legacy - used for STUN phones). |
Options Exposed by the Header
These come from the <option> values you defined in <header>:
Variable | From |
%%language%% | <languages> |
%%datestyle%%, %%timestyle%% | <dateformat>, <timeformat> |
%%defringtone%% | <ringtones> |
%%queueringtone%%, %%queueringtonevalue%%, %%queueid%% | <queueringtones> |
%%mwiled%%, %%missedled%% | <powerled> |
%%blktime%% | <backlight> |
%%scrsavertime%% | <screensaver> |
%%vlanwanenabled%%, %%vlanwanportid%%, %%vlanwanportpriority%% | <vlan> (WAN port) |
%%vlanpcenabled%%, %%vlanpcportid%%, %%vlanpcportpriority%% | <vlan> (PC port) |
%%lldpenabled%% | <lldp> |
%%param::time_timezone_yealink%%, %%TimeZoneName%% | <timezoneParams> |
%%XFERmethod_Value%% | <xfertype> |
%%logo%% | defaultlogo attribute on <model>
and screensaver.type= 1
|
%%logo_filename%% | For Yealink you need to set |
Codecs
Variable | Meaning |
%%codec1%% … %%codec5%% | Codec value at each priority slot. |
%%payload1%% … %%payload5%% | Payload type for each slot. |
%%[id].codecselected%% | 1 if codec is enabled (pcmuid, g729id, opusid, etc.). |
%%[id].priority%% | Priority slot the codec occupies. |
BLF / Function Keys
Inside {IF blfN} blocks (where N is the key index):
Variable | Meaning |
%%Line%% | Line number from the <blftype> definition. |
%%type%% | Monitored extension number or function code. |
%%PickupValue%% | Pickup target. |
%%DKtype%% | Function-key type code (vendor-specific in <DKtype>). |
%%label%% | Display label. |
%%blfno%% | The extension number of the BLF or Speed Dial target. |
%%param::pickup%% | Call Pickup code taken from the 3CX Phone System configuration. |
%%blffirstname%%, %%blflastname%% | First/Last name of the extension used for the BLF display label. |
Conditional Logic
The CDATA section supports simple conditionals. 3CX evaluates them before sending the config to the phone.
Network Mode
Different blocks emit depending on how the phone is reaching the PBX:
{IF network=LOCALLAN}
...config for LAN-attached phones...
{ENDIF}
{IF network=SBC}
...config for remote phones using the SBC...
{ENDIF}
{IF network=REMOTESTUN}
...config for STUN-based remote phones...
{ENDIF}
BLF Slots
Each BLF/function key has its own conditional. Inside the block, the BLF-context variables (%%Line%%, %%type%%, %%label%%, etc.) refer to that key:
{IF blf1}
linekey.1.type = %%DKtype%%
linekey.1.value = %%type%%
linekey.1.label = %%label%%
{ELSE}
linekey.1.type = 0
{ENDIF}
Repeat for blf2, blf3, … up to the number of programmable keys your phone supports.
System Parameters
Reference any 3CX system parameter via sysparam.NAME:
{IF sysparam.CUSTOMIZE_QUEUE_RINGTONES=1}
...emit per-queue ringtone mappings...
{ELSE}
...emit a single default queue ringtone...
{ENDIF}
Testing and Verification
- After saving the template, add a test extension and assign your custom template as the phone model.
- Factory-reset the phone (recommended for a clean test).
- Provision the phone using one of:
- Manual — enter %%PROVLINK%% (visible in the extension's IP Phone tab) into the phone's provisioning URL field.
- DHCP Option 66 — point the option to the PBX provisioning URL.
- PNP / RPS — if the vendor supports it and <rps>1</rps> is set in your template.
- Watch the 3CX Activity Log and the phone's local logs. Confirm the device fetches the config and registers successfully.
- Verify each feature you mapped: codec order, BLF keys, ringtones, transfer behaviour, VLAN.
If a value comes through wrong, inspect the rendered config file directly — 3CX serves it at %%PROVLINK%%/<mac_address>.cfg (or the filename pattern you set in <deviceconfig filename="...">).
Set Your Time Zone Automatically with Your Department
Your 3CX Global Time Zone, or your custom Department Time Zone has a corresponding ID per region name as seen in the below example table:
Id | Description | Zone |
121 | -12:00 International Date Line West | -12:00 |
120 | -11:00 Midway Island, Samoa | -11:00 |
1 | -10:00 United States - Hawaii-Aleutian | -10:00 |
2 | -10:00 United States - Alaska-Aleutian | -10:00 |
If your template contains the IDs in its <timezoneParams>, then your phones can utilize the default option “Use Global Time Zone”. We then automatically match the time zone for you, and provision your phones accordingly so you don’t have to manually select a time zone for each phone individually.
If you need to manually set an ID, find the full list of timezone ID’s in the timezone reference guide here.
Sample Template
Copy this template into your custom template as a starting point, then replace the variable placeholders (seen in the template snippet below in the format your_*_variable and [Example_*]) with your device's and vendor's real parameters and names.
Template Editing Best Practices:
- Format: Use raw .ph.xml or plain-text editors. Avoid rich-text (Word/Docs) to prevent corruption.
- Structure: Outside the <deviceconfig> CDATA block, indentation is ignored.
- CDATA: Inside the CDATA section, preserve exact vendor-required syntax (spaces/breaks).
- Validation: Save as UTF-8, validate the XML, and inspect rendered configurations on a test device.
<?xml version="1.0" encoding="utf-8"?>
<doc xmlns:tcx="http://www.3cx.com">
<header>
<type>phone-template</type>
<version>150000</version>
<time>2026-01-01 12:30:00</time>
<!-- Template Name -->
<name>[Example_GreatPhone]</name>
<url>https://www.3cx.com/sip-phones/</url>
<templatetype>supported</templatetype>
<!-- List the model user agent, SBC capability, logo filename/dimensions/bitdepth, and model name -->
<models>
<model ua="[Example_GP100]" canbesbc="true" defaultlogo="[Example_GreatPhone.png]" logowidth="320" logoheight="240" logobitdepth="24">[Example_GreatPhone GP100]</model>
<model ua="[Example_GreatPhone GP200]" canbesbc="true" defaultlogo="[Example_GreatPhone.png]" logowidth="320" logoheight="240" logobitdepth="24">GreatPhone GP200</model>
<!-- The name "[Example_GreatPhone.png]" also defines the firmware foldername -->
</models>
<description>[Example_GreatPhone SIP Phones]</description>
...
<languages>
<!-- Options: Language drop-down entries -->
<option value="English">
<item name="your_language_variable">English</item>
</option>
</languages>
<ringtones>
<!-- Default Ringtone drop-down entries -->
<option value="Ring 1">
<item name="defringtone">your_ring1_variable</item>
</option>
</ringtones>
....
<data>
<device>
<type>phone</type>
<!-- Friendly Name -->
<field name="Name">[Example_GreatPhone GP100 Identity]</field>
<deviceconfig filename="%%mac_address%%.cfg"><![CDATA[
<!-- The below example section will contain all of your own vendor syntax, replacing 3CX variables with what you define above -->
your_provisioning_url_variable = %%PROVLINK%%
your_firmware_url_variable = %%PROVLINK%%/firmware/[Example_GreatPhone]/%%firmware%%
your_ntp_server_variable = %%param::time_ntp_server%%
...
<!-- Your own vendor syntax ends here -->
]]></deviceconfig>
</device>
</data>
</doc>
Troubleshooting
Symptom | Likely Cause |
The phone never fetches the config. | Wrong provisioning URL, or HTTP/HTTPS mismatch. Check <AllowSSLProvisioning>. |
Config is fetched but the phone fails to register. | network=LOCALLAN block missing, or wrong SIP port variable. |
Remote phone registers but no audio. | network=SBC block missing your_proxy_* lines, or SBC ports closed. |
BLF keys empty after provisioning. | Vendor key indexing is 0-based vs. 1-based; or DKtype codes don't match the vendor's function-key map. |
Codec order wrong on the phone. | %%[id].codecselected%% / %%[id].priority%% not mapped, only %%codecN%% used. |
The web console link in 3CX opens to the wrong page. | Fix <interfaceLink> pattern in the header. |
Next Steps
Once your template provisions cleanly, consider:
- Publishing it via Create Copy and sharing with other admins in your org.
- Submitting it to 3CX for inclusion as a community-supported template.
- Adding additional <model> entries to the same template if your vendor's models share a config schema.
See Also
Last Updated
This document was last updated on 10 September 2026
https://www.3cx.com/docs/custom-phone-template-configuration/
