public static List<UsageReport> GetUsageReports(SIPAccount SIPAccount, DateTime From, DateTime To) { List<UsageReport> result = new List<UsageReport> (); foreach (Number number in SIPAccount._numbers) { UsageReport report = new UsageReport (number); foreach (qnaxLib.voip.Usage u in qnaxLib.voip.Usage.List (number.Value, From, To)) { report.AddUsage (u); } result.Add (report); } return result; }
public static void GetUsageold(SIPAccount SIPAccount) { foreach (Number number in SIPAccount._numbers) { Console.WriteLine ("--------------------------"); Console.WriteLine (number.Value); Console.WriteLine ("--------------------------"); // List<qnaxLib.voip.Usage> usage = qnaxLib.voip.Usage.List (number.Value, DateTime.Parse ("01/10/2010"), DateTime.Parse ("31/10/2010")); List<qnaxLib.voip.Usage> usage = qnaxLib.voip.Usage.List (number.Value, DateTime.Parse ("01/01/2010"), DateTime.Parse ("31/12/2011")); UsageReport report = new UsageReport (number); foreach (qnaxLib.voip.Usage u in usage) { report.AddUsage (u); } foreach (UsageReportItem item in report.GetNationalUsage ()) { Console.WriteLine ("Range : "+ item.Range.Name); Console.WriteLine ("Calls : "+ item.Calls); Console.WriteLine ("Duration : "+ item.DurationInSeconds); Console.WriteLine ("Cost callcharge : "+ item.CostDialCharge); Console.WriteLine ("Costprice : "+ item.Costprice); Console.WriteLine ("Total costprice : "+ item.TotalCostPrice); Console.WriteLine ("Retail callcharge : "+ item.RetailDialCharge); Console.WriteLine ("Retailprice : "+ item.Retailprice); Console.WriteLine ("Total retailprice : "+ item.TotalRetailPrice); Console.WriteLine (""); } foreach (UsageReportItem item in report.GetInternationalUsage ()) { Console.WriteLine ("Range : "+ item.Range.Name); Console.WriteLine ("Calls : "+ item.Calls); Console.WriteLine ("Duration : "+ item.DurationInSeconds); Console.WriteLine ("Cost callcharge : "+ item.CostDialCharge); Console.WriteLine ("Costprice : "+ item.Costprice); Console.WriteLine ("Total costprice : "+ item.TotalCostPrice); Console.WriteLine ("Retail callcharge : "+ item.RetailDialCharge); Console.WriteLine ("Retailprice : "+ item.Retailprice); Console.WriteLine ("Total retailprice : "+ item.TotalRetailPrice); Console.WriteLine (""); } } }