Пример #1
0
        /// <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);
        }
Пример #2
0
        /// <summary>
        /// Gets Contact Popup Data
        /// </summary>
        /// <param name="message"></param>
        /// <param name="callType"></param>
        /// <returns></returns>
        public ContactData GetContactVoicePopupData(IMessage message, SFDCCallType callType)
        {
            try
            {
                this.logger.Info("GetContactVoicePopupData :  Reading Contact Popup Data.....");
                this.logger.Info("GetContactVoicePopupData :  Event Name : " + message.Name);
                this.logger.Info("GetContactVoicePopupData :  CallType Name : " + callType.ToString());
                dynamic _popupEvent = Convert.ChangeType(message, message.GetType());
                if (_popupEvent != null)
                {
                    ContactData _contact = new ContactData();

                    #region Collect contact Data

                    _contact.SearchData                             = this.sfdcUtilityHelper.GetVoiceSearchValue(contactVoiceOptions, message, callType);
                    _contact.ObjectName                             = contactVoiceOptions.ObjectName;
                    _contact.NoRecordFound                          = SFDCObjectHelper.GetNoRecordFoundAction(callType, contactVoiceOptions);
                    _contact.MultipleMatchRecord                    = SFDCObjectHelper.GetMultiMatchRecordAction(callType, contactVoiceOptions);
                    _contact.NewRecordFieldIds                      = contactVoiceOptions.NewrecordFieldIds;
                    _contact.SearchCondition                        = contactVoiceOptions.SearchCondition;
                    _contact.CreateLogForNewRecord                  = contactVoiceOptions.CanCreateLogForNewRecordCreate;
                    _contact.MaxRecordOpenCount                     = contactVoiceOptions.MaxNosRecordOpen;
                    _contact.SearchpageMode                         = contactVoiceOptions.SearchPageMode;
                    _contact.PhoneNumberSearchFormat                = contactVoiceOptions.PhoneNumberSearchFormat;
                    _contact.CanCreateNoRecordActivityLog           = SFDCObjectHelper.GetCanCreateProfileActivity(callType, contactVoiceOptions, true);
                    _contact.CanPopupNoRecordActivityLog            = SFDCObjectHelper.GetCanPopupProfileActivity(callType, contactVoiceOptions, true);
                    _contact.CanCreateMultiMatchActivityLog         = SFDCObjectHelper.GetCanCreateProfileActivity(callType, contactVoiceOptions);
                    _contact.CanPopupMultiMatchActivityLog          = SFDCObjectHelper.GetCanPopupProfileActivity(callType, contactVoiceOptions);
                    _contact.CanCreateProfileActivityforInbNoRecord = contactVoiceOptions.CanCreateProfileActivityforInbNoRecord;
                    _contact.CanCreateProfileActivityforOutNoRecord = contactVoiceOptions.CanCreateProfileActivityforOutNoRecord;
                    _contact.CanCreateProfileActivityforConNoRecord = contactVoiceOptions.CanCreateProfileActivityforConNoRecord;
                    if (_contact.NoRecordFound.Equals("createnew") && this.ContactVoiceRecordConfig != null)
                    {
                        _contact.CreateRecordFieldData = this.sfdcUtility.GetCreateActivityLogData(this.ContactVoiceRecordConfig, message, callType);
                    }
                    if (callType == SFDCCallType.InboundVoice)
                    {
                        if (contactVoiceOptions.InboundCanCreateLog)
                        {
                            _contact.CreateActvityLog = true;
                            _contact.ActivityLogData  = this.sfdcUtility.GetCreateActivityLogData(this.ContactLogConfig, _popupEvent, callType);
                        }
                    }
                    else if (callType == SFDCCallType.OutboundVoiceSuccess)
                    {
                        if (contactVoiceOptions.OutboundCanCreateLog)
                        {
                            _contact.CreateActvityLog = true;
                            _contact.ActivityLogData  = this.sfdcUtility.GetCreateActivityLogData(this.ContactLogConfig, _popupEvent, callType);
                        }
                    }
                    else if (callType == SFDCCallType.OutboundVoiceFailure)
                    {
                        if (contactVoiceOptions.OutboundFailureCanCreateLog)
                        {
                            _contact.CreateActvityLog = true;
                            _contact.ActivityLogData  = this.sfdcUtility.GetCreateActivityLogData(this.ContactLogConfig, _popupEvent, callType);
                        }
                    }
                    else if (callType == SFDCCallType.ConsultVoiceReceived)
                    {
                        if (contactVoiceOptions.ConsultCanCreateLog)
                        {
                            _contact.CreateActvityLog = true;
                            _contact.ActivityLogData  = this.sfdcUtility.GetCreateActivityLogData(this.ContactLogConfig, _popupEvent, callType);
                        }
                    }
                    return(_contact);
                }

                #endregion Collect contact Data
            }
            catch (Exception generalException)
            {
                this.logger.Error("GetContactVoicePopupData : Error occurred while reading Contact Data on EventRinging Event : " + generalException.ToString());
            }
            return(null);
        }
