/// <summary>
 /// Releases the force party chat session.
 /// </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>
 /// <returns></returns>
 public static Pointel.Interactions.Chat.Core.General.OutputValues ReleaseForcePartyChatSession(string sessionID, int proxyID, string userId, string messageText)
 {
     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.MessageText newMessageText = Genesyslab.Platform.WebMedia.Protocols.BasicChat.MessageText.Create();
         newMessageText.Text = messageText;
         Genesyslab.Platform.WebMedia.Protocols.BasicChat.Requests.RequestReleaseParty requestReleaseParty = Genesyslab.Platform.WebMedia.Protocols.BasicChat.Requests.RequestReleaseParty.Create(sessionID, userId, Genesyslab.Platform.WebMedia.Protocols.BasicChat.Action.ForceClose,
                                                                                                                                                                                                  newMessageText);
         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("------------ReleaseForcePartyChatSession-------------");
             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";
         }
         else
         {
             logger.Warn("ReleaseForcePartyChatSession() : Chat Server protocol is Null..");
         }
     }
     catch (Exception generalException)
     {
         logger.Error("Error occurred while Release Party Chat Session request " + generalException.ToString());
         output.MessageCode = "2001";
         output.Message     = generalException.Message;
     }
     return(output);
 }
Exemple #2
0
        /// <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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
 /// <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);
 }
Exemple #5
0
 /// <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>
 /// Sends the type start notification.
 /// </summary>
 /// <param name="sessionID">The session unique identifier.</param>
 /// <param name="noticeText">The notice text.</param>
 /// <param name="chatProtocol">The chat protocol.</param>
 /// <returns></returns>
 public static Pointel.Interactions.Chat.Core.General.OutputValues SendTypeStartNotification(string sessionID, string noticeText)
 {
     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.RequestNotify requestNotify = Genesyslab.Platform.WebMedia.Protocols.BasicChat.Requests.RequestNotify.Create();
         requestNotify.SessionId = sessionID;
         Genesyslab.Platform.WebMedia.Protocols.BasicChat.NoticeText newNoticeText = Genesyslab.Platform.WebMedia.Protocols.BasicChat.NoticeText.Create();
         newNoticeText.NoticeType = Genesyslab.Platform.WebMedia.Protocols.NoticeType.TypingStarted;
         newNoticeText.Text       = noticeText;
         requestNotify.NoticeText = newNoticeText;
         requestNotify.Visibility = Genesyslab.Platform.WebMedia.Protocols.BasicChat.Visibility.All;
         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(requestNotify);
             logger.Info("------------Send Type Start Notification-------------");
             logger.Info("SessionID      :" + sessionID);
             logger.Info("NoticeText     :" + noticeText);
             logger.Info("----------------------------------------");
             logger.Info(requestNotify.ToString());
             output.MessageCode = "200";
             output.Message     = "Send Type Start Notification Successful";
         }
         else
         {
             logger.Warn("SendTypeStartNotification() : Basic Chat Protocol is Null..");
         }
     }
     catch (Exception generalException)
     {
         logger.Error("Error occurred while Send Type Start Notification request " + generalException.ToString());
         output.MessageCode = "2001";
         output.Message     = generalException.Message;
     }
     return(output);
 }
 /// <summary>
 /// Stops the interaction process.
 /// </summary>
 /// <param name="stopInteractionId">The stop interaction identifier.</param>
 /// <param name="proxyId">The proxy identifier.</param>
 /// <returns></returns>
 public static Pointel.Interactions.Chat.Core.General.OutputValues StopInteractionProcess(string stopInteractionId, 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.InteractionManagement.RequestStopProcessing requestStopProcessing = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Requests.InteractionManagement.RequestStopProcessing.Create();
         requestStopProcessing.InteractionId = stopInteractionId;
         requestStopProcessing.ProxyClientId = proxyId;
         Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.ReasonInfo reasonInfo = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.ReasonInfo.Create();
         reasonInfo.ReasonSystemName  = "Stop Processing Reason Normal";
         reasonInfo.ReasonDescription = "Normal";
         requestStopProcessing.Reason = reasonInfo;
         logger.Info("Trying to Stop the interaction :" + stopInteractionId);
         if (Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol != null && Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.State == Genesyslab.Platform.Commons.Protocols.ChannelState.Opened)
         {
             Pointel.Interactions.Chat.Core.Util.Settings.IxnServerProtocol.Send(requestStopProcessing);
             logger.Info("------------StopChatSession-------------");
             logger.Info("InteractionId  :" + stopInteractionId);
             logger.Info("ProxyClientId    :" + proxyId);
             logger.Info("------------------------------------------------");
             output.MessageCode = "200";
             output.Message     = "Stop Chat Session Successful";
         }
         else
         {
             logger.Warn("StopInteractionProcess() : Interaction Server protocol is Null..");
         }
     }
     catch (Exception generalException)
     {
         logger.Error("Error occurred while Stop Chat Interaction request " + generalException.ToString());
         output.MessageCode = "2001";
         output.Message     = generalException.Message;
     }
     return(output);
 }
        /// <summary>
        /// Closes the chat protocol.
        /// </summary>
        /// <returns></returns>
        public Pointel.Interactions.Chat.Core.General.OutputValues CloseChatProtocol()
        {
            Pointel.Interactions.Chat.Core.General.OutputValues output = Pointel.Interactions.Chat.Core.General.OutputValues.GetInstance();

            try
            {
                Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol.Close();
                output.MessageCode = "200";
                output.Message     = "Closed Chat Protocol Successful";
            }
            catch (Genesyslab.Platform.Commons.Protocols.ProtocolException protocolException)
            {
                output.MessageCode = "2001";
                output.Message     = "Can't Close Chat Protocol";
                logger.Error("Error occurred while Close Chat Protocol " + protocolException.ToString());
            }
            catch (Exception generalException)
            {
                output.MessageCode = "2001";
                output.Message     = "Can't Close Chat Protocol";
                logger.Error("Error occurred while Close Chat Protocol " + generalException.ToString());
            }
            return(output);
        }
