Esempio n. 1
0
        public SMSCDR CreateSMSCDRFromRawSMSCDR(RawSMSCDR rawSMSCDR)
        {
            var ret = new SMSCDR();

            ret.RawSMSCDR              = rawSMSCDR;
            ret.MobileNumber           = rawSMSCDR.Charge_Party_Number;
            ret.DialedNumber           = rawSMSCDR.Dialed_Digit;
            ret.NormalizedDialedNumber = BillingCommon.NormalizeDialedNumber(rawSMSCDR.Dialed_Digit);
            ret.MNOAmountOrg           = 1;                                                // long.Parse(RawSMSCDR.Call_Duration);//TODO: Correct Amount
            ret.MNOAmount              = ret.MNOAmountOrg;
            ret.MNOCostOrg             = double.Parse(rawSMSCDR.Event_Amount);             // double.Parse(RawSMSCDR.Dedicated_Amount_Used);//TODO: Mapping Fld is Correct?
            ret.MNOCost        = ret.MNOCostOrg;
            ret.MNORateOrg     = ret.MNOAmount == 0 ? 0 : (ret.MNOCost / (ret.MNOAmount)); //TODO: Correct Rate Formula
            ret.StartTime      = DateTime.ParseExact($"{rawSMSCDR.Call_Date}{rawSMSCDR.Call_Time}", "yyyyMMddHHmmss", new CultureInfo("en-US"));
            ret.EndTime        = ret.StartTime.AddSeconds(ret.MNOAmountOrg);
            ret.MNOAmountLeft  = ret.MNOAmount;
            ret.RecordType     = rawSMSCDR.Record_Type;
            ret.CallType       = rawSMSCDR.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);
        }
Esempio n. 2
0
 public MyBillingSMS(RawSMSCDR RawSMSCDR)
 {
     this.CDR  = CreateSMSCDRFromRawSMSCDR(RawSMSCDR);
     base._CDR = this.CDR;
 }