manual_configuration.rst 8.7 KB
Newer Older
1 2 3 4 5 6
.. _manual_configuration:

*************************************
Manual configuration and installation
*************************************

7
This section describes the manual installation of the XiVO CC components.
8
In most cases you **SHOULD NOT** follow this page, and install the XiVO CC components via the `xivocc-installer` package (see
Etienne Allovon's avatar
Etienne Allovon committed
9
:ref:`ccinstallation`).
10

11
.. important::  You **SHOULD NOT** follow this page to install XiVO CC. We leave this page here :
12

13
  - to document how to install only a subset of the XiVO CC components (since it is not currently possible
14
    via the `xivocc-installer` package).
15 16
  - to help with reconfiguring XiVO for XiVO CC after it has been :ref:`restored from backup <restore>`
  - as a reference
17

18
.. note:: Since XiVO PBX 2017.06 some parts of the installation were moved from `xivocc-installer` to installation of XiVO PBX.
19 20 21 22

Prerequisites
=============

Etienne Allovon's avatar
Etienne Allovon committed
23
We will assume your *XiVO CC* server meets the following requirements:
24 25

- OS : Debian 8 (jessie), 64 bit
Etienne Allovon's avatar
Etienne Allovon committed
26 27
- the latest stable version of Docker_ is installed
- the latest stable version of Docker-compose_ is installed
28 29 30 31 32 33
- the XiVO PBX is reachable on the network
- the XiVO PBX is setup with users, queues and agents, you must be able to place and answer calls.

.. _Docker: https://www.docker.com
.. _Docker-compose: https://docs.docker.com/compose/install/

Etienne Allovon's avatar
Etienne Allovon committed
34
Note : Install only stable version of docker and docker compose.
35 36 37

We will make the following assumptions :

Etienne Allovon's avatar
Etienne Allovon committed
38
- the *XiVO PBX* has the IP 192.168.0.1
39
- some data (incoming calls, internal calls etc.) might be available on XiVO (otherwise, you will not see `anything` in the :ref:`check-list`).
Etienne Allovon's avatar
Etienne Allovon committed
40
- the *XiVO CC* server has the IP 192.168.0.2
41 42 43

.. check-list: installation#check-list

44 45
.. _xivo_pbx_configuration:

Etienne Allovon's avatar
Etienne Allovon committed
46 47
XiVO PBX configuration
======================
48 49 50 51

PostgreSQL configuration
------------------------

Etienne Allovon's avatar
Etienne Allovon committed
52
Firstly, allow access to PostgreSQL from the outside. Edit :file:`/etc/postgresql/9.4/main/postgresql.conf`:
53 54 55 56 57

.. code-block:: ini

   listen_addresses = '*'

Etienne Allovon's avatar
Etienne Allovon committed
58
Add this line to :file:`/etc/postgresql/9.4/main/pg_hba.conf`:
59 60 61 62 63

.. code-block:: ini

   host asterisk all 192.168.0.2/32 md5

64 65
.. _creating_user_stats:

66 67 68 69 70 71 72 73 74
Create a user `stats` with read permissions :

.. code-block:: bash

   sudo -u postgres psql asterisk << EOF
   CREATE USER stats WITH PASSWORD 'stats';
   GRANT SELECT ON ALL TABLES IN SCHEMA PUBLIC TO stats;
   EOF

75
And run ``xivo-service restart all`` to apply these modifications.
76 77 78 79

AMI configuration
-----------------

80 81
* Add file :file:`/etc/asterisk/manager.d/02-xivocc.conf` directory with the following
  content, replacing *X.X.X.X* by your xucserver IP address :
82 83

.. code-block:: ini
84
   :emphasize-lines: 4
85 86 87 88

   [xuc]
   secret = xucpass
   deny=0.0.0.0/0.0.0.0
89
   permit=X.X.X.X/255.255.255.255
90 91
   read = system,call,log,verbose,command,agent,user,dtmf,originate,dialplan
   write = system,call,log,verbose,command,agent,user,dtmf,originate,dialplan
