Configure 3CX automatically via setupconfig.xml in no time!
Take the PBX Express
Your PBX, Your Cloud, ready in minutes
Zero Admin
With the new Dashboard
Bulletproof Security
With SSL certs and NGINX
Install on $200 Appliance
Intel MiniPC architecture
New, Intuitive Windows Client
More themes, more UC
More CRM Integrations
Scripting Interface to add your own
Improved Integrated Web Conferencing
iOS and Android apps included
Run On-Premise or in the Cloud
Google, OVH, Windows & Linux

Deploying 3CX and provisioning settings automatically via setupconfig.xml

Deploying 3CX and Provisioning Settings Automatically via setupconfig.xml

On this topic

Deploying 3CX and Provisioning Settings Automatically via setupconfig.xml

Introduction

Overview

Example of Cloud.init

How to include setupconfig in cloud init.

Setupconfig.xml explained

Configuration of the wizard

Adding Extensions, SIP Trunks, DID’s and outbound rules

Creating an Extension

Creating a SIP Trunk, DID’s and Inbound rules

Importing SSL Certificates

Download Links

Introduction

It is possible to launch and automatically configure 3CX by creating an answer file - this is nothing more than all the questions that the 3CX command line tool asks you, all pre-populated in an XML file. You can get this XML file and put it either inside the host or in Cloud.Init and 3CX will run through all the questions automatically. You basically end up from nothing to a fully configured 3CX in no time!

It is also possible to include extensions, SIP Trunks and DIDs during installation.

Overview

This is how it will work:

You can prepare the xml and put it on the computer before 3CX is installed

  1. Download this sample Setup Template XML File.
  2. Create the configuration manually by filling in all the details required.
  3. Place setupconfig.xml on the host machine:
  • For Linux place the file in /etc/3cxpbx/setupconfig.xml.
  • For Windows place file in C:\ProgramData\3CX\Data\setupconfig.xml
  1. When 3CX is installed, the command line wizard will check the above locations and if it sees  “setupconfig.xml” it will automatically process it.

Note: Instead of copying the file you can also use Cloud Init by copying the contents of the xml and paste it in the Advanced / User data section. Below is an image of Amazon AWS cloud-init.


Example of Cloud.init

How to include setupconfig in cloud init.

Download cloudinit sample.

Setupconfig.xml explained

Setupconfig is split in 4 sections:

<tcxinit> This is the initial phase of the PBX Configuration tool. In here we will fill in the answers to the questions asked in the PBX or Web configuration tool example License or Backup file path, Network settings, Public IP, FQDN, 3CX FQDN or Custom FQDN, Hostname, Local DNS, Http/s ports.

<mcwizard> This is the second part where the answers correspond to the questions asked in the initial Management console Wizard example Extension length, mail server, timezone, country, and license information.

<extensions> this is the part where extensions are declared and created.

<siptrunk> This is where SIP Trunks and DID’s are created with a subnode for <inboundrules> to create Inbound routing associated with the DID of that SIP Trunk.

<OutboundRules> This is the section where outbound rules are created.

Configuration of the wizard

This is an xml that corresponds to the questions asked in the Management console wizard:

   

To populate <CountryName>, <TimezoneId> and <LicenseCountry> refer to this list and select from appropriate columns:https://www.3cx.com/wp-content/uploads/2016/11/Time-Zone-Sheet1-1.pdf

Example if you are in Mexico, after referring to the pdf you should end up with the following configuration:

Adding Extensions, SIP Trunks, DID’s and outbound rules

In this section we will add extensions, SIP Trunks, Inbound rules and outbound rules to the setup configuration file.

You can also provision an IP Phone to an extension. The XML node will ask you for some file name information which you can get from this here:

Available Supported Phone Templates and Model codes

Example: if you have a snom 720 then you find “snom 720” in the Model name and see what the corresponding template file name will be - in this case “snom.ph.xml”. Enter the information in the corresponding xml tag.

Creating an Extension

Screen Shot 2017-02-22 at 15.21.57.png

Creating a SIP Trunk, DID’s and Inbound rules

Creating Outbound rules with backup routes

Screen Shot 2017-02-22 at 15.25.29.png

Importing SSL Certificates

This is a small example showing how we would include SSL certificate information to setupconfig.xml. This example shows only the parts relevant to SSL. Also different types of certificates require differnet xml nodes to be configured. Example CertificatePath is used in all. But CertificatePassword only pfx.

sslsetupconfig.PNG

Download Links

On Windows, download v15 here.
On Linux, follow this
guide. Debian Linux 8 ONLY!
Download the 3CX Debian ISO
here.

<