Skip to content
cloud pbx
  • Cloud PBX
  • Products & Services
    • Cloud PBX
      • Cloud PBX Enterprise
      • Cloud PBX Multi tenant
      • Cloud PBX office
      • Cloud PBX Lite
      • Hotel IP PBX Integrated Hotel PBX Solution
      • Cloud Call Center
        • Cloud call center
        • Call center customer service
        • Call Center Telemarketing
        • Call center AI 
      • SIP Trunk Provider Jakarta–Indonesia
    • Services
      • Data & Integration
        • 3CX, Grafana, and SQL Dashboard Monitoring Optimization
        • Wallboard Custom – Dimension
        • Creomate — Advanced External API Solution for 3CX Integration
        • Universal CRM Integration with 3CX
      • Contact Center Solutions
        • Omni channel Social Media
        • Telemarketing System
        • Solusi Business Process Outsourcing
      • Communication Channel Solutions
        • Microsoft Teams Direct Routing
        • WhatsApp Business Calling API Integration with PBX
        • Video conference: webmeeting 3CX
        • Webrtc softphone
        • Softphone
    • AI Agent & API Integration: 24/7 Automated Customer Service Solution
  • Devices
    • Voice Gateway
      • FXO
        • Dinstar FXO Gateway
        • Yeastar NeoGate TA410 VoIP Gateway
      • FXS
        • Analog Telephony Integration Solution: Dinstar
      • E1
        • E1/T1 Digital VoIP Gateway Newrock OM1000-TE (1–4 E1)
        • Beronet E1 Voip Gateway
    • IP Phone
      • Best IP Phones of 2026
      • SNOM D140, D150
      • Yealink IP Phone series
      • Poly Desk Phone
    • SBC
      • 3CX Micro SBC
      • Linkvil A710 SBC
      • Ribbon SBC
      • Sangoma SBC
  • Case Studies
  • News
  • Video
    • Tutorials
    • Video Integration
    • Testimoni
  • Help Center
  • Contact
  • Partnership Program
  • About Us
cloud pbx
  • Cloud PBX
  • Products & Services
    • Cloud PBX
      • Cloud PBX Enterprise
      • Cloud PBX Multi tenant
      • Cloud PBX office
      • Cloud PBX Lite
      • Hotel IP PBX Integrated Hotel PBX Solution
      • Cloud Call Center
        • Cloud call center
        • Call center customer service
        • Call Center Telemarketing
        • Call center AI 
      • SIP Trunk Provider Jakarta–Indonesia
    • Services
      • Data & Integration
        • 3CX, Grafana, and SQL Dashboard Monitoring Optimization
        • Wallboard Custom – Dimension
        • Creomate — Advanced External API Solution for 3CX Integration
        • Universal CRM Integration with 3CX
      • Contact Center Solutions
        • Omni channel Social Media
        • Telemarketing System
        • Solusi Business Process Outsourcing
      • Communication Channel Solutions
        • Microsoft Teams Direct Routing
        • WhatsApp Business Calling API Integration with PBX
        • Video conference: webmeeting 3CX
        • Webrtc softphone
        • Softphone
    • AI Agent & API Integration: 24/7 Automated Customer Service Solution
  • Devices
    • Voice Gateway
      • FXO
        • Dinstar FXO Gateway
        • Yeastar NeoGate TA410 VoIP Gateway
      • FXS
        • Analog Telephony Integration Solution: Dinstar
      • E1
        • E1/T1 Digital VoIP Gateway Newrock OM1000-TE (1–4 E1)
        • Beronet E1 Voip Gateway
    • IP Phone
      • Best IP Phones of 2026
      • SNOM D140, D150
      • Yealink IP Phone series
      • Poly Desk Phone
    • SBC
      • 3CX Micro SBC
      • Linkvil A710 SBC
      • Ribbon SBC
      • Sangoma SBC
  • Case Studies
  • News
  • Video
    • Tutorials
    • Video Integration
    • Testimoni
  • Help Center
  • Contact
  • Partnership Program
  • About Us
  • English
  • Bahasa Indonesia
  • English
  • Bahasa Indonesia
cloud pbx

IP Phone

8
  • What Is an IP Phone?
  • How to Install/Provision an IP Phone
  • IP Phones Compatible with 3CX
  • Factory Reset an IP Phone: A Required Step Before Provisioning to Avoid Errors

3CX Softphone: Webclient and Apps

