[asterisk-commits] cdr.c: Fix setting dnid, callingsubaddr, and calledsubaddr (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 13 17:11:54 CDT 2017


Kevin Harwell has submitted this change and it was merged. ( https://gerrit.asterisk.org/6782 )

Change subject: cdr.c: Fix setting dnid, callingsubaddr, and calledsubaddr
......................................................................

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
---
M main/cdr.c
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Corey Farrell: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved; Approved for Submit



diff --git a/main/cdr.c b/main/cdr.c
index d34503d..fc125f2 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -1333,13 +1333,13 @@
 		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);
 	}
 }

-- 
To view, visit https://gerrit.asterisk.org/6782
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9482073524411e7ea6c03805b16de200cb1669ea
Gerrit-Change-Number: 6782
Gerrit-PatchSet: 2
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20171013/5948ec27/attachment-0001.html>


More information about the asterisk-commits mailing list