Ejemplo n.º 1
0
        public void WriteCDR(SIPCDR cdr)
        {
            try
            {
                //if (m_sipCDRPersistor != null && !StopCDRWrites && !m_pendingCDRs.Contains(cdr))
                //{
                //    m_pendingCDRs.Enqueue(cdr);
                //}

                SIPCDRAsset cdrAsset = new SIPCDRAsset(cdr);

                var existingCDR = m_sipCDRPersistor.Get(cdrAsset.Id);

                if (existingCDR == null)
                {
                    cdrAsset.Inserted = DateTimeOffset.UtcNow;
                    m_sipCDRPersistor.Add(cdrAsset);
                }
                else //if (existingCDR.ReconciliationResult == null)
                {
                    m_sipCDRPersistor.Update(cdrAsset);
                }
            }
            catch (Exception excp)
            {
                logger.Error("Exception QueueCDR. " + excp.Message);
            }
        }
        public void WriteCDR(SIPCDR cdr)
        {
            try
            {
                SIPCDRAsset cdrAsset = new SIPCDRAsset(cdr);

                var existingCDR = m_sipCDRPersistor.Get(cdrAsset.Id);

                if (existingCDR == null)
                {
                    cdrAsset.Inserted = DateTimeOffset.UtcNow;
                    m_sipCDRPersistor.Add(cdrAsset);
                }
                else
                {
                    m_sipCDRPersistor.Update(cdrAsset);
                }
            }
            catch (Exception excp)
            {
                logger.Error("Exception QueueCDR. " + excp.Message);
            }
        }