Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Content imported from a Scroll Translations translation file.
Sv translation
languageen

The CHAT role is used for conducting chat sessions with agents from external websites. The CHAT role is also required for WhatsApp integrations.

The chat server is a Java application, which can be installed in parallel on the web servers with corresponding additional RAM of about 4 GB per server.

Alternatively, the chat-server can be installed on a separate server, or on the load balancer. 

The following recommendations are made:

WhereRequirements
On an existing webserverAdditional 4 GB of RAM
On the load balancerAdditional 4 GB of RAM and 2 CPU cores, expand system drive (home directories) to 32 GB
On a separate server8 GB RAM, 32 GB HDD, 2 CPU Cores (can be extended later to 4 CPU cores, depending on system load)

Installation

Java 8 Installation

First of all, Java 8 is installed:

Translations Ignore


Code Block
languagebash
wget https://cdn.jtel.de/downloads/java/jdk-8u202-linux-x64.rpm
dnf -y install ./jdk-8u202-linux-x64.rpm
rm -f jdk-8u202-linux-x64.rpm


Installing and Configuring ClientMessenger

ClientMessenger Installation

First of all, the ClientMessenger directory is copied to /home/jtel

Translations Ignore


Code Block
languagebash
cp -R /home/jtel/shared/JTELCarrierPortal/Utils/Install/ClientMessenger/ /home/jtel/ClientMessenger
chown -R jtel:jtel /home/jtel/ClientMessenger


Hazelcast Cluster Configuration File

The hazelcast.xml file is copied to the configuration directory of the chat server. 

Translations Ignore


Code Block
languagebash
rm -f /home/jtel/ClientMessenger/conf/hazelcast.xml
cp /home/jtel/shared/hazelcast.xml /home/jtel/ClientMessenger/conf/hazelcast.xml
chown jtel:jtel /home/jtel/ClientMessenger/conf/hazelcast.xml


Client Messenger Configuration

The configuration or the start file jtel-clientmessenger may have to be adapted so that the database connection can be established. Here <password> must be replaced with the password for the root user of the database:

Status
colourRed
titleCaution Password

Translations Ignore


Code Block
# Edit this file:
vi /home/jtel/ClientMessenger/systemd/jtel-clientmessenger.service

# Check this setting
...
-Dde.jtel.platform.clientmessenger.connection=jdbc:mysql://acd-dbm/JTELWeb?user=root&password=Fe1er3B0rl&characterEncoding=utf8 \
...


Install ClientMessenger with systemd

Translations Ignore


Code Block
languagebash
cp /home/jtel/ClientMessenger/systemd/jtel-clientmessenger.service /etc/systemd/system/jtel-clientmessenger.service
systemctl daemon-reload
systemctl enable jtel-clientmessenger.service


Create the Update Script

An update script is created for updating the chat server:

Translations Ignore


