public void UpdateRecords(IXNCustomData emailData, SFDCCallType callType)
        {
            try
            {
                this._logger.Info("Trying to update SFDC on EmailMoveToWorkbin Event, Email Type: " + callType.ToString());
                if (callType == SFDCCallType.InboundEmail)
                {
                    this._sfdcPopupData = this._emailEvents.GetInboundUpdateData(emailData, callType, "movetoworkbin");
                }
                else if (callType == SFDCCallType.OutboundEmailSuccess)
                {
                    this._sfdcPopupData = this._emailEvents.GetOutboundEmailUpdateData(emailData, callType, "movetoworkbin");
                }

                if (this._sfdcPopupData != null)
                {
                    this._sfdcPopupData.InteractionId = emailData.InteractionId;
                    this._searchHandler.ProcessUpdateData(emailData.InteractionId, this._sfdcPopupData);
                }
                else
                {
                    this._logger.Info("UpdateRecords ; Search data is empty");
                }
            }
            catch (Exception exception)
            {
                this._logger.Error("EmailMoveToWorkbin: Error Occurred while collecting data : " + exception.ToString());
            }
        }
 public void InteractionEventEmail(IXNCustomData ixnData)
 {
     try
     {
         ThreadPool.QueueUserWorkItem(delegate
         {
             if (ixnData != null)
             {
                 if (ixnData.MediaType == MediaType.Email && this._emailPopup != null)
                 {
                     this._emailPopup.ReceiveEmailEventsFromCommands(ixnData);
                 }
                 else if (ixnData.MediaType == MediaType.Chat && _chatPopup != null)
                 {
                     this._chatPopup.InteractionEventChat(ixnData);
                 }
                 else if (ixnData.MediaType == MediaType.Voice && _voicePopup != null)
                 {
                     _voicePopup.UpdateDispositionCodeChange(ixnData);
                 }
             }
             else
             {
                 this._logger.Info("EmailData object is null");
             }
         });
     }
     catch (Exception generalException)
     {
         _logger.Error("InteractionEventEmail:  Error occurred : " + generalException.ToString());
     }
 }
Example #3
0
        /// <summary>
        /// Popup SFDC on EventInvite Event
        /// </summary>
        /// <param name="ixnData"></param>
        /// <param name="callType"></param>
        public void PopupRecords(IXNCustomData ixnData, SFDCCallType callType)
        {
            try
            {
                this._logger.Info("PopupRecords: ChatSessionConnected Event ");
                if (callType == SFDCCallType.InboundChat)
                {
                    _sfdcPopupData = this._chatEvents.GetInboundPopupData(ixnData, callType, "established");
                }
                else if (callType == SFDCCallType.ConsultChatReceived)
                {
                    _sfdcPopupData = this._chatEvents.GetInboundPopupData(ixnData, callType, "established");
                }

                if (_sfdcPopupData != null)
                {
                    _sfdcPopupData.InteractionId = ixnData.InteractionId;
                    this._searchHandler.ProcessSearchData(ixnData.InteractionId, _sfdcPopupData, callType);
                }
                else
                {
                    this._logger.Info("PopupRecords : Search data is empty");
                }
            }
            catch (Exception generalException)
            {
                this._logger.Error("PopupRecords : Error Occurred at ChatConnected : " + generalException.ToString());
            }
        }
