mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 06:48:25 +00:00
Convert some built-in applications to use new args parsing macros.
Change ast_cdr_reset to take a pointer to an ast_flags structure instead of an integer for flags. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
12
cdr.c
12
cdr.c
@@ -809,16 +809,18 @@ static void post_cdr(struct ast_cdr *cdr)
|
||||
}
|
||||
}
|
||||
|
||||
void ast_cdr_reset(struct ast_cdr *cdr, int flags)
|
||||
void ast_cdr_reset(struct ast_cdr *cdr, struct ast_flags *_flags)
|
||||
{
|
||||
struct ast_flags tmp = {flags};
|
||||
struct ast_cdr *dup;
|
||||
struct ast_flags flags = { 0 };
|
||||
|
||||
if (_flags)
|
||||
ast_copy_flags(&flags, _flags, AST_FLAGS_ALL);
|
||||
|
||||
while (cdr) {
|
||||
/* Detach if post is requested */
|
||||
if (ast_test_flag(&tmp, AST_CDR_FLAG_LOCKED) || !ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
|
||||
if (ast_test_flag(&tmp, AST_CDR_FLAG_POSTED)) {
|
||||
if (ast_test_flag(&flags, AST_CDR_FLAG_LOCKED) || !ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
|
||||
if (ast_test_flag(&flags, AST_CDR_FLAG_POSTED)) {
|
||||
ast_cdr_end(cdr);
|
||||
if ((dup = ast_cdr_dup(cdr))) {
|
||||
ast_cdr_detach(dup);
|
||||
@@ -827,7 +829,7 @@ void ast_cdr_reset(struct ast_cdr *cdr, int flags)
|
||||
}
|
||||
|
||||
/* clear variables */
|
||||
if (!ast_test_flag(&tmp, AST_CDR_FLAG_KEEP_VARS)) {
|
||||
if (!ast_test_flag(&flags, AST_CDR_FLAG_KEEP_VARS)) {
|
||||
ast_cdr_free_vars(cdr, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user