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:12:07 +0000 (19:12 -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 d34503d..fc125f2 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);
        }
 }