Example #4
0
        public void UpdateRecords(IXNCustomData emailData, SFDCCallType callType)
        {
            try
            {
                this._logger.Info("Trying to update SFDC on AttachedDataChanged Event, Email Type: " + callType.ToString());
                if (callType == SFDCCallType.InboundEmail)
                {
                    this._sfdcPopupData = this._emailEvents.GetInboundUpdateData(emailData, callType, "datachanged");
                }
                else if (callType == SFDCCallType.OutboundEmailSuccess)
                {
                    this._sfdcPopupData = this._emailEvents.GetOutboundEmailUpdateData(emailData, callType, "datachanged");
                }

                if (this._sfdcPopupData != null)
                {
                    this._sfdcPopupData.InteractionId = emailData.InteractionId;
                    this._searchHandler.ProcessUpdateData(emailData.InteractionId, this._sfdcPopupData);
                }
                else
                {
                    this._logger.Info("Search data is empty");
                }
            }
            catch (Exception exception)
            {
                this._logger.Error("EmailInvite: Error Occurred in Updating sfdc data : " + exception.ToString());
            }
        }
        /// <summary>
        /// Updates the records.
        /// </summary>
        /// <param name="chatData">The chat data.</param>
        /// <param name="callType">Type of the call.</param>
        public void UpdateRecords(IXNCustomData chatData, SFDCCallType callType)
        {
            try
            {
                if (callType == SFDCCallType.InboundChat)
                {
                    _sfdcUpdateData = this._chatEvents.GetInboundUpdateData(chatData, "rejected");
                }
                else if (callType == SFDCCallType.ConsultChatReceived)
                {
                    _sfdcUpdateData = this._chatEvents.GetConsultUpdateData(chatData, "rejected");
                }

                if (_sfdcUpdateData != null)
                {
                    _sfdcUpdateData.InteractionId = chatData.InteractionId;
                    this._searchHandler.ProcessUpdateData(chatData.InteractionId, _sfdcUpdateData);
                }
                else
                {
                    this._logger.Info("UpdateRecords: Search data is empty");
                }
            }
            catch (Exception generalException)
            {
                this._logger.Error("UpdateRecords : Error Occurred While collecting log data : " + generalException.ToString());
            }
        }
        /// <summary>
        /// Gets the Chat Update data.
        /// </summary>
        /// <param name="emailData"></param>
        /// <param name="callType"></param>
        /// <param name="duration"></param>
        /// <param name="emailContent"></param>
        /// <returns></returns>
        public CaseData GetCaseEmailUpdateData(IXNCustomData emailData, SFDCCallType callType, string eventName)
        {
            CaseData cases = new CaseData();

            try
            {
                this._logger.Info("GetCaseOutboundEmailUpdateData :  Reading Account Update Data.....");

                if (emailData != null)
                {
                    #region Collect Case Data

                    cases.ObjectName = _caseEmailOptions.ObjectName;
                    if (callType == SFDCCallType.InboundEmail || callType == SFDCCallType.InboundEmailPulled)
                    {
                        if (_caseEmailOptions.InboundCanUpdateLog)
                        {
                            cases.UpdateActivityLog     = true;
                            cases.UpdateActivityLogData = this._sfdcUtility.GetUpdateActivityLogData(this._caseEmailLogOptions, null, callType, emailData.Duration, emailData: emailData);
                            if (!string.IsNullOrWhiteSpace(_caseEmailOptions.EmailAppendActivityLogEventNames) && _caseEmailOptions.EmailAppendActivityLogEventNames.Contains(eventName))
                            {
                                cases.AppendActivityLogData = this._sfdcUtility.GetUpdateActivityLogData(this._caseEmailLogOptions, null, callType, emailData.Duration, emailData: emailData, isAppendLogData: true);
                            }
                        }
                    }
                    else if (callType == SFDCCallType.OutboundEmailFailure || callType == SFDCCallType.OutboundEmailSuccess || callType == SFDCCallType.OutboundEmailPulled)
                    {
                        if (_caseEmailOptions.OutboundCanUpdateLog)
                        {
                            cases.UpdateActivityLog     = true;
                            cases.UpdateActivityLogData = this._sfdcUtility.GetUpdateActivityLogData(this._caseEmailLogOptions, null, callType, emailData.Duration, emailData: emailData);
                            if (!string.IsNullOrWhiteSpace(_caseEmailOptions.EmailAppendActivityLogEventNames) && _caseEmailOptions.EmailAppendActivityLogEventNames.Contains(eventName))
                            {
                                cases.AppendActivityLogData = this._sfdcUtility.GetUpdateActivityLogData(this._caseEmailLogOptions, null, callType, emailData.Duration, emailData: emailData, isAppendLogData: true);
                            }
                        }
                    }
                    //update account record fields
                    cases.UpdateRecordFields = _caseEmailOptions.CanUpdateRecordData;
                    cases.NoRecordFound      = SFDCObjectHelper.GetNoRecordFoundAction(callType, _caseEmailOptions);
                    if (cases.NoRecordFound.Equals("createnew") && this._caseEmailRecordConfig != null)
                    {
                        if (_caseEmailOptions.CanUpdateRecordData)
                        {
                            cases.UpdateRecordFieldsData = this._sfdcUtility.GetUpdateActivityLogData(this._caseEmailRecordConfig, null, callType, emailData.Duration, emailData: emailData);
                        }
                    }

                    #endregion Collect Case Data

                    return(cases);
                }
            }
            catch (Exception generalException)
            {
                this._logger.Error("GetCaseOutboundEmailUpdateData : Error occurred while reading Account Data : " + generalException.ToString());
                return(cases);
            }
            return(null);
        }
Example #7
0
        public void PopupRecords(IXNCustomData ixnData, SFDCCallType callType)
        {
            try
            {
                if (callType == SFDCCallType.InboundChat)
                {
                    _sfdcPopupData = this._chatEvents.GetInboundPopupData(ixnData, callType, "invite");
                }
                else if (callType == SFDCCallType.ConsultChatReceived)
                {
                    _sfdcPopupData = this._chatEvents.GetConsultReceivedPopupData(ixnData, callType, "invite");
                }

                if (_sfdcPopupData != null)
                {
                    _sfdcPopupData.InteractionId = ixnData.InteractionId;
                    this._searchHandler.ProcessSearchData(ixnData.InteractionId, _sfdcPopupData, callType);
                }
                else
                {
                    this._logger.Info("ChatInvite.PopupRecords : Search data is empty");
                }
            }
            catch (Exception generalException)
            {
                _logger.Error("ChatInvite.PopupRecords : Error Occurred while collecting Log data : " + generalException.ToString());
            }
        }
Example #8
0
 internal void UpdateDispositionCodeChange(IXNCustomData data)
 {
     try
     {
         this._logger.Info("UpdateDispositionCodeChange()");
         if (!Settings.SFDCOptions.CanUseGenesysCallDuration || string.IsNullOrWhiteSpace(data.Duration))
         {
             if (_callDurationData.ContainsKey(data.InteractionId))
             {
                 TimeSpan ts = System.DateTime.Now.Subtract(_callDurationData[data.InteractionId]);
                 data.Duration = ts.Hours + " Hr " + ts.Minutes + " Mins " + ts.Seconds + " Secs";
             }
         }
         if (!string.IsNullOrWhiteSpace(data.EventName) && data.EventName == "InteractionMarkDone")
         {
             CallMarkDone.GetInstance().UpdateRecords(data);
         }
         else if (data.InteractionEvent != null)
         {
             UpdateOnDispositionCodeChange(data.InteractionEvent, data.Duration);
         }
     }
     catch (Exception generalException)
     {
         this._logger.Error("UpdateDispositionCodeChange: Error occurred, details: " + generalException);
     }
 }
