/// <summary>
        /// To parse the call data
        /// </summary>
        /// <param name="callData">IVR Call Data</param>
        /// <param name="appId">IVR Application ID</param>
        /// <param name="callId">IVR Call ID</param>
        /// <param name="response">To hold the call data imporation response</param>
        /// <returns></returns>
        private IvrReportData ParseCallData(string callData, string appId, string callId, ref ImportationResponse response)
        {
            IvrData       ivrData    = null;
            IvrReportData reportData = null;

            System.Xml.Serialization.XmlSerializer xmlSerialize = null;
            Stopwatch sWatch = new Stopwatch();

            try
            {
                sWatch.Start();
                xmlSerialize = new System.Xml.Serialization.XmlSerializer(typeof(IvrData));
                ivrData      = (IvrData)xmlSerialize.Deserialize(new System.IO.StringReader(callData));
                reportData   = new IvrReportData(ivrData);
                reportData.AdditionalCallInformation.ApplicationName       = _applicationName;
                reportData.AdditionalCallInformation.ApplicationThreadName = _applicationThreadName;
                reportData.AdditionalCallInformation.ApplicationServer     = _applicationServer;
                sWatch.Stop();
                if (_isDebugLogEnabled)
                {
                    _log.DebugFormat("Total time taken to parse the call data {0}", sWatch.Elapsed);
                }
            }
            catch (Exception ex)
            {
                response.HasImported  = false;
                response.FailureMode  = ImportationFailureMode.ParserFailed;
                response.ErrorMessage = ex.Message;
                _log.Error("Error occured while parsing the process", ex);
            }
            finally
            {
                xmlSerialize = null;
                sWatch       = null;
            }
            return(reportData);
        }
Ejemplo n.º 2
0
 public IvrReportData(IvrData callData)
 {
     _callData          = callData;
     _additonalCallInfo = _callData == null ? new AdditionalCallInfo() : callData.CallInformation.GetAdditionalCallInfo();
 }