12
  • How to Access the 3CX Web Client
  • How to Install and Activate the 3CX Desktop App on Windows (PWA & Windows App)
  • Learn 3CX’s Basic Communication Features in 5 Minutes
  • The Easy Way to Set Available, Away, and DND Status in 3CX
  • Activating the 3CX Mobile App with a QR Code
  • Digital Receptionist (IVR): How to Build a Professional Automated Phone Menu

3CX Admin Console & Manajemen Sistem

22
  • What Is an SBC? Meet the “Security Guard” Protecting Your VoIP System
  • What Is FXO? How FXO Connects Analog Lines to IP PBX
  • Backup and Restore Feature
  • How to Set Up Call Forwarding Based on Presence Status in 3CX
  • How to Use Call Parking and Retrieve Call in 3CX
  • How to Change Your AUX Status (Available, Away, DND) in 3CX
  • Tutorial: Setting Up Call Transcription on Cloud PBX (3CX)
  • Managing Departments & Users in 3CX: Adding Users, Setting Roles, and Managing Departments Easily
  • How to Set Up a Router Phone / 3CX SBC for Remote & WFH Employees
  • Ring Groups vs Call Queues in 3CX: Keep Customers From Waiting and Your Team From Getting Overwhelmed
  • Office Hours & Holiday Rules: Keep Business Calls Handled Even When the Office Is Closed

Keamanan VoIP dan Troubleshoot

6
  • Fixing One-Way Audio in 3CX — Call Connects But Only One Side Can Hear?
  • How to Unblock an IP After Too Many Failed Login Attempts
  • 3CX Firewall Checker: How to Check 3CX Ports So Calls Stay Smooth

Developer

14
  • Transforming Enterprise Phone Architecture with a WebRTC SBC Gateway
  • WebRTC SBC Gateway Integration for Flutter
  • Optimizing Enterprise Collaboration with the 3CX Video Conference API
  • 3CX CRM XML Template Structure & Specification Guide
  • 3CX REST API (XAPI) Endpoint Guide for Configuration
  • Guide to Integrating Odoo CRM with 3CX
  • Flutter WebRTC Softphone App Using the sip_ua Package

SIP TRUNK

8
  • What Is a SIP Trunk?
  • How Many Types of SIP Trunk Numbers or Services Are There?
  • How to Enable Incoming WhatsApp Calls (WhatsApp SIP Calling) in 3CX
  • SIP Trunk Management: How to Connect a Local Provider Phone Number to 3CX

WhatsApp Calling API

12
  • What Is the WhatsApp Calling API?
  • Guide & Optimization: Setting Up WhatsApp Call for Customer Service in 3CX
  • How to Route WhatsApp Calls to Multiple Extensions at Once
  • Guide to Building a WhatsApp Call Queue in 3CX for Customer Service
  • How to Enable Incoming WhatsApp Calls (WhatsApp SIP Calling) in 3CX
  • Integrating WhatsApp Call with CRM Using 3CX
View Categories
  • Home
  • Pusat Bantuan
  • Developer
  • 3CX CRM XML Template Structure & Specification Guide

3CX CRM XML Template Structure & Specification Guide

Admin
Updated on October 2, 2026

5 min read

3CX CRM XML TEMPLATE INTEGRATION SPECIFICATION #

  • Document ID: KB-3CX-CRM-XML-01

  • Target Version: 3CX v18 / v20 (Server-Side Integration)

  • Category: Middleware & API Development

1. Introduction & Core Architecture #

3CX uses a server-side integration engine that executes instructions from a custom XML configuration file. This engine handles phone number lookups (contact lookup), call history logging (call journaling), message interaction reporting (chat journaling), and even complex token authorization flows (OAuth2).

The engine supports three scenario types (Type):

  1. REST: Interaction via HTTP REST API (returns JSON- or XML-formatted data).

  2. SQLDatabase: Direct relational database queries (supports MySQL, PostgreSQL, and Microsoft SQL Server).

  3. NoSQLDatabase: Non-relational database command execution (supports MongoDB).

2. Root Element Structure & Base Attributes #

Every template must be wrapped inside a <Crm> root tag with the following attribute declarations:

XML

<Crm Name="Custom_CRM_REST" Version="1" Country="ID" SupportsEmojis="true">
    </Crm>
  • Name: A unique identifier string for the template, shown in the 3CX Admin Console UI.

  • Version: An integer marking the integration schema version (used by the system for update management).

  • Country: The app’s target country code (required, though it isn’t currently evaluated by the core functionality).

  • SupportsEmojis: A boolean value (true/false). If set to false, emoji characters in chat messages will be automatically filtered out before being sent to your CRM system.

