def __init__(self, start_time, end_time, is_dup_data): self.config_options = Helper.get_configurations(os.path.join(os.path.dirname(__file__), os.path.pardir, 'dnl_softswitch', 'conf', 'dnl_softswitch.conf')) self.connect_database() self.start_time = start_time if start_time is not None else self.get_start_time(end_time) self.end_time = end_time self.is_dup_data = is_dup_data self.total_start_time = start_time options = self.get_options() try: self.billing_path = options.get('switch_cdr', 'cdr_directory') except Exception: self.billing_path = None if not self.billing_path: self.billing_path = os.path.join(os.path.dirname(__file__), os.path.pardir, 'dnl_softswitch', 'cdr') if not os.path.exists(self.billing_path): os.makedirs(self.billing_path)
def get_options(self): ini_path= os.path.join(os.path.dirname(__file__), os.path.pardir, 'dnl_softswitch', 'conf', 'dnl_softswitch.conf') options = Helper.get_configurations(ini_path) return options