Example #9
0
        public void PopupRecords(IXNCustomData emailData, SFDCCallType callType)
        {
            try
            {
                this._logger.Info("Trying to update SFDC on EmailPulled Event, Email Type: " + callType.ToString());
                if (callType == SFDCCallType.InboundEmailPulled)
                {
                    this._sfdcPopupData = this._emailEvents.GetInboundPopupData(emailData, callType, "pulled");
                }
                else if (callType == SFDCCallType.OutboundEmailPulled)
                {
                    this._sfdcPopupData = this._emailEvents.GetOutboundEmailPopupData(emailData, callType, "pulled");
                }

                if (this._sfdcPopupData != null)
                {
                    this._sfdcPopupData.InteractionId = emailData.InteractionId;
                    this._searchHandler.ProcessSearchData(emailData.InteractionId, this._sfdcPopupData, callType);
                }
                else
                {
                    this._logger.Info("Search data is empty");
                }
            }
            catch (Exception exception)
            {
                this._logger.Error("EmailPulled: Error Occurred while collecting Log data : " + exception.ToString());
            }
        }
 public void PopupRecords(IXNCustomData emailData, SFDCCallType callType)
 {
     try
     {
         this._logger.Info("Trying to Popup SFDC on EmailCreate Event, Email Type: " + callType.ToString());
         if (callType == SFDCCallType.OutboundEmailSuccess)
         {
             this._sfdcPopupData = this._emailEvents.GetOutboundEmailPopupData(emailData, callType, "create");
             if (this._sfdcPopupData != null)
             {
                 this._sfdcPopupData.InteractionId = emailData.InteractionId;
                 if (emailData.IXN_Attributes.ParentId != null && Settings.InboundEmailSearchResult.ContainsKey(emailData.IXN_Attributes.ParentId))
                 {
                     this.searchHandler.ProcessSFDCResponseForCommonSearch(Settings.InboundEmailSearchResult[emailData.IXN_Attributes.ParentId], this._sfdcPopupData, emailData.InteractionId, callType);
                 }
                 else
                 {
                     this.searchHandler.ProcessSearchData(emailData.InteractionId, this._sfdcPopupData, callType);
                 }
             }
             else
             {
                 this._logger.Info("Search data is empty");
             }
         }
     }
     catch (Exception exception)
     {
         this._logger.Error("EmailCreate: Error Occurred : " + exception.ToString());
     }
 }
        /// <summary>
        /// Gets Case Popup Data
        /// </summary>
        /// <param name="message"></param>
        /// <param name="callType"></param>
        /// <returns></returns>
        public CaseData GetCaseChatPopupData(IXNCustomData chatData, SFDCCallType callType)
        {
            try
            {
                IMessage message = chatData.InteractionEvent;
                this._logger.Info("GetCaseChatPopupData :  Reading Case Popup Data.....");
                this._logger.Info("GetCaseChatPopupData :  Event Name : " + message.Name);
                this._logger.Info("GetCaseChatPopupData :  CallType Name : " + callType.ToString());
                dynamic popupEvent = Convert.ChangeType(message, message.GetType());

                if (popupEvent != null)
                {
                    CaseData cases = new CaseData();
                    cases.SearchData                             = this._sfdcUtilityHelper.GetChatSearchValue(_caseChatOptions, chatData, callType);
                    cases.ObjectName                             = _caseChatOptions.ObjectName;
                    cases.NoRecordFound                          = SFDCObjectHelper.GetNoRecordFoundAction(callType, _caseChatOptions);
                    cases.MultipleMatchRecord                    = SFDCObjectHelper.GetMultiMatchRecordAction(callType, _caseChatOptions);
                    cases.NewRecordFieldIds                      = _caseChatOptions.NewrecordFieldIds;
                    cases.SearchCondition                        = _caseChatOptions.SearchCondition;
                    cases.CreateLogForNewRecord                  = _caseChatOptions.CanCreateLogForNewRecordCreate;
                    cases.MaxRecordOpenCount                     = _caseChatOptions.MaxNosRecordOpen;
                    cases.SearchpageMode                         = _caseChatOptions.SearchPageMode;
                    cases.PhoneNumberSearchFormat                = _caseChatOptions.PhoneNumberSearchFormat;
                    cases.CanCreateNoRecordActivityLog           = SFDCObjectHelper.GetCanCreateProfileActivity(callType, _caseChatOptions, true);
                    cases.CanPopupNoRecordActivityLog            = SFDCObjectHelper.GetCanPopupProfileActivity(callType, _caseChatOptions, true);
                    cases.CanCreateMultiMatchActivityLog         = SFDCObjectHelper.GetCanCreateProfileActivity(callType, _caseChatOptions);
                    cases.CanPopupMultiMatchActivityLog          = SFDCObjectHelper.GetCanPopupProfileActivity(callType, _caseChatOptions);
                    cases.CanCreateProfileActivityforInbNoRecord = _caseChatOptions.CanCreateProfileActivityforInbNoRecord;
                    if (cases.NoRecordFound.Equals("createnew") && this._caseChatRecordConfig != null)
                    {
                        cases.CreateRecordFieldData = this._sfdcUtility.GetCreateActivityLogData(this._caseChatRecordConfig, message, callType, emailData: chatData);
                    }
                    if (callType == SFDCCallType.InboundChat)
                    {
                        if (_caseChatOptions.InboundCanCreateLog)
                        {
                            cases.CreateActvityLog = true;
                            cases.ActivityLogData  = this._sfdcUtility.GetCreateActivityLogData(this._caseChatLogOptions, popupEvent, callType, emailData: chatData);
                        }
                    }
                    else if (callType == SFDCCallType.ConsultChatReceived)
                    {
                        if (_caseChatOptions.ConsultCanCreateLog)
                        {
                            cases.CreateActvityLog = true;
                            cases.ActivityLogData  = this._sfdcUtility.GetCreateActivityLogData(this._caseChatLogOptions, popupEvent, callType, emailData: chatData);
                        }
                    }
                    return(cases);
                }
            }
            catch (Exception generalException)
            {
                this._logger.Error("GetCaseChatPopupData : Error occurred while reading Case Data : " + generalException.ToString());
            }
            return(null);
        }
        /// <summary>
        /// Get Account Popup Data for Email
        /// </summary>
        /// <param name="emailData"></param>
        /// <param name="callType"></param>
        /// <returns></returns>
        public CaseData GetCaseEmailPopupData(IXNCustomData emailData, SFDCCallType callType)
        {
            try
            {
                this._logger.Info("GetAccountEmailPopupData :  Reading Account Popup Data.....");
                this._logger.Info("GetAccountEmailPopupData :  CallType Name : " + callType.ToString());

                if (emailData != null)
                {
                    CaseData cases = new CaseData();

                    #region Collect Case Data

                    cases.SearchData              = this._sfdcUtilityHelper.GetEmailSearchValue(_caseEmailOptions, emailData, callType);
                    cases.ObjectName              = _caseEmailOptions.ObjectName;
                    cases.NoRecordFound           = SFDCObjectHelper.GetNoRecordFoundAction(callType, _caseEmailOptions);
                    cases.MultipleMatchRecord     = SFDCObjectHelper.GetMultiMatchRecordAction(callType, _caseEmailOptions);
                    cases.NewRecordFieldIds       = _caseEmailOptions.NewrecordFieldIds;
                    cases.SearchCondition         = _caseEmailOptions.SearchCondition;
                    cases.CreateLogForNewRecord   = _caseEmailOptions.CanCreateLogForNewRecordCreate;
                    cases.MaxRecordOpenCount      = _caseEmailOptions.MaxNosRecordOpen;
                    cases.SearchpageMode          = _caseEmailOptions.SearchPageMode;
                    cases.PhoneNumberSearchFormat = _caseEmailOptions.PhoneNumberSearchFormat;
                    if (cases.NoRecordFound.Equals("createnew") && this._caseEmailRecordConfig != null)
                    {
                        cases.CreateRecordFieldData = this._sfdcUtility.GetCreateActivityLogData(this._caseEmailRecordConfig, null, callType, emailData);
                    }
                    if (callType == SFDCCallType.InboundEmail || callType == SFDCCallType.InboundEmailPulled)
                    {
                        if (_caseEmailOptions.InboundCanCreateLog)
                        {
                            cases.CreateActvityLog = true;
                            cases.ActivityLogData  = this._sfdcUtility.GetCreateActivityLogData(this._caseChatLogOptions, null, callType, emailData);
                        }
                    }
                    else if (callType == SFDCCallType.OutboundEmailFailure || callType == SFDCCallType.OutboundEmailSuccess || callType == SFDCCallType.OutboundEmailPulled)
                    {
                        if (_caseEmailOptions.OutboundCanCreateLog)
                        {
                            cases.CreateActvityLog = true;
                            cases.ActivityLogData  = this._sfdcUtility.GetCreateActivityLogData(this._caseChatLogOptions, null, callType, emailData);
                        }
                    }

                    #endregion Collect Case Data

                    return(cases);
                }
            }
            catch (Exception generalException)
            {
                this._logger.Error("GetAccountEmailPopupData : Error occurred while reading Account Data : " + generalException.ToString());
            }
            return(null);
        }
 public void NotifyChatDispositionCode(string interactionId, string dispKeyName, string dispCode)
 {
     if (sfdcAdapter != null)
     {
         IXNCustomData data = new IXNCustomData();
         data.InteractionId   = interactionId;
         data.MediaType       = MediaType.Chat;
         data.DispositionCode = new System.Tuple <string, string>(dispKeyName, dispCode);
         sfdcAdapter.DispositionCodeChanged(data);
     }
 }
 /// <summary>
 /// Gets Updated Disposition Code Change
 /// </summary>
 /// <param name="ixnId"></param>
 /// <param name="key"></param>
 /// <param name="code"></param>
 public void UpdateDispositionCodeChange(IXNCustomData dispCode)
 {
     try
     {
         GetEmailData(dispCode.InteractionId, dispCode);
         EmailInvite.GetInstance().UpdateRecords(dispCode, dispCode.InteractionType);
     }
     catch (Exception generalException)
     {
         this._logger.Error("UpdateDispositionCodeChange : Error at updating disposition code Changed : " + generalException.ToString());
     }
 }