Пример #3
0
        /// <summary>
        /// Get Account Popup Data for Email
        /// </summary>
        /// <param name="emailData"></param>
        /// <param name="callType"></param>
        /// <returns></returns>
        public ContactData GetContactEmailPopupData(IXNCustomData emailData, SFDCCallType callType)
        {
            try
            {
                this.logger.Info("GetContactEmailPopupData :  Reading Account Popup Data.....");
                this.logger.Info("GetContactEmailPopupData :  CallType Name : " + callType.ToString());

                if (emailData != null)
                {
                    ContactData _contact = new ContactData();

                    #region Collect Contact Data

                    _contact.SearchData                             = this.sfdcUtilityHelper.GetEmailSearchValue(contactEmailOptions, emailData, callType);
                    _contact.ObjectName                             = contactEmailOptions.ObjectName;
                    _contact.NoRecordFound                          = SFDCObjectHelper.GetNoRecordFoundAction(callType, contactEmailOptions);
                    _contact.MultipleMatchRecord                    = SFDCObjectHelper.GetMultiMatchRecordAction(callType, contactEmailOptions);
                    _contact.NewRecordFieldIds                      = contactEmailOptions.NewrecordFieldIds;
                    _contact.SearchCondition                        = contactEmailOptions.SearchCondition;
                    _contact.CreateLogForNewRecord                  = contactEmailOptions.CanCreateLogForNewRecordCreate;
                    _contact.MaxRecordOpenCount                     = contactEmailOptions.MaxNosRecordOpen;
                    _contact.SearchpageMode                         = contactEmailOptions.SearchPageMode;
                    _contact.PhoneNumberSearchFormat                = contactEmailOptions.PhoneNumberSearchFormat;
                    _contact.CanCreateNoRecordActivityLog           = SFDCObjectHelper.GetCanCreateProfileActivity(callType, contactEmailOptions, true);
                    _contact.CanPopupNoRecordActivityLog            = SFDCObjectHelper.GetCanPopupProfileActivity(callType, contactEmailOptions, true);
                    _contact.CanCreateMultiMatchActivityLog         = SFDCObjectHelper.GetCanCreateProfileActivity(callType, contactEmailOptions);
                    _contact.CanPopupMultiMatchActivityLog          = SFDCObjectHelper.GetCanPopupProfileActivity(callType, contactEmailOptions);
                    _contact.CanCreateProfileActivityforInbNoRecord = contactEmailOptions.CanCreateProfileActivityforInbNoRecord;
                    _contact.CanCreateProfileActivityforOutNoRecord = contactEmailOptions.CanCreateProfileActivityforOutNoRecord;
                    //_contact.CanCreateProfileActivityforConNoRecord = contactEmailOptions.CanCreateProfileActivityforConNoRecord;
                    if (_contact.NoRecordFound.Equals("createnew") && this.ContactEmailRecordConfig != null)
                    {
                        _contact.CreateRecordFieldData = this.sfdcUtility.GetCreateActivityLogData(this.ContactEmailRecordConfig, null, callType, emailData);
                    }
                    if (callType == SFDCCallType.InboundEmail || callType == SFDCCallType.InboundEmailPulled)
                    {
                        if (contactEmailOptions.InboundCanCreateLog)
                        {
                            _contact.CreateActvityLog = true;
                            _contact.ActivityLogData  = this.sfdcUtility.GetCreateActivityLogData(this.ContactEmailLogConfig, null, callType, emailData);
                        }
                    }
                    else if (callType == SFDCCallType.OutboundEmailFailure || callType == SFDCCallType.OutboundEmailSuccess || callType == SFDCCallType.OutboundEmailPulled)
                    {
                        if (contactEmailOptions.OutboundCanCreateLog)
                        {
                            _contact.CreateActvityLog = true;
                            _contact.ActivityLogData  = this.sfdcUtility.GetCreateActivityLogData(this.ContactEmailLogConfig, null, callType, emailData);
                        }
                    }

                    #endregion Collect Contact Data

                    return(_contact);
                }
            }
            catch (Exception generalException)
            {
                this.logger.Error("GetAccountEmailPopupData : Error occurred while reading Account Data : " + generalException.ToString());
            }
            return(null);
        }
