Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
How can you send/receive Telegram Messages from XCALLY?

ON THIS PAGE

Table of Contents

How to manage Telegram Messages from XCALLY

RIVEDERE SOTTO

Risultati immagini per telegramImage Modified XCALLY Motion Open Channel offers the integration of Telegram messenger as a New Channel, allowing:

  • the Customers to interact with your Agents sending direct messages to your Telegram Official Account;

  • your Agents to receive the incoming messages on a special Telegram Queue and to reply from the XCALLY Motion standard GUI;

Image Removed Panel
titleOn this page:
Table of ContentsmaxLevel1
Image Added
  • the Customers to receive the messages back on Telegram messenger.

Info
titleCompatibility

The minimum required version of XCALLY Motion is 2.0.81

Info

The integration allows you to exchange text or attachments. To send both text and attachments, you must send more messages

Telegram Account Configuration

Follow these steps to create a Telegram service (bot) and enable its integration with XCALLY Motion:

Image Added

  • Type /newbot to create a new bot

  • Choose a name for your bot

  • Choose a username for your bot. It must end in bot.

  • Save the token to access the HTTP API. We will need it to setup the Telegram plugin.

Image Added

Now your Telegram service is completed!


XCALLY Configuration

In this section you’ll see how to install and configure the XCALLY Motion Telegram Plugin interface, in order to let your Agents interact with Telegram users.

Setup Open Channel Account

Below you can find the steps to create an Open Channel Account and an Open Channel Queue:

Info
titleOpen Channel
For more info please refer to the Configure a new OpenChannel account section of this documentation.


  • Create a new Open Channel Account in your XCALLY Motion in the Open Channel Section:

Image Removed
Image Added

Image Removed


Image Added


Info

The default Reply URL is http://localhost:3011/sendMessage and you usually don't need to change it. 

But if the 3011 port is already in use (or you want to change it for any other reason), you can modify its value

here and

here and also in the configuration file:

just before

just before installing the plugin, unzip the files and change the property of the Port variable in the following file:

 server

 server/config/config.json.

Code Block
languagejs
{
	"token" : "{TOKEN}",
	"webhook": "https://{HOSTNAME}/api/plugins/webhook?port=3011&encoding=binary&path=/api/messages",
	"openChannel": {
		"id": "",
		"receiveUrl": "",
		"mapKey": ""
	},
	"authentication": {
		"username": "",
		"password": ""
	},
	"port": "3011"
}

At the end of these changes, zip all the folder files and upload the plugin you modified.


  • Complete the Open Channel account configuration (Disposition, Action, etc)


Warning

Don't forget to select telegram (or any other custom field of the Customer profile) as mapKey and add the proper Agents to the account used for Telegram interactions.



Open Channel Queue

  • Create a new Open Channel 

Queue and then
  • Queue. LINK

  • Add Agents

to it as well.

Setup Telegram Account

Below you can find the steps to create a Telegram service (bot) and enable its integration with XCALLY Motion:

  • To create a Telegram bot using BotFather
    • Open Telegram
    • Search @BotFather
    • Type /newbot
    • Choose a name for your bot
    • Choose a username for your bot. It must end in 'bot'
    • Save the token to access the HTTP API. We will need it to setup the telegram plugin.

Image RemovedImage RemovedImage Removed

Info

Keep the Token provided by BotFather safe, it will be used later to setup the Telegram Plugin!

Now your Telegram Service is completed!

Image Removed

The next steps will be about how to install and configure the XCALLY Motion Telegram Plugin interface, in order to let your Agents interact with Telegram users.

Installing
  • or Teams to the queue. LINK


Upload the Plugin to XCALLY Motion

  • Download the Telegram Plugin zip file that you can find in the App Zone Page.

  • Login as admin in XCALLY Motion, upload the Telegram Plugin and Install it:

Image Removed
Image Added


  • After the upload, you will find it in the list of the uploaded App Zone Plugins. :

Image Removed
Image Added


  • Edit this plugin clicking on the three dots

Image Removed
  • Image Added

    :  

Image Removed
Image Added

and select in the Sidebar field how/to whom this integration must be shown in the menu (default value: Admin Only):

Image Removed
Image Added


  • Finally, install the Plugin:

click on Image Modified and then you find the proper command:

Image Removed
Image Added

and at the end the plugin will become Active Image Modified


Setup Telegram Plugin

  • Configure the Plugin for Telegram by selecting Telegram integration from the list of Plugins:

Image Removed


Image Added


  • Insert BOT Token (the one you obtained in previous steps)

  • Select your Open Channel account from the list (as created in the previous step)

  • Insert the admin username and password 

  • Update the Webhook inserting your server name

Image Removed
Image Added


Info

The webhook URL should follow the format: https://{HOSTNAME}/api/plugins/webhook?port={PORT}&path=/api/messages&token={TOKEN}

  • where {HOSTNAME} is usually your XCALLY hostname or IP address, or the hostname of another server in case you would like to host your integration/application separately.

  • {PORT} is usually 3011, or the specific port you have defined in your Telegram Plugin settings inside XCALLY Motion.

  • {TOKEN} is the Open Channel Account token


Info

Remember to modify the admin password you inserted here anytime you change it!


Info

Pay attention to the Port value: each Port can be associated only to one service. Check if the chosen value has already been assigned to another service.

  • After saving the changes, remember to Restart the Plugin: click on 

Image Removed
  • Image Added

     and you'll find the proper command

Image Removed
Image Added


Now you can test the communication between the Telegram users (who will write messages to the Telegram Bot you created) and your Agents (who will interact from the XCALLY Omnidesktop Interface)!


Additional Information

Configuring your firewall

If your XCALLY service is hosted behind a firewall then please make sure that the HTTPS port is able to accept incoming requests from Telegram webhook server.

A few suggestions in this regard:

  • Try to find the IP address for Telegram server, that is sending webhook requests to XCALLY, using your preferable network analysis tool.

  • Add the rule to allow incoming traffic from Telegram IP address, on Port 443, in your firewall policy.

-- OR --

Modify the file /etc/sysconfig/iptables and add the following line:

-A INPUT -s 0.0.0.0/0 -p tcp --dport 443 -j ACCEPT

Disclaimer: This method will open port 443 of your XCALLY server for all IP addresses.

-- OR --

Accordingly to the following link https://core.telegram.org/bots/webhooks you can open just the following TCP ports from the specified networks:

149.154.160.0/20

and

91.108.4.0/22

on port 443, 80, 88, or 8443.

Debugging/Troubleshooting

All of the log files for Telegram Messenger plugin events are available at /var/log/xcally/ directory under openchannel-line- naming convention.

Telegram Interaction

scrivere dove visualizzare interazioni e stamp

Info

The integration allows you to exchange text or attachments. To send both text and attachments, you must send more messages