Example #15
0
        private void GetChatData(string ixnId, IXNCustomData chatData)
        {
            try
            {
                this._logger.Info("Retrieving UCS data for the InteractionId : " + ixnId + "\t EventName : " + chatData.EventName);
                EventGetInteractionContent chatContent = Settings.SFDCListener.GetOpenMediaInteractionContent(ixnId, false);
                if (chatContent != null)
                {
                    if (chatContent.InteractionAttributes.TypeId == "Inbound")
                    {
                        chatData.InteractionType = SFDCCallType.InboundChat;
                    }
                    else if (chatContent.InteractionAttributes.TypeId == "Consult")
                    {
                        chatData.InteractionType = SFDCCallType.ConsultChatReceived;
                    }

                    EventInvite currentEvent = null;
                    _chatIXNCollection.TryGetValue(ixnId, out currentEvent);
                    chatData.InteractionEvent    = currentEvent;
                    chatData.IXN_Attributes      = chatContent.InteractionAttributes;
                    chatData.EntityAttributes    = chatContent.EntityAttributes;
                    chatData.AttachmentLists     = chatContent.Attachments;
                    chatData.InteractionContents = chatContent.InteractionContent;
                    if (chatData.UserData == null)
                    {
                        chatData.UserData = chatContent.InteractionAttributes.AllAttributes;
                    }

                    if (chatData.InteractionNotes == null && chatContent.InteractionAttributes != null)
                    {
                        chatData.InteractionNotes = chatContent.InteractionAttributes.TheComment;
                    }

                    if (!Settings.SFDCOptions.CanUseGenesysCallDuration || string.IsNullOrWhiteSpace(chatData.Duration))
                    {
                        if (_callDurationData.ContainsKey(chatData.InteractionId))
                        {
                            TimeSpan ts = System.DateTime.Now.Subtract(_callDurationData[chatData.InteractionId]);
                            chatData.Duration = ts.Hours + "Hr " + ts.Minutes + " Mins " + ts.Seconds + "Secs";
                        }
                    }
                }
                else
                {
                    this._logger.Info("GetChatData: Null is returned from UCS for the  interaction id : " + chatData.InteractionId);
                }
            }
            catch (Exception generalException)
            {
                this._logger.Info("GetChatData: Error occurred, Exception : " + generalException.ToString());
            }
        }
