private void writeCallEventLog(string eventName, CallEvent evt) { StringBuilder sb = new StringBuilder(); sb.Append("STATE : "); foreach (DictionaryEntry item in evt.getCallStateTable()) { sb.Append("[" + item.Key + " -> " + item.Value + "]"); } StringBuilder actionBuilder = new StringBuilder(); actionBuilder.Append("ACTION : "); foreach (string str in evt.getActionList()) { actionBuilder.Append("[" + str + "]"); } logwrite.write("raiseEvent", ":::::::::::::::::::::::::::::::::::: " + eventName + " ::::::::::::::::::::::::::::::::::::"); logwrite.write("raiseEvent", evt.getEvtMsg()); logwrite.write("raiseEvent", "ID : " + evt.getDialogID()); logwrite.write("raiseEvent", "CALLTYPE : " + evt.getCallType()); logwrite.write("raiseEvent", "FromAddress : " + evt.getFromAddress()); logwrite.write("raiseEvent", "ToAddress : " + evt.getToAddress()); logwrite.write("raiseEvent", sb.ToString()); logwrite.write("raiseEvent", actionBuilder.ToString()); logwrite.write("raiseEvent", "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"); }
private void setActiveDialogID(CallEvent evt) { if (evt.getCallType().Equals("CONSULT") || evt.getCallType().Equals(CALL.PLAY_AGENT_GREETING)) { dialogID_second = evt.getDialogID(); activeDialogID = dialogID_second; } else { if (evt.getDialogID().Equals(dialogID_second)) { dialogID_second = evt.getDialogID(); activeDialogID = dialogID_second; } else { dialogID = evt.getDialogID(); activeDialogID = dialogID; } } logwrite.write("setDialogID", "Active DialogID : " + activeDialogID + " , first ID : " + dialogID + " , seconde ID : " + dialogID_second); logwrite.write("", ""); }
private void raiseCallEvent(CallEvent evt) { string evtCode = evt.getEvtCode(); string evtMessage = evt.getEvtMsg(); callDataTable = evt.getCallVariable(); evtMessage = evtMessage.Replace("\n", ""); StringBuilder callState = new StringBuilder(); foreach (DictionaryEntry item in evt.getCallStateTable()) { callState.Append(item.Key).Append("^").Append(item.Value).Append("|"); } if (callState.ToString().EndsWith("|")) { string tempStr = callState.ToString().Substring(0, callState.ToString().Length - 1); callState = new StringBuilder(); callState.Append(tempStr); } StringBuilder callAction = new StringBuilder(); foreach (string str in evt.getActionList()) { callAction.Append(str).Append("^"); } if (callAction.ToString().EndsWith("^")) { string tempStr = callAction.ToString().Substring(0, callAction.ToString().Length - 1); callAction = new StringBuilder(); callAction.Append(tempStr); } switch (evtCode) { case EVENT_TYPE.ON_CONNECTION: logwrite.write("raiseEvent", ":::::::::::::::::::::::::::::::::::: GetEventOnConnection ::::::::::::::::::::::::::::::::::::"); logwrite.write("raiseEvent", evtMessage); logwrite.write("raiseEvent", "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"); GetEventOnConnection(evt.getCurFinesseIP(), evt.getCurAemsIP(), evt.getCurIspsIP(), evtMessage); break; case EVENT_TYPE.ON_DISCONNECTION: logwrite.write("raiseEvent", ":::::::::::::::::::::::::::::::::::: GetEventOnDisConnection ::::::::::::::::::::::::::::::::::::"); logwrite.write("raiseEvent", evtMessage); logwrite.write("raiseEvent", "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"); GetEventOnDisConnection(evt.getCurFinesseIP(), evt.getCurAemsIP(), evt.getCurIspsIP(), evtMessage); break; case EVENT_TYPE.ALERTING: writeCallEventLog("GetEventOnCallAlerting", evt); setActiveDialogID(evt); GetEventOnCallAlerting(evt.getDialogID(), evt.getCallType(), evt.getFromAddress(), evt.getToAddress(), callState.ToString(), callAction.ToString()); if (agentCurrentState.Equals(AGENTSTATE.NOT_READY)) { // 상담원 현재 상태가 NOTREADY 인데 Alerting 이벤트가 발생했다는건, 내선인입콜 케이스 isInternalCall = true; } else { isInternalCall = false; } break; case EVENT_TYPE.FAILED: writeCallEventLog("GetEventOnCallFailed", evt); setActiveDialogID(evt); GetEventOnCallFailed(evt.getDialogID(), evt.getCallType(), evt.getFromAddress(), evt.getToAddress(), callState.ToString(), callAction.ToString()); break; case EVENT_TYPE.ACTIVE: writeCallEventLog("GetEventOnCallActive", evt); setActiveDialogID(evt); GetEventOnCallActive(evt.getDialogID(), evt.getCallType(), evt.getFromAddress(), evt.getToAddress(), callState.ToString(), callAction.ToString()); if (evt.getToAddress() != null && evt.getToAddress().Equals(phonePadNum)) { // 폰패드 컨퍼런스 logwrite.write("raiseEvent", "PhonePad Conference Start"); phonePadCallID = dialogID; // phonePad 콜 구분을 위한 DialogID 세팅 fnConference(); } break; case EVENT_TYPE.HELD: writeCallEventLog("GetEventOnCallHeld", evt); //setActiveDialogID(evt); GetEventOnCallHeld(evt.getDialogID(), evt.getCallType(), evt.getFromAddress(), evt.getToAddress(), callState.ToString(), callAction.ToString()); break; case EVENT_TYPE.INITIATING: writeCallEventLog("GetEventOnCallInitiating", evt); setActiveDialogID(evt); GetEventOnCallInitiating(evt.getDialogID(), evt.getCallType(), evt.getFromAddress(), evt.getToAddress(), callState.ToString(), callAction.ToString()); break; case EVENT_TYPE.INITIATED: writeCallEventLog("GetEventOnCallInitiated", evt); setActiveDialogID(evt); GetEventOnCallInitiated(evt.getDialogID(), evt.getCallType(), evt.getFromAddress(), evt.getToAddress(), callState.ToString(), callAction.ToString()); break; case EVENT_TYPE.WRAP_UP: writeCallEventLog("GetEventOnCallWrapUp", evt); // checkTable(callEvent.getCallVariable()); removeDialogID(evt); GetEventOnCallWrapUp(evt.getDialogID(), evt.getCallType(), evt.getFromAddress(), evt.getToAddress(), callState.ToString(), callAction.ToString()); break; case EVENT_TYPE.DROPPED: writeCallEventLog("GetEventOnCallDropped", evt); // checkTable(callEvent.getCallVariable()); removeDialogID(evt); GetEventOnCallDropped(evt.getDialogID(), evt.getCallType(), evt.getFromAddress(), evt.getToAddress(), callState.ToString(), callAction.ToString()); if (evt.getCallType().Equals(CALL.CONFERENCE) && evt.getDialogID().Equals(phonePadCallID)) { // 폰패드 이후 Dropped 이벤트일 경우 폰패드 결과를 요청한다. getPhonePadInfo(); } if (isInternalCall) { // NOTREADY 상태에서 내선콜이 인입되었다가 Alerting 도중에 콜이 종료되면 상담원 이전상태 이벤트를 Finesse 가 주지 않아 // 임의적으로 상담원상태 요청 이후 상태 이벤트를 발생시킨다. AgentStateVO agentStateVO = FinesseClient.checkAgentState(); // 이전 상담원 상태체크 AgentEvent evt_ = new AgentEvent(); evt_.setEvtMsg(agentStateVO.getXmppMsg()); evt_.setAgentState(agentStateVO.getState()); evt_.setReasonCode(agentStateVO.getReasonCode()); evt_.setEvtCode(EVENT_TYPE.ON_AGENTSTATE_CHANGE); raiseEvent(evt_); } break; default: logwrite.write("raiseEvent", ":::::::::::::::::::::::::::::::::::: UNKWON EVENT ::::::::::::::::::::::::::::::::::::"); logwrite.write("raiseEvent", evtMessage); logwrite.write("raiseEvent", "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"); setActiveDialogID(evt); break; } }