[Asterisk-code-review] CDR: fix setting userfield on h exten (asterisk[13])

Sebastian Gutierrez asteriskteam at digium.com
Tue Mar 21 12:39:36 CDT 2017


Sebastian Gutierrez has uploaded a new change for review. ( https://gerrit.asterisk.org/5276 )

Change subject: CDR:  fix setting userfield on h exten
......................................................................

CDR:  fix setting userfield on h exten

Make some changers to be able to overwrite user field on h exten

ASTERISK-26818

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


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

diff --git a/main/cdr.c b/main/cdr.c
index 5e515d8..8c1ae55 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -3227,7 +3227,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
@@ -3246,12 +3246,13 @@
 			.userfield = userfield,
 	};
 	struct cdr_object *it_cdr;
+		
 
 	/* Handle Party A */
 	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/5276
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0fed8a79b5e408bac4e30542b8f33a61c5ed9aa6
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Sebastian Gutierrez <scgm11 at gmail.com>



More information about the asterisk-code-review mailing list