Example #16
0
        public IUserActivity GetChatUpdateUserAcitivityData(IXNCustomData chatData, string eventName)
        {
            try
            {
                IMessage     message      = chatData.InteractionEvent;
                SFDCCallType callType     = chatData.InteractionType;
                string       callDuration = chatData.Duration;
                this._logger.Info("GetChatUpdateUserAcitivityData :  Reading User Activity Update Data.....");
                this._logger.Info("GetChatUpdateUserAcitivityData :  Event Name : " + message.Name);
                dynamic popupEvent = Convert.ChangeType(message, message.GetType());

                if (popupEvent != null)
                {
                    IUserActivity userActivity = new UserActivityData();

                    #region Collect Lead Data

                    userActivity.ObjectName = this._voiceUserActivityOptions.ObjectName;

                    if (callType == SFDCCallType.InboundChat)
                    {
                        if (this._voiceUserActivityOptions.InboundCanUpdateLog)
                        {
                            userActivity.UpdateActivityLog     = true;
                            userActivity.UpdateActivityLogData = this._sfdcUtility.GetUpdateActivityLogData(_chatUserActivityLog, popupEvent, callType, callDuration, emailData: chatData);
                        }
                    }
                    if (callType == SFDCCallType.ConsultChatReceived)
                    {
                        if (this._voiceUserActivityOptions.ConsultCanUpdateLog)
                        {
                            userActivity.UpdateActivityLog     = true;
                            userActivity.UpdateActivityLogData = this._sfdcUtility.GetUpdateActivityLogData(_chatUserActivityLog, popupEvent, callType, callDuration, emailData: chatData);
                        }
                    }

                    #endregion Collect Lead Data

                    return(userActivity);
                }
            }
            catch (Exception generalException)
            {
                this._logger.Error("GetChatUpdateUserAcitivityData : Error occurred while reading Lead Data : " + generalException.ToString());
            }
            return(null);
        }
Example #17
0
        public IUserActivity GetOutboundEmailUpdateUserAcitivityData(IXNCustomData emailData, SFDCCallType callType, string eventName)
        {
            try
            {
                this._logger.Info("GetOutboundEmailUpdateUserAcitivityData :  Reading User Activity Update Data.....");
                if (emailData != null)
                {
                    IUserActivity userActivity = new UserActivityData();

                    #region Collect Lead Data

                    userActivity.ObjectName = this._emailUserActivityOptions.ObjectName;

                    if (callType == SFDCCallType.InboundEmail || callType == SFDCCallType.InboundEmailPulled)
                    {
                        if (_emailUserActivityOptions.InboundCanUpdateLog)
                        {
                            userActivity.UpdateActivityLog     = true;
                            userActivity.UpdateActivityLogData = this._sfdcUtility.GetUpdateActivityLogData(_emailUserActivityLog, null, callType, emailData.Duration, emailData: emailData);
                            //if (!string.IsNullOrWhiteSpace(_emailUserActivityOptions.AppendActivityLogEventNames) && _emailUserActivityOptions.AppendActivityLogEventNames.Contains(eventName))
                            //    userActivity.AppendActivityLogData = this._sfdcUtility.GetUpdateActivityLogData(this._emailUserActivityLog, null, callType, emailData.Duration, emailData: emailData, isAppendLogData: true);
                        }
                    }
                    else if (callType == SFDCCallType.OutboundEmailFailure || callType == SFDCCallType.OutboundEmailSuccess || callType == SFDCCallType.OutboundEmailPulled)
                    {
                        if (this._emailUserActivityOptions.OutboundCanUpdateLog)
                        {
                            userActivity.UpdateActivityLog     = true;
                            userActivity.UpdateActivityLogData = this._sfdcUtility.GetUpdateActivityLogData(_emailUserActivityLog, null, callType
                                                                                                            , emailData.Duration, emailData: emailData);
                            //if (!string.IsNullOrWhiteSpace(_emailUserActivityOptions.AppendActivityLogEventNames) && _emailUserActivityOptions.AppendActivityLogEventNames.Contains(eventName))
                            //    userActivity.AppendActivityLogData = this._sfdcUtility.GetUpdateActivityLogData(this._emailUserActivityLog, null, callType, emailData.Duration, emailData: emailData, isAppendLogData: true);
                        }
                    }

                    #endregion Collect Lead Data

                    return(userActivity);
                }
            }
            catch (Exception generalException)
            {
                this._logger.Error("GetOutboundEmailUpdateUserAcitivityData : Error occurred while reading Lead Data : " + generalException.ToString());
            }
            return(null);
        }
        /// <summary>
        /// Receives the DispositionCode Changed Event from chat/ email interaction and updates SFDC Records
        /// </summary>
        /// <param name="InteractionData"></param>

        public void DispositionCodeChanged(IXNCustomData dispCode)
        {
            ThreadPool.QueueUserWorkItem(delegate
            {
                if (dispCode.MediaType == MediaType.Voice && _voicePopup != null)
                {
                    _voicePopup.UpdateDispositionCodeChange(dispCode);
                }
                else if (dispCode.MediaType == MediaType.Chat && _chatPopup != null)
                {
                    _chatPopup.UpdateDispositionCodeChange(dispCode);
                }
                else if (dispCode.MediaType == MediaType.Email && _emailPopup != null)
                {
                    _emailPopup.UpdateDispositionCodeChange(dispCode);
                }
            });
        }
        public void PopupRecords(IXNCustomData emailData, SFDCCallType callType)
        {
            try
            {
                this._logger.Info("Trying to popup SFDC on EmailSend Event, Email Type: " + callType.ToString());
                if (callType == SFDCCallType.OutboundEmailSuccess)
                {
                    this._sfdcPopupData = this._emailEvents.GetOutboundEmailPopupData(emailData, callType, "send");
                    if (this._sfdcPopupData != null)
                    {
                        this._sfdcPopupData.InteractionId = emailData.InteractionId;
                        this.searchHandler.ProcessSearchData(emailData.InteractionId, this._sfdcPopupData, callType);
                    }
                    else
                    {
                        this._logger.Info("Search data is empty");
                    }

                    this._logger.Info("Trying to update SFDC on EmailSend Event, Email Type: " + callType.ToString());
                    this._sfdcPopupData = this._emailEvents.GetOutboundEmailUpdateData(emailData, callType, "send");
                    if (this._sfdcPopupData != null)
                    {
                        this._sfdcPopupData.InteractionId = emailData.InteractionId;

                        if (Settings.SFDCOptions.CanAddEmailAttachmentsInLog)
                        {
                            this.searchHandler.ProcessUpdateData(emailData.InteractionId, this._sfdcPopupData, true);
                        }
                        else
                        {
                            this.searchHandler.ProcessUpdateData(emailData.InteractionId, this._sfdcPopupData);
                        }
                    }
                    else
                    {
                        this._logger.Info("Search data is empty");
                    }
                }
            }
            catch (Exception exception)
            {
                this._logger.Error("EmailSend: Error Occurred, Exception : " + exception.ToString());
            }
        }
