summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Nicholson <mnicholson@digium.com>2009-05-21 15:33:55 +0000
committerMatthew Nicholson <mnicholson@digium.com>2009-05-21 15:33:55 +0000
commitd02ad6b5f76636395ca2ace8a45f290428bf397f (patch)
tree006d7411ce4f94971f9f6080d43be42cad9220f8
parent873a46ded5edc3a9ce6c5e003f3d29cb3452b28c (diff)
Merged revisions 195881 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r195881 | mnicholson | 2009-05-21 10:25:50 -0500 (Thu, 21 May 2009) | 13 lines This commit prevents cdr records with AST_CDR_FLAG_ANSLOCKED and AST_CDR_FLAG_LOCKED from being updated in certain cases. This is accomplished by adding two functions to update the answer time and disposition of calls that checks for the proper lock flags. These functions are used in the ast_bridge_call() function so that ForkCDR(A) calls are respected. This patch also modifies the way ast_bridge_call() chooses the cdr record to base the bridged_cdr on. Previously the first unlocked cdr record would be chosen, now instead the first cdr record is chosen and forked cdr records are moved to the bridge_cdr. This allows the original cdr record and any forked cdr records to be properly updated with answer and end times. (closes issue #13797) Reported by: sh0t Tested by: sh0t (closes issue #14744) Reported by: deepesh ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--include/asterisk/cdr.h18
-rw-r--r--main/cdr.c24
2 files changed, 42 insertions, 0 deletions
diff --git a/include/asterisk/cdr.h b/include/asterisk/cdr.h
index 312c2546e..9cd65713a 100644
--- a/include/asterisk/cdr.h
+++ b/include/asterisk/cdr.h
@@ -284,6 +284,24 @@ void ast_cdr_setdestchan(struct ast_cdr *cdr, const char *chan);
*/
void ast_cdr_setapp(struct ast_cdr *cdr, const char *app, const char *data);
+/*!
+ * \brief Set the answer time for a call
+ * \param cdr the cdr you wish to associate with the call
+ * \param t the answer time
+ * Starts all CDR stuff necessary for doing CDR when answering a call
+ * NULL argument is just fine.
+ */
+void ast_cdr_setanswer(struct ast_cdr *cdr, struct timeval t);
+
+/*!
+ * \brief Set the disposition for a call
+ * \param cdr the cdr you wish to associate with the call
+ * \param disposition the new disposition
+ * Set the disposition on a call.
+ * NULL argument is just fine.
+ */
+void ast_cdr_setdisposition(struct ast_cdr *cdr, long int disposition);
+
/*!
* \brief Convert a string to a detail record AMA flag
* \param flag string form of flag
diff --git a/main/cdr.c b/main/cdr.c
index 991b01a25..65c4e3e01 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -787,6 +787,30 @@ void ast_cdr_setapp(struct ast_cdr *cdr, const char *app, const char *data)
}
}
+void ast_cdr_setanswer(struct ast_cdr *cdr, struct timeval t)
+{
+
+ for (; cdr; cdr = cdr->next) {
+ if (ast_test_flag(cdr, AST_CDR_FLAG_ANSLOCKED))
+ continue;
+ if (ast_test_flag(cdr, AST_CDR_FLAG_DONT_TOUCH) && ast_test_flag(cdr, AST_CDR_FLAG_LOCKED))
+ continue;
+ check_post(cdr);
+ cdr->answer = t;
+ }
+}
+
+void ast_cdr_setdisposition(struct ast_cdr *cdr, long int disposition)
+{
+
+ for (; cdr; cdr = cdr->next) {
+ if (ast_test_flag(cdr, AST_CDR_FLAG_LOCKED))
+ continue;
+ check_post(cdr);
+ cdr->disposition = disposition;
+ }
+}
+
/* set cid info for one record */
static void set_one_cid(struct ast_cdr *cdr, struct ast_channel *c)
{