Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

The CHAT role is used for conducting chat sessions with agents from external websites. 

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

Die Rolle CHAT wird für das Durchführen von Chat-Sessions, ausgehend von externe Webseiten, mit den Agenten verwendet. 

...

.

Java 8 Installation

In

...

this step Java 8 is installed on the server

Translations Ignore


Code Block
languagebash
titleInstallation java 8
cd
yum -y install https://cdn.jtel.de/downloads/java/jdk-8u202-linux-x64.rpm



Installing and Configuring ClientMessenger

ClientMessenger Installation

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

The configuration of the Hazelcast cluster must be checked. For new installations of Release 3.11 as of April 1, 2018, the entries in hazelcast.xml are available, but not before. 

  • On the one hand, the chat server is accepted as a member of the cluster. 
  • On the other hand the CHAT buffers and counters are added to the configuration - if not available.

The necessary configuration sections in hazelcast.xml are listed here

Translations Ignore


Code Block
languagebash
titlehazelcast.xml
	...
 
	<tcp-ip enabled="true">
 		...
		<member>CHATSERVER</member>
	</tcp-ip>

	...

	<ringbuffer name="CHAT">
		<in-memory-format>BINARY</in-memory-format>
		<backup-count>1</backup-count>
		<async-backup-count>0</async-backup-count>
		<time-to-live-seconds>60</time-to-live-seconds>
		<capacity>500</capacity>
	</ringbuffer>
	
	<map name="CHATCOUNTERS">
        <backup-count>0</backup-count>
        <async-backup-count>1</async-backup-count>
        <time-to-live-seconds>600</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
        <max-size policy="PER_NODE">5000</max-size>
	</map>



View all computers in the Hazelcast cluster:

  • Role DATA, DB master
    • update hazelcast.xml 
    • execute updatepl.sh
  • Role TEL
    • update hazelcast.xml
    • restart PlatformUDPListener
  • Role WEB
    • update hazelcast.xml
    • execute updatejb.sh

  • Role CHAT (the system that is being installed!)
    • its best to copy hazelcast.xml 

Install ClientMessenger as a daemon process

If the repositories are located on a Windows machine (this can only affect old installations), the start script /etc/init.d/jtel-clientmessenger must be repaired before, so that CR+LF becomes only LF.

Translations Ignore


Code Block
languagebash
sed -i -e 's/\r//g' /home/jtel/ClientMessenger/init.d/jtel-clientmessenger



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:

Translations Ignore


Code Block
titlevi /home/jtel/ClientMessenger/init.d/jtel-clientmessenger
...
                        -Dde.jtel.platform.clientmessenger.connection=jdbc:mysql://acd-dbm/JTELWeb?user=root\&password=<password>\&characterEncoding=utf8 \
...

# For jtel portal version >= 3.25
-Dde.jtel.platform.clientmessenger.connection=jdbc:mysql://acd-dbm/JTELWeb?user=root\&password=<password>\&characterEncoding=utf8\&serverTimezone=Europe/Berlin \



Then, the process is installed as a Linux daemon:

Translations Ignore


Code Block
languagebash
cd /home/jtel/
cp /home/jtel/ClientMessenger/init.d/jtel-clientmessenger /etc/init.d/
chmod 755 /etc/init.d/jtel-clientmessenger
chkconfig jtel-clientmessenger on
service jtel-clientmessenger start



