Exemplo n.º 1
0
        public DataCDR CreateDataCDRFromRawDataCDR(RawDataCDR rawDataCDR)
        {
            var ret = new DataCDR();

            ret.RawDataCDR   = rawDataCDR;
            ret.MobileNumber = rawDataCDR.Mobile_Number;
            //ret.DownloadAmount = long.Parse(RawDataCDR.Data_Volume_Incoming_1)
            //    + long.Parse(RawDataCDR.Data_Volume_Incoming_2)
            //    + long.Parse(RawDataCDR.Data_Volume_Incoming_3);//TODO: Correct ret
            //ret.UploadAmount = long.Parse(RawDataCDR.Data_Volume_Outgoing_1)
            //    + long.Parse(RawDataCDR.Data_Volume_Outgoing_2)
            //    + long.Parse(RawDataCDR.Data_Volume_Outgoing_3);//TODO: Correct ret
            ret.DownloadAmount = long.Parse(rawDataCDR.Data_Volume_Incoming_2);
            ret.UploadAmount   = 0;
            ret.MNOAmountOrg   = ret.DownloadAmount + ret.UploadAmount;
            ret.MNOAmount      = ret.MNOAmountOrg;
            ret.MNOCostOrg     = double.Parse(rawDataCDR.Dedicated_Amount_Used);//TODO: true Cost may be another field
            ret.MNOCost        = ret.MNOCostOrg;
            ret.MNORateOrg     = ret.MNOAmount == 0 ? 0 : ret.MNOCost / ret.MNOAmount;
            ret.StartTime      = DateTime.ParseExact($"{rawDataCDR.Call_Date}", "yyyyMMddHHmmss", new CultureInfo("en-US"));
            ret.EndTime        = ret.StartTime.AddSeconds(long.Parse(rawDataCDR.Call_Duration));
            ret.MNOAmountLeft  = ret.MNOAmount;
            ret.APartyMNP      = BillingCommon.getCallNetProvider(ret.MobileNumber);
            return(ret);
        }
Exemplo n.º 2
0
        public VoiceCDR CreateVoiceCDRFromRawVoiceCDR(RawVoiceCDR rawVoiceCDR)
        {
            var ret = new VoiceCDR();

            ret.RawVoiceCDR            = rawVoiceCDR;
            ret.RawVoiceCDRId          = rawVoiceCDR.RawVoiceCDRId;
            ret.MobileNumber           = rawVoiceCDR.Charge_Party_Number;
            ret.DialedNumber           = rawVoiceCDR.Dialed_Digit;
            ret.NormalizedDialedNumber = BillingCommon.NormalizeDialedNumber(rawVoiceCDR.Dialed_Digit);
            ret.MNOAmountOrg           = long.Parse(rawVoiceCDR.Call_Duration);
            ret.MNOAmount      = ret.MNOAmountOrg;
            ret.MNOCostOrg     = double.Parse(rawVoiceCDR.Event_Amount);                   //TODO: RawVoiceCDR.Dedicated_Amount_Used
            ret.MNOCost        = ret.MNOCostOrg;
            ret.MNORateOrg     = ret.MNOAmount == 0 ? 0 : ((ret.MNOCost / ret.MNOAmount)); //TODO: Correct Rate Formula
            ret.StartTime      = DateTime.ParseExact($"{rawVoiceCDR.Call_Date}{rawVoiceCDR.Call_Time}", "yyyyMMddHHmmss", new CultureInfo("en-US"));
            ret.EndTime        = ret.StartTime.AddSeconds(ret.MNOAmountOrg);
            ret.MNOAmountLeft  = ret.MNOAmount;
            ret.RecordType     = rawVoiceCDR.Record_Type;
            ret.CallType       = rawVoiceCDR.Call_Type;
            ret.CallSectorType = BillingCommon.GetCallSectorType(ret.NormalizedDialedNumber);
            ret.APartyMNP      = BillingCommon.getCallNetProvider(ret.MobileNumber);
            ret.BPartyMNP      = BillingCommon.getCallNetProvider(ret.NormalizedDialedNumber);
            ret.CallNetType    = ret.CallSectorType != EntityConstants.CALLSECTORTYPE_IRANMOBILE ? EntityConstants.CONST_NA : (ret.APartyMNP == ret.BPartyMNP ? EntityConstants.CALLNETTYPE_ONNET : EntityConstants.CALLNETTYPE_OFFNET);
            return(ret);
        }
Exemplo n.º 3
0
 public bool IsLatinSMS()
 {
     return(BillingCommon.IsLatinSMS(CDR.CallType));
 }
Exemplo n.º 4
0
 public bool IsFarsiSMS()
 {
     return(BillingCommon.IsFarsiSMS(CDR.CallType));
 }
Exemplo n.º 5
0
 public DateTime GetBillingEndTime(DateTime st1)
 {
     return(BillingCommon.GetStartOfNextMonth(st1));
 }