Hi all,

  I was looking around cdr batch mode and I think that should be two
signalling functions:

ast_cdr_batch_start();
ast_cdr_batch_finish();

This two functions would tell all the BackEnds about the batch mode
happening, so in the PGSQL backend the CDR loading could be done in a
single COPY sql command, which is much faster than single INSERTs

Sounds like a small addition for having a much faster CDR insertion

Gabriel Ortiz



The do_batch_backend_process would look like this:
static void *do_batch_backend_process(void *data)
{
struct cdr_batch_item *processeditem;
struct cdr_batch_item *batchitem = data;

ast_cdr_batch_start();

/* Push each CDR into storage mechanism(s) and free all the memory */
while (batchitem) {
post_cdr(batchitem->cdr);
ast_cdr_free(batchitem->cdr);
processeditem = batchitem;
batchitem = batchitem->next;
ast_free(processeditem);
}

ast_cdr_batch_finish();

return NULL;
}
-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to