public void NotifyVoiceDispositionCode(Genesyslab.Platform.Commons.Protocols.IMessage message) { if (sfdcAdapter != null) { sfdcAdapter.DispositionCodeChanged(message); } }
public void NotifyEventMessage(MediaTypes mediaType, Genesyslab.Platform.Commons.Protocols.IMessage eventMessage) { switch (mediaType) { case MediaTypes.Voice: Genesyslab.Platform.Voice.Protocols.TServer.Events.EventUserEvent userEvent = (Genesyslab.Platform.Voice.Protocols.TServer.Events.EventUserEvent)eventMessage; if (userEvent.UserData != null) { Application.Current.Dispatcher.Invoke((System.Action)(delegate { outboundHandler.NotifyEventIMessage(userEvent.UserData); })); } break; case MediaTypes.Interaction: Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventUserEvent eventUserEvent = (Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventUserEvent)eventMessage; if (eventUserEvent.PsEventContent != null) { Application.Current.Dispatcher.Invoke((System.Action)(delegate { outboundHandler.NotifyEventIMessage(eventUserEvent.PsEventContent); })); } break; } }
public void NotifyInteractionEvents(Genesyslab.Platform.Commons.Protocols.IMessage message) { if (sfdcAdapter != null) { sfdcAdapter.InteactionEvents(message); } }
/// <summary> /// Leaves the interaction from conference. /// </summary> /// <param name="interactionID">The interaction identifier.</param> /// <param name="proxyID">The proxy identifier.</param> /// <param name="agentID">The agent identifier.</param> /// <param name="_chatClosingProtocol">The _chat closing protocol.</param> /// <returns></returns> public static Pointel.Interactions.Chat.Core.General.OutputValues LeaveInteractionFromConference(string interactionID, int proxyID, string agentID) { Pointel.Logger.Core.ILog logger = Pointel.Logger.Core.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "AID"); Pointel.Interactions.Chat.Core.General.OutputValues output = Pointel.Interactions.Chat.Core.General.OutputValues.GetInstance(); try { Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestLeaveInteraction requestLeaveInteraction = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestLeaveInteraction.Create(); requestLeaveInteraction.InteractionId = interactionID; requestLeaveInteraction.ProxyClientId = proxyID; requestLeaveInteraction.Reason = null; //ReasonInfo reasonInfo = ReasonInfo.Create(); //reasonInfo.ReasonDescription = agentID.ToString() + " Leaving from the Conference"; //requestLeaveInteraction.Reason = reasonInfo; requestLeaveInteraction.Extension = null; if (Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol != null && Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.State == Genesyslab.Platform.Commons.Protocols.ChannelState.Opened) { Genesyslab.Platform.Commons.Protocols.IMessage response = Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.Request(requestLeaveInteraction); if (response != null) { switch (response.Id) { case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck.MessageId: logger.Info("------------LeaveInteractionFromConference-------------"); logger.Info("InteractionId :" + interactionID); logger.Info("ProxyClientId :" + proxyID); logger.Info("AgentId :" + agentID); logger.Info("-------------------------------------------------------"); logger.Trace(response.ToString()); output.MessageCode = "200"; output.Message = "Leave Interaction From Conference Successful"; break; case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError.MessageId: logger.Trace(response.ToString()); output.MessageCode = "2001"; output.Message = "Don't Leave Interaction From Conference Successful"; break; } } else { output.MessageCode = "2001"; output.Message = "Don't Leave Interaction From Conference Successful"; } } else { logger.Warn("LeaveInteractionFromConference() : Interaction Server protocol is Null.."); } } catch (Exception generalException) { logger.Error("Error occurred while Leave Interaction From Conference request " + generalException.ToString()); output.MessageCode = "2001"; output.Message = generalException.Message; } return(output); }
public static Pointel.Interactions.Chat.Core.General.OutputValues ResumeInteraction(int proxyID, string sessionID, KeyValueCollection extensions, ReasonInfo reason) { Pointel.Logger.Core.ILog logger = Pointel.Logger.Core.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "AID"); Pointel.Interactions.Chat.Core.General.OutputValues output = Pointel.Interactions.Chat.Core.General.OutputValues.GetInstance(); try { Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestResume requestResume = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestResume.Create(); requestResume.InteractionId = sessionID; requestResume.ProxyClientId = proxyID; requestResume.Extension = extensions; requestResume.Reason = reason; if (Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol != null && Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.State == Genesyslab.Platform.Commons.Protocols.ChannelState.Opened) { Genesyslab.Platform.Commons.Protocols.IMessage message = Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.Request(requestResume); if (message != null) { switch (message.Id) { case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck.MessageId: logger.Info("------------RequestResume-------------"); logger.Info("SessionID :" + sessionID); logger.Info("ProxyID :" + proxyID); logger.Info("--------------------------------------"); logger.Info(requestResume.ToString()); output.MessageCode = "200"; output.Message = "Interaction Resume Successful."; break; case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError.MessageId: Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError eventError = (Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError)message; string LoginErrorCode = Convert.ToString(eventError.ErrorCode); string LoginErrorDescription = Convert.ToString(eventError.ErrorDescription); logger.Trace(eventError.ToString()); output.MessageCode = "2001"; output.Message = "ResumeInteraction() : " + LoginErrorDescription; break; } } else { output.MessageCode = "2001"; output.Message = "Chat Media Resume Interaction UnSuccessful"; } } else { logger.Warn("ResumeInteraction() : IXN Server protocol is Null.."); } } catch (Exception generalException) { logger.Error("Error occurred while Resume Interaction request " + generalException.ToString()); output.MessageCode = "2001"; output.Message = generalException.Message; } return(output); }
public static Genesyslab.Platform.Commons.Protocols.IMessage UpdateInteraction(string interactionID, int owerId, string comment, KeyValueCollection userData, int status, string dtEndDate = null) { Genesyslab.Platform.Commons.Protocols.IMessage result = null; if (Pointel.Interactions.IPlugins.PluginCollection.GetInstance().PluginCollections.ContainsKey(Plugins.Contact)) { result = ((IContactPlugin)Pointel.Interactions.IPlugins.PluginCollection.GetInstance().PluginCollections[Pointel.Interactions.IPlugins.Plugins.Contact]).UpdateInteraction(interactionID, owerId, comment, userData, status, dtEndDate); } return(result); }
/// <summary> /// Changes the properties. /// </summary> /// <param name="interactionId">The interaction identifier.</param> /// <param name="proxyId">The proxy identifier.</param> /// <param name="dispositionNotes">The disposition notes.</param> /// <returns></returns> public static Pointel.Interactions.Chat.Core.General.OutputValues ChangeProperties(string interactionId, int proxyId, Genesyslab.Platform.Commons.Collections.KeyValueCollection addedProperties, Genesyslab.Platform.Commons.Collections.KeyValueCollection changedProperties) { Pointel.Logger.Core.ILog logger = Pointel.Logger.Core.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "AID"); Pointel.Interactions.Chat.Core.General.OutputValues output = Pointel.Interactions.Chat.Core.General.OutputValues.GetInstance(); Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestChangeProperties requestChangeProperties = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestChangeProperties.Create(); try { requestChangeProperties.InteractionId = interactionId; requestChangeProperties.ProxyClientId = proxyId; if (changedProperties != null) { requestChangeProperties.ChangedProperties = changedProperties; } if (addedProperties != null) { requestChangeProperties.AddedProperties = addedProperties; } if (Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol != null && Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.State == Genesyslab.Platform.Commons.Protocols.ChannelState.Opened) { Genesyslab.Platform.Commons.Protocols.IMessage response = Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.Request(requestChangeProperties); if (response.Id == Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventPropertiesChanged.MessageId || response.Id == Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck.MessageId) { logger.Info("------------RequestChangeProperties-------------"); logger.Info("InteractionId :" + interactionId); logger.Info("ProxyClientId :" + proxyId); logger.Info(" RequestChangeProperties : response :" + response.ToString()); logger.Info("-------------------------------------------------"); logger.Trace(response.ToString()); output.MessageCode = "200"; output.Message = "Change Properties Successful"; } else { output.MessageCode = "2001"; output.Message = "Don't Change Properties Successful"; } } else { logger.Warn("ChangeProperties() : Interaction Server Protocol is Null.."); } } catch (Genesyslab.Platform.Commons.Protocols.ProtocolException protocolException) { logger.Error("Error occurred while change properties request " + protocolException.ToString()); output.MessageCode = "2001"; output.Message = protocolException.Message; } catch (Exception generalException) { logger.Error("Error occurred while change properties request " + generalException.ToString()); output.MessageCode = "2001"; output.Message = generalException.Message; } return(output); }
/// <summary> /// Requests the get contact attribute. /// </summary> /// <param name="contactId">The contact identifier.</param> /// <param name="retrievelist">The retrievelist.</param> /// <returns>EventGetAttributes.</returns> public static EventGetAttributes RequestGetContactAttribute(string contactId, List <string> retrievelist) { if (Pointel.Interactions.IPlugins.PluginCollection.GetInstance().PluginCollections.ContainsKey(Plugins.Contact)) { Genesyslab.Platform.Commons.Protocols.IMessage result = ((IContactPlugin)Pointel.Interactions.IPlugins.PluginCollection.GetInstance().PluginCollections[Pointel.Interactions.IPlugins.Plugins.Contact]).GetAllAttributes(contactId, retrievelist); if (result.Id == EventGetAttributes.MessageId) { return(result as EventGetAttributes); } } return(null); }
/// <summary> /// Requests the content of the interaction. /// </summary> /// <param name="interactionId">The interaction identifier.</param> /// <param name="isNeedAttachment">if set to <c>true</c> [is need attachment].</param> /// <returns>EventGetInteractionContent.</returns> public static EventGetInteractionContent RequestInteractionContent(string interactionId, bool isNeedAttachment) { if (Pointel.Interactions.IPlugins.PluginCollection.GetInstance().PluginCollections.ContainsKey(Plugins.Contact)) { Genesyslab.Platform.Commons.Protocols.IMessage result = ((IContactPlugin)Pointel.Interactions.IPlugins.PluginCollection.GetInstance().PluginCollections[Pointel.Interactions.IPlugins.Plugins.Contact]).GetInteractionContent(interactionId, false); if (result.Id == EventGetInteractionContent.MessageId) { return(result as EventGetInteractionContent); } } return(null); }
public static Genesyslab.Platform.Commons.Protocols.IMessage InitiateTransferResponse(string pOtherDN, string location, Genesyslab.Platform.Commons.Collections.KeyValueCollection userData) { var logger = Pointel.Logger.Core.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "AID"); Genesyslab.Platform.Commons.Protocols.IMessage response = null; try { //Input Validation Pointel.Softphone.Voice.Core.Exceptions.CheckException.CheckDialValues(pOtherDN); var requestInitiateTransfer = Genesyslab.Platform.Voice.Protocols.TServer.Requests.Party.RequestInitiateTransfer.Create(); //Below condition added to decide which DN going to control the call //05-14-2013 Palaniappan requestInitiateTransfer.ThisDN = (Settings.GetInstance().CallControl == "both" ? Settings.GetInstance().ActiveDN : (Settings.GetInstance().CallControl == "acd" ? Settings.GetInstance().ACDPosition : Settings.GetInstance().ExtensionDN)); //End var connId = new Genesyslab.Platform.Voice.Protocols.ConnectionId(Settings.GetInstance().ConnectionID); requestInitiateTransfer.ConnID = connId; requestInitiateTransfer.OtherDN = pOtherDN; if (!string.IsNullOrEmpty(location)) { requestInitiateTransfer.Location = location; } if (userData != null && userData.Count > 0) { requestInitiateTransfer.UserData = userData; } //Code Added - V.Palaniappan //28.10.2013 if (requestInitiateTransfer.ThisDN != pOtherDN) { response = Settings.GetInstance().VoiceProtocol.Request(requestInitiateTransfer); } //End logger.Info("---------------InitiateTransfer------------------"); //Below condition added to decide which DN going to control the call //05-14-2013 Palaniappan logger.Info("ThisDN:" + (Settings.GetInstance().CallControl == "both" ? Settings.GetInstance().ActiveDN : (Settings.GetInstance().CallControl == "acd" ? Settings.GetInstance().ACDPosition : Settings.GetInstance().ExtensionDN))); //End logger.Info("ConnectionID:" + connId); logger.Info("OtherDN:" + pOtherDN); logger.Info("Location :" + location); logger.Info("--------------------------------------------"); } catch (System.Exception commonException) { logger.Error("Error occurred while Initiate Transfer call " + commonException.ToString()); } return(response); }
/// <summary> /// Deletes the case information. /// </summary> /// <param name="interactionid">The interactionid.</param> /// <param name="keyvalues">The keyvalues.</param> /// <returns></returns> public static Pointel.Interactions.Chat.Core.General.OutputValues DeleteCaseInformation(string interactionId, int proxyClientID, Genesyslab.Platform.Commons.Collections.KeyValueCollection keyvalues) { Pointel.Logger.Core.ILog logger = Pointel.Logger.Core.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "AID"); Pointel.Interactions.Chat.Core.General.OutputValues output = Pointel.Interactions.Chat.Core.General.OutputValues.GetInstance(); try { Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestChangeProperties deletedProperties = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestChangeProperties.Create(); deletedProperties.InteractionId = interactionId; deletedProperties.ProxyClientId = proxyClientID; if (keyvalues != null) { deletedProperties.DeletedProperties = keyvalues; } if (Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol != null && Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.State == Genesyslab.Platform.Commons.Protocols.ChannelState.Opened) { Genesyslab.Platform.Commons.Protocols.IMessage response = Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.Request(deletedProperties); if (response.Id == Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventPropertiesChanged.MessageId || response.Id == Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck.MessageId) { logger.Info("------------DeleteCaseInformation-------------"); logger.Info("InteractionId :" + interactionId); logger.Info("ProxyClientId :" + proxyClientID); logger.Info("KVC : " + keyvalues.ToString()); logger.Info("AddCaseInformation : response :" + response.ToString()); logger.Info("---------------------------------------------"); logger.Trace(response.ToString()); output.MessageCode = "200"; output.Message = "Delete Case Information Successful"; } else { logger.Trace(response.ToString()); output.MessageCode = "2001"; output.Message = "Add Properties UnSuccessful"; } } else { logger.Warn("AddCaseInformation() : Interaction Server Protocol is Null.."); } } catch (Exception generalException) { logger.Error("Error occurred while doing Add Case Information:" + generalException.ToString()); output.MessageCode = "2001"; output.Message = generalException.Message; } return(output); }
/// <summary> /// Joins the consult chat session. /// </summary> /// <param name="sessionID">The session unique identifier.</param> /// <param name="subject">The subject.</param> /// <param name="message">The message.</param> /// <param name="userData">The user data.</param> /// <returns></returns> public static Pointel.Interactions.Chat.Core.General.OutputValues JoinConsultChatSession(string sessionID, string subject, string message, Genesyslab.Platform.Commons.Collections.KeyValueCollection userData) { Pointel.Logger.Core.ILog logger = Pointel.Logger.Core.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "AID"); Pointel.Interactions.Chat.Core.General.OutputValues output = Pointel.Interactions.Chat.Core.General.OutputValues.GetInstance(); try { Genesyslab.Platform.WebMedia.Protocols.BasicChat.Requests.RequestJoin requestJoinChat = Genesyslab.Platform.WebMedia.Protocols.BasicChat.Requests.RequestJoin.Create(); Genesyslab.Platform.WebMedia.Protocols.BasicChat.MessageText newMessageText = Genesyslab.Platform.WebMedia.Protocols.BasicChat.MessageText.Create(); newMessageText.Text = message; requestJoinChat.MessageText = newMessageText; requestJoinChat.SessionId = sessionID; requestJoinChat.UserData = userData; requestJoinChat.Visibility = Genesyslab.Platform.WebMedia.Protocols.BasicChat.Visibility.Int; requestJoinChat.Subject = subject; if (Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol != null && Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol.State == Genesyslab.Platform.Commons.Protocols.ChannelState.Opened) { Genesyslab.Platform.Commons.Protocols.IMessage iMessage = Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol.Request(requestJoinChat); if (iMessage != null) { logger.Info("------------JoinConsultChatSession-------------"); logger.Info("SessionID :" + sessionID); logger.Info("subject :" + subject); logger.Info("MessageText:" + message); logger.Info("----------------------------------------"); logger.Trace(iMessage.ToString()); output.RequestJoinIMessage = iMessage; output.MessageCode = "200"; output.Message = "Join Consult Chat Session Successful"; } else { logger.Warn("JoinConsultChatSession() : IMessage is Null.."); } } else { logger.Warn("JoinConsultChatSession() : Interaction Server protocol is Null.."); } } catch (Exception generalException) { logger.Error("Error occurred while Join the consult chat session request " + generalException.ToString()); output.MessageCode = "2001"; output.Message = generalException.Message; } return(output); }
/// <summary> /// Adds the attach document. /// </summary> /// <param name="interactionId">The interaction identifier.</param> /// <param name="filePath">The file path.</param> /// <returns>Genesyslab.Platform.Commons.Protocols.IMessage.</returns> public static Genesyslab.Platform.Commons.Protocols.IMessage AddAttachDocument(string interactionId, string filePath, bool isDocID = false) { if (Pointel.Interactions.IPlugins.PluginCollection.GetInstance().PluginCollections.ContainsKey(Plugins.Contact)) { Genesyslab.Platform.Commons.Protocols.IMessage result = null; if (!isDocID) { result = ((IContactPlugin)Pointel.Interactions.IPlugins.PluginCollection.GetInstance().PluginCollections[Pointel.Interactions.IPlugins.Plugins.Contact]).AddAttachmentDocument(interactionId, filePath); } else { result = ((IContactPlugin)Pointel.Interactions.IPlugins.PluginCollection.GetInstance().PluginCollections[Pointel.Interactions.IPlugins.Plugins.Contact]).AddAttachmentDocument(interactionId, filePath, true); } return(result); } return(null); }
public static Genesyslab.Platform.Commons.Protocols.IMessage RequestRegisterDN(string dnNumber) { var logger = Pointel.Logger.Core.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "AID"); try { //Input Validation Pointel.Softphone.Voice.Core.Exceptions.CheckException.CheckDialValues(dnNumber); var requestRegisterAddress = Genesyslab.Platform.Voice.Protocols.TServer.Requests.Dn.RequestRegisterAddress.Create(dnNumber, Genesyslab.Platform.Voice.Protocols.TServer.RegisterMode.ModeShare, Genesyslab.Platform.Voice.Protocols.TServer.ControlMode.RegisterDefault, Genesyslab.Platform.Voice.Protocols.TServer.AddressType.DN); Genesyslab.Platform.Commons.Protocols.IMessage message = Settings.GetInstance().VoiceProtocol.Request(requestRegisterAddress); return(message); } catch (System.Exception commonException) { logger.Error("Error occurred while registering " + dnNumber + " : " + commonException.ToString()); return(null); } }
/// <summary> /// Accepts the chat interaction. /// </summary> /// <param name="ticketID">The ticket identifier.</param> /// <param name="interactionID">The interaction identifier.</param> /// <param name="proxyID">The proxy identifier.</param> /// <returns></returns> public static Pointel.Interactions.Chat.Core.General.OutputValues AcceptChatInteraction(int ticketID, string interactionID, int proxyID) { Pointel.Logger.Core.ILog logger = Pointel.Logger.Core.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "AID"); Pointel.Interactions.Chat.Core.General.OutputValues output = Pointel.Interactions.Chat.Core.General.OutputValues.GetInstance(); try { Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionDelivery.RequestAccept requestAccept = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionDelivery.RequestAccept.Create(); requestAccept.TicketId = ticketID; requestAccept.InteractionId = interactionID; requestAccept.ProxyClientId = Convert.ToInt32(proxyID); //added 27-02-2015 requestAccept.InitialInFocusState = true; //end if (Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol != null && Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.State == Genesyslab.Platform.Commons.Protocols.ChannelState.Opened) { Genesyslab.Platform.Commons.Protocols.IMessage message = Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.Request(requestAccept); if (message != null) { switch (message.Id) { case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck.MessageId: Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck eventAck = (Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck)message; logger.Info("------------Accepted Chat Interaction-------------"); logger.Info("TicketID :" + ticketID); logger.Info("InteractionID :" + interactionID); logger.Info("ProxyID :" + proxyID); logger.Info("----------------------------------------------"); logger.Trace(eventAck.ToString()); output.MessageCode = "200"; output.Message = "Accept Chat Interaction Successful"; break; case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError.MessageId: Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError eventError = (Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError)message; logger.Info("------------Error on Chat Interaction-------------"); logger.Info("TicketID :" + ticketID); logger.Info("InteractionID :" + interactionID); logger.Info("ProxyID :" + proxyID); logger.Info("----------------------------------------------"); logger.Trace(eventError.ToString()); output.MessageCode = "2001"; output.Message = Convert.ToString(eventError.ErrorDescription); logger.Error("Error occurred while accepting the interaction : " + Convert.ToString(eventError.ErrorDescription)); break; } } else { output.MessageCode = "2001"; output.Message = "Chat Media Agent Not Ready UnSuccessful"; } } else { logger.Warn("AcceptChatInteraction() : Interaction Server protocol is Null.."); } } catch (Exception generalException) { logger.Error("Error occurred while Accept the chat request " + generalException.ToString()); output.MessageCode = "2001"; output.Message = generalException.Message; } return(output); }
/// <summary> /// Notifies the email interaction. /// </summary> /// <param name="message">The message.</param> public void NotifyEmailInteraction(Genesyslab.Platform.Commons.Protocols.IMessage message) { try { switch (message.Id) { case EventInvite.MessageId: // Newly Added // Start CheckAutoAnswer(message as EventInvite); // Stop //Old Code // Start // EventInvite eventInvite = message as EventInvite; //if (ConfigContainer.Instance().AllKeys.Contains("email.enable.auto-answer") // && ((string)ConfigContainer.Instance().GetValue("email.enable.auto-answer")).ToLower().Equals("true")) //{ // //EmailNotifier.needPerformAccept = true; // _taskbarNotifier.eventInvite = eventInvite; // _taskbarNotifier.ReadContactName(); // _taskbarNotifier.DoEmailAccept(); //} //else // ShowEmailNotifier(eventInvite); // Stop break; case EventRevoked.MessageId: EventRevoked eventRevoked = message as EventRevoked; if (_taskbarNotifier != null) { _taskbarNotifier.BindInfo(eventRevoked); } break; case EventAck.MessageId: EventAck eventAck = message as EventAck; break; case EventPulledInteractions.MessageId: EventPulledInteractions puledIteraction = message as EventPulledInteractions; if (puledIteraction.Interactions != null && puledIteraction.Interactions.Count > 0) { string[] keys = puledIteraction.Interactions.AllKeys; var _interactionID = keys[0]; if (_interactionID != null) { EmailMainWindow mailWindow = new EmailMainWindow(puledIteraction); mailWindow.Show(); } } break; } } catch (Exception exception) { logger.Error("NotifyEmailInteraction" + exception.ToString()); } }
/// <summary> /// Rejects the chat interaction. /// </summary> /// <param name="ticketID">The ticket identifier.</param> /// <param name="interactionID">The interaction identifier.</param> /// <param name="proxyID">The proxy identifier.</param> /// <returns></returns> public static Pointel.Interactions.Chat.Core.General.OutputValues RejectChatInteraction(int ticketID, string interactionID, int proxyID, Genesyslab.Platform.Commons.Collections.KeyValueCollection data) { Pointel.Interactions.Chat.Core.General.OutputValues output = Pointel.Interactions.Chat.Core.General.OutputValues.GetInstance(); Pointel.Logger.Core.ILog logger = Pointel.Logger.Core.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "AID"); try { Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionDelivery.RequestReject requestReject = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionDelivery.RequestReject.Create(); requestReject.TicketId = ticketID; requestReject.InteractionId = interactionID; requestReject.ProxyClientId = proxyID; requestReject.Extension = data; Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.ReasonInfo reasonInfo = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.ReasonInfo.Create(); reasonInfo.ReasonDescription = "Agent has reject this interaction"; requestReject.Reason = reasonInfo; if (Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol != null && Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.State == Genesyslab.Platform.Commons.Protocols.ChannelState.Opened) { Genesyslab.Platform.Commons.Protocols.IMessage message = Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.Request(requestReject); if (message != null) { switch (message.Id) { case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck.MessageId: Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck eventInteractionReject = (Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck)message; logger.Info("------------RejectChatInteraction-------------"); logger.Info("InteractionId :" + interactionID); logger.Info("ProxyClientId :" + proxyID); logger.Info("---------------------------------------------"); logger.Trace(eventInteractionReject.ToString()); output.MessageCode = "200"; output.Message = "Reject Chat Interaction Successful"; break; case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError.MessageId: Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError eventError = (Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError)message; string LoginErrorCode = Convert.ToString(eventError.ErrorCode); string LoginErrorDescription = Convert.ToString(eventError.ErrorDescription); logger.Trace(eventError.ToString()); output.MessageCode = "2001"; output.Message = "RejectChatInteraction() : " + LoginErrorDescription; break; } } else { output.MessageCode = "2001"; output.Message = "Chat Media Agent Reject Interaction UnSuccessful"; } } else { logger.Warn("RejectChatInteraction() : Interaction Server protocol is Null.."); } } catch (Exception generalException) { logger.Error("Error occurred while Reject Chat Interaction request " + generalException.ToString()); output.MessageCode = "2001"; output.Message = generalException.Message; } return(output); }
/// <summary> /// Transfers the chat session. /// </summary> /// <param name="interactionId">The interaction identifier.</param> /// <param name="agentId">The agent identifier.</param> /// <param name="placeId">The place identifier.</param> /// <param name="proxyId">The proxy identifier.</param> /// <param name="queueName">Name of the queue.</param> /// <returns></returns> public static Pointel.Interactions.Chat.Core.General.OutputValues TransferChatSession(string interactionId, string agentId, string placeId, int proxyId, string queueName, Genesyslab.Platform.Commons.Collections.KeyValueCollection userData) { Pointel.Logger.Core.ILog logger = Pointel.Logger.Core.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "AID"); Pointel.Interactions.Chat.Core.General.OutputValues output = Pointel.Interactions.Chat.Core.General.OutputValues.GetInstance(); try { if (!string.IsNullOrEmpty(placeId) && !string.IsNullOrEmpty(agentId)) { Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestTransfer requestTransfer = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestTransfer.Create(); requestTransfer.Extension = userData; requestTransfer.InteractionId = interactionId; requestTransfer.ProxyClientId = proxyId; requestTransfer.PlaceId = placeId; requestTransfer.AgentId = agentId; if (Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol != null && Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.State == Genesyslab.Platform.Commons.Protocols.ChannelState.Opened) { Genesyslab.Platform.Commons.Protocols.IMessage message = Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.Request(requestTransfer); if (message != null) { switch (message.Id) { case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck.MessageId: Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck eventack = (Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck)message; logger.Info("------------TransferChatSession-------------"); logger.Info("InteractionId :" + interactionId); logger.Info("ProxyClientId :" + proxyId); logger.Info("AgentId :" + agentId); logger.Info("PlaceId :" + placeId); logger.Info("--------------------------------------------"); logger.Trace(eventack.ToString()); output.MessageCode = "200"; output.Message = "Transfer Chat Session Successful"; break; case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError.MessageId: Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError eventError = (Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError)message; string LoginErrorCode = Convert.ToString(eventError.ErrorCode); string LoginErrorDescription = Convert.ToString(eventError.ErrorDescription); logger.Info("------------TransferChatSession-------------"); logger.Error(LoginErrorCode + ":" + LoginErrorDescription); logger.Info("--------------------------------------------"); logger.Trace(eventError.ToString()); output.MessageCode = "2001"; output.Message = LoginErrorDescription; break; } } } else { logger.Warn("TransferChatSession() : Interaction Server protocol is Null.."); } } else if (!string.IsNullOrEmpty(queueName)) { Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestChangeProperties requestChangeProperties = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestChangeProperties.Create(); Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestPlaceInQueue requestPlaceInQueue = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestPlaceInQueue.Create(); Genesyslab.Platform.Commons.Collections.KeyValueCollection attachData = new Genesyslab.Platform.Commons.Collections.KeyValueCollection(); attachData.Add("ChatSkills", queueName); requestChangeProperties.ChangedProperties = attachData; requestChangeProperties.InteractionId = interactionId; requestChangeProperties.ProxyClientId = proxyId; requestPlaceInQueue.InteractionId = interactionId; requestPlaceInQueue.Queue = queueName; requestPlaceInQueue.ProxyClientId = proxyId; requestPlaceInQueue.AddedProperties = attachData; if (Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol != null && Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.State == Genesyslab.Platform.Commons.Protocols.ChannelState.Opened) { Genesyslab.Platform.Commons.Protocols.IMessage message = Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.Request(requestPlaceInQueue); if (message != null) { switch (message.Id) { case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck.MessageId: Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck eventAck = (Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck)message; logger.Info("------------Chat Transfer Interaction By Queue-------------"); logger.Info("InteractionId :" + interactionId); logger.Info("ProxyClientId :" + proxyId); logger.Info("QueueName :" + queueName); logger.Info("----------------------------------------------------------"); logger.Trace(eventAck.ToString()); output.MessageCode = "200"; output.Message = "Chat Transfer interaction Successful"; break; case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError.MessageId: Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError eventError = (Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError)message; logger.Info("------------Error on Chat Transfer Interaction By Queue-------------"); logger.Info("InteractionId :" + interactionId); logger.Info("ProxyClientId :" + proxyId); logger.Info("QueueName :" + queueName); logger.Info("-------------------------------------------------------------------"); logger.Trace(eventError.ToString()); output.MessageCode = "2001"; output.Message = Convert.ToString(eventError.ErrorDescription); logger.Error("Error occurred while chat transferring interaction : " + Convert.ToString(eventError.ErrorDescription)); break; } } else { output.MessageCode = "2001"; output.Message = "Chat Transfer Interaction UnSuccessful"; } logger.Info("------------TransferChatSession-------------"); logger.Info("InteractionId :" + interactionId); logger.Info("ProxyClientId :" + proxyId); logger.Info("QueueName :" + queueName); logger.Info("--------------------------------------------"); logger.Info(requestChangeProperties.ToString()); logger.Info(requestPlaceInQueue.ToString()); } else { logger.Warn("TransferChatSession() : Interaction Server protocol is Null.."); } } } catch (Exception generalException) { logger.Error("Error occurred while Transfer Chat Session request " + generalException.ToString()); output.MessageCode = "2001"; output.Message = generalException.Message; } return(output); }
/// <summary> /// Consults the chat session. /// </summary> /// <param name="interactionId">The interaction unique identifier.</param> /// <param name="agentID">The agent unique identifier.</param> /// <param name="placeId">The place unique identifier.</param> /// <param name="proxyId">The proxy unique identifier.</param> /// <param name="userData">The user data.</param> /// <returns></returns> public static Pointel.Interactions.Chat.Core.General.OutputValues ConsultChatSession(string interactionId, string agentID, string placeId, int proxyId, Genesyslab.Platform.Commons.Collections.KeyValueCollection userData) { Pointel.Logger.Core.ILog logger = Pointel.Logger.Core.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "AID"); Pointel.Interactions.Chat.Core.General.OutputValues output = Pointel.Interactions.Chat.Core.General.OutputValues.GetInstance(); try { Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestConference requestConference = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestConference.Create(); requestConference.PlaceId = placeId; requestConference.AgentId = agentID; requestConference.InteractionId = interactionId; requestConference.ProxyClientId = proxyId; requestConference.Extension = userData; requestConference.Extension.Add("ConsultUserData", "separate"); requestConference.VisibilityMode = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.VisibilityMode.Coach; if (Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol != null && Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.State == Genesyslab.Platform.Commons.Protocols.ChannelState.Opened) { Genesyslab.Platform.Commons.Protocols.IMessage message = Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.Request(requestConference); if (message != null) { switch (message.Id) { case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck.MessageId: Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck eventack = (Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck)message; logger.Info("------------ConsultChatSession-------------"); logger.Info("InteractionId :" + interactionId); logger.Info("ProxyClientId :" + proxyId); logger.Info("AgentId :" + agentID); logger.Info("PlaceId :" + placeId); logger.Info("--------------------------------------------"); logger.Trace(eventack.ToString()); output.MessageCode = "200"; output.Message = "Consult Chat Session Successful"; break; case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError.MessageId: Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError eventError = (Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventError)message; string LoginErrorCode = Convert.ToString(eventError.ErrorCode); string LoginErrorDescription = Convert.ToString(eventError.ErrorDescription); logger.Info("------------ConsultChatSession-------------"); logger.Error(LoginErrorCode + ":" + LoginErrorDescription); logger.Info("--------------------------------------------"); logger.Trace(eventError.ToString()); output.MessageCode = "2001"; output.Message = LoginErrorDescription; break; } } } else { logger.Warn("ConferenceChatSession() : Interaction Server protocol is Null.."); } } catch (Exception generalException) { logger.Error("Error occurred while Conference Chat Session request " + generalException.ToString()); output.MessageCode = "2001"; output.Message = generalException.Message; } return(output); }
/// <summary> /// Releases the chat interaction. /// </summary> /// <param name="sessionID">The session identifier.</param> /// <param name="proxyID">The proxy identifier.</param> /// <param name="userId">The user identifier.</param> /// <param name="chatClosingProtocol">The chat closing protocol.</param> /// <param name="queueName">Name of the queue.</param> /// <returns></returns> public static Pointel.Interactions.Chat.Core.General.OutputValues ReleaseChatInteraction(string sessionID, int proxyID, string userId, string queueName) { Pointel.Logger.Core.ILog logger = Pointel.Logger.Core.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "AID"); Pointel.Interactions.Chat.Core.General.OutputValues output = Pointel.Interactions.Chat.Core.General.OutputValues.GetInstance(); Genesyslab.Platform.Commons.Protocols.IMessage requestPlaceInQueueMsg = null; try { Genesyslab.Platform.WebMedia.Protocols.BasicChat.Requests.RequestReleaseParty requestReleaseParty = Genesyslab.Platform.WebMedia.Protocols.BasicChat.Requests.RequestReleaseParty.Create(); requestReleaseParty.AfterAction = Genesyslab.Platform.WebMedia.Protocols.BasicChat.Action.ForceClose; requestReleaseParty.SessionId = sessionID; if (Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol != null && Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol.State == Genesyslab.Platform.Commons.Protocols.ChannelState.Opened) { Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol.Send(requestReleaseParty); logger.Info("------------ReleaseChatInteraction-------------"); logger.Info("SessionID :" + sessionID); logger.Info("ProxyID :" + proxyID); logger.Info("UserID :" + userId); logger.Info("-----------------------------------------------------"); logger.Info(requestReleaseParty.ToString()); output.MessageCode = "200"; output.Message = "Release Force Party ChatSession Successful"; } Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestPlaceInQueue requestPlaceInQueue = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestPlaceInQueue.Create(); requestPlaceInQueue.InteractionId = sessionID; requestPlaceInQueue.ProxyClientId = proxyID; requestPlaceInQueue.Queue = queueName; if (Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol != null && Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.State == Genesyslab.Platform.Commons.Protocols.ChannelState.Opened) { requestPlaceInQueueMsg = Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.Request(requestPlaceInQueue); if (requestPlaceInQueueMsg != null) { switch (requestPlaceInQueueMsg.Id) { case Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events.EventAck.MessageId: // chatClosingProtocol.Close(); break; } logger.Info("------------ReleaseChatInteraction-------------"); logger.Info("SessionID :" + sessionID); logger.Info("ProxyID :" + proxyID); logger.Info("UserID :" + userId); logger.Info("------------------------------------------------"); logger.Info(requestReleaseParty.ToString()); output.MessageCode = "200"; output.Message = "Release Chat Interaction Successful"; } else { output.MessageCode = "2001"; output.Message = "Don't Release Chat Interaction Successful"; } } else { logger.Warn("ReleaseChatInteraction() : Interaction Server protocol is Null.."); } } catch (Exception generalException) { logger.Error("Error occurred while Release Chat Interaction request " + generalException.ToString()); output.MessageCode = "2001"; output.Message = generalException.Message; } return(output); }