Exemple #10
0
        /// <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>
        /// Opens the chat protocol.
        /// </summary>
        /// <param name="nickName">Name of the nick.</param>
        /// <param name="personId">The person identifier.</param>
        /// <param name="host">The host.</param>
        /// <param name="port">The port.</param>
        /// <returns></returns>
        public Pointel.Interactions.Chat.Core.General.OutputValues OpenChatProtocol(string nickName, string personId,
                                                                                    Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgApplication primaryServer,
                                                                                    Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgApplication secondaryServer, bool switchoverServer = true)
        {
            var output = new Pointel.Interactions.Chat.Core.General.OutputValues();

            var chatServerConfProperties = new BasicChatServerConfProperties();

            try
            {
                if (primaryServer != null)
                {
                    logger.Debug("OpenChatProtocol : Applied primary server properties to Chat protocol");
                    logger.Debug("OpenChatProtocol : Primary server uri " + "tcp://" + primaryServer.ServerInfo.Host.IPaddress
                                 + ":" + primaryServer.ServerInfo.Port);
                    if (secondaryServer != null)
                    {
                        logger.Debug("OpenChatProtocol : Applied secondary server properties to Chst protocol");
                        logger.Debug("OpenChatProtocol : Secondary server uri " + "tcp://" + secondaryServer.ServerInfo.Host.IPaddress
                                     + ":" + secondaryServer.ServerInfo.Port);
                    }
                    else
                    {
                        logger.Warn("OpenChatProtocol : Secondary server is not mentioned");
                        logger.Info("OpenChatProtocol : Application has no backup servers");
                    }
                    ProtocolManagers.Instance().DisConnectServer(ServerType.Chatserver);
                    chatServerConfProperties.Create(new Uri("tcp://" + primaryServer.ServerInfo.Host.IPaddress + ":" + primaryServer.ServerInfo.Port),
                                                    nickName, Genesyslab.Platform.WebMedia.Protocols.BasicChat.UserType.Agent, personId,
                                                    new Uri("tcp://" + secondaryServer.ServerInfo.Host.IPaddress + ":" + secondaryServer.ServerInfo.Port),
                                                    Convert.ToInt32(primaryServer.ServerInfo.Timeout), Convert.ToInt16(primaryServer.ServerInfo.Attempts),
                                                    Convert.ToInt32(Pointel.Interactions.Chat.Core.Util.Settings.AddpServerTimeout),
                                                    Convert.ToInt32(Pointel.Interactions.Chat.Core.Util.Settings.AddpClientTimeout),
                                                    Genesyslab.Platform.Commons.Connection.Configuration.AddpTraceMode.Both);
                    var    ChatserverProtocolConfiguration = chatServerConfProperties.Protocolconfiguration;
                    string error = "";
                    if (!ProtocolManagers.Instance().ConnectServer(ChatserverProtocolConfiguration, out error))
                    {
                        logger.Error("Chat protocol is not opened due to, " + error);
                        output.MessageCode = "2001";
                        output.Message     = error;
                        return(output);
                    }
                    Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol =
                        ProtocolManagers.Instance().ProtocolManager[ChatserverProtocolConfiguration.Name] as Genesyslab.Platform.WebMedia.Protocols.BasicChatProtocol;

                    Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol.Received += Pointel.Interactions.Chat.Core.Listener.BasicChatListener.GetInstance().BasicExtractor;
                    #region Old code
                    //if (Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol == null)
                    //{
                    //    logger.Debug("ConnectBasicChatServer : Applied primary server properties to Basic Chat protocol");

                    //    //Primary Server settings
                    //    logger.Debug("OpenChatProtocol : Primary server uri " + "tcp://" + primaryServer.ServerInfo.Host.IPaddress
                    //                                                              + ":" + primaryServer.ServerInfo.Port);
                    //    ChatConnectionSettings.GetInstance().ChatProtocolProperties.Uri = new Uri("tcp://" + primaryServer.ServerInfo.Host.IPaddress
                    //                                                              + ":" + primaryServer.ServerInfo.Port);

                    //    if (secondaryServer != null)
                    //    {
                    //        logger.Debug("OpenChatProtocol : Applied secondary server properties to Basic Chat protocol");
                    //        //Backup Server settings
                    //        ChatConnectionSettings.GetInstance().ChatProtocolProperties.FaultTolerance = Genesyslab.Platform.ApplicationBlocks.Commons.Protocols.FaultToleranceMode.WarmStandby;
                    //        //HardCoded Values
                    //        ChatConnectionSettings.GetInstance().ChatProtocolProperties.WarmStandbyTimeout = Convert.ToInt32(primaryServer.ServerInfo.Timeout);
                    //        ChatConnectionSettings.GetInstance().ChatProtocolProperties.WarmStandbyAttempts = Convert.ToInt16(primaryServer.ServerInfo.Attempts);
                    //        //End

                    //        ChatConnectionSettings.GetInstance().ChatProtocolProperties.WarmStandbyUri = new Uri("tcp://" + secondaryServer.ServerInfo.Host.IPaddress +
                    //                                                                            ":" + secondaryServer.ServerInfo.Port);
                    //        logger.Debug("OpenChatProtocol : Secondary server uri " + "tcp://" + secondaryServer.ServerInfo.Host.IPaddress
                    //                                                                  + ":" + secondaryServer.ServerInfo.Port);
                    //    }
                    //    else
                    //    {
                    //        logger.Warn("OpenChatProtocol : Secondary server is not mentioned");
                    //        logger.Warn("OpenChatProtocol : Application has no backup servers");
                    //    }
                    //    //Set ADDP
                    //    ChatConnectionSettings.GetInstance().ChatProtocolProperties.UseAddp = true;

                    //    ChatConnectionSettings.GetInstance().ChatProtocolProperties.AddpServerTimeout = Convert.ToInt32(Pointel.Interactions.Chat.Core.Util.Settings.AddpServerTimeout);
                    //    ChatConnectionSettings.GetInstance().ChatProtocolProperties.AddpClientTimeout = Convert.ToInt32(Pointel.Interactions.Chat.Core.Util.Settings.AddpClientTimeout);

                    //    ChatConnectionSettings.GetInstance().ChatProtocolProperties.AddpTrace = "both";

                    //    ChatConnectionSettings.GetInstance().ChatProtocolProperties.UserNickname = nickName;
                    //    ChatConnectionSettings.GetInstance().ChatProtocolProperties.UserType = Genesyslab.Platform.WebMedia.Protocols.BasicChat.UserType.Agent;
                    //    ChatConnectionSettings.GetInstance().ChatProtocolProperties.PersonId = personId;

                    //    logger.Debug("OpenChatProtocol : Trying to register protocol manger for Basic Chat protocol");
                    //    if (ChatConnectionSettings.GetInstance().ChatProtocolManager == null)
                    //    {
                    //        ChatConnectionSettings.GetInstance().ChatProtocolManager = new Genesyslab.Platform.ApplicationBlocks.Commons.Protocols.ProtocolManagementService();
                    //        ChatConnectionSettings.GetInstance().ChatProtocolManager.Register(ChatConnectionSettings.GetInstance().ChatProtocolProperties);
                    //        logger.Debug("OpenChatProtocol : Registered protocol manager");
                    //    }
                    //    else
                    //    {
                    //        ChatConnectionSettings.GetInstance().ChatProtocolManager.Register(ChatConnectionSettings.GetInstance().ChatProtocolProperties);
                    //        logger.Debug("OpenChatProtocol : Registered protocol manager");
                    //    }
                    //    //Open the connection
                    //    ChatConnectionSettings.GetInstance().ChatProtocolManager[ChatConnectionSettings.ChatServer].Open();
                    //    Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol = (Genesyslab.Platform.WebMedia.Protocols.BasicChatProtocol)ChatConnectionSettings.GetInstance().ChatProtocolManager[ChatConnectionSettings.ChatServer];

                    //    ChatConnectionSettings.GetInstance().ChatEventBroker[0] = Genesyslab.Platform.ApplicationBlocks.Commons.Broker.BrokerServiceFactory.CreateEventBroker(ChatConnectionSettings.GetInstance().ChatProtocolManager.Receiver);
                    //    ChatConnectionSettings.GetInstance().ChatEventBroker[0].Activate();

                    //    ChatConnectionSettings.GetInstance().ChatEventBroker[0].Register(Pointel.Interactions.Chat.Core.Listener.BasicChatListener.GetInstance().BasicExtractor);

                    #endregion

                    if (Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol.State == Genesyslab.Platform.Commons.Protocols.ChannelState.Opened)
                    {
                        Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol.Opened += new EventHandler(ChatConnectionManager_Opened);
                        Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol.Closed += new EventHandler(ChatConnectionManager_Closed);
                        logger.Debug("OpenChatProtocol : Basic Chat protocol is opened ");
                        logger.Debug("OpenChatProtocol : Basic Chat protocol object id is "
                                     + Pointel.Interactions.Chat.Core.Util.Settings.ChatProtocol.GetHashCode().ToString());
                        output.MessageCode = "200";
                        output.Message     = "Chat Server Connected";
                    }
                    else
                    {
                        logger.Warn("OpenChatProtocol : Basic Chat protocol is closed ");
                    }
                }
                else
                {
                    logger.Error("OpenChatProtocol : No primary server configured.");
                    output.MessageCode = "2002";
                    output.Message     = "No primary server configured. Could not able to connect Chat server";
                }
            }
            catch (Exception generalException)
            {
                if (switchoverServer)
                {
                    output = OpenChatProtocol(nickName, personId, secondaryServer, primaryServer, false);
                }
                else
                {
                    logger.Error("OpenChatProtocol :" + generalException.ToString());
                    output.MessageCode = "2001";
                    output.Message     = generalException.Message;
                }
            }
            return(output);
        }
        /// <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>
 /// 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);
 }
        /// <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);
        }