summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatthew Nicholson <mnicholson@digium.com>2009-11-03 21:21:09 +0000
committerMatthew Nicholson <mnicholson@digium.com>2009-11-03 21:21:09 +0000
commit7ed425ec808f26cc02068c81b4b0f28801100b9f (patch)
treea0f4b7160c78f146373e2ad325b1915676955edf /include
parent2263ced9dd27312c3c5c967833702c961f079dd7 (diff)
This patch adds a sequence field to CDRs that can be combined with the linkedid or uniqueid field to uniquely identify a CDR.
(closes issue #15180) Reported by: Nick_Lewis Patches: cdr-sequence10.diff uploaded by mnicholson (license 96) Tested by: mnicholson git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/cdr.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/asterisk/cdr.h b/include/asterisk/cdr.h
index 9ac0e1147..23c63ea50 100644
--- a/include/asterisk/cdr.h
+++ b/include/asterisk/cdr.h
@@ -110,6 +110,8 @@ struct ast_cdr {
char linkedid[32];
/*! User field */
char userfield[AST_MAX_USER_FIELD];
+ /*! Sequence field */
+ int sequence;
/*! A linked list for variables */
struct varshead varshead;
@@ -143,9 +145,37 @@ int check_cdr_enabled(void);
struct ast_cdr *ast_cdr_alloc(void);
/*!
+ * \brief Duplicate a record and increment the sequence number.
+ * \param cdr the record to duplicate
+ * \retval a malloc'd ast_cdr structure,
+ * \retval NULL on error (malloc failure)
+ * \see ast_cdr_dup()
+ * \see ast_cdr_dup_unique_swap()
+ */
+struct ast_cdr *ast_cdr_dup_unique(struct ast_cdr *cdr);
+
+/*!
+ * \brief Duplicate a record and increment the sequence number of the old
+ * record.
+ * \param cdr the record to duplicate
+ * \retval a malloc'd ast_cdr structure,
+ * \retval NULL on error (malloc failure)
+ * \note This version increments the original CDR's sequence number rather than
+ * the duplicate's sequence number. The effect is as if the original CDR's
+ * sequence number was swapped with the duplicate's sequence number.
+ *
+ * \see ast_cdr_dup()
+ * \see ast_cdr_dup_unique()
+ */
+struct ast_cdr *ast_cdr_dup_unique_swap(struct ast_cdr *cdr);
+
+/*!
* \brief Duplicate a record
+ * \param cdr the record to duplicate
* \retval a malloc'd ast_cdr structure,
* \retval NULL on error (malloc failure)
+ * \see ast_cdr_dup_unique()
+ * \see ast_cdr_dup_unique_swap()
*/
struct ast_cdr *ast_cdr_dup(struct ast_cdr *cdr);