This code is built to show the ability to migrate Cisco Jabber's persistent chat and rooms to Webex. This is for environment with Persistent Chat Rooms are enabled. It will use read-only access to the External Databases configured for Jabber, read the list of rooms, users, and messages, then posts them to Webex using Webex APIs.
A video showing a sample run of this prototype: https://youtu.be/4xJe8KsRjZs
Clone this Github repository into a local folder:
git clone [add github link here]
Access the folder GVE_DevNet_Jabber_MigrateRooms-ChatToWebex:
cd GVE_DevNet_Jabber_MigrateRooms-ChatToWebex
Make sure you have Python installed. This app was written with Python 3.8, and the libraries in the requirements.txt file are compatible with Python 3.8. To ensure a smooth experience, download a version of Python 3.8.
Load up the required libraries from requirements.txt file:
pip install -r requirements.txt
Configure the configuration variables in config.py
file:
Start with setting up the Persesent Chat DB connection:
# Persistent Chat DB TC_DB_TYPE = "<db_type>" TC_DB_HOST = "<hostname_or_ip_address_here>" TC_DB_NAME = "tcmadb" TC_DB_USER = "<username_here>" TC_DB_PASSWORD = "<password_here>"
Set up the boolean variable INCLUDE_FILE_TRANSFER to choose to include file transfer activity or not, which refers to message attachments.
INCLUDE_FILE_TRANSFER = False
# Managed file transfer DB MFT_DB_TYPE = "<db_type>" MFT_DB_HOST = "<hostname_or_ip_address_here>" MFT_DB_NAME = "mftadb" MFT_DB_USER = "<username_here>" MFT_DB_PASSWORD = "<password_here>"
# File-transfer server details FILE_SERVER_HOST = '<hostname_or_ip_address_here>' FILE_SERVER_USER = '<username_here>' FILE_SERVER_PASSWORD = '<password_here>'
Set up the boolean variable CREATE_WEBEX_ROOMS to choose to migrate the detected Jabber rooms to Webex, or just test the script's ability to read Jabber's chat data.
For best practice, keep this variable as False for the first run, to test the connectivity and make sure the right data is read and stored in the logs correctly.
If set to True, set up the variable WEBEX_AUTH to have Webex Access Token for the archiver user that will be creating the rooms and adding the users & creating the messages found in Jabber:
WEBEX_AUTH = 'Bearer <webex_user_token>'
Also if set to True, set up the boolean variable CHECK_WEBEX_EXISTING_ROOMS to choose if you want to check for existing Webex rooms with the same title as the detected Jabber room's title. Please note that for the existing rooms to be detected, the archiver user (who runs this script) is part of the rooms meant to be checked. If that's the case, you will get the option to migrate the room or skip it:
Also if set to True, and in case Jabber's Chat IM address domain used is different than the user's email domain used in Webex, set up the following two variables accordingly:
# Example: In dCloud environment, Jabber IM uses @dcloud.cisco.com while Webex environment uses @cbXXX.dc-YY.com JABBER_DOMAIN = "" WEBEX_DOMAIN = ""
Set up the boolean variable INCLUDE_JABBER_WEBEX_MAP to choose if you have an Excel file that maps the Jabber IDs of the users to their Webex IDs.
INCLUDE_JABBER_WEBEX_MAP = True
jabber_to_webex.xlsx
in this directory that contains the Jabber IDs and Webex IDs of the users in the following format.jabber_to_webex.xlsx
is provided in this repository for you to fill out as needed.Set up the following two varibales to have the paths to two local folders to store:
LOGS_FOLDER = os.path.dirname(os.path.realpath(__file__)) + '\\Logs\\'
LOCAL_FILE_TRANSFER_FOLDER = os.path.dirname(os.path.realpath(__file__)) + '\\FileTransfer\\'
1- Start with setting up the right variables in config.py
as explained above.
2- Run the main script main.py
:
python main.py
3- The script progress and logs will be printed to the console, alongside a generated timestamped-logs that will be inside the configured LOGS_FOLDER:
[current_time] - Read chat only.log
[current_time] - Migrate chat to Webex.log
[current_time] - Webex json summary.json
4- [Optional] If the data generated to Webex was somehow unacceptable or unexpected, the script rollback_webex_rooms.py
can be run that will rollback the created Webex rooms and users. As follows:
Webex json summary.json
that was generated by the last step:5- [Optional] If the data generated to Webex was acceptable and the archiver user (who migrated the rooms to Webex) needs to leave the generated rooms, the script leave_webex_rooms.py
can be run for the archiver user to leave the generated rooms.
A sample of a migrated message from Jabber to Webex that was formatted with Markdown:
Provided under Cisco Sample Code License, for details see LICENSE
Our code of conduct is available here
See our contributing guidelines here
Please note: This script is meant for demo purposes only. All tools/ scripts in this repo are released for use "AS IS" without any warranties of any kind, including, but not limited to their installation, use, or performance. Any use of these scripts and tools is at your own risk. There is no guarantee that they have been through thorough testing in a comparable environment and we are not responsible for any damage or data loss incurred with their use.
You are responsible for reviewing and testing any scripts you run thoroughly before use in any non-testing environment.
Owner
Contributors
Categories
Products
WebexCisco Unified Communications Manager (CUCM)Programming Languages
PythonLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community