]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add originated_legs and originate_causes to A leg when present in an originate to...
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 18 Oct 2012 17:23:05 +0000 (13:23 -0400)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 18 Oct 2012 17:23:05 +0000 (13:23 -0400)
libs/esl/src/esl_event.c

index 60547b1be2340bc448091cc6ad7c927c79a6fc4a..a953964c3e39ae1badb83c8c0e440e90ee61ccca 100644 (file)
@@ -552,7 +552,12 @@ static esl_status_t esl_event_base_add_header(esl_event_t *event, esl_stack_t st
                        esl_assert(hv);
                        header->value = hv;
 
-                       esl_snprintf(header->value, len, "ARRAY::");
+                       if (header->idx > 1) {
+                               esl_snprintf(header->value, len, "ARRAY::");
+                       } else {
+                               *header->value = '\0';
+                       }
+
                        for(j = 0; j < header->idx; j++) {
                                esl_snprintf(header->value + strlen(header->value), len - strlen(header->value), "%s%s", j == 0 ? "" : "|:", header->array[j]);
                        }