Пример #4
0
        /// <summary>
        /// Gets Custom Object Popup Data
        /// </summary>
        /// <param name="message"></param>
        /// <param name="callType"></param>
        /// <param name="objectName"></param>
        /// <returns></returns>
        public CustomObjectData GetCustomObjectVoicePopupData(IMessage message, SFDCCallType callType, string objectName)
        {
            try
            {
                this.logger.Info("GetCustomObjectVoicePopupData :  Reading CustomObject Popup Data.....");
                this.logger.Info("GetCustomObjectVoicePopupData :  Event Name : " + message.Name);
                this.logger.Info("GetCustomObjectVoicePopupData :  CallType Name : " + callType.ToString());
                dynamic popupEvent = Convert.ChangeType(message, message.GetType());
                if (popupEvent != null && customvoiceOptions.ContainsKey(objectName))
                {
                    CustomObjectData custom = new CustomObjectData();
                    VoiceOptions     customObjectOptions = customvoiceOptions[objectName];

                    #region Collect CustomObject Popup data

                    custom.SearchData                             = this.sfdcUtilityHelper.GetVoiceSearchValue(customObjectOptions, message, callType);
                    custom.ObjectName                             = customObjectOptions.ObjectName;
                    custom.NoRecordFound                          = SFDCObjectHelper.GetNoRecordFoundAction(callType, customObjectOptions);
                    custom.MultipleMatchRecord                    = SFDCObjectHelper.GetMultiMatchRecordAction(callType, customObjectOptions);
                    custom.NewRecordFieldIds                      = customObjectOptions.NewrecordFieldIds;
                    custom.SearchCondition                        = customObjectOptions.SearchCondition;
                    custom.CreateLogForNewRecord                  = customObjectOptions.CanCreateLogForNewRecordCreate;
                    custom.MaxRecordOpenCount                     = customObjectOptions.MaxNosRecordOpen;
                    custom.SearchpageMode                         = customObjectOptions.SearchPageMode;
                    custom.CustomObjectURL                        = customObjectOptions.CustomObjectURL;
                    custom.PhoneNumberSearchFormat                = customObjectOptions.PhoneNumberSearchFormat;
                    custom.CanCreateNoRecordActivityLog           = SFDCObjectHelper.GetCanCreateProfileActivity(callType, customObjectOptions, true);
                    custom.CanPopupNoRecordActivityLog            = SFDCObjectHelper.GetCanPopupProfileActivity(callType, customObjectOptions, true);
                    custom.CanCreateMultiMatchActivityLog         = SFDCObjectHelper.GetCanCreateProfileActivity(callType, customObjectOptions);
                    custom.CanPopupMultiMatchActivityLog          = SFDCObjectHelper.GetCanPopupProfileActivity(callType, customObjectOptions);
                    custom.CanCreateProfileActivityforInbNoRecord = customObjectOptions.CanCreateProfileActivityforInbNoRecord;
                    custom.CanCreateProfileActivityforOutNoRecord = customObjectOptions.CanCreateProfileActivityforOutNoRecord;
                    custom.CanCreateProfileActivityforConNoRecord = customObjectOptions.CanCreateProfileActivityforConNoRecord;

                    if (CustomVoiceRecordConfigs != null && CustomVoiceRecordConfigs.ContainsKey(objectName))
                    {
                        KeyValueCollection RecordConfig = CustomVoiceRecordConfigs[objectName];
                        if (RecordConfig != null)
                        {
                            if (custom.NoRecordFound.Equals("createnew"))
                            {
                                custom.CreateRecordFieldData = this.sfdcUtility.GetCreateActivityLogData(RecordConfig, message, callType);
                            }
                        }
                    }
                    KeyValueCollection LogConfig = null;
                    if (this.CustomVoiceLogConfigs != null && this.CustomVoiceLogConfigs.ContainsKey(objectName))
                    {
                        LogConfig = this.CustomVoiceLogConfigs[objectName];
                    }

                    if (callType == SFDCCallType.InboundVoice)
                    {
                        custom.CreateActvityLog = customObjectOptions.InboundCanCreateLog;
                        if (LogConfig != null)
                        {
                            if (customObjectOptions.InboundCanCreateLog)
                            {
                                custom.ActivityLogData = this.sfdcUtility.GetCreateActivityLogData(LogConfig, popupEvent, callType);
                            }
                        }
                    }
                    else if (callType == SFDCCallType.OutboundVoiceSuccess)
                    {
                        custom.CreateActvityLog = customObjectOptions.OutboundCanCreateLog;
                        if (LogConfig != null)
                        {
                            if (customObjectOptions.OutboundCanCreateLog)
                            {
                                custom.ActivityLogData = this.sfdcUtility.GetCreateActivityLogData(LogConfig, popupEvent, callType);
                            }
                        }
                    }
                    else if (callType == SFDCCallType.OutboundVoiceFailure)
                    {
                        custom.CreateActvityLog = customObjectOptions.OutboundFailureCanCreateLog;
                        if (LogConfig != null)
                        {
                            if (customObjectOptions.OutboundFailureCanCreateLog)
                            {
                                custom.ActivityLogData = this.sfdcUtility.GetCreateActivityLogData(LogConfig, popupEvent, callType);
                            }
                        }
                    }
                    else if (callType == SFDCCallType.ConsultVoiceReceived)
                    {
                        custom.CreateActvityLog = customObjectOptions.ConsultCanCreateLog;
                        if (LogConfig != null)
                        {
                            if (customObjectOptions.ConsultCanCreateLog)
                            {
                                custom.ActivityLogData = this.sfdcUtility.GetCreateActivityLogData(LogConfig, popupEvent, callType);
                            }
                        }
                    }

                    return(custom);
                }

                #endregion Collect CustomObject Popup data
            }
            catch (Exception generalException)
            {
                this.logger.Error("GetCustomObjectVoicePopupData : Error occurred while reading Contact Data on EventRinging Event : " + generalException.ToString());
            }
            return(null);
        }
