Edit C:\galaxie\Back\galaxie\js\cti\cti_genesys_js.jsp
<%/****************************************************************************** * Copyright (c) 2000-2007 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.CTIServiceClient" %><%@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()); logger.warn("Page GENESYS"); String contextPath = (String) session.getAttribute("contextPath"); FlContext context = null; if (contextPath != null) { context = Frontline.getContext(contextPath); } else { context = Frontline.getContext(request.getContextPath()); } DataDictionary dico = context.getDataDictionary(); String pPhone = Utils.getRequestParameter(context, request, "phone"); logger.warn("Phone :"+pPhone); logger.warn("REQUEST HOST:"+request.getRemoteAddr()); CTIServiceClient cti = null; String polInterval=null; try{ cti = (CTIServiceClient)context.getServiceManager().getServiceClient(session, "CTI"); if (cti != null) { polInterval = cti.getOption("PollInterval","1000"); } }catch(Exception e){ logger.warn("Error in CTI Service :\n"+e.getMessage()); }%> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/ajax/sarissa.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/ajax/ajax.js"></script> <script language="javascript"> var genesysOperation = '<fl:webapp/>/<%=GenesysServlet.SERVLET_NAME%>?<%=GenesysServlet.URL_ACTION_PARAMETER%>='; var call = genesysOperation+'<%=GenesysServlet.CALL_OPERATION%>'; var transfert= genesysOperation+'<%=GenesysServlet.TRANSFER_OPERATION%>'; var answer= genesysOperation+'<%=GenesysServlet.ANSWER_OPERATION%>'; var release= genesysOperation+'<%=GenesysServlet.RELEASE_OPERATION%>'; var initiateTransfer = genesysOperation+'<%=GenesysServlet.INITIATE_OPERATION%>'; var completeTransfer = genesysOperation+'<%=GenesysServlet.COMPLETE_OPERATION%>'; var reconnectTransfer = genesysOperation+'<%=GenesysServlet.RECONNECT_OPERATION%>'; var hold = genesysOperation+'<%=GenesysServlet.HOLD_OPERATION%>'; var retrieve = genesysOperation+'<%=GenesysServlet.RETRIEVE_OPERATION%>'; var okResponse='OK'; var koResponse='NOK'; var callReturn='caller='; var pool='<fl:webapp/>/call_pool'; // *********** Starts the polling *********** function doOnLoadCTI(){ startListen(); } // ************ Outbound calls : auto dial ************ function doCallCTI(pPhone){ var formatedPhone = getPurePhone(pPhone); var url = call+'&phone='+formatedPhone; url=encodeURI(url); //alert("url called : "+url); doAjax(url); //, cTIReturn); } // ************ Answer & Release a call. ************** function doAnswerCTI(pRef){ var url = answer; url=encodeURI(url); doAjax(url); //, cTIReturn); } function doReleaseCTI(pRef){ var url = release; url=encodeURI(url); doAjax(url); //, cTIReturn); } // ************* Mute Transfer ************** function doTransferCTI(pRef, pPhone){ var ref = ''; if (pRef!=null) ref = pRef; var formatedPhone = getPurePhone(pPhone); var url = transfert+'&phone='+formatedPhone+'&ref='+ref; url=encodeURI(url); doAjax(url); //, cTIReturn); } // *************** 2 phase transfer. *************** function doInitiateTransferCTI(pPhone, pAttachedData, pReason) { var formatedPhone = getPurePhone(pPhone); var url = initiateTransfer+'&phone='+formatedPhone; url = encodeURI(url); doAjax(url); } function doCompleteTransferCTI(pPhone, pReason) { var formatedPhone = getPurePhone(pPhone); var url = completeTransfer+'&phone='+formatedPhone; url = encodeURI(url); doAjax(url); } function doReconnectTransferCTI(pReason) { var url = reconnectTransfer; url = encodeURI(url); doAjax(url); } // **************** Hold & Retrieve ************** function doHoldCallCTI() { var url = hold; url = encodeURI(url); //'&reason='pReason doAjax(url); } function doRetrieveCallCTI() { var url = retrieve; url = encodeURI(url); //'&reason='pReason doAjax(url); } // ************** Ajax Answers **************** function cTIReturn(arrIndex){ var response = ''; if (eDealXmlhttpArr[arrIndex].readyState == 4) { response = eDealXmlhttpArr[arrIndex].responseText; //Traitement de la reponse ... if (response==okResponse){ //OK, on ne fait rien //Trace à enlever //alert(response); eval(response); }else{ //alert(response.substring(koResponse.length+1, response.length)); //Trace à enlever //alert(response); eval(response); } } } // *************** Polling **************** function startListen(){ var periode = '<%=polInterval%>'; dummyStuff=(new Date).getMilliseconds(); //alert('polling'); doAjax(genesysOperation+'poll&dummy='+dummyStuff+'&CallWindowName=uneInstance', cTIReturn); setTimeout('startListen()', periode); } </script>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de