Example #20
0
        public IUserActivity GetOutboundEmailCreateUserAcitivityData(IXNCustomData emailData, SFDCCallType callType)
        {
            try
            {
                this._logger.Info("GetEmailCreateUserAcitivityData :  Reading Email UserActivity Log Data.....");

                if (emailData != null)
                {
                    IUserActivity userActivity = new UserActivityData();

                    #region Collect userActivity Data

                    userActivity.ObjectName = this._emailUserActivityOptions.ObjectName;
                    if (callType == SFDCCallType.InboundEmail || callType == SFDCCallType.InboundEmailPulled)
                    {
                        userActivity.CreateActvityLog = this._emailUserActivityOptions.InboundCanCreateLog;
                        if (this._emailUserActivityOptions.InboundCanCreateLog && this._emailUserActivityLog != null)
                        {
                            //userActivity.ActivityLogData = this.sfdcUtility.GetCreateActivityLogData(this.emailUserActivityLog, popupEvent, callType);
                        }
                    }
                    else if (callType == SFDCCallType.OutboundEmailFailure || callType == SFDCCallType.OutboundEmailSuccess || callType == SFDCCallType.OutboundEmailPulled)
                    {
                        userActivity.CreateActvityLog = this._emailUserActivityOptions.OutboundCanCreateLog;
                        if (this._emailUserActivityOptions.OutboundCanCreateLog && this._emailUserActivityLog != null)
                        {
                            // userActivity.ActivityLogData =
                            // this.sfdcUtility.GetCreateActivityLogData(this.emailUserActivityLog,
                            // popupEvent, callType);
                        }
                    }

                    #endregion Collect userActivity Data

                    return(userActivity);
                }
            }
            catch (Exception generalException)
            {
                this._logger.Error("GetChatCreateUserAcitivityData : Error occurred  : " + generalException.ToString());
            }
            return(null);
        }
Example #21
0
        public void InteractionEventChat(IXNCustomData chatData)
        {
            try
            {
                this._logger.Info("Chat Event Received : " + chatData.EventName);
                switch (chatData.EventName)
                {
                case "InteractionChatAcceptChat":
                    GetChatData(chatData.InteractionId, chatData);
                    ChatSessionConnected.GetInstance().PopupRecords(chatData, SFDCCallType.InboundChat);
                    return;

                case "InteractionChatDeclineChat":
                    GetChatData(chatData.InteractionId, chatData);
                    ChatRejected.GetInstance().UpdateRecords(chatData, chatData.InteractionType);
                    return;

                case "InteractionChatCloseInteraction":

                case "InteractionChatDisconnectChat":

                case "InteractionChatAutoCloseInteraction":

                case "InteractionChatAutoDisconnect":
                    GetChatData(chatData.InteractionId, chatData);
                    ChatSessionEnded.GetInstance().PopupRecords(chatData, chatData.InteractionType);
                    return;

                case "InteractionMarkDone":
                    GetChatData(chatData.InteractionId, chatData);
                    ChatMarkDone.GetInstance().UpdateRecords(chatData, chatData.InteractionType);
                    break;

                default:

                    return;
                }
            }
            catch (Exception generalException)
            {
                this._logger.Error("Error occurred while processing chat event, exception : " + generalException.ToString());
            }
        }
Example #22
0
        public IUserActivity GetChatCreateUserAcitivityData(IXNCustomData chatData, SFDCCallType callType)
        {
            try
            {
                IMessage message = chatData.InteractionEvent;
                this._logger.Info("GetChatCreateUserAcitivityData :  Reading Chat UserActivity Log Data.....");
                this._logger.Info("GetChatCreateUserAcitivityData :  Event Name : " + message.Name);
                dynamic popupEvent = Convert.ChangeType(message, message.GetType());
                if (popupEvent != null)
                {
                    IUserActivity userActivity = new UserActivityData();

                    #region Collect Lead Data

                    userActivity.ObjectName = this._chatUserActivityOptions.ObjectName;
                    if (callType == SFDCCallType.InboundChat)
                    {
                        userActivity.CreateActvityLog = this._chatUserActivityOptions.InboundCanCreateLog;
                        if (this._chatUserActivityOptions.InboundCanCreateLog && this._chatUserActivityLog != null)
                        {
                            userActivity.ActivityLogData = this._sfdcUtility.GetCreateActivityLogData(this._chatUserActivityLog, popupEvent, callType, emailData: chatData);
                        }
                    }
                    else if (callType == SFDCCallType.ConsultChatReceived)
                    {
                        userActivity.CreateActvityLog = this._chatUserActivityOptions.ConsultCanCreateLog;
                        if (this._chatUserActivityOptions.ConsultCanCreateLog && this._chatUserActivityLog != null)
                        {
                            userActivity.ActivityLogData = this._sfdcUtility.GetCreateActivityLogData(this._chatUserActivityLog, popupEvent, callType, emailData: chatData);
                        }
                    }

                    #endregion Collect Lead Data

                    return(userActivity);
                }
            }
            catch (Exception generalException)
            {
                this._logger.Error("GetChatCreateUserAcitivityData : Error occurred  : " + generalException.ToString());
            }
            return(null);
        }