Пример #5
0
        /// <summary>
        /// Gets Custom Object Chat Popup Data
        /// </summary>
        /// <param name="emailData"></param>
        /// <param name="callType"></param>
        /// <param name="objectName"></param>
        /// <returns></returns>
        public CustomObjectData GetCustomObjectEmailPopupData(IXNCustomData emailData, SFDCCallType callType, string objectName)
        {
            try
            {
                this.logger.Info("GetCustomObjectEmailPopupData :  Reading CustomObject Chat Popup Data.....");
                this.logger.Info("GetCustomObjectEmailPopupData :  CallType Name : " + callType.ToString());

                if (emailData != null && customchatOptions.ContainsKey(objectName))
                {
                    CustomObjectData custom = new CustomObjectData();
                    EmailOptions     customObjectOptions = customemailOptions[objectName];

                    #region Collect CustomObject Popup data

                    custom.SearchData                             = this.sfdcUtilityHelper.GetEmailSearchValue(customObjectOptions, emailData, callType);
                    custom.ObjectName                             = customObjectOptions.ObjectName;
                    custom.NoRecordFound                          = SFDCObjectHelper.GetNoRecordFoundAction(callType, customObjectOptions);
                    custom.MultipleMatchRecord                    = SFDCObjectHelper.GetMultiMatchRecordAction(callType, customObjectOptions);
                    custom.NewRecordFieldIds                      = customObjectOptions.NewrecordFieldIds;
                    custom.SearchCondition                        = customObjectOptions.SearchCondition;
                    custom.CreateLogForNewRecord                  = customObjectOptions.CanCreateLogForNewRecordCreate;
                    custom.MaxRecordOpenCount                     = customObjectOptions.MaxNosRecordOpen;
                    custom.SearchpageMode                         = customObjectOptions.SearchPageMode;
                    custom.PhoneNumberSearchFormat                = customObjectOptions.PhoneNumberSearchFormat;
                    custom.CanCreateNoRecordActivityLog           = SFDCObjectHelper.GetCanCreateProfileActivity(callType, customObjectOptions, true);
                    custom.CanPopupNoRecordActivityLog            = SFDCObjectHelper.GetCanPopupProfileActivity(callType, customObjectOptions, true);
                    custom.CanCreateMultiMatchActivityLog         = SFDCObjectHelper.GetCanCreateProfileActivity(callType, customObjectOptions);
                    custom.CanPopupMultiMatchActivityLog          = SFDCObjectHelper.GetCanPopupProfileActivity(callType, customObjectOptions);
                    custom.CanCreateProfileActivityforInbNoRecord = customObjectOptions.CanCreateProfileActivityforInbNoRecord;
                    custom.CanCreateProfileActivityforOutNoRecord = customObjectOptions.CanCreateProfileActivityforOutNoRecord;
                    if (CustomEmailRecordConfigs != null && CustomEmailRecordConfigs.ContainsKey(objectName))
                    {
                        KeyValueCollection RecordConfig = CustomEmailRecordConfigs[objectName];
                        if (RecordConfig != null)
                        {
                            if (custom.NoRecordFound.Equals("createnew"))
                            {
                                custom.CreateRecordFieldData = this.sfdcUtility.GetCreateActivityLogData(RecordConfig, null, callType, emailData);
                            }
                        }
                    }
                    KeyValueCollection LogConfig = null;
                    if (this.CustomEmailLogConfigs != null && this.CustomEmailLogConfigs.ContainsKey(objectName))
                    {
                        LogConfig = this.CustomEmailLogConfigs[objectName];
                    }

                    if (callType == SFDCCallType.InboundEmail || callType == SFDCCallType.InboundEmailPulled)
                    {
                        custom.CreateActvityLog = customObjectOptions.InboundCanCreateLog;
                        if (LogConfig != null)
                        {
                            if (customObjectOptions.InboundCanCreateLog)
                            {
                                custom.ActivityLogData = this.sfdcUtility.GetCreateActivityLogData(LogConfig, null, callType, emailData);
                            }
                        }
                    }
                    else if (callType == SFDCCallType.OutboundEmailFailure || callType == SFDCCallType.OutboundEmailSuccess || callType == SFDCCallType.OutboundEmailPulled)
                    {
                        custom.CreateActvityLog = customObjectOptions.OutboundCanCreateLog;
                        if (LogConfig != null)
                        {
                            if (customObjectOptions.OutboundCanCreateLog)
                            {
                                custom.ActivityLogData = this.sfdcUtility.GetCreateActivityLogData(LogConfig, null, callType, emailData);
                            }
                        }
                    }
                    return(custom);
                }

                #endregion Collect CustomObject Popup data
            }
            catch (Exception generalException)
            {
                this.logger.Error("GetCustomObjectEmailPopupData : Error occurred  : " + generalException.ToString());
            }
            return(null);
        }
