[Asterisk-code-review] cdr.c: Fix setting dnid, callingsubaddr, and calledsubaddr (asterisk[15])

Richard Mudgett asteriskteam at digium.com
Thu Oct 12 12:33:23 CDT 2017


Richard Mudgett has uploaded this change for review. ( https://gerrit.asterisk.org/6776


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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/76/6776/1

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/6776
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9482073524411e7ea6c03805b16de200cb1669ea
Gerrit-Change-Number: 6776
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171012/e25f31d1/attachment-0001.html>


More information about the asterisk-code-review mailing list