[Asterisk-code-review] cdr: Allow setting of user field from 'h' extension (asterisk[master])

Joshua Colp asteriskteam at digium.com
Fri Mar 24 18:02:12 CDT 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/5282 )

Change subject: cdr: Allow setting of user field from 'h' extension
......................................................................


cdr: Allow setting of user field from 'h' extension

The CDR code previously did not allow the user field to be set
from the 'h' extension in the dialplan. This change removes that
limitation and allows it to be set.

ASTERISK-26818

Change-Id: I0fed8a79b5e408bac4e30542b8f33a61c5ed9aa6
---
M main/cdr.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/main/cdr.c b/main/cdr.c
index 60fe977..363a2c6 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -3251,7 +3251,7 @@
 	struct party_b_userfield_update *info = arg;
 	struct cdr_object *it_cdr;
 	for (it_cdr = cdr; it_cdr; it_cdr = it_cdr->next) {
-		if (it_cdr->fn_table == &finalized_state_fn_table) {
+		if (it_cdr->fn_table == &finalized_state_fn_table && it_cdr->next != NULL) {
 			continue;
 		}
 		if (it_cdr->party_b.snapshot
@@ -3275,7 +3275,7 @@
 	if (cdr) {
 		ao2_lock(cdr);
 		for (it_cdr = cdr; it_cdr; it_cdr = it_cdr->next) {
-			if (it_cdr->fn_table == &finalized_state_fn_table) {
+			if (it_cdr->fn_table == &finalized_state_fn_table && it_cdr->next != NULL) {
 				continue;
 			}
 			strcpy(it_cdr->party_a.userfield, userfield);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0fed8a79b5e408bac4e30542b8f33a61c5ed9aa6
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Sebastian Gutierrez <scgm11 at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list