aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authormnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-11-03 21:21:09 +0000
committermnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-11-03 21:21:09 +0000
commit899c3fed766d6e8337e4c85ccc54c1de1599c695 (patch)
treea0f4b7160c78f146373e2ad325b1915676955edf /include
parent930620c029c038931bd88ec390f525b49e1f74ae (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: http://svn.digium.com/svn/asterisk/trunk@227435 f38db490-d61c-443f-a65b-d21fe96a405b
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);