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

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


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


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/70/6770/1

diff --git a/main/cdr.c b/main/cdr.c
index 06cadcd..28dab7e 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -1336,13 +1336,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/6770
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9482073524411e7ea6c03805b16de200cb1669ea
Gerrit-Change-Number: 6770
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/ca0ab9b7/attachment-0001.html>


More information about the asterisk-code-review mailing list