Code Block
languagebash
cat <<EOFF>/usr/local/bin/updatesc.sh
#!/bin/bash
systemctl stop jtel-clientmessenger.service
cp /home/jtel/shared/JTELCarrierPortal/Utils/Install/ClientMessenger/bin/* /home/jtel/ClientMessenger/bin
chown -R jtel:jtel /home/jtel/ClientMessenger
systemctl start jtel-clientmessenger.service
EOFF
chmod +x /usr/local/bin/updatesc.sh


Configure the Firewall

Next, the open ports for the chat service must be entered in the firewall and saved persistently. Here you can distinguish whether http (speak unsecure websocket) or https (secure websocket) is used.

Since the load balancer usually decrypts the https, for https only port 3003 needs to be opened to the load balancer.

Firewall configuration http

Execute the following commands, on the following machines:

  • On CHAT server (here the chat port and the Hazelcast Cluster ports)

Translations Ignore


Code Block
languagebash
firewall-cmd --zone=public --add-port=5701-5801/tcp --permanent
firewall-cmd --zone=public --add-port=3000/tcp --permanent
firewall-cmd --reload



  • On all LB - with http connection to the outside

Translations Ignore


Code Block
languagebash
firewall-cmd --zone=public --add-port=3000/tcp --permanent
firewall-cmd --reload


Firewall configuration https

  • On all LB - with https connection to the outside

Translations Ignore


Code Block
languagebash
firewall-cmd --zone=public --add-port=3003/tcp --permanent
firewall-cmd --reload


Load Balancer Configuration

haproxy.cfg Adjustments

For http

The following adjustments are made on the haproxy, in case of a http connection for the chat to the outside:

Translations Ignore


Code Block
languagebash
frontend acdportal_chat_ws
        mode            http
        bind            :3000 
        timeout         client 1d
        default_backend backend_chat_ws

backend backend_chat_ws
        mode            http
        balance         leastconn # roundrobin
        server          chatserver1 <ip_addresse_oder_name>:3000 weight 1 check inter 1m
        server          chatserver2 <ip_addresse_oder_name>:3000 weight 1 check inter 1m


For https

Translations Ignore


Code Block
languagebash
frontend acdportal_chat_wss
        mode            http
        bind            :3003 ssl crt /etc/haproxy/haproxy.pem
        timeout         client 1d
        default_backend backend_chat_ws

backend backend_chat_ws
        mode            http
        balance         leastconn # roundrobin
        server          chatserver1 <ip_addresse_oder_name>:3000 weight 1 check inter 1m
        server          chatserver2 <ip_addresse_oder_name>:3000 weight 1 check inter 1m



Reload Haproxy

Then, reload the haproxy with the following command:

Translations Ignore


Code Block
languagebash
service haproxy reload



Chat Configuration

Parameters (as sysadmin)

For https / wss

ACD.Chat.Script.Library.URL
https://<load-balancer>:3003/gui/
ACD.Chat.Server.Base.URLwss://<load-balancer>:3003

For http / ws

ACD.Chat.Script.Library.URL
https://<load-balancer>:3000/gui/
ACD.Chat.Server.Base.URLws://<load-balancer>:3000

Status

An appropriate agent status for "Chat" - or an existing status - must be configured so that chat is distributed to the agent:

Max chats per agent

The maximum number of parallel chats per agent must be configured. This value is set to 0 by default for all agents.

Additional configurations for WhatsApp

In order for What's App to work, further configurations still need to be made.

Note: setting up the WhatsApp business account or connecting to the provider (currently TynTec) is done directly with the provider.

Warning
titlehttps

The load balancer must be operated with https and a valid certificate.

Additional configuration in jtel-clientmessenger

The parameter DATADIR must be checked. This must point to either the /srv/jtel/shared/Data/Clients/ directory if it is hosted directly on the chat server, or /home/jtel/shared/Data/clients/ if the server has mouted the directory.

Translations Ignore


Code Block
Environment=DATADIR=/home/jtel/shared/Data/clients/


Additional configuration on the load balancer

Additional entries are required in the frontend area for the portal:

Translations Ignore


Code Block
frontend acdportal_https
...
        acl whatsapp_req    path /incoming
        acl whatsapp_req    path /delivery
...
        use_backend     backend_chat_ws if whatsapp_req


Additional parameters

The following system parameters must be checked in the portal:

ParameterValueComment
ACD.Whatsapp.Server.Base.URL

https://jtel-portal:3003

The URL used by the agent client to allow the agent to reply to messages. This must be resolved from all agent workstations to a valid URL via DNS, and is directed to the chat server via the haproxy.
ACD.Whatsapp.Whatsapp.Urlhttps://jtel-portal:3003The URL used by the outside world (WhatsApp users) to download the attachments of the messages. This must be resolved from the Internet to a valid URL via DNS, and is directed to the chat server via the haproxy.
ACD.Whatsapp.Tyntec.Urlhttps://api.tyntec.com/chat-api/v2/messagesThe URL of the TynTec API for WhatsApp.

Customize TynTec API endpoints

It may be necessary to adjust the API endpoints to which the messages are sent. Currently TynTec does not offer the possibility to do this via a web configuration, this must be done via a REST call. The easiest way to do this is to use Postman.

The following parameters are required, both callback URLs are adjusted according to the end point of the system.

SettingValue
URLhttps://api.tyntec.com/chat-api/v2/applications/default
Request TypePATCH
Authorization

apikey

Value = the generated API Key from Tyntec

Additional Headers

Accept

application/problem+json

Additional Headers

Content-Type

application/json

Body


Translations Ignore


Code Block
{
"webhooks": [
{
"events": [
"MoMessage"
],
"callbackUrl": "https://jtel-portal/incoming"
},
{
"events": [
"MessageStatus::accepted",
"MessageStatus::delivered",
"MessageStatus::seen",
"MessageStatus::failed",
"MessageStatus::channelFailed",
"MessageStatus::deleted",
"WhatsAppGroupEvent::userJoined",
"WhatsAppGroupEvent::userLeft",
"WhatsAppGroupEvent::subjectChanged",
"WhatsAppGroupEvent::descriptionChanged"
],
"callbackUrl": "https://jtel-portal/delivery"
}
]
}



Chat Connector Configuration

The following additional parameters are configured in the Chat Connector:

  • The check mark Whatsapp is set.
  • The TynTec API Key is entered.
  • The incoming service number for WhatsApp is configured and in E.164 and associated with the connector




Sv translation
languagede

Status
colourRed
titleTHIS PAGE IS ONLY AVAILABLE IN ENGLISH

Sv translation
languagefr

Le rôle de CHAT est utilisé pour mener des sessions de chat avec des agents de sites web externes. Le rôle CHAT est également requis pour les intégrations WhatsApp.

Le serveur de chat est une application Java, qui peut être installée en parallèle sur les serveurs web avec une mémoire vive supplémentaire correspondante d'environ 4 Go par serveur.

Alternativement, le serveur de chat peut être installé sur un serveur séparé, ou sur l'équilibreur de charge. 

Les recommandations suivantes sont formulées :

Requirements
Sur un serveur web existant4 Go de RAM supplémentaires
Sur l'équilibreur de charge4 Go de RAM et 2 cœurs de CPU supplémentaires, extension du lecteur système (répertoires personnels) à 32 Go
Sur un serveur séparé8 Go de RAM, 32 Go de disque dur, 2 cœurs de processeur (peut être étendu ultérieurement à 4 cœurs de processeur, en fonction de la charge du système)

Installation

Installation de Java 8

Tout d'abord, Java 8 est installé :

Translations Ignore


Code Block
languagebash
wget https://cdn.jtel.de/downloads/java/jdk-8u202-linux-x64.rpm dnf -y install ./jdk-8u202-linux-x64.rpm rm -f jdk-8u202-linux-x64.rpm


Installation et configuration de ClientMessenger

Installation ClientMessenger

Tout d'abord, le répertoire ClientMessenger est copié dans /home/jtel

Translations Ignore


Code Block
languagebash
cp -R /home/jtel/shared/JTELCarrierPortal/Utils/Install/ClientMessenger/ /home/jtel/ClientMessenger chown -R jtel:jtel /home/jtel/ClientMessenger


Fichier de configuration du  « Hazelcast Cluster »

Le fichier hazelcast.xml est copié dans le répertoire de configuration du serveur de chat. 

Translations Ignore


Code Block
languagebash
rm -f /home/jtel/ClientMessenger/conf/hazelcast.xml cp /home/jtel/shared/hazelcast.xml /home/jtel/ClientMessenger/conf/hazelcast.xml chown jtel:jtel /home/jtel/ClientMessenger/conf/hazelcast.xml


Configuration de la messagerie client

La configuration ou le fichier de démarrage jtel-clientmessenger peut devoir être adapté afin que la connexion à la base de données puisse être établie. Ici <password> doit être remplacé par le mot de passe de l'utilisateur root de la base de données :

Status
colourRed
titleMot de passe de précaution

Translations Ignore


Code Block
# Editez ce fichier: vi /home/jtel/ClientMessenger/systemd/jtel-clientmessenger.service# Vérifiez ce paramètre ...- Dde.jtel.platform.clientmessenger.connection = jdbc: mysql: // acd-dbm / JTELWeb? utilisateur = root & mot de passe = Fe1er3B0rl & characterEncoding = utf8 \ ...


Installer ClientMessenger avec systemd

Translations Ignore


Code Block
languagebash
cp /home/jtel/ClientMessenger/systemd/jtel-clientmessenger.service /etc/systemd/system/jtel-clientmessenger.service systemctl daemon-reload systemctl enable jtel-clientmessenger.service


Créer le script de mise à jour

Un script de mise à jour est créé pour mettre à jour le serveur de chat :

Translations Ignore


Code Block
languagebash
cat <<EOFF>/usr/local/bin/updatesc.sh #!/bin/bash systemctl stop jtel-clientmessenger.service cp /home/jtel/shared/JTELCarrierPortal/Utils/Install/ClientMessenger/bin/* /home/jtel/ClientMessenger/bin chown -R jtel:jtel /home/jtel/ClientMessenger systemctl start jtel-clientmessenger.service EOFF chmod +x /usr/local/bin/updatesc.sh


Configurer le pare-feu

Ensuite, les Ouvrir ports du service de chat doivent être saisis dans le pare-feu et sauvegardés de façon permanente. Vous pouvez distinguer ici si http (speak unsecure websocket) ou https (secure websocket) est utilisé.

Comme l'équilibreur de charge décrypte généralement le https, pour le https, seul le port 3003 doit être ouvert à l'équilibreur de charge.

Configuration http du Pare-feu

Exécutez les commandes suivantes, sur les machines suivantes :

  • Sur le serveur CHAT (ici le port de chat et les ports de Hazelcast Cluster)

Translations Ignore


Code Block
languagebash
firewall-cmd --zone=public --add-port=5701-5801/tcp --permanent firewall-cmd --zone=public --add-port=3000/tcp --permanent firewall-cmd --reload



  • Sur tous les LB - avec connexion http vers l'extérieur

Translations Ignore


Code Block
languagebash
firewall-cmd --zone=public --add-port=3000/tcp --permanent firewall-cmd --reload


Configuration https du Pare-feu

  • Sur tous les LB - avec connexion https vers l'extérieur

Translations Ignore


Code Block
languagebash
firewall-cmd --zone=public --add-port=3003/tcp --permanent firewall-cmd --reload


Configuration de l'équilibreur de charge

réglages du haproxy.cfg

For http

Les ajustements suivants sont effectués sur l'haproxy, en cas de connexion http pour le chat vers l'extérieur :

Translations Ignore


Code Block
languagebash
frontend acdportal_chat_ws mode http bind :3000 timeout client 1d default_backend backend_chat_ws backend backend_chat_ws mode http balance leastconn # roundrobin server chatserver1 <ip_addresse_oder_name>:3000 weight 1 check inter 1m server chatserver2 <ip_addresse_oder_name>:3000 weight 1 check inter 1m


For https

Translations Ignore


Code Block
languagebash
frontend acdportal_chat_wss mode http bind :3003 ssl crt /etc/haproxy/haproxy.pem timeout client 1d default_backend backend_chat_ws backend backend_chat_ws mode http balance leastconn # roundrobin server chatserver1 <ip_addresse_oder_name>:3000 weight 1 check inter 1m server chatserver2 <ip_addresse_oder_name>:3000 weight 1 check inter 1m



Recharger l'haproxie

Ensuite, rechargez l'haproxy avec la commande suivante :

Translations Ignore


Code Block
languagebash
service haproxy reload



Configuration Chat

Paramètres (en tant que sysadmin)

Pour https / wss

ACD.Chat.Script.Library.URL
https://<load-balancer>:3003/gui/
ACD.Chat.Server.Base.URLwss://<load-balancer>:3003

For http / ws

ACD.Chat.Script.Library.URL
https://<load-balancer>:3000/gui/
ACD.Chat.Server.Base.URLws://<load-balancer>:3000

Statut

Un statut d'agent approprié pour le "Chat" - ou un statut existant - doit être configuré de manière à ce que le chat soit distribué à l'agent :

Nombre maximum de chats par agent

Le nombre maximum de chats parallèles par agent doit être configuré. Cette valeur est fixée à 0 par défaut pour tous les agents.

Configurations supplémentaires pour WhatsApp

Pour que What's App fonctionne, d'autres configurations doivent encore être effectuées.

Remarque : la création du compte professionnel WhatsApp ou la connexion au fournisseur (actuellement TynTec) se fait directement avec le fournisseur.

Warning
titlehttps

L'équilibreur de charge doit être utilisé avec https et un certificat valide.

Configuration supplémentaire dans jtel-clientmessenger

Le paramètre DATADIR doit être vérifié. Il doit indiquer soit le/srv/jtel/shared/Data/Clients/ s'il est hébergé directement sur le serveur de chat, ou /home/jtel/shared/Data/clients/ si le serveur a mis en sourdine le répertoire.

Translations Ignore


Code Block
Environment=DATADIR=/home/jtel/shared/Data/clients/


Configurations supplémentaires sur l'équilibreur de charge

Des entrées supplémentaires sont nécessaires dans la zone frontale du portail :

Translations Ignore


Code Block
frontend acdportal_https ... acl whatsapp_req path /incoming acl whatsapp_req path /delivery ... use_backend backend_chat_ws if whatsapp_req


Paramètres supplémentaires

Les paramètres suivants du système doivent être vérifiés dans le portail :

ParamètreValeurCommentaire
ACD.Whatsapp.Server.Base.URL

https://jtel-portal:3003

L'URL utilisée par l'agent client pour permettre à l'agent de répondre aux messages. Ce problème doit être résolu depuis tous les postes de travail de l'agent vers une URL valide via le DNS, et est dirigé vers le serveur de chat via l'haproxy.
ACD.Whatsapp.Whatsapp.Urlhttps://jtel-portal:3003L'URL utilisée par le monde extérieur (utilisateurs de WhatsApp) pour télécharger les pièces jointes des messages. Ce problème doit être résolu depuis Internet vers une URL valide via le DNS, et est dirigé vers le serveur de chat via l'haproxy.
ACD.Whatsapp.Tyntec.Urlhttps://api.tyntec.com/chat-api/v2/messagesL'URL de l'API TynTec pour WhatsApp.

Personnaliser les points d'extrémité de l'API TynTec

Il peut être nécessaire d'ajuster les points terminaux de l'API vers lesquels les messages sont envoyés. Actuellement, TynTec n'offre pas la possibilité de le faire via une configuration web, cela doit être fait via un appel REST. Le moyen le plus simple est de faire appel au facteur.

Les paramètres suivants sont requis, les deux URL de rappel sont ajustés en fonction du point final du système.

ParamètresValeur
URLhttps://api.tyntec.com/chat-api/v2/applications/default
Type de demandePATCH
Autorisation

apikey

Valeur = la clé API générée par Tyntec

Entêtes Supplémentaires

Accepter

application/problem+json

Entêtes Supplémentaires

Content-Type

application/json

Corps


Translations Ignore


Code Block
{ "webhooks": [ { "events": [ "MoMessage" ], "callbackUrl": "https://jtel-portal/incoming" }, { "events": [ "MessageStatus::accepted", "MessageStatus::delivered", "MessageStatus::seen", "MessageStatus::failed", "MessageStatus::channelFailed", "MessageStatus::deleted", "WhatsAppGroupEvent::userJoined", "WhatsAppGroupEvent::userLeft", "WhatsAppGroupEvent::subjectChanged", "WhatsAppGroupEvent::descriptionChanged" ], "callbackUrl": "https://jtel-portal/delivery" } ] }



Configuration du connecteur de chat

Les paramètres supplémentaires suivants sont configurés dans le Chat Connector :

  • La case à cocher "Whatsapp" est activée.
  • La clé API TynTec est saisie.
  • Le numéro de service entrant pour WhatsApp est configuré et en E.164 et associé au connecteur