92
   writetimeout = 10000
93

94
* And reload the AMI :
95 96 97 98 99 100 101 102 103

.. code-block:: bash

   asterisk -rx "manager reload"
   asterisk -rx "manager show user xuc" and check your if previous configuration is displayed.

CEL Configuration
-----------------

104
* Replace content of file :file:`/etc/asterisk/cel.conf` by the following :
105 106 107 108 109 110 111 112 113 114 115

.. code-block:: ini

   [general]
   enable = yes
   apps = dial,park,queue
   events = APP_START,CHAN_START,CHAN_END,ANSWER,HANGUP,BRIDGE_ENTER,BRIDGE_EXIT,USER_DEFINED,LINKEDID_END,HOLD,UNHOLD,BLINDTRANSFER,ATTENDEDTRANSFER

   [manager]
   enabled = yes

116
* and reload the cel module in Asterisk :
117 118 119 120 121 122 123 124

.. code-block:: bash

   asterisk -rx "module reload cel"

Customizations in the web interface
-----------------------------------

125
* Create a user *xuc* in :menuselection:`Services -> IPBX -> Users` with the following parameters:
126

127 128 129
 - CTI login : xuc
 - CTI password : 0000
 - profil supervisor
130

131
* Create a Web Services user in :menuselection:`Configuration -> Web Services Access` with the following parameters :
132

133 134 135
 - Login : xivows
 - Password : xivows
 - Host : 192.168.0.2
136

Etienne Allovon's avatar
Etienne Allovon committed
137
Make sure **Multiqueues call stats sharing** is enabled in :menuselection:`Services -> IPBX -> Advanced configuration` tab.
138 139 140 141 142 143 144 145 146

Phone integration
-----------------
Do not forget to follow configuration steps detailed in :ref:`Required configuration for phone integration
<phone_integration_installation>`.

Packages for the recording
--------------------------

147
Still on the *XiVO PBX*, install the package which will handle the recording.
148

149
See :ref:`Recording paragraph <recording_xpbx>` in installation section.
150 151


Etienne Allovon's avatar
Etienne Allovon committed
152 153
XiVO CC configuration
=====================
154 155 156

Now we switch to the installation of the XiVO CC server.

Etienne Allovon's avatar
Etienne Allovon committed
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
Install ntp server
------------------
.. code-block:: ini

    apt-get install ntp

*XiVO CC* server and *XiVO  PBX* server must be synchronized to the same source.

Enable Docker LogRotate
-----------------------

Docker container log output to /dev/stdout and /dev/stderr.
The Docker container log file is saved in /var/lib/docker/containers/[CONTAINER ID]/[CONTAINER_ID]-json.log.

Create a new Logrotate config file for your Docker containers in the Logrotate folder /etc/logrotate.d/docker-container.

