/// <summary>
 /// Initializes a new instance of the <see cref="InboundUserControl"/> class.
 /// </summary>
 /// <param name="userData">The user data.</param>
 /// <param name="eventGetInteractionContent">Content of the event get interaction.</param>
 public InboundUserControl(KeyValueCollection userData, EventGetInteractionContent eventGetInteractionContent)
 {
     try
     {
         InitializeComponent();
         if (userData.Contains("Subject") && !string.IsNullOrEmpty(userData["Subject"].ToString()))
         {
             txtInboundSubject.Text = userData["Subject"].ToString();
         }
         else
         {
             txtInboundSubject.ToolTip = txtInboundSubject.Text = "(No Subject)";
         }
         if (userData.Contains("To"))
         {
             txtInboundTo.Text = Pointel.Interactions.Email.Helper.EmailAddressValidation.GetEmailAddress(userData["To"].ToString());
         }
         if (userData.Contains("FromAddress"))
         {
             txtInboundFrom.Text = Pointel.Interactions.Email.Helper.EmailAddressValidation.GetEmailAddress(userData["FromAddress"].ToString());
         }
         BindContent(eventGetInteractionContent);
     }
     catch (Exception ex)
     {
         logger.Error("Error occurred at InboundUserControl constructor" + ex.ToString());
     }
 }