Create 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
service jtel-clientmessenger stop
cp /home/jtel/shared/JTELCarrierPortal/Utils/Install/ClientMessenger/bin/* /home/jtel/ClientMessenger/bin
cp /home/jtel/shared/JTELCarrierPortal/Utils/Install/ClientMessenger/public /home/jtel/ClientMessenger/ -r
 chown -R jtel:jtel /home/jtel/ClientMessenger
service jtel-clientmessenger start
EOFF
chmod +x /usr/local/bin/updatesc.sh



Firewall configuration

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
titleconfigure firewall - http
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
titleconfigure firewall - http
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
titleconfigure firewall - https
firewall-cmd --zone=public --add-port=3003/tcp --permanent
firewall-cmd --reload



Firewall Centos 6

Translations Ignore


Code Block
languagebash
titleconfigure firewall - https
service iptables status
iptables -I INPUT 4 -p tcp -m tcp --dport 5701:5801 -j ACCEPT
iptables -I INPUT 4 -p tcp -m tcp --dport 3000:3003 -j ACCEPT
service iptables save
service iptables restart



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
titlehaproxy.cfg - http / ws
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
titlehaproxy.cfg - https / wss
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
titlereload haproxy
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:

Image Added

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.

Image Added

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 mooted the directory.

Translations Ignore


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



Additional configurations 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

{
"webhooks": [
{
"events": [
"MoMessage"
],
"callbackUrl": "https://jtel-portal/incoming"
},
{
"events": [
"MessageStatus::accepted",
"MessageStatus::delivered",
"MessageStatus::seen",
"MessageStatus::failed",
"MessageStatus::channelFailed",
"MessageStatus::deleted",
],
"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 phone number is entered in E.164 format.
  • The language used for automatic Whatsapp responses 

Image Added




Sv translation
languagede

Die Rolle CHAT wird für das Durchführen von Chat-Sessions, ausgehend von externe Webseiten, mit den Agenten verwendet. 

Der Chat-Server ist eine Java Anwendung, was parallel auf den Webservern - bei entsprechende RAM Erweiterung um ca. 4 GB pro Server - mit installiert werden kann, oder auf einem separaten Server installiert wird.

Java 8 Installation

In diesem Schritt wird Java 8 auf dem Server installiert. 

Translations Ignore


Code Block
languagebash
titleInstallation java 8
yum -y install https://cdn.jtel.de/downloads/java/jdk-8u202-linux-x64.rpm
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz tar -xvzf jdk-8u131-linux-x64.tar.gz rm -f jdk-8u131-linux-x64.tar.gz chown -R root:root jdk1.8.0_131/ chmod 755 -R jdk1.8.0_131/



ClientMessenger Installieren und Konfigurieren

ClientMessenger Installation

Das Verzeichnis ClientMessenger wird nach /home/jtel kopiert. 

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 Konfiguration

Die Konfiguration des Hazelcast-Clusters muss geprüft werden. Bei Neuinstallationen von Release 3.11 ab 01.04.2018 sind die Einträge in hazelcast.xml vorhanden, davor hingegen nicht. 

  • Zum einen, wird der Chat-Server als Member im Cluster aufgenommen. 
  • Zum anderen werden die CHAT Buffer und Counter der Konfiguration - falls nicht vorhanden - hinzugefügt.

Die notwendigen Konfigurationsabschnitte in hazelcast.xml sind hier aufgeführt:

Translations Ignore


Code Block
languagebash
titlehazelcast.xml
	...
 
	<tcp-ip enabled="true">
 
		...

		<member>CHATSERVER</member>
 
	</tcp-ip>

	...

	<ringbuffer name="CHAT">
		<in-memory-format>BINARY</in-memory-format>
		<backup-count>1</backup-count>
		<async-backup-count>0</async-backup-count>
		<time-to-live-seconds>60</time-to-live-seconds>
		<capacity>500</capacity>
	</ringbuffer>
	
	<map name="CHATCOUNTERS">
        <backup-count>0</backup-count>
        <async-backup-count>1</async-backup-count>
        <time-to-live-seconds>600</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
        <max-size policy="PER_NODE">5000</max-size>
	</map>



Sämtliche Rechner im Hazelcast-Cluster betrachten:

  • Rolle DATA, DB-Master
    • hazelcast.xml updaten
    • updatepl.sh ausführen
  • Rolle TEL
    • hazelcast.xml updaten
    • PlatformUDPListener neu starten
  • Rolle WEB
    • hazelcast.xml updaten
    • updatejb.sh ausführen

  • Rolle CHAT (das System, was gerade installiert wird!)
    • hazelcast.xml am besten kopieren

ClientMessenger als Daemon Prozess installieren

Falls die Repositories auf einer Windows Maschine liegen (dies kann nur alte Installationen betreffen), muss der Start-Skript /etc/init.d/jtel-clientmessenger vorher repariert werden, damit aus CR+LF nur LF wird.

Translations Ignore


Code Block
languagebash
sed -i -e 's/\r//g' /home/jtel/ClientMessenger/init.d/jtel-clientmessenger



Die Konfiguration, bzw. die Startdatei jtel-clientmessenger muss ggf. angepasst werden, damit die Datenbank-Verbindung aufgebaut werden kann. Hierbei muss <password> mit den Passwort für den root User der Datenbank ersetzt werden:

Translations Ignore


Code Block
titlevi /home/jtel/ClientMessenger/init.d/jtel-clientmessenger
...
                        -Dde.jtel.platform.clientmessenger.connection=jdbc:mysql://acd-dbm/JTELWeb?user=root\&password=<password>\&characterEncoding=utf8 \
...

# Für jtel portal version >= 3.25
-Dde.jtel.platform.clientmessenger.connection=jdbc:mysql://acd-dbm/JTELWeb?user=root\&password=<password>\&characterEncoding=utf8\&serverTimezone=Europe/Berlin \



Anschließend, wird der Prozess als Linux Daemon installiert:

Translations Ignore


Code Block
languagebash
cd /home/jtel/
cp /home/jtel/ClientMessenger/init.d/jtel-clientmessenger /etc/init.d/
chmod 755 /etc/init.d/jtel-clientmessenger
chkconfig jtel-clientmessenger on
service jtel-clientmessenger start


Update Skript anlegen

Für das Updaten des Chat-Servers wird ein Update-Skript angelegt:

Translations Ignore


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


Firewall Konfiguration

Als nächstes müssen in der Firewall die Port-Freigaben für den Chat Dienst eingetragen und persistent gespeichert werden. Hierbei kann unterschieden werden, ob http (sprich unsecure websocket) oder https (secure websocket) genutzt wird.

Da der Load-Balancer den https üblicherweise entschlüsselt, muss bei https nur der Port 3003 auf den Load-Balancer geöffnet werden.

Firewall Konfiguration http

Folgende Befehle, auf folgende Maschinen ausführen:

  • Auf CHAT Server (hier der Chat-Port sowie die Hazelcast Cluster Ports)
Translations Ignore


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



  • Auf alle LB - bei http Verbindung nach Aussen

Translations Ignore


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



Firewall Konfiguration https

  • Auf alle LB - bei https Verbindung nach Aussen

Translations Ignore


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



Firewall Centos 6

Translations Ignore


Code Block
languagebash
titleconfigure firewall - https
service iptables status
iptables -I INPUT 4 -p tcp -m tcp --dport 5701:5801 -j ACCEPT
iptables -I INPUT 4 -p tcp -m tcp --dport 3000:3003 -j ACCEPT
service iptables save
service iptables restart


Load Balancer Konfiguration

haproxy.cfg Anpassungen

Für http

Folgende Anpassungen werden am haproxy vorgenommen, bei einer http Verbindung für den Chat nach Aussen:

Translations Ignore


Code Block
languagebash
titlehaproxy.cfg - http / ws
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



Für https

Translations Ignore


Code Block
languagebash
titlehaproxy.cfg - https / wss
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


Haproxy neu laden

Anschließend, den haproxy neu laden mit folgenden Befehl:

Translations Ignore


Code Block
languagebash
titlereload haproxy
service haproxy reload


Chat Konfiguration

Parameter (als sysadmin)

Für https / wss

ACD.Chat.Script.Library.URL

https://<load-balancer>:3003/gui/

ACD.Chat.Server.Base.URLwss://<load-balancer>:3003

Für http / ws

ACD.Chat.Script.Library.URL

https://<load-balancer>:3000/gui/

ACD.Chat.Server.Base.URLws://<load-balancer>:3000

Status

Ein entsprechender Agentenstatus für "Chat" - oder einen vorhandenen Status - muss konfiguriert werden, sodass der Chat an den Agenten verteilt wird:

Image Added

Max Chats pro Agent

Die maximale Anzahl an parallele Chats pro Agent muss konfiguriert werden. Dieser Wert ist standardmäßig bei allen Agenten auf 0 eingestellt.

Image Added

Zusätzliche Konfigurationen für WhatsApp

Damt What's App funktioniert, müssen weitere Konfigurationen noch getätigt werden.

Hinweis: das Einrichten vom WhatsApp Business-Konto bzw. die Anbindung an den Provider (derzeit TynTec) erfolgt direkt mit dem Provider.

Warning
titlehttps

Der Load-Balancer muss mit https und ein gültiges Zertifikat betrieben werden.

Zusätzliche Konfiguration im jtel-clientmessenger

Der Parameter DATADIR muss geprüft werden. Dies muss entweder auf das /srv/jtel/shared/Data/Clients/ Verzeichnis zeigen, falls dieser am Chat-Server direkt gehostet ist, oder /home/jtel/shared/Data/clients/, falls der Server das Verzeichnis gemoutet hat.

Translations Ignore


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



Zusätzliche Konfigurationen am Load-Balancer

Im Bereich frontend für das Portal sind zusätzliche Einträge nötig:

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


Zusätzliche Parameter

Folgende System-Parameter müssen im Portal geprüft werden:

ParameterWertKommentar
ACD.Whatsapp.Server.Base.URL

https://jtel-portal:3003

Die URL, die vom Agenten-Client genutzt wird, damit der Agent auf Nachrichten antworten kann. Dies muss von allen Agenten-Arbeitsplätze aus gesehen auf eine gültige URL per DNS aufgelöst werden, und wird über den haproxy auf den Chatserver gerichtet.
ACD.Whatsapp.Whatsapp.Urlhttps://jtel-portal:3003Die URL, die von der Aussenwelt (WhatsApp Nutzer) genutzt wird, damit die Anhänge der Nachrichten heruntergeladen werden können. Dies muss vom Internet aus gesehen auf eine gültige URL per DNS aufgelöst werden, und wird über den haproxy auf den Chatserver gerichtet.
ACD.Whatsapp.Tyntec.Urlhttps://api.tyntec.com/chat-api/v2/messagesDie URL des TynTec APIs für WhatsApp.

TynTec API Endpunkte anpassen

Es kann notwendig sein, die API Endpunkte anzupassen, auf den die Nachrichten gesendet werden. Derzeit bietet TynTec keine Möglichkeit dies über eine Web-Konfiguration durchzuführen, dies muss über ein REST Aufruf geschehen. Dies kann am einfachsten mit Postman erfolgen.

Folgende Parameter werden benötigt, hierbei werden beide Callback-URL entsprechend des Endpunktes des Systems angepasst.

EinstellungWert
URLhttps://api.tyntec.com/chat-api/v2/applications/default
Request TypPATCH
Authorization

apikey

Wert = den generierten API Key von Tyntec

Zusätzliche Header

Accept

application/problem+json

Zusätzliche Header

Content-Type

application/json

Body


Translations Ignore

{
"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 Konfiguration

Folgende zusätzliche Parameter werden beim Chat-Connector konfiguriert:

  • Der Haken Whatsapp wird gesetzt.
  • Der TynTec API Key wird eingetragen.
  • Die Rufnummer wird in E.164 Format eingetragen.
  • Die Sprache für automatische WhatsApp-Antworten

Image Added



Sv translation
languagefr

Le rôle de CHAT est utilisé pour mener des sessions de chat avec des agents de sites web externes. 

Le serveur de chat est une application Java, qui peut être installée en parallèle sur les serveurs web - avec une extension de RAM correspondante d'environ 4 Go par serveur - ou installée sur un serveur séparé.

Installation de Java 8

Dans cette étape, Java 8 est installé sur le serveur. 

Translations Ignore


Code Block
languagebash
titleInstallation java 8
yum -y install https://cdn.jtel.de/downloads/java/jdk-8u202-linux-x64.rpm



Installation et configuration de ClientMessenger

Installation ClientMessenger

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



Hazelcast Configuration des clusters

La configuration du cluster Hazelcast doit être vérifiée. Pour les nouvelles installations de la version 3.11 à partir du 1er avril 2018, les entrées dans hazelcast.xml sont disponibles, mais pas avant. 

  • D'une part, le serveur de chat est accepté comme membre du cluster. 
  • D'autre part, les tampons et les compteurs de CHAT sont ajoutés à la configuration - s'ils ne sont pas disponibles.

Les sections de configuration nécessaires dans hazelcast.xml sont énumérées ici

Translations Ignore


Code Block
languagebash
titlehazelcast.xml
	...   <tcp-ip enabled="true">   ... <member>CHATSERVER</member> </tcp-ip> ... <ringbuffer name="CHAT"> <in-memory-format>BINARY</in-memory-format> <backup-count>1</backup-count> <async-backup-count>0</async-backup-count> <time-to-live-seconds>60</time-to-live-seconds> <capacity>500</capacity> </ringbuffer> <map name="CHATCOUNTERS"> <backup-count>0</backup-count> <async-backup-count>1</async-backup-count> <time-to-live-seconds>600</time-to-live-seconds> <eviction-policy>LRU</eviction-policy> <max-size policy="PER_NODE">5000</max-size> </map>



Voir tous les ordinateurs du claster Hazelcast :

  • Rôle DONNÉES, DB maître
    • mise à jour hazelcast.xml 
    • éxécuter updatepl.sh
  • Rôle TEL
    • mise à jour hazelcast.xml
    • redémarrer PlatformUDPListener
  • Rôle WEB
    • mise à jour hazelcast.xml
    • éxécuter updatejb.sh

  • Rôle CHAT (le système qui est en cours d'installation !)
    • il est préférable de copier hazelcast.xml 

Installer ClientMessenger comme un processus de démon

Si les dépôts sont situés sur une machine Windows (cela ne peut concerner que les anciennes installations), le script de démarrage /etc/init.d/jtel-clientmessenger doit être réparé avant, de sorte que CR+LF devient seulement LF.

Translations Ignore


Code Block
languagebash
sed -i -e 's/\r//g' /home/jtel/ClientMessenger/init.d/jtel-clientmessenger



Il se peut que la configuration ou le fichier de démarrage jtel-clientmessenger doive être adapté pour 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 :

Translations Ignore


Code Block
titlevi /home/jtel/ClientMessenger/init.d/jtel-clientmessenger
... -Dde.jtel.platform.clientmessenger.connection=jdbc:mysql://acd-dbm/JTELWeb?user=root\&password=<password>\&characterEncoding=utf8 \ ... # For jtel portal version >= 3.25 -Dde.jtel.platform.clientmessenger.connection=jdbc:mysql://acd-dbm/JTELWeb?user=root\&password=<password>\&characterEncoding=utf8\&serverTimezone=Europe/Berlin \



Ensuite, le processus est installé comme un démon Linux :

Translations Ignore


Code Block
languagebash
cd /home/jtel/ cp /home/jtel/ClientMessenger/init.d/jtel-clientmessenger /etc/init.d/ chmod 755 /etc/init.d/jtel-clientmessenger chkconfig jtel-clientmessenger on service jtel-clientmessenger start



Créer un 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 
service jtel-clientmessenger stop 
cp /home/jtel/shared/JTELCarrierPortal/Utils/Install/ClientMessenger/bin/* /home/jtel/ClientMessenger/bin
cp /home/jtel/shared/JTELCarrierPortal/Utils/Install/ClientMessenger/public /home/jtel/ClientMessenger/ -r 
chown -R jtel:jtel /home/jtel/ClientMessenger 
service jtel-clientmessenger start 
EOFF 
chmod +x /usr/local/bin/updatesc.sh



Configuration du pare-feu

Ensuite, les ports open pour le service de chat doivent être saisis dans le pare-feu et enregistrés de manière persistante. Ici, vous pouvez distinguer 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 cluster Hazelcast)

Translations Ignore


Code Block
languagebash
titleconfigure firewall - http
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
titleconfigure firewall - http
firewall-cmd --zone=public --add-port=3000/tcp --permanent firewall-cmd --reload



Firewall configuration https

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

Translations Ignore


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



Firewall Centos 6

Translations Ignore


Code Block
languagebash
titleconfigure firewall - https
service iptables status iptables -I INPUT 4 -p tcp -m tcp --dport 5701:5801 -j ACCEPT iptables -I INPUT 4 -p tcp -m tcp --dport 3000:3003 -j ACCEPT service iptables save service iptables restart 



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
titlehaproxy.cfg - http / ws
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 http

Translations Ignore


Code Block
languagebash
titlehaproxy.cfg - https / wss
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
titlereload haproxy
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

Pour https / 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 :

Image Added

Nombre maximum de chats par agent

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

Image Added

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é. Celui-ci doit pointer soit vers le répertoire /srv/jtel/shared/Data/Clients/ s'il est hébergé directement sur le serveur de chat, soit vers /home/jtel/shared/Data/clients/ si le serveur a mooté le répertoire.

Translations Ignore


Code Block
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. Celle-ci doit être résolue à partir de tous les postes de travail des agents en une URL valide via DNS, et est dirigée vers le serveur de chat via le 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. Celle-ci doit être résolue depuis l'Internet en une URL valide via le DNS, et est dirigée vers le serveur de chat via le 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

Type de contenu

application/json

Corps


Translations Ignore

{
"webhooks": [
{
"events": [
"MoMessage"
],
"callbackUrl": "https://jtel-portal/incoming"
},
{
"events": [
"MessageStatus::accepted",
"MessageStatus::delivered",
"MessageStatus::seen",
"MessageStatus::failed",
"MessageStatus::channelFailed",
"MessageStatus::deleted",
],
"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 téléphone est saisi au format E.164.
  • La langue utilisée pour les réponses automatiques Whatsapp 

Image Added