3. Core Component Configuration Elements #

3.1 The <Number> Element #

Used to normalize the format of the incoming phone number string (caller ID) so it matches the lookup index format in your CRM database.

  • Prefix (Enum): Determines how the number’s leading characters are manipulated:

    • AsIs: Keeps the original string unmodified (example: +62 or 00 stays as is).

    • Off: Strips out all leading marker characters (such as the + symbol or the digits 00).

    • Plus: Forces the leading character to be a plus sign (+).

    • Zeros: Forces the leading characters to be double zero (00).

  • MaxLength (Expression): Trims the string from the right, keeping only the last $N$ digits. This value can be set dynamically using the [MaxLength] variable expression to pull the global parameter from 3CX Console > Contacts > Options.

3.2 The <Connection> Element #

Configures the engine’s concurrency limits for requests to the external server.

  • MaxConcurrentRequests: Limits the maximum number of parallel simultaneous queries allowed to be sent to the CRM API (prevents rate limiting). A single phone call lookup session — even one that runs several parallel lookup scenarios for Lead, Contact, or Account — is counted as a single request unit.

3.3 The <Parameters> Element #

Holds a collection of custom <Parameter> elements whose values are entered dynamically by the administrator through the 3CX Web Console UI. These parameter values can be referenced anywhere in the template using square-bracket notation: [ParameterName].

  • Parameter Data Type (Type): Supports String, Password (hidden text input), Boolean (checkbox), Integer, Double, DateTime, and OAuth (triggers an interactive OAuth2 authorization flow button).

  • Editor Control Attribute: The Editor attribute is either String (max 100 characters) or Sql (max 1000 characters). For OAuth-type parameters, you must also include the RequestUrl, RequestUrlParameters, and ResponseScenario attributes.

3.4 The <Authentication> Element #

Configures how security tokens are injected into the HTTP header. Supports three configurations:

  1. Type="No": No built-in authentication — used when the CRM handles the token manually inside the URL’s query string.

  2. Type="Basic": Automatically injects the Authorization: Basic <base64> HTTP header on every request, based on the value from the child node <Value>.

  3. Type="Scenario": Used for dynamic token schemes (such as an OAuth2 Access Token). This option triggers a dedicated scenario to fetch a fresh token, detect its expiry time, and store it in runtime memory state.

4. Scenario Handling Based on Reserved System IDs #

The Id attribute on the <Scenario> tag controls when and how a block of instructions is executed by the 3CX telephony core engine:

  • Id="" (Empty String): The primary default scenario for matching a contact based on the incoming phone number (Inbound Call Contact Lookup).

  • Id="LookupByEmail": Automatically triggered when the system requests an entity lookup using an email address.

  • Id="SearchContacts": Used for free-text search functionality across data columns (Name, Company, Email, etc.) from the 3CX client application.

  • Id="ReportCall": Executed automatically the instant a phone call session ends, to log the call history (Call Journaling).

  • Id="ReportChat": Executed automatically once a custom message interaction session finishes (Chat Journaling).

  • Id="CreateContactRecordFromClient": Triggers the creation of a new contact record in the CRM directly from an action button in the 3CX client application.

  • Id="LookupFromCFD_[Entity]_[Type]": Used specifically to pass back a raw data payload (JSON/XML) directly to the Call Flow Designer (CFD) application.

⚠️ IMPORTANT FOR DEVELOPERS (JOURNALING RULES):

Specifically for the ReportCall and ReportChat scenarios, the 3CX engine does not expect any data to be returned (output data return). Because of this, the XML structure for these scenarios must not include closing nodes such as <Rules>, <Variables>, or <Outputs>. Simply declare the main interaction elements such as <Request>, <Query>, or <Command>.

5. Response Data Processing Pipeline (REST) #

