]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
cdr: Allow setting of user field from 'h' extension
authorSebastian Gutierrez <sgutierrez@integraccs.com>
Tue, 21 Mar 2017 17:32:06 +0000 (14:32 -0300)
committerJoshua Colp <jcolp@digium.com>
Wed, 22 Mar 2017 13:32:29 +0000 (07:32 -0600)
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

main/cdr.c

index 5e515d823743c8155a06b84e25276545c77e922a..2d2f51b3f8e02ae8ee9bf8a4629119aa7535c4aa 100644 (file)
@@ -3227,7 +3227,7 @@ static int cdr_object_update_party_b_userfield_cb(void *obj, void *arg, int flag
        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
@@ -3251,7 +3251,7 @@ void ast_cdr_setuserfield(const char *channel_name, const char *userfield)
        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);