mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
(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/branches/1.4@122046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
20
main/cdr.c
20
main/cdr.c
@@ -312,6 +312,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)) {
|
||||
@@ -695,6 +697,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;
|
||||
@@ -707,6 +713,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)
|
||||
@@ -718,6 +728,10 @@ 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)) {
|
||||
if (cdr->disposition < AST_CDR_FAILED)
|
||||
@@ -731,6 +745,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;
|
||||
chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
|
||||
if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
|
||||
ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
|
||||
@@ -852,6 +870,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();
|
||||
|
Reference in New Issue
Block a user