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

Richard Mudgett asteriskteam at digium.com
Thu Oct 12 12:16:46 CDT 2017


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


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/61/6761/1

diff --git a/main/cdr.c b/main/cdr.c
index ecf7bd3..c2f981c 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/6761
To unsubscribe, visit https://gerrit.asterisk.org/settings

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


More information about the asterisk-code-review mailing list