Example #23
0
 public void UpdateRecords(IXNCustomData chatData, SFDCCallType callType)
 {
     try
     {
         if (callType == SFDCCallType.InboundChat || callType == SFDCCallType.ConsultChatReceived)
         {
             _sfdcPopupData = this._chatEvents.GetInboundUpdateData(chatData, "datachanged");
             if (_sfdcPopupData != null)
             {
                 _sfdcPopupData.InteractionId = chatData.InteractionId;
                 this._searchHandler.ProcessUpdateData(chatData.InteractionId, _sfdcPopupData);
             }
             else
             {
                 this._logger.Info("ChatInvite.UpdateRecords : Search data is empty");
             }
         }
     }
     catch (Exception generalException)
     {
         this._logger.Error("ChatInvite.UpdateRecords : Error Occurred in Updating sfdc data : " + generalException.ToString());
     }
 }
        /// <summary>
        /// Update SFDC Records on Call MarkDone Event
        /// </summary>
        /// <param name="eventReleased"></param>
        /// <param name="callType"></param>
        /// <param name="callDuration"></param>

        #endregion Popup/Update Records

        #region UpdateRecords on Markdone

        /// <summary>
        /// Update SFDC Records on EventReleased Event
        /// </summary>
        /// <param name="eventReleased"></param>
        /// <param name="callType"></param>
        /// <param name="callDuration"></param>
        public void UpdateRecords(IXNCustomData ixnData)
        {
            try
            {
                _logger.Info("CallMarkDone : Update activity log on markdone event ");
                if (ixnData.InteractionType == SFDCCallType.InboundVoice)
                {
                    _sfdcPopupData = this._voiceEvents.GetInboundUpdateData(ixnData.InteractionEvent, ixnData.InteractionType, ixnData.Duration, "markdone", ixnData.InteractionNotes);
                }
                else if (ixnData.InteractionType == SFDCCallType.ConsultVoiceReceived)
                {
                    _sfdcPopupData = this._voiceEvents.GetConsultUpdateData(ixnData.InteractionEvent, ixnData.InteractionType, ixnData.Duration, "markdone", ixnData.InteractionNotes);
                }
                else if (ixnData.InteractionType == SFDCCallType.OutboundVoiceSuccess)
                {
                    _sfdcPopupData = this._voiceEvents.GetOutboundUpdateData(ixnData.InteractionEvent, ixnData.InteractionType, ixnData.Duration, "markdone", ixnData.InteractionNotes);
                }
                else if (ixnData.InteractionType == SFDCCallType.OutboundVoiceFailure)
                {
                    _sfdcPopupData = this._voiceEvents.GetOutboundUpdateData(ixnData.InteractionEvent, ixnData.InteractionType, ixnData.Duration, "markdone", ixnData.InteractionNotes);
                }

                if (_sfdcPopupData != null)
                {
                    _sfdcPopupData.InteractionId = ixnData.InteractionId;
                    this._searchHandler.ProcessUpdateData(ixnData.InteractionId, _sfdcPopupData);
                }
                else
                {
                    this._logger.Info("Search data is empty");
                }
            }
            catch (Exception generalException)
            {
                _logger.Error("CallMarkDone : Error Occurred  : " + generalException.ToString());
            }
        }
Example #25
0
 public void UpdateRecords(IXNCustomData chatData, SFDCCallType callType)
 {
     try
     {
         if (callType == SFDCCallType.InboundEmail)
         {
             this.logger.Info("UpdateRecords : Update SFDC Logs for Email Markdone ");
             this.sfdcPopupData = this.chatManager.GetInboundUpdateData(chatData, "markdone");
             if (this.sfdcPopupData != null)
             {
                 this.sfdcPopupData.InteractionId = chatData.InteractionId;
                 this._searchHandler.ProcessUpdateData(chatData.InteractionId, this.sfdcPopupData);
             }
             else
             {
                 this.logger.Info("UpdateRecords : Search data is empty");
             }
         }
     }
     catch (Exception exception)
     {
         this.logger.Error("UpdateRecords : Error Occurred while collecting Log data : " + exception.ToString());
     }
 }
