]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
cdr.c: Fix setting dnid, callingsubaddr, and calledsubaddr
authorRichard Mudgett <rmudgett@digium.com>
Thu, 5 Oct 2017 23:03:11 +0000 (18:03 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Fri, 13 Oct 2017 00:11:02 +0000 (19:11 -0500)
The string comparisons for setting these CDR variables was inverted.  We
were repeatedly setting these CDR variables only if the channel snapshots
had the same value.

ASTERISK-27335

Change-Id: I9482073524411e7ea6c03805b16de200cb1669ea

main/cdr.c

index ecf7bd30bc5dca2fe0f749a8f64a7e7dbcfb0996..c2f981c1a31277aafc116d7048fa71ced4d6c5b8 100644 (file)
@@ -1333,13 +1333,13 @@ static void cdr_object_update_cid(struct cdr_object_snapshot *old_snapshot, stru
                set_variable(&old_snapshot->variables, "calledsubaddr", new_snapshot->dialed_subaddr);
                return;
        }
-       if (!strcmp(old_snapshot->snapshot->caller_dnid, new_snapshot->caller_dnid)) {
+       if (strcmp(old_snapshot->snapshot->caller_dnid, new_snapshot->caller_dnid)) {
                set_variable(&old_snapshot->variables, "dnid", new_snapshot->caller_dnid);
        }
-       if (!strcmp(old_snapshot->snapshot->caller_subaddr, new_snapshot->caller_subaddr)) {
+       if (strcmp(old_snapshot->snapshot->caller_subaddr, new_snapshot->caller_subaddr)) {
                set_variable(&old_snapshot->variables, "callingsubaddr", new_snapshot->caller_subaddr);
        }
-       if (!strcmp(old_snapshot->snapshot->dialed_subaddr, new_snapshot->dialed_subaddr)) {
+       if (strcmp(old_snapshot->snapshot->dialed_subaddr, new_snapshot->dialed_subaddr)) {
                set_variable(&old_snapshot->variables, "calledsubaddr", new_snapshot->dialed_subaddr);
        }
 }