The API response processing cycle in a REST scenario follows 4 sequential stages (sequential pipeline):

  1. <Request>: Constructs the HTTP Request (URL, Method GET/POST/PUT, Headers, and Request Body).

  2. <Rules>: Maps the base of the external response’s object array (the Type="json" attribute uses JSONPath syntax, while Type="xml" uses XPath syntax). A <Filter> element can be nested inside it to filter by a specific property condition.

  3. <Variables>: Extracts specific property values from the filtered array results and maps them into local runtime variables.

    XML

    <Variables>
        <Variable Name="ContactID" Path="id" />
        <Variable Name="Company" Path="company.name" />
    </Variables>
    
  4. <Outputs>: Passes the local runtime variable values back to the 3CX PBX core. For a contact lookup scenario, the required properties that must be mapped include: ContactUrl, FirstName, LastName, CompanyName, Email, and PhoneBusiness.

  • Chained Scenarios: Developers can recursively trigger a follow-up scenario per data row by adding a Next attribute to the output tag, for example: <Outputs Next="GetContactDetailsByID"/>. The child scenario automatically inherits all the variable state captured in its parent scenario.

6. Expression Syntax Rules & Special Character Escaping #

3CX’s XML expression parsing engine enforces strict rules around reserved system characters. If a literal string inside an expression attribute contains special characters, you must escape them as follows:

  • The opening square bracket [ must be changed to: {{

  • The closing square bracket ] must be changed to: }}

  • The double-quote character " must be changed to: ^^

Note for SQL Developers: Specifically when writing variable bindings inside a SQLDatabase scenario, you must not reference variable values using square-bracket notation [Variable] — instead, use SQL’s native bound-parameter prefix, the @ symbol (Example: WHERE phone = @NumberToLookup).

7. Testing & Debugging Workflow #

The main 3CX System Service is responsible for loading all XML schema files into RAM when the PBX first boots up. As a result, every time a developer changes a line of code in the XML template file, the 3CX System Service must be fully restarted for the updated schema to be picked up.

To test the integration’s functionality without placing an actual call (dummy testing execution), use the interactive “Test” button located on the admin web management page: 3CX Admin Console > Settings > CRM Integration.

Also read: Call Center Hospitality for Multi-Country Guest Service with 3CX, CRM & AI Agent (Indonesian)

Optimizing Enterprise Collaboration with the 3CX Video Conference API3CX REST API (XAPI) Endpoint Guide for Configuration
Table of Contents
  • 3CX CRM XML TEMPLATE INTEGRATION SPECIFICATION
    • 1. Introduction & Core Architecture
    • 2. Root Element Structure & Base Attributes
    • 3. Core Component Configuration Elements
      • 3.1 The Element
      • 3.2 The Element
      • 3.3 The Element
      • 3.4 The Element
    • 4. Scenario Handling Based on Reserved System IDs
    • 5. Response Data Processing Pipeline (REST)
    • 6. Expression Syntax Rules & Special Character Escaping
    • 7. Testing & Debugging Workflow

Share This Article :

  • Facebook
  • X
  • LinkedIn

Was it helpful ?

  • Happy
  • Normal
  • Sad
  • Cloud PBX
  • Products & Services
  • Devices
  • Case Studies
  • News
  • Video
  • Help Center
  • Contact
  • Partnership Program
  • About Us
  • Cloud PBX Enterprise
  • Cloud PBX Multi tenant
  • Cloud call center
  • Cloud PBX office
  • Click to Talk
  • Webrtc softphone
  • AI Agent & API Integration: 24/7 Automated Customer Service Solution
  • WhatsApp Business Calling API Integration with PBX
  • Integrasi CRM dengan 3CX
  • Help Center
  • Comply with PCI DSS & HIPAA Standards
  • Practical Ways to Improve Hotel Communication Efficiency
  • Agentic AI: A New Era for Smart Phone Systems
  • Cloud PBX Office for Business Communication
  • Understanding the Call Flow Designer Feature
  • Call Center Hospitality
  • WhatsApp Customer Service with 3CX
  • PBX Monitoring with Grafana and SQL Dashboard
  • Ribbon SBC for Microsoft Teams Direct Routing: SBC 1000 Appliance vs Cloud-Based SWe Lite
  • Sangoma SBC: A Secure Bridge from Telkom SIP Trunk to AI Voice Platforms
  • Privacy Policy

PT. Solusi Teknologi Unggul | My Republik Plaza Wing A Ground Level Zona 6, Green Office Park 6. BSD City Tangerang Banten 15345 Tel:+62-21-50111266

Copyright © 2026 PT. Solusi Teknologi Unggul 

Need help? Chat with us on WhatsApp
WhatsApp
Hello, welcome to Solusipbx.com, thank you for contacting us

To help us provide the right solution, please tell us your Name, Company
and your needs
Open Chat
Powered by Joinchat