Lab 2

Description Hostname IP RDP SSH - - - -
AD lab2-ad-01.lab2.purplepi.ie 192.168.1.231 RDP Cert Admin SplashPage
Finesse ucce-finesse-a.lab2.purplepi.ie 192.168.1.237 n/a ssh Agent Login| [[https://ucce-finesse-a.lab2.purplepi.ie/cfadmin|Admin Logs OS Platform API Docs
UCCE AW-HDS-DDS ucce-hds-a.lab2.purplepi.ie 192.168.1.234 RDP n/a CCE Portico Admin
UCCE-CUIC-A ucce-cuic-a.lab2.purplepi.ie 192.168.1.238 n/a SSH http://ucce-cuic-a.lab2.purplepi.ie OAMP IDS Admin
CVP ucce-cvp-1a.lab2.purplepi.ie 192.168.1.235 RDP CVP WSM API CVP Diagnostics OAMP
CUCM uc-cucm12-a.lab2.purplepi.ie 192.168.1.236 n/a SSH Web Admin
VVB UCCE-VVB-A.lab2.purplepi.ie 192.168.1.239 n/a SSH Web Admin
ASR nuance-asr.lab2.purplepi.ie 192.168.1.244 n/a RDP
ECE ucce-ece-db-12.lab2.purplepi.ie 192.168.1.245 RDP Gadget CHAT URL ECE System ECE Default Agent Desktop - Non Finesse
Attendant Console w2012r2-01.lab2.purplepi.ie 192.168.1.222 Web Admin
Redbox 1 redbox1.lab2.purplepi.ie 192.168.1.213 RDP Web Admin
UCCX https://uc-uccx-a.lab2.purplepi.ie/ SSH UCCX UCCX Web Admin
Description Hostname IP RDP SSH - - - -
Finesse ucce-finesse-beta.lab2.purplepi.ie 192.168.1.137 n/a ssh Agent Login Admin Logs OS Platform
UCCE AW-HDS-DDS ucce-hds-beta.lab2.purplepi.ie 192.168.1.134 RDP n/a CCE Portico Admin
UCCE-CUIC-A ucce-cuic-beta.lab2.purplepi.ie 192.168.1.138 n/a SSH http://ucce-cuic-beta.lab2.purplepi.ie OAMP IDS Admin
CVP ucce-cvp-1a.lab2.purplepi.ie 192.168.1.135 RDP n/a CVP Diagnostics OAMP
VVB UCCE-VVB-A.lab2.purplepi.ie 192.168.1.139 n/a SSH Web Admin
ECE ucce-ece-beta.lab2.purplepi.ie 192.168.1.145 RDP Gadget CHAT URL ECE System ECE Default Agent Desktop - Non Finesse
<script language=javascript>
var egainChat  = egainChat  || {};
    /*eGain Chat server */
    egainChat.serverURL = "http://ucce-ece-db-12.lab2.purplepi.ie/system";
    /*eGain Chat Entry Point*/
    egainChat.EntryPointId  = "1001";
    /*eGain Chat Locale*/
    egainChat.Locale  = "en-US";
    /*eGain template name*/
    egainChat.Template = "aqua";
    /*Set to true to enable posting attributes to templates*/
    egainChat.PostChatAttributes = false;
    egainChat.CustomerContextParameters = {};
    egainChat.openHelp = function () {
    var domainRegex = /^((?:https?:\/\/)?(?:www\.)?([^\/]+))/i;
    try {
    	if (egainChat.eglvchathandle != null && egainChat.eglvchathandle.closed == false) {
    		egainChat.eglvchathandle.focus();
    		return;
    	}
    }
    catch (err) {
    }
    var refererName = "";
    refererName = encodeURIComponent(refererName);
    var refererurl = encodeURIComponent(document.location.href);
    var hashIndex = refererurl.lastIndexOf('#');
    if (hashIndex != -1) {
    	refererurl = refererurl.substring(0, hashIndex);
    }
    var eglvcaseid = (/eglvcaseid=[0-9]*/gi).exec(window.location.search);
    var vhtIds = '';
    if (typeof EGAINCLOUD != 'undefined' && EGAINCLOUD.Account.getAllIds)
    {
    	var ids = EGAINCLOUD.Account.getAllIds();
    	vhtIds = '&aId=' + ids.a + '&sId=' + ids.s + '&uId=' + ids.u;
    }
    var EG_CALL_Q = window.EG_CALL_Q || [];
    EG_CALL_Q.push(['enableTracker', true]);
    var eGainChatUrl = egainChat.serverURL + '/templates/chat/' + egainChat.Template + '/index.html?subActivity=Chat&entryPointId=' + egainChat.EntryPointId;
    
    eGainChatUrl += '' + '&templateName=' + egainChat.Template + '&locale=' + egainChat.Locale + '&ver=v11';
    eGainChatUrl += '&postChatAttributes=' + egainChat.PostChatAttributes + '&eglvrefname=' + refererName + '&' + eglvcaseid + vhtIds;
    
    var domain = domainRegex.exec(eGainChatUrl)[0];
    
    if ((eGainChatUrl + refererurl).length <= 2000)
    	eGainChatUrl += '&referer=' + refererurl;
    var params = 'height=650,width=450,resizable=yes,scrollbars=yes,toolbar=no';
    
	    window.addEventListener('message', function (event) {
	    try{
	    var message = JSON.parse(event.data);
	    if (event.origin === domain && message.Caller.indexOf('EGLV_DOCK') !== -1) {
	       if (message.Key === 'X-egain-session') {
	           var response = {
         		value: window.sessionStorage.getItem('X-egain-session'),
         		caller: message.Caller 
	             };
	           event.source.postMessage(JSON.stringify(response), event.origin);
	           }
	         }
	        }catch(e){}
	      });
    if (egainChat.PostChatAttributes) {
	if(window.navigator.userAgent.indexOf("Trident") != -1 || window.navigator.userAgent.indexOf("Edge") != -1){
	var win = document.getElementById('egainChatDomainFrame');
	win.contentWindow.postMessage(JSON.stringify(egainChat.CustomerContextParameters), domain);
	}else{ 
    	window.addEventListener('message', function (event) {
    		try{
    			var message = JSON.parse(event.data);
    			if (event.origin === domain && message.Caller.indexOf('EGLV_DOCK') !== -1) {
    				if (message.Key === 'EgainChatParameter') {
    
    					var response = {
    						value: egainChat.CustomerContextParameters,
    						caller: message.Caller
    					};
    					event.source.postMessage(JSON.stringify(response), event.origin);
    				}
    			}
    		}catch(e){
    		}	
    	});
       }
    }
    egainChat.eglvchathandle = window.open(eGainChatUrl, '', params);
    };
    /*To be called by client website. All the parameters specified in application-chat-defaults must be set here.*/
    egainChat.SetCustomerParameters = function (egainAttributeName, attributeValue) {
        egainChat.CustomerContextParameters[egainAttributeName] = attributeValue;
    };
egainChat.writeIframeIfRequired = function() {
if(egainChat.PostChatAttributes  &&  (window.navigator.userAgent.indexOf("Trident") != -1 || window.navigator.userAgent.indexOf("Edge") != -1) ) {
  var iframe = document.createElement('iframe');
  iframe.src=egainChat.serverURL+'/web/view/live/customer/storeparams.html?wsname='+window.location.protocol+'//'+window.location.host;
  iframe.style.display = 'none';
  iframe.name = 'egainChatDomainFrame';
  iframe.id = 'egainChatDomainFrame';
	if (typeof document.body !== 'undefined' && document.body !== null){
		document.body.appendChild(iframe);
	}else{
		setTimeout(egainChat.writeIframeIfRequired, 100);
	}
  }
}
egainChat.writeIframeIfRequired();
</script>
<a href="#" onClick="egainChat.openHelp()" style=cursor:hand>Test text chat</a>

The following line must be added to the HTML of all pages on which you want docked chat to function:

<script type="text/javascript" src="http://WebServerName/system/templates/chat/egain-chat.js"></script>

<sortable>

Description Hostname IP RDP SSH - - - -
UCCX uc-uccx-a.lab2.purplepi.ie 192.168.1.247 ssh http://uc-uccx-a.lab2.purplepi.ie
SOCIALMINER uc-socialminer.lab2.purplepi.ie 192.168.1.248 ssh http://uc-socialminer.lab2.purplepi.ie OS Platform

</sortable>

Classic Chat

Bubble Chat Code

<!-- Add this script tag without any modification to the target webpage -->
<script type="application/javascript">
    var ciscoBubbleChat = (function () {
        var smHost = 'UC-SOCIALMINER.lab2.purplepi.ie';
        var widgetId = '1';

        var appId = 'cisco_bubble_chat';
        var secure = 'true';
        var appMargin = 10;
        var messageEventListener = undefined;
        return {
            showChatWindow: function () {
                var logPrefix = 'CISCO_BUBBLE_CHAT: ';
                if (document.getElementById(appId)) {
                    console.log(logPrefix + 'Not loading BubbleChat as it is already loaded');
                    return;
                }
                var iframe = document.createElement('iframe');
                iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms allow-popups');
                iframe.setAttribute('id', appId);
                iframe.setAttribute('style', 'position: fixed;width: 312px; height: 407px; bottom: 0px;right: 0px; border: none; z-index:999;');
                var appUrl = 'https://' + smHost + '/ccp/ui/BubbleChat.html?host=' + smHost + '&wid=' + widgetId + '&secure=' + secure;
                iframe.setAttribute('src', appUrl);
                document.body.appendChild(iframe);
                document.getElementById(appId).style.visibility = 'visible';
                if(!messageEventListener) {
                    messageEventListener = function (event) {
                        console.log(logPrefix + 'Received event from origin: ' + event.origin);
                        if (event.origin.indexOf(smHost) >= 0) {
                            console.log(logPrefix + 'Received event data: ' + JSON.stringify(event.data));
                            if (event.data.messageType === 'resize') {
                                document.getElementById(appId).height = event.data.height + appMargin;
                                console.log(logPrefix + 'Successfully resized');
                            } else if (event.data.messageType === 'unmount') {
                                document.body.removeChild(document.getElementById(appId));
                                window.removeEventListener('message', messageEventListener);
                                console.log(logPrefix + 'Successfully unmounted BubbleChat and removed event listener for message');
                            }
                        }
                    };
                }
                window.addEventListener('message', messageEventListener);
                console.log(logPrefix + 'Event listener for message added');
            }
        };
    })();
</script>

<!-- Use the function 'ciscoBubbleChat.showChatWindow() as the event handler for initiating chat -->
<!-- eg: <button onclick="ciscoBubbleChat.showChatWindow()">Start Chat</button> -->