From: Richard Mudgett Date: Thu, 5 Oct 2017 23:03:11 +0000 (-0500) Subject: cdr.c: Fix setting dnid, callingsubaddr, and calledsubaddr X-Git-Tag: 13.19.0-rc1~213^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6393c106ca12fda924c5e15e004a45a072271c4d;p=thirdparty%2Fasterisk.git cdr.c: Fix setting dnid, callingsubaddr, and calledsubaddr 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 --- diff --git a/main/cdr.c b/main/cdr.c index ecf7bd30bc..c2f981c1a3 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -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); } }