Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\js\cti\cti_algoria_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 ALGORIA"); 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()); }%> var algoriaOperation = '<fl:webapp/>/<%=AlgoriaServlet.SERVLET_NAME%>?<%=AlgoriaServlet.URL_ACTION_PARAMETER%>='; var call = algoriaOperation+'<%=AlgoriaServlet.CALL_OPERATION%>'; var transfert= algoriaOperation+'<%=AlgoriaServlet.TRANSFER_OPERATION%>'; var answer= algoriaOperation+'<%=AlgoriaServlet.ANSWER_OPERATION%>'; var release= algoriaOperation+'<%=AlgoriaServlet.RELEASE_OPERATION%>'; var initiateTransfer = algoriaOperation+'<%=AlgoriaServlet.INITIATE_OPERATION%>'; var completeTransfer = algoriaOperation+'<%=AlgoriaServlet.COMPLETE_OPERATION%>'; var reconnectTransfer = algoriaOperation+'<%=AlgoriaServlet.RECONNECT_OPERATION%>'; var hold = algoriaOperation+'<%=AlgoriaServlet.HOLD_OPERATION%>'; var retrieve = algoriaOperation+'<%=AlgoriaServlet.RETRIEVE_OPERATION%>'; var alternate = algoriaOperation+'<%=AlgoriaServlet.ALTERNATE_OPERATION%>'; var okResponse='OK'; var koResponse='NOK'; var callReturn='caller='; var pool='<fl:webapp/>/call_pool'; // Stops the polling. var stopPollingStatus = "NOPOLL"; //var pollingOn = true; var pollingOn; var listening; function getPurePhone(phone){ var formated = phone; var number = '0123456789'; //alert('getPurePhone : '+phone); if (formated == '' || formated == null){ return ''; }else{ if (formated.charAt(0) == '+'){ formated = '00'+formated.substring(1, formated.length); } if (formated.indexOf('(')>-1){ formated = formated.substring(0,formated.indexOf('('))+formated.substring(formated.indexOf(')')+1, formated.length); } //alert('formated : '+formated); for(var i=0; i < formated.length; i++){ //Suprresion de tout les caracteres non num?riques var currentChar = formated.charAt(i); if (number.indexOf(currentChar)==-1){ formated = formated.substring(0,i)+formated.substring(i+1, formated.length); i--; } } if (formated != '' && formated != null && formated.length > 10) { formated = '0'+formated.substring(4,formated.length); } //alert('formated retourne : '+formated); return formated; } } // *********** Starts the polling *********** function doOnLoadCTI(){ startListen(); } // ************ Outbound calls : auto dial ************ function doCallCTI(pPhone, pObj, pID){ //alert("Algoria cti call;"+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; //alert("cti_algoria_js.jsp#doTransferCTI(pRef=" + pRef + ", pPhone=" + pPhone); 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) { <%-- alert("In doCompleteTransferCTI(pPhone, pReason) of cti_algoria_js.jsp ."); --%> var formatedPhone = getPurePhone(pPhone); var url = completeTransfer+'&phone='+formatedPhone; url = encodeURI(url); doAjax(url); } function doReconnectTransferCTI(pReason) { var url = reconnectTransfer; dummyStuff=(new Date).getMilliseconds(); url = encodeURI(url+'&dummy='+dummyStuff); 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); } // ************** Alternate ******************* function doAlternateCallCTI() { var url = alternate; dummyStuff=(new Date).getMilliseconds(); url = encodeURI(url+'&dummy='+dummyStuff); doAjax(url); } // ************** Ajax Answers **************** function cTIReturn(arrIndex){ var response = ''; if (eDealXmlhttpArr[arrIndex].readyState == 4) { hideWaiting(); response = eDealXmlhttpArr[arrIndex].responseText; //Traitement de la reponse ... if (response==okResponse){ //OK, on ne fait rien //Trace à enlever //alert(response); eval(response); } else if (response==stopPollingStatus && pollingOn) { pollingOn = false; clearTimeout(listening); alert('Service CTI déconnecté. Veuillez vous relogguer.'); } else { //alert(response.substring(koResponse.length+1, response.length)); //Trace à enlever // alert(response); eval(response); } } } // *************** Polling **************** function startListen(){ pollingOn = true ; var periode = '<%=polInterval%>'; dummyStuff=(new Date).getMilliseconds(); //alert('polling : ' + algoriaOperation+'poll&dummy='+dummyStuff+'&CallWindowName=uneInstance'); doAjax(algoriaOperation+'poll&dummy='+dummyStuff+'&CallWindowName=uneInstance', cTIReturn); listening = setTimeout('startListen()', periode); }
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de