<%/****************************************************************************** * Copyright (c) 2000-2004 e-Deal * * e-Deal S.A. * 55 rue Brillat Savarin * 75013 Paris * France * * T: +33 (0)1 53 80 80 30 * F: +33 (0)1 73 01 69 77 * http://www.e-deal.com * * La diffusion de ce code source sous quelque forme que ce soit sans * l'autorisation de E-DEAL est interdite. * * Vous êtes autorisés à modifier ce code source uniquement pour votre usage * propre et sous réserve que les mentions de copyright demeurent intactes. * * Ce code est fourni en l'état. Aucune garantie d'aucune sorte, explicite ou * implicite n'est donnée. En aucun cas E-DEAL ne pourra être tenu pour * responsable des dommages pouvant résulter de l'utilisation de ce code * source. * * ******************************************************************************/%><%@page session="true" import="com.edeal.frontline.*, java.util.*,com.edeal.frontline.services.*,com.edeal.frontline.services.cti.*"%><%@ page import="com.edeal.frontline.services.cti.CTIService, com.edeal.frontline.helper.CTIHelper" %><%@ page import="com.edeal.frontline.AccessControlManager" %><%@ page import="com.edeal.frontline.ActorBean" %><%@ page import="com.edeal.frontline.services.cti.CTIServiceClient" %><%@ page import="com.edeal.frontline.navigation.FlRequest" %><%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl"%><%final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); String strActID = (String)session.getAttribute("actorID"); ActorBean actor = null; boolean hasCTIRole = false; try{ actor = new ActorBean(strActID, context); hasCTIRole = actor.hasRole("CTI"); } catch(Exception e){} boolean actHasLic; try { actHasLic = ((Boolean)session.getAttribute("actorHasCTI")).booleanValue(); } catch (Exception e) { // Lic V3 version actHasLic = context.getLicenceManager().actorHasSoftware(strActID, CTIServiceClient.CTI_LIC_CODE, LicenceManager.LicenceType.PermanentLicence, null); } //if CTI is activated, the CTI window will pop up. //if not, it is hidden in the main frameset and the ActiveX control should not be loaded. boolean activateCTI = false; String pActivateCTI = context.getContextParameter("ActivateCTI"); if (pActivateCTI != null && "true".equalsIgnoreCase(pActivateCTI) && hasCTIRole) { activateCTI = true ; } CTIServiceClient cti; try { cti = (CTIServiceClient)context.getServiceManager().getServiceClient(session, "CTI"); } catch (FlServiceException e) { cti = null; } //boolean activateCTI = (cti != null); final String DEFAULT_VOCALCOM_CODEBASE = ""; String javascriptToInclude = null; boolean isicomCTI = false; boolean isicomAppletCTI = false; // DGE : vocalcom add-on. boolean vocalcomCTI = false; boolean sibiloCTI = false; boolean isCCACTI = false; //**********Fin CCA*********** boolean genesysCTI = false; boolean algoriaCTI = false; String serverURL = null; String idService = null; if (activateCTI) { try { if (cti != null) { javascriptToInclude = cti.getJavaScriptInclude(); idService = cti.getImplementation().getProviderId(); if ("isicom".equalsIgnoreCase(idService)){ isicomCTI = true; } else if ("isicom_applet".equalsIgnoreCase(idService)) { isicomAppletCTI = true; } else if ("vocalcom".equalsIgnoreCase(idService)) { vocalcomCTI = true; } else if ("sibilo".equalsIgnoreCase(idService)){ sibiloCTI = true; serverURL = cti.getImplementation().getOption("URL", ""); if ("".equals(serverURL)){ logger.warn("CTI SIBILO Error, option 'CTI.Option.URL' not initialised"); } } else if ("genesys".equalsIgnoreCase(idService)) { // If the genesys agent is not logged in the activate cti variable is set to false. if (!"1".equals((String)session.getAttribute(CTIHelper.SESSION_ATTRIBUTE_GENESYSLOGGED))) { genesysCTI = true; activateCTI = false; } } else if ("algoria".equalsIgnoreCase(idService)) { // If the algoria agent is not logged in the activate cti variable is set to false. if (!"1".equals((String)session.getAttribute(CTIHelper.SESSION_ATTRIBUTE_ALGORIALOGGED))) { algoriaCTI = true; activateCTI = false; } } else if ("cca".equalsIgnoreCase(idService)) { isCCACTI = true; } } else { String CTIproviderClassName = context.getContextParameter("CTI.Provider"); if (CTIproviderClassName != null && CTIproviderClassName.indexOf("Genesys") > -1) { activateCTI = false; } } } catch(Exception e) { logger.error("CTI Service Error : ", e); //javascriptToInclude = ""; javascriptToInclude = null; activateCTI = false; } } String telephonyMode = "Auto"; if (isicomAppletCTI) { telephonyMode = context.getContextParameter("CTI.Option.ISICOM_TelephonyMode"); if (telephonyMode == null) telephonyMode = "Auto"; }%> <% if (idService != null) { %> <fl:getMessage code="L2025" alt="E-DEAL"/> CTI <%=idService.toUpperCase()%> <% } else { %> <fl:getMessage code="L2025" alt="E-DEAL"/> CTI <% } %> <% if (activateCTI && actHasLic && hasCTIRole) { if (isicomCTI) { String ctiOnLoadString = "doOnLoadCTI(" + activateCTI + ")"; //logger.debug("doOnloadCTI(doBlur=" + activateCTI + ")"); %>
<% } else if (sibiloCTI) { %>
<% } else if (vocalcomCTI) { String ctiOnLoadString = "doOnLoadCTI()"; //String ctiOnLoadString = "doOnLoadCTI2()"; %> <%-- onunload="doUnload()" --%>
<% if (cti != null) { %> " width="800px" height="100px" > <% } else { %> <% } %>
<% } else if (isCCACTI){ %> <%-- --%> <%-- --%> <%-- --%> <% } else if (cti != null && "algoria".equalsIgnoreCase(cti.getImplementation().getProviderId())) { %>


<% } else if (activateCTI && isicomAppletCTI) { %>

<%-- Debug Clear Call testing
--%>

<%-- *********** ANY OTHER CTI ******* --%> <%-- CAUTION depending on the conditions in the else if statements, this block of code can be not reached --%> <% } else { %> <% } %> <%} else { %> <%-- *********** NO CTI DETECTED ******* --%>


<% } %>