Example #26
0
 public void UpdateRecords(IXNCustomData emailData, SFDCCallType callType, string callDuration, string chatContent)
 {
     try
     {
         this._logger.Info("Trying to Update SFDC Logs on EmailConnected event, Email Type: " + callType.ToString());
         if (callType == SFDCCallType.InboundEmail)
         {
             this._sfdcPopupData = this._emailEvents.GetInboundUpdateData(emailData, callType, "datachanged");
             if (this._sfdcPopupData != null)
             {
                 this._sfdcPopupData.InteractionId = emailData.InteractionId;
                 this._searchHandler.ProcessUpdateData(emailData.InteractionId, this._sfdcPopupData);
             }
             else
             {
                 this._logger.Info("Search data is empty");
             }
         }
     }
     catch (Exception exception)
     {
         this._logger.Error("EmailConnected : Error Occurred in Updating sfdc data : " + exception.ToString());
     }
 }
 public void UpdateRecords(IXNCustomData emailData, SFDCCallType callType)
 {
     try
     {
         this._logger.Info("Trying to popup or update SFDC on EmailDelete Event, Email Type: " + callType.ToString());
         if (callType == SFDCCallType.OutboundEmailSuccess)
         {
             this._sfdcPopupData = this._emailEvents.GetOutboundEmailUpdateData(emailData, callType, "delete");
             if (this._sfdcPopupData != null)
             {
                 this._sfdcPopupData.InteractionId = emailData.InteractionId;
                 this._searchHandler.ProcessUpdateData(emailData.InteractionId, this._sfdcPopupData);
             }
             else
             {
                 this._logger.Info("Search data is empty");
             }
         }
     }
     catch (Exception exception)
     {
         this._logger.Error("EmailDelete: Error Occurred : " + exception.ToString());
     }
 }
        private void GetEmailData(string ixnId, IXNCustomData emailData)
        {
            try
            {
                this._logger.Info("Retrieving UCS content for the InteractionId :" + ixnId);
                EventGetInteractionContent emailContent = Settings.SFDCListener.GetOpenMediaInteractionContent(ixnId, false);
                if (emailContent != null)
                {
                    if (emailContent.InteractionAttributes.TypeId == "Inbound")
                    {
                        emailData.InteractionType = SFDCCallType.InboundEmail;
                    }
                    else if (emailContent.InteractionAttributes.TypeId == "Outbound")
                    {
                        emailData.InteractionType = SFDCCallType.OutboundEmailSuccess;
                    }

                    emailData.IXN_Attributes      = emailContent.InteractionAttributes;
                    emailData.EntityAttributes    = emailContent.EntityAttributes;
                    emailData.AttachmentLists     = emailContent.Attachments;
                    emailData.InteractionContents = emailContent.InteractionContent;
                    if (emailData.UserData == null)
                    {
                        emailData.UserData = emailContent.InteractionAttributes.AllAttributes;
                    }
                }
                else
                {
                    this._logger.Info("Null is returned from UCS");
                }
            }
            catch (Exception generalException)
            {
                this._logger.Info("Error Occurred, Exception : " + generalException.ToString());
            }
        }
 public void UpdateRecords(IXNCustomData EmailData, SFDCCallType callType)
 {
     try
     {
         this._logger.Info("Trying to update SFDC on Markdone Event, Email Type: " + callType.ToString());
         if (callType == SFDCCallType.InboundEmail)
         {
             this.sfdcPopupData = this.emailEvents.GetInboundUpdateData(EmailData, callType, "markdone");
             if (this.sfdcPopupData != null)
             {
                 this.sfdcPopupData.InteractionId = EmailData.InteractionId;
                 this._searchHandler.ProcessUpdateData(EmailData.InteractionId, this.sfdcPopupData);
             }
             else
             {
                 this._logger.Info("Search data is empty");
             }
         }
     }
     catch (Exception exception)
     {
         this._logger.Error("EmailMarkDone: Error Occurred while collecting Log data : " + exception.ToString());
     }
 }
        /// <summary>
        /// Gets chat Update Data
        /// </summary>
        /// <param name="message"></param>
        /// <param name="callType"></param>
        /// <param name="duration"></param>
        /// <param name="chatContent"></param>
        /// <returns></returns>
        public CaseData GetCaseChatUpdateData(IXNCustomData chatData, string eventName)
        {
            try
            {
                IMessage     message  = chatData.InteractionEvent;
                SFDCCallType callType = chatData.InteractionType;
                string       duration = chatData.Duration;
                this._logger.Info("GetCaseChatUpdateData :  Reading Case Update Data.....");
                this._logger.Info("GetCaseChatUpdateData :  Event Name : " + message.Name);
                dynamic popupEvent = Convert.ChangeType(message, message.GetType());
                if (popupEvent != null)
                {
                    CaseData cases = new CaseData();

                    #region Collect Case Data

                    cases.ObjectName = _caseChatOptions.ObjectName;
                    if (callType == SFDCCallType.InboundChat)
                    {
                        if (_caseChatOptions.InboundCanUpdateLog)
                        {
                            cases.UpdateActivityLog     = true;
                            cases.UpdateActivityLogData = this._sfdcUtility.GetUpdateActivityLogData(this._caseChatLogOptions, popupEvent, callType, duration, emailData: chatData);
                            if (!string.IsNullOrWhiteSpace(_caseChatOptions.ChatAppendActivityLogEventNames) && _caseChatOptions.ChatAppendActivityLogEventNames.Contains(eventName))
                            {
                                cases.AppendActivityLogData = this._sfdcUtility.GetUpdateActivityLogData(this._caseChatLogOptions, null, callType, duration, emailData: chatData, isAppendLogData: true);
                            }
                        }
                    }
                    else
                    if (callType == SFDCCallType.ConsultChatReceived)
                    {
                        if (_caseChatOptions.ConsultCanUpdateLog)
                        {
                            cases.UpdateActivityLog     = true;
                            cases.UpdateActivityLogData = this._sfdcUtility.GetUpdateActivityLogData(this._caseChatLogOptions, popupEvent, callType, duration, emailData: chatData);
                            if (!string.IsNullOrWhiteSpace(_caseChatOptions.ChatAppendActivityLogEventNames) && _caseChatOptions.ChatAppendActivityLogEventNames.Contains(eventName))
                            {
                                cases.AppendActivityLogData = this._sfdcUtility.GetUpdateActivityLogData(this._caseChatLogOptions, null, callType, duration, emailData: chatData, isAppendLogData: true);
                            }
                        }
                    }

                    //update case record fields
                    cases.UpdateRecordFields = _caseChatOptions.CanUpdateRecordData;
                    if (SFDCObjectHelper.GetNoRecordFoundAction(callType, _caseChatOptions).Equals("createnew") && this._caseChatRecordConfig != null)
                    {
                        if (_caseChatOptions.CanUpdateRecordData)
                        {
                            cases.UpdateRecordFieldsData = this._sfdcUtility.GetUpdateActivityLogData(this._caseChatRecordConfig, popupEvent, callType, duration, emailData: chatData);
                        }
                    }

                    #endregion Collect Case Data

                    return(cases);
                }
            }
            catch (Exception generalException)
            {
                this._logger.Error("GetCaseChatUpdateData : Error occurred while reading Case Data : " + generalException.ToString());
            }
            return(null);
        }