Пример #6
0
        public LeadData GetLeadVoicePopupData(IMessage message, SFDCCallType callType)
        {
            try
            {
                this.logger.Info("GetLeadVoicePopupData :  Reading Lead Popup Data.....");
                this.logger.Info("GetLeadVoicePopupData :  Event Name : " + message.Name);
                dynamic popupEvent = Convert.ChangeType(message, message.GetType());
                if (this.leadVoiceOptions != null)
                {
                    if (popupEvent != null)
                    {
                        LeadData lead = new LeadData();

                        #region Collect Lead Data

                        lead.SearchData                             = this.sfdcUtilityHelper.GetVoiceSearchValue(leadVoiceOptions, message, callType);
                        lead.ObjectName                             = leadVoiceOptions.ObjectName;
                        lead.NoRecordFound                          = SFDCObjectHelper.GetNoRecordFoundAction(callType, leadVoiceOptions);
                        lead.MultipleMatchRecord                    = SFDCObjectHelper.GetMultiMatchRecordAction(callType, leadVoiceOptions);
                        lead.NewRecordFieldIds                      = leadVoiceOptions.NewrecordFieldIds;
                        lead.SearchCondition                        = leadVoiceOptions.SearchCondition;
                        lead.CreateLogForNewRecord                  = leadVoiceOptions.CanCreateLogForNewRecordCreate;
                        lead.MaxRecordOpenCount                     = leadVoiceOptions.MaxNosRecordOpen;
                        lead.SearchpageMode                         = leadVoiceOptions.SearchPageMode;
                        lead.PhoneNumberSearchFormat                = leadVoiceOptions.PhoneNumberSearchFormat;
                        lead.CanCreateNoRecordActivityLog           = SFDCObjectHelper.GetCanCreateProfileActivity(callType, leadVoiceOptions, true);
                        lead.CanPopupNoRecordActivityLog            = SFDCObjectHelper.GetCanPopupProfileActivity(callType, leadVoiceOptions, true);
                        lead.CanCreateMultiMatchActivityLog         = SFDCObjectHelper.GetCanCreateProfileActivity(callType, leadVoiceOptions);
                        lead.CanPopupMultiMatchActivityLog          = SFDCObjectHelper.GetCanPopupProfileActivity(callType, leadVoiceOptions);
                        lead.CanCreateProfileActivityforInbNoRecord = leadVoiceOptions.CanCreateProfileActivityforInbNoRecord;
                        lead.CanCreateProfileActivityforOutNoRecord = leadVoiceOptions.CanCreateProfileActivityforOutNoRecord;
                        lead.CanCreateProfileActivityforConNoRecord = leadVoiceOptions.CanCreateProfileActivityforConNoRecord;
                        if (lead.NoRecordFound.Equals("createnew") && this.LeadVoiceRecordConfig != null)
                        {
                            lead.CreateRecordFieldData = this.sfdcUtility.GetCreateActivityLogData(this.LeadVoiceRecordConfig, message, callType);
                        }

                        switch (callType)
                        {
                        case SFDCCallType.InboundVoice:
                            lead.CreateActvityLog = leadVoiceOptions.InboundCanCreateLog;
                            if (leadVoiceOptions.InboundCanCreateLog && this.LeadLogConfig != null)
                            {
                                lead.ActivityLogData = this.sfdcUtility.GetCreateActivityLogData(this.LeadLogConfig, popupEvent, callType);
                            }
                            break;

                        case SFDCCallType.OutboundVoiceSuccess:
                            lead.CreateActvityLog = leadVoiceOptions.OutboundCanCreateLog;
                            if (leadVoiceOptions.OutboundCanCreateLog && this.LeadLogConfig != null)
                            {
                                lead.ActivityLogData = this.sfdcUtility.GetCreateActivityLogData(this.LeadLogConfig, popupEvent, callType);
                            }
                            break;

                        case SFDCCallType.OutboundVoiceFailure:
                            lead.CreateActvityLog = leadVoiceOptions.OutboundFailureCanCreateLog;
                            if (leadVoiceOptions.OutboundFailureCanCreateLog && this.LeadLogConfig != null)
                            {
                                lead.ActivityLogData = this.sfdcUtility.GetCreateActivityLogData(this.LeadLogConfig, popupEvent, callType);
                            }
                            break;

                        case SFDCCallType.ConsultVoiceReceived:
                            lead.CreateActvityLog = leadVoiceOptions.ConsultCanCreateLog;
                            if (leadVoiceOptions.ConsultCanCreateLog && this.LeadLogConfig != null)
                            {
                                lead.ActivityLogData = this.sfdcUtility.GetCreateActivityLogData(this.LeadLogConfig, popupEvent, callType);
                            }
                            break;

                        default:
                            break;
                        }

                        #endregion Collect Lead Data

                        return(lead);
                    }
                }
                else
                {
                    this.logger.Info("Can not Collect Lead Popup data because Lead Configuration is null.");
                }
            }
            catch (Exception generalException)
            {
                this.logger.Error("GetLeadVoicePopupData : Error occurred while reading Lead Data : " + generalException.ToString());
            }
            return(null);
        }