The Enswitch code is stored in the Integrics git repository. There is one git branch for each Enswitch version. You can download the code using 'git clone', specifying the branch for the version you wish to install. If in doubt as to which version to use, see the guides index page, and choose the most recent stable version listed there. If you require the latest features and are willing to tolerate an increased risk of bugs, you may choose to install a test version. Do not install a development version.
Access to the Integrics git repository is via SSH public key. Before installing Enswitch, create an SSH key using 'ssh-keygen', and copy it to /root/.ssh/ on each Enswitch machine. Each Enswitch machine should use the same key. Then send the public key to Enswitch support. They will add your public key to the repository to give you access.
Enswitch expects to be installed into /opt/enswitch, as this path is hard coded into various programs.
Installation commands
To install Enswitch version 4.4:
- apt install git || dnf install git || yum install git
- cd /opt
- git clone git@git.integrics.com:enswitch -b 4.4
- cd enswitch
- if [ "$SHELL" == "/bin/bash" ]; then source bin/install.bash; fi # for bash tab completion
- bin/install [-a] [-f] [-r] [-u] <components>...
The Enswitch installer allows you to pass on the command-line a list of which components to install on this machine. They are:
- enswitch (required for all machines)
- asterisk|asterisk-primary|asterisk-backup (for Asterisk machines)
- files-primary|files-backup (for file server)
- g729 (for G729 codec with Asterisk)
- kamailio|kamailio-primary|kamailio-backup (for Kamailio machines)
- mysql|mysql-primary|mysql-backup (for MySQL machines)
- nfs-server|nfs-client (for NFS machines)
- rtpengine|rtpengine-primary|rtpengine-backup (for RTPengine machines)
- web|web-primary|web-backup (for web server machines)
The following optional sub-systems can also be installed:
- amazon_recordings (for Asterisk and web machines if using Amazon S3 storage for recordings)
- cwmpd|cwmpd-primary|cwmpd-backup (experimental, for CWMP/TR-069 machines only)
- ejabberd (for ejabberd/XMPP machines only)
- email_to_fax (for inbound email machines only)
- google_recordings (for Asterisk and web machines if using Google Cloud Services for recordings)
- google_transcription (for Asterisk and web machines if using Google Cloud for recording or voicemail transcription)
- hylafax (for Asterisk machines, depreciated)
- hylafax-enterprise (for commercial Hylafax Enterprise)
- ringtone (for web machines if using custom ringtones in numbers)
Some components can be installed for use with Corosync/Pacemaker HA failover using the -primary or -backup suffix. For standalone machines specify the component without any suffix.
Components such as Asterisk and Kamailio will prompt you for the version to be installed (unless in automatic mode), giving a recommended default.
The Enswitch installer has the following options:
- -a to put the installer in automatic mode, instead of the default interactive behaviour. In this case it will use the settings in /etc/enswitch/install.conf or exit with an error if any required settings are missing. The interactive installation will write /etc/enswitch/install.conf, so you can install one machine and then copy /etc/enswitch/install.conf to other machines to use with -a and the same settings. An example install.conf is available in install/install.conf if you want to prepare the settings beforehand.
- -f to force overwrite of existing files and directories.
- -r for reinstallations rather than new installations, and not install dependencies.
- -u for upgrades rather than installations, and not install dependencies or overwrite existing configuration.
Example installations
Run the Enswitch installer with the desired components. For example, to install a simple single-machine system:
- bin/install enswitch asterisk files-primary kamailio mysql web
To install the primary of two machines in HA failover:
- bin/install enswitch mysql-primary
- bin/install asterisk-primary files-primary kamailio-primary rtpengine-primary web-primary
To install the backup of two machines in HA failover:
- bin/install enswitch mysql-backup # at the same time as mysql-primary is installing on primary machine
- scp <primary machine>/etc/enswitch/install.conf /etc/enswitch/install.conf # optional, to copy configuration after full installation has completed on primary machine
- bin/install asterisk-backup files-backup kamailio-backup rtpengine-backup web-backup # optionally, add -a if /etc/enswitch/install.conf was copied from primary machine
Possible issues with SSH authentication for git commands
When running the "git clone" command above, the underlying SSH authentication should work without requiring a password from the user. If that is not the case, when creating your SSH key maybe you specified a custom file name which does not match one of the defaults expected by the SSH client, like any of these:
- /root/.ssh/id_rsa
- /root/.ssh/id_ecdsa
- /root/.ssh/id_ecdsa_sk
- /root/.ssh/id_ed25519
- /root/.ssh/id_ed25519_sk
- /root/.ssh/id_xmss
- /root/.ssh/id_dsa
To solve that, you may apply any of these fixes on each Enswitch machine:
- Rename the private key file, for example with a command like "mv /root/.ssh/my_id_rsa /root/.ssh/id_rsa".
- Assign a value to the GIT_SSH_COMMAND environment variable to use the private key custom path, for example GIT_SSH_COMMAND="ssh -i /root/.ssh/my_id_rsa".
- Use the "ssh-agent" and "ssh-add" commands to load the private key from its custom file path.
- Edit the file /root/.ssh/config to have specific settings to connect to the git.integrics.com server.
Running "git clone" again should work passwordless.