--- cdr_adaptive_odbc.c.orig 2014-05-09 18:39:22.000000000 -0400 +++ cdr_adaptive_odbc.c 2014-08-07 17:13:20.835174960 -0400 @@ -398,7 +398,11 @@ return -1; } + int alreadyinserted = 0; + AST_LIST_TRAVERSE(&odbc_tables, tableptr, list) { + if (alreadyinserted==1) + continue; int first = 1; if (ast_strlen_zero(tableptr->schema)) { ast_str_set(&sql, 0, "INSERT INTO %s (", tableptr->table); @@ -746,6 +750,8 @@ } if (rows == 0) { ast_log(LOG_WARNING, "cdr_adaptive_odbc: Insert failed on '%s:%s'. CDR failed: %s\n", tableptr->connection, tableptr->table, ast_str_buffer(sql)); + } else { + alreadyinserted=1; } early_release: ast_odbc_release_obj(obj);