.. code-block:: ini

        /var/lib/docker/containers/*/*.log {
          rotate 7
          daily
          compress
          missingok
          delaycompress
          copytruncate
        }

You can test it with logrotate -fv /etc/logrotate.d/docker-container.
You should get some output and a new log file with suffix [CONTAINER ID]-json.log.1 should be created.
This file is compressed in next rotation cycle.


189 190
Retrieve the configuration script and launch it:

Etienne Allovon's avatar
Etienne Allovon committed
191 192 193
Containers installation
-----------------------

194 195
.. code-block:: bash

196
   wget  https://gitlab.com/xivo.solutions/packaging/raw/master/install/install-docker-xivocc.sh
197 198 199 200 201 202 203 204 205 206 207 208 209 210
   bash install-docker-xivocc.sh

During the installation, you will be asked for :

- the XiVO IP address (e.g. 192.168.0.1)
- the number of weeks to keep for the statistics
- the number of weeks to keep for the recording files
- the external IP of the machine (i.e. the adress used afterwards for http URLs)

Create the following alias in your .bashrc file:

.. code-block:: bash

    vi ~/.bashrc
211
    alias dcomp='docker-compose -p xivocc -f /etc/docker/compose/docker-xivocc.yml'
212

Etienne Allovon's avatar
Etienne Allovon committed
213 214
Containers modification
-----------------------
215

Etienne Allovon's avatar
Etienne Allovon committed
216
The yml file :file:`/etc/docker/compose/docker-xivocc.yml` should have the correct tag version for each imeage.
217

Etienne Allovon's avatar
Etienne Allovon committed
218
Check also that the **XIVO_CTI_VERSION** is correct for the xuc container.
219 220 221

.. code-block:: yaml

Etienne Allovon's avatar
Etienne Allovon committed
222 223
    xivo_replic :
      image: xivoxc/xivo-db-replication:2016.03.latest
224

Etienne Allovon's avatar
Etienne Allovon committed
225 226
    xivo_stats :
      image: xivoxc/xivo-full-stats:2016.03.latest
227

Etienne Allovon's avatar
Etienne Allovon committed
228 229
    pack_reporting:
      image: xivoxc/pack-reporting:2016.03.latest
230

Etienne Allovon's avatar
Etienne Allovon committed
231 232
    config_mgt:
      image: xivoxc/config-mgt:2016.03.latest
233

Etienne Allovon's avatar
Etienne Allovon committed
234 235
    recording_server:
      image: xivoxc/recording-server:2016.03.latest
236

237
    xuc:
Etienne Allovon's avatar
Etienne Allovon committed
238
      image: xivoxc/xuc:2016.03.latest
239

Etienne Allovon's avatar
Etienne Allovon committed
240 241
      environment:
      - XIVO_CTI_VERSION=2.1
242

Etienne Allovon's avatar
Etienne Allovon committed
243 244
    xucmgt:
      image: xivoxc/xucmgt:2016.03.latest
245 246 247 248 249 250 251 252 253


Starting XivoCC
---------------

Then you can launch the XiVO CC with the following command :

.. code-block:: bash

254
   dcomp up -d
255 256 257 258 259 260 261 262


List XivoCC services :


.. code-block:: bash


263
    # dcomp ps
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282
               Name                         Command               State                        Ports
    ---------------------------------------------------------------------------------------------------------------------
    xivocc_config_mgt_1         bin/config-mgt-docker            Up       0.0.0.0:9100->9000/tcp
    xivocc_elasticsearch_1      /docker-entrypoint.sh elas ...   Up       0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp
    xivocc_fingerboard_1        /bin/sh -c /usr/bin/tail - ...   Up
    xivocc_kibana_volumes_1     /bin/sh -c /usr/bin/tail - ...   Up
    xivocc_nginx_1              nginx -g daemon off;             Up       443/tcp, 0.0.0.0:80->80/tcp
    xivocc_pack_reporting_1     /bin/sh -c echo            ...   Up
    xivocc_pgxivocc_1           /docker-entrypoint.sh postgres   Up       0.0.0.0:5443->5432/tcp
    xivocc_postgresvols_1       /bin/bash                        Exit 0
    xivocc_recording_server_1   bin/recording-server-docker      Up       0.0.0.0:9400->9000/tcp
    xivocc_reporting_rsync_1    /usr/local/sbin/run-rsync.sh     Up       0.0.0.0:873->873/tcp
    xivocc_spagobi_1            /bin/sh -c /root/start.sh        Up       0.0.0.0:9500->8080/tcp
    xivocc_timezone_1           /bin/bash                        Exit 0
    xivocc_xivo_replic_1        /usr/local/bin/start.sh /o ...   Up
    xivocc_xivo_stats_1         /usr/local/bin/start.sh /o ...   Up
    xivocc_xivocclogs_1         /bin/bash                        Exit 0
    xivocc_xuc_1                bin/xuc_docker                   Up       0.0.0.0:8090->9000/tcp
    xivocc_xucmgt_1             bin/xucmgt_docker                Up       0.0.0.0:8070->9000/tcp