Exemplo n.º 2
0
        private void InteractionManager_InteractionEvent(object sender, Infrastructure.EventArgs <Core.Model.Interactions.IInteraction> e)
        {
            var interaction = e.Value;

            if (interaction != null)
            {
                if (interaction.State == InteractionStateType.Connected)
                {
                    KeyValueCollection userData = interaction.ExtractAttachedData();

                    if (userData != null && Model != null && userData.Contains("CiscoCallID"))
                    {
                        string callId = userData["CiscoCallID"].ToString();
                        //  MessageBox.Show(userData["CiscoCallID"].ToString());
                        if (callId != null)
                        {
                            _callId        = callId;
                            _interactionId = interaction.InteractionId;
                            _caseId        = interaction.CaseId;
                            if (FinesseEventListener.Instance.CiscoVoices == null)
                            {
                                FinesseEventListener.Instance.CiscoVoices = new System.Collections.Generic.Dictionary <string, FinView>();
                            }
                            if (!FinesseEventListener.Instance.CiscoVoices.ContainsKey(_callId))
                            {
                                FinesseEventListener.Instance.CiscoVoices.Add(_callId, this);
                            }
                            Model.LoadInteraction(callId);
                            Model.FinAgent.AnswerCall(callId); // Auto Answer for the call. Mamdouh Temp
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        internal static bool CiscoVoiceViewModelCondition(ref object context)
        {
            IDictionary <string, object> contextDictionary = context as IDictionary <string, object>;
            object caseView;

            contextDictionary.TryGetValue("CaseView", out caseView);
            object caseObject;

            contextDictionary.TryGetValue("Case", out caseObject);
            ICase @case = caseObject as ICase;

            if (@case != null)
            {
                if (@case.MainInteraction != null)
                {
                    IInteraction       interaction = @case.MainInteraction;
                    KeyValueCollection userData    = interaction.ExtractAttachedData();

                    if (userData != null && userData.Contains("CiscoCallID"))
                    {
                        string callId = userData["CiscoCallID"].ToString();

                        if (callId != null)
                        {
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
Exemplo n.º 4
0
        public SerializableException(Exception ex)
        {
            HelpLink      = ex.HelpLink;
            HResult       = ex.HResult;
            Message       = ex.Message?.RemoveInvalidXmlChars();
            Source        = ex.Source;
            StackTrace    = ex.StackTrace;
            ExceptionType = ex.GetType().FullName;
            if (ex.InnerException != null)
            {
                InnerException = new SerializableException(ex.InnerException);
            }

            if (ex.Data == null)
            {
                return;
            }

            Data = new KeyValueCollection();
            foreach (var key in ex.Data.Keys)
            {
                if (!(key is string) && key.GetType().GetTypeInfo().IsClass)
                {
                    continue;
                }

                var    strKey = key.ToString();
                string strValue;
                try
                {
                    strValue = SerializerManager.DefaultTextSerializer.SerializeToString(ex.Data[key], ex.Data[key].GetType())?.RemoveInvalidXmlChars();
                }
                catch (Exception sEx)
                {
                    strValue = sEx.Message?.RemoveInvalidXmlChars();
                }
                if (!Data.Contains(strKey))
                {
                    Data.Add(strKey, strValue);
                }
            }
        }
Exemplo n.º 5
0
        private void InteractionManager_InteractionEvent(object sender, Infrastructure.EventArgs <Core.Model.Interactions.IInteraction> e)
        {
            var interaction = e.Value;

            string state = interaction.EntrepriseInteractionCurrent.State.ToString().ToLower();

            if (!(interactionID == e.Value.InteractionId))
            {
                interactionID = e.Value.InteractionId;


                FinesseEventListener.Instance.FinAgent.FireLogMessage("USD Module , A new interaction Event");
                try
                {
                    if (interaction != null)
                    {
                        FinesseEventListener.Instance.FinAgent.FireLogMessage("USD Module , We have new interaction event" + interaction.State);
                        if (interaction is IInteractionEmail || interaction is IInteractionChat) // We have email interaction received
                        {
                            _interactionId = interaction.InteractionId;
                            _caseId        = interaction.CaseId;
                            FinesseEventListener.Instance.FinAgent.FireLogMessage("USD Module  , we have a new interaction of type Email or Chat");

                            if (interaction.State == InteractionStateType.Connected) // Interaction is connected , now we should popup
                            {
                                FinesseEventListener.Instance.FinAgent.FireLogMessage("USD Module  , Interaction of email or chat is connected");

                                KeyValueCollection userData = interaction.ExtractAttachedData();

                                userData.Add("CustomerCIC", "123492");
                                userData.Add("FromAddress", "*****@*****.**");
                                userData.Add("ToAddress", "*****@*****.**");
                                //TODO Mamdouh Add Customer CIC and From Address and To Address
                                if (userData != null && Model != null && userData.Contains("CustomerCIC"))
                                {
                                    string customerCIC = userData["CustomerCIC"].ToString();
                                    string fromAddress = userData["FromAddress"].ToString();
                                    string toAddress   = userData["ToAddress"].ToString();

                                    FinesseEventListener.Instance.FinAgent.FireLogMessage("USD Module CIC is:" + customerCIC);


                                    if (customerCIC != null)
                                    {
                                        //check the CIC length is 16 digits
                                        string CICFormatted = customerCIC;
                                        while (CICFormatted.Length < 16)
                                        {
                                            CICFormatted = "0" + CICFormatted;
                                        }

                                        _customerCIC = CICFormatted;

                                        Dictionary <string, string> data = new Dictionary <string, string>();
                                        data.Add("CallVar4", _customerCIC);
                                        data.Add("InetractionID", _interactionId);
                                        data.Add("CaseID", _caseId);
                                        data.Add("AgentID", interaction.Agent.UserName);
                                        data.Add("AgentExt", "NA");
                                        data.Add("FromAddress", fromAddress);
                                        data.Add("ToAddress", toAddress);
                                        data.Add("DialNumber", "8016");


                                        //We should popup interaction ID now
                                        if (interaction is IInteractionEmail)
                                        {
                                            FinesseEventListener.Instance.FinAgent.FireLogMessage("USD Module Fire WS Event Start Email from address" + fromAddress);
                                            WSEventListener.Instance.FireWSEvent(data, EventType.EMAIL, EventDirection.START);
                                        }
                                        if (interaction is IInteractionChat)
                                        {
                                            FinesseEventListener.Instance.FinAgent.FireLogMessage("USD Module Fire WS Event Start Chat");
                                            WSEventListener.Instance.FireWSEvent(data, EventType.CHAT, EventDirection.START);
                                        }
                                    }
                                }
                            }
                            else if (interaction.State == InteractionStateType.Ended || interaction.State == InteractionStateType.Dropped)
                            {
                                KeyValueCollection userData = interaction.ExtractAttachedData();

                                if (userData != null && Model != null && userData.Contains("CustomerCIC"))
                                {
                                    string customerCIC = userData["CustomerCIC"].ToString();
                                    if (customerCIC != null)
                                    {
                                        _customerCIC = customerCIC;

                                        Dictionary <string, string> data = new Dictionary <string, string>();
                                        data.Add("CallVar4", _customerCIC);
                                        data.Add("InetractionID", _interactionId);
                                        data.Add("CaseID", _caseId);
                                        //We should popup interaction ID now
                                        if (interaction is IInteractionEmail)
                                        {
                                            WSEventListener.Instance.FireWSEvent(data, EventType.EMAIL, EventDirection.END);
                                        }
                                        if (interaction is IInteractionChat)
                                        {
                                            WSEventListener.Instance.FireWSEvent(data, EventType.CHAT, EventDirection.END);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    FinesseEventListener.Instance.FinAgent.FireLogMessage("USD Module , Exception during the event:" + ex.StackTrace + "\n and the message is" + ex.Message);
                }
            }
        }