def handle(self, *args, **options): import_cdr_asterisk(shell=True) # Apply index on collection if options['apply-index']: print "\nWe are going to apply index..." apply_index(shell=True)
def run(self, **kwargs): logger = self.get_logger() logger.info('TASK :: sync_cdr_pending') if settings.CDR_BACKEND[settings.LOCAL_SWITCH_IP]['cdr_type'] == 'asterisk': # Import from Asterisk import_cdr_asterisk() elif settings.CDR_BACKEND[settings.LOCAL_SWITCH_IP]['cdr_type'] == 'freeswitch': # Import from Freeswitch Mongo import_cdr_freeswitch_mongodb() return True