summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorSteve Murphy <murf@digium.com>2008-06-12 14:28:01 +0000
committerSteve Murphy <murf@digium.com>2008-06-12 14:28:01 +0000
commit1cebe01daca79dcef122f7144542f30e9dca5105 (patch)
tree3f936b2aabc61fa98f819ca4043d90d6cf9f2347 /main
parent191081e45fd7275f14f6736d58da63e96dd1dd75 (diff)
Merged revisions 122046 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r122046 | murf | 2008-06-12 07:47:34 -0600 (Thu, 12 Jun 2008) | 37 lines (closes issue #10668) Reported by: arkadia Tested by: murf, arkadia Options added to forkCDR() app and the CDR() func to remove some roadblocks for CDR applications. The "show application ForkCDR" output was upgraded to more fully explain the inner workings of forkCDR. The A option was added to forkCDR to force the CDR system to NOT change the disposition on the original CDR, after the fork. This involves ast_cdr_answer, _busy, _failed, and so on. The T option was added to forkCDR to force obedience of the cdr LOCKED flag in the ast_cdr_end, all the disposition changing funcs (ast_cdr_answer, etc), and in the ast_cdr_setvar func. The CHANGES file was updated to explain ALL the new options added to satisfy this bug report (and some requests made verbally and via email, irc, etc, over the past months/year) The 's' option was added to the CDR() func, to force it to skip LOCKED cdr's in the chain. Again, the new options should be totally transparent to existing apps! Current behavior of CDR, forkCDR, and the rest of the CDR system should not change one little bit. Until you add the new options, at least! ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/cdr.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/main/cdr.c b/main/cdr.c
index 0a91f74fd..bbc0c6ec4 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -306,6 +306,8 @@ int ast_cdr_setvar(struct ast_cdr *cdr, const char *name, const char *value, int
}
for (; cdr; cdr = recur ? cdr->next : NULL) {
+ if (ast_test_flag(cdr, AST_CDR_FLAG_DONT_TOUCH) && ast_test_flag(cdr, AST_CDR_FLAG_LOCKED))
+ continue;
headp = &cdr->varshead;
AST_LIST_TRAVERSE_SAFE_BEGIN(headp, newvariable, entries) {
if (!strcasecmp(ast_var_name(newvariable), name)) {
@@ -689,6 +691,10 @@ void ast_cdr_answer(struct ast_cdr *cdr)
{
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);
if (cdr->disposition < AST_CDR_ANSWERED)
cdr->disposition = AST_CDR_ANSWERED;
@@ -701,6 +707,10 @@ void ast_cdr_busy(struct ast_cdr *cdr)
{
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;
if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
check_post(cdr);
if (cdr->disposition < AST_CDR_BUSY)
@@ -712,6 +722,11 @@ void ast_cdr_busy(struct ast_cdr *cdr)
void ast_cdr_failed(struct ast_cdr *cdr)
{
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);
if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
check_post(cdr);
if (cdr->disposition < AST_CDR_FAILED)
@@ -725,6 +740,10 @@ void ast_cdr_noanswer(struct ast_cdr *cdr)
char *chan;
while (cdr) {
+ 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;
if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
@@ -847,6 +866,8 @@ int ast_cdr_init(struct ast_cdr *cdr, struct ast_channel *c)
void ast_cdr_end(struct ast_cdr *cdr)
{
for ( ; cdr ; cdr = cdr->next) {
+ if (ast_test_flag(cdr, AST_CDR_FLAG_DONT_TOUCH) && ast_test_flag(cdr, AST_CDR_FLAG_LOCKED))
+ continue;
check_post(cdr);
if (ast_tvzero(cdr->end))
cdr->end = ast_tvnow();