Asterisk - The Open Source Telephony Project GIT-master-c7a8271
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
ari_model_validators.c
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2013, Digium, Inc.
5 *
6 * See http://www.asterisk.org for more information about
7 * the Asterisk project. Please do not directly contact
8 * any of the maintainers of this project for assistance;
9 * the project provides a web site, mailing lists and IRC
10 * channels for your use.
11 *
12 * This program is free software, distributed under the terms of
13 * the GNU General Public License Version 2. See the LICENSE file
14 * at the top of the source tree.
15 */
16
17/*! \file
18 *
19 * \brief Generated file - Build validators for ARI model objects.
20 */
21
22 /*
23 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24 * !!!!! DO NOT EDIT !!!!!
25 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26 * This file is generated by a mustache template. Please see the original
27 * template in rest-api-templates/ari_model_validators.c.mustache
28 */
29
30#include "asterisk.h"
31
32#include "asterisk/logger.h"
33#include "asterisk/module.h"
35
37{
38 int res = 1;
39 struct ast_json_iter *iter;
40
41 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
42 if (strcmp("build", ast_json_object_iter_key(iter)) == 0) {
43 int prop_is_valid;
44 prop_is_valid = ast_ari_validate_build_info(
46 if (!prop_is_valid) {
47 ast_log(LOG_ERROR, "ARI AsteriskInfo field build failed validation\n");
48 res = 0;
49 }
50 } else
51 if (strcmp("config", ast_json_object_iter_key(iter)) == 0) {
52 int prop_is_valid;
53 prop_is_valid = ast_ari_validate_config_info(
55 if (!prop_is_valid) {
56 ast_log(LOG_ERROR, "ARI AsteriskInfo field config failed validation\n");
57 res = 0;
58 }
59 } else
60 if (strcmp("status", ast_json_object_iter_key(iter)) == 0) {
61 int prop_is_valid;
62 prop_is_valid = ast_ari_validate_status_info(
64 if (!prop_is_valid) {
65 ast_log(LOG_ERROR, "ARI AsteriskInfo field status failed validation\n");
66 res = 0;
67 }
68 } else
69 if (strcmp("system", ast_json_object_iter_key(iter)) == 0) {
70 int prop_is_valid;
71 prop_is_valid = ast_ari_validate_system_info(
73 if (!prop_is_valid) {
74 ast_log(LOG_ERROR, "ARI AsteriskInfo field system failed validation\n");
75 res = 0;
76 }
77 } else
78 {
80 "ARI AsteriskInfo has undocumented field %s\n",
82 res = 0;
83 }
84 }
85
86 return res;
87}
88
90{
92}
93
95{
96 int res = 1;
97 struct ast_json_iter *iter;
98 int has_asterisk_id = 0;
99 int has_ping = 0;
100 int has_timestamp = 0;
101
102 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
103 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
104 int prop_is_valid;
105 has_asterisk_id = 1;
106 prop_is_valid = ast_ari_validate_string(
108 if (!prop_is_valid) {
109 ast_log(LOG_ERROR, "ARI AsteriskPing field asterisk_id failed validation\n");
110 res = 0;
111 }
112 } else
113 if (strcmp("ping", ast_json_object_iter_key(iter)) == 0) {
114 int prop_is_valid;
115 has_ping = 1;
116 prop_is_valid = ast_ari_validate_string(
118 if (!prop_is_valid) {
119 ast_log(LOG_ERROR, "ARI AsteriskPing field ping failed validation\n");
120 res = 0;
121 }
122 } else
123 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
124 int prop_is_valid;
125 has_timestamp = 1;
126 prop_is_valid = ast_ari_validate_string(
128 if (!prop_is_valid) {
129 ast_log(LOG_ERROR, "ARI AsteriskPing field timestamp failed validation\n");
130 res = 0;
131 }
132 } else
133 {
135 "ARI AsteriskPing has undocumented field %s\n",
137 res = 0;
138 }
139 }
140
141 if (!has_asterisk_id) {
142 ast_log(LOG_ERROR, "ARI AsteriskPing missing required field asterisk_id\n");
143 res = 0;
144 }
145
146 if (!has_ping) {
147 ast_log(LOG_ERROR, "ARI AsteriskPing missing required field ping\n");
148 res = 0;
149 }
150
151 if (!has_timestamp) {
152 ast_log(LOG_ERROR, "ARI AsteriskPing missing required field timestamp\n");
153 res = 0;
154 }
155
156 return res;
157}
158
160{
162}
163
165{
166 int res = 1;
167 struct ast_json_iter *iter;
168 int has_date = 0;
169 int has_kernel = 0;
170 int has_machine = 0;
171 int has_options = 0;
172 int has_os = 0;
173 int has_user = 0;
174
175 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
176 if (strcmp("date", ast_json_object_iter_key(iter)) == 0) {
177 int prop_is_valid;
178 has_date = 1;
179 prop_is_valid = ast_ari_validate_string(
181 if (!prop_is_valid) {
182 ast_log(LOG_ERROR, "ARI BuildInfo field date failed validation\n");
183 res = 0;
184 }
185 } else
186 if (strcmp("kernel", ast_json_object_iter_key(iter)) == 0) {
187 int prop_is_valid;
188 has_kernel = 1;
189 prop_is_valid = ast_ari_validate_string(
191 if (!prop_is_valid) {
192 ast_log(LOG_ERROR, "ARI BuildInfo field kernel failed validation\n");
193 res = 0;
194 }
195 } else
196 if (strcmp("machine", ast_json_object_iter_key(iter)) == 0) {
197 int prop_is_valid;
198 has_machine = 1;
199 prop_is_valid = ast_ari_validate_string(
201 if (!prop_is_valid) {
202 ast_log(LOG_ERROR, "ARI BuildInfo field machine failed validation\n");
203 res = 0;
204 }
205 } else
206 if (strcmp("options", ast_json_object_iter_key(iter)) == 0) {
207 int prop_is_valid;
208 has_options = 1;
209 prop_is_valid = ast_ari_validate_string(
211 if (!prop_is_valid) {
212 ast_log(LOG_ERROR, "ARI BuildInfo field options failed validation\n");
213 res = 0;
214 }
215 } else
216 if (strcmp("os", ast_json_object_iter_key(iter)) == 0) {
217 int prop_is_valid;
218 has_os = 1;
219 prop_is_valid = ast_ari_validate_string(
221 if (!prop_is_valid) {
222 ast_log(LOG_ERROR, "ARI BuildInfo field os failed validation\n");
223 res = 0;
224 }
225 } else
226 if (strcmp("user", ast_json_object_iter_key(iter)) == 0) {
227 int prop_is_valid;
228 has_user = 1;
229 prop_is_valid = ast_ari_validate_string(
231 if (!prop_is_valid) {
232 ast_log(LOG_ERROR, "ARI BuildInfo field user failed validation\n");
233 res = 0;
234 }
235 } else
236 {
238 "ARI BuildInfo has undocumented field %s\n",
240 res = 0;
241 }
242 }
243
244 if (!has_date) {
245 ast_log(LOG_ERROR, "ARI BuildInfo missing required field date\n");
246 res = 0;
247 }
248
249 if (!has_kernel) {
250 ast_log(LOG_ERROR, "ARI BuildInfo missing required field kernel\n");
251 res = 0;
252 }
253
254 if (!has_machine) {
255 ast_log(LOG_ERROR, "ARI BuildInfo missing required field machine\n");
256 res = 0;
257 }
258
259 if (!has_options) {
260 ast_log(LOG_ERROR, "ARI BuildInfo missing required field options\n");
261 res = 0;
262 }
263
264 if (!has_os) {
265 ast_log(LOG_ERROR, "ARI BuildInfo missing required field os\n");
266 res = 0;
267 }
268
269 if (!has_user) {
270 ast_log(LOG_ERROR, "ARI BuildInfo missing required field user\n");
271 res = 0;
272 }
273
274 return res;
275}
276
278{
280}
281
283{
284 int res = 1;
285 struct ast_json_iter *iter;
286 int has_default_language = 0;
287 int has_name = 0;
288 int has_setid = 0;
289
290 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
291 if (strcmp("default_language", ast_json_object_iter_key(iter)) == 0) {
292 int prop_is_valid;
293 has_default_language = 1;
294 prop_is_valid = ast_ari_validate_string(
296 if (!prop_is_valid) {
297 ast_log(LOG_ERROR, "ARI ConfigInfo field default_language failed validation\n");
298 res = 0;
299 }
300 } else
301 if (strcmp("max_channels", ast_json_object_iter_key(iter)) == 0) {
302 int prop_is_valid;
303 prop_is_valid = ast_ari_validate_int(
305 if (!prop_is_valid) {
306 ast_log(LOG_ERROR, "ARI ConfigInfo field max_channels failed validation\n");
307 res = 0;
308 }
309 } else
310 if (strcmp("max_load", ast_json_object_iter_key(iter)) == 0) {
311 int prop_is_valid;
312 prop_is_valid = ast_ari_validate_double(
314 if (!prop_is_valid) {
315 ast_log(LOG_ERROR, "ARI ConfigInfo field max_load failed validation\n");
316 res = 0;
317 }
318 } else
319 if (strcmp("max_open_files", ast_json_object_iter_key(iter)) == 0) {
320 int prop_is_valid;
321 prop_is_valid = ast_ari_validate_int(
323 if (!prop_is_valid) {
324 ast_log(LOG_ERROR, "ARI ConfigInfo field max_open_files failed validation\n");
325 res = 0;
326 }
327 } else
328 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
329 int prop_is_valid;
330 has_name = 1;
331 prop_is_valid = ast_ari_validate_string(
333 if (!prop_is_valid) {
334 ast_log(LOG_ERROR, "ARI ConfigInfo field name failed validation\n");
335 res = 0;
336 }
337 } else
338 if (strcmp("setid", ast_json_object_iter_key(iter)) == 0) {
339 int prop_is_valid;
340 has_setid = 1;
341 prop_is_valid = ast_ari_validate_set_id(
343 if (!prop_is_valid) {
344 ast_log(LOG_ERROR, "ARI ConfigInfo field setid failed validation\n");
345 res = 0;
346 }
347 } else
348 {
350 "ARI ConfigInfo has undocumented field %s\n",
352 res = 0;
353 }
354 }
355
356 if (!has_default_language) {
357 ast_log(LOG_ERROR, "ARI ConfigInfo missing required field default_language\n");
358 res = 0;
359 }
360
361 if (!has_name) {
362 ast_log(LOG_ERROR, "ARI ConfigInfo missing required field name\n");
363 res = 0;
364 }
365
366 if (!has_setid) {
367 ast_log(LOG_ERROR, "ARI ConfigInfo missing required field setid\n");
368 res = 0;
369 }
370
371 return res;
372}
373
375{
377}
378
380{
381 int res = 1;
382 struct ast_json_iter *iter;
383 int has_attribute = 0;
384 int has_value = 0;
385
386 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
387 if (strcmp("attribute", ast_json_object_iter_key(iter)) == 0) {
388 int prop_is_valid;
389 has_attribute = 1;
390 prop_is_valid = ast_ari_validate_string(
392 if (!prop_is_valid) {
393 ast_log(LOG_ERROR, "ARI ConfigTuple field attribute failed validation\n");
394 res = 0;
395 }
396 } else
397 if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
398 int prop_is_valid;
399 has_value = 1;
400 prop_is_valid = ast_ari_validate_string(
402 if (!prop_is_valid) {
403 ast_log(LOG_ERROR, "ARI ConfigTuple field value failed validation\n");
404 res = 0;
405 }
406 } else
407 {
409 "ARI ConfigTuple has undocumented field %s\n",
411 res = 0;
412 }
413 }
414
415 if (!has_attribute) {
416 ast_log(LOG_ERROR, "ARI ConfigTuple missing required field attribute\n");
417 res = 0;
418 }
419
420 if (!has_value) {
421 ast_log(LOG_ERROR, "ARI ConfigTuple missing required field value\n");
422 res = 0;
423 }
424
425 return res;
426}
427
429{
431}
432
434{
435 int res = 1;
436 struct ast_json_iter *iter;
437 int has_channel = 0;
438 int has_configuration = 0;
439 int has_status = 0;
440 int has_type = 0;
441
442 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
443 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
444 int prop_is_valid;
445 has_channel = 1;
446 prop_is_valid = ast_ari_validate_string(
448 if (!prop_is_valid) {
449 ast_log(LOG_ERROR, "ARI LogChannel field channel failed validation\n");
450 res = 0;
451 }
452 } else
453 if (strcmp("configuration", ast_json_object_iter_key(iter)) == 0) {
454 int prop_is_valid;
455 has_configuration = 1;
456 prop_is_valid = ast_ari_validate_string(
458 if (!prop_is_valid) {
459 ast_log(LOG_ERROR, "ARI LogChannel field configuration failed validation\n");
460 res = 0;
461 }
462 } else
463 if (strcmp("status", ast_json_object_iter_key(iter)) == 0) {
464 int prop_is_valid;
465 has_status = 1;
466 prop_is_valid = ast_ari_validate_string(
468 if (!prop_is_valid) {
469 ast_log(LOG_ERROR, "ARI LogChannel field status failed validation\n");
470 res = 0;
471 }
472 } else
473 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
474 int prop_is_valid;
475 has_type = 1;
476 prop_is_valid = ast_ari_validate_string(
478 if (!prop_is_valid) {
479 ast_log(LOG_ERROR, "ARI LogChannel field type failed validation\n");
480 res = 0;
481 }
482 } else
483 {
485 "ARI LogChannel has undocumented field %s\n",
487 res = 0;
488 }
489 }
490
491 if (!has_channel) {
492 ast_log(LOG_ERROR, "ARI LogChannel missing required field channel\n");
493 res = 0;
494 }
495
496 if (!has_configuration) {
497 ast_log(LOG_ERROR, "ARI LogChannel missing required field configuration\n");
498 res = 0;
499 }
500
501 if (!has_status) {
502 ast_log(LOG_ERROR, "ARI LogChannel missing required field status\n");
503 res = 0;
504 }
505
506 if (!has_type) {
507 ast_log(LOG_ERROR, "ARI LogChannel missing required field type\n");
508 res = 0;
509 }
510
511 return res;
512}
513
515{
517}
518
520{
521 int res = 1;
522 struct ast_json_iter *iter;
523 int has_description = 0;
524 int has_name = 0;
525 int has_status = 0;
526 int has_support_level = 0;
527 int has_use_count = 0;
528
529 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
530 if (strcmp("description", ast_json_object_iter_key(iter)) == 0) {
531 int prop_is_valid;
532 has_description = 1;
533 prop_is_valid = ast_ari_validate_string(
535 if (!prop_is_valid) {
536 ast_log(LOG_ERROR, "ARI Module field description failed validation\n");
537 res = 0;
538 }
539 } else
540 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
541 int prop_is_valid;
542 has_name = 1;
543 prop_is_valid = ast_ari_validate_string(
545 if (!prop_is_valid) {
546 ast_log(LOG_ERROR, "ARI Module field name failed validation\n");
547 res = 0;
548 }
549 } else
550 if (strcmp("status", ast_json_object_iter_key(iter)) == 0) {
551 int prop_is_valid;
552 has_status = 1;
553 prop_is_valid = ast_ari_validate_string(
555 if (!prop_is_valid) {
556 ast_log(LOG_ERROR, "ARI Module field status failed validation\n");
557 res = 0;
558 }
559 } else
560 if (strcmp("support_level", ast_json_object_iter_key(iter)) == 0) {
561 int prop_is_valid;
562 has_support_level = 1;
563 prop_is_valid = ast_ari_validate_string(
565 if (!prop_is_valid) {
566 ast_log(LOG_ERROR, "ARI Module field support_level failed validation\n");
567 res = 0;
568 }
569 } else
570 if (strcmp("use_count", ast_json_object_iter_key(iter)) == 0) {
571 int prop_is_valid;
572 has_use_count = 1;
573 prop_is_valid = ast_ari_validate_int(
575 if (!prop_is_valid) {
576 ast_log(LOG_ERROR, "ARI Module field use_count failed validation\n");
577 res = 0;
578 }
579 } else
580 {
582 "ARI Module has undocumented field %s\n",
584 res = 0;
585 }
586 }
587
588 if (!has_description) {
589 ast_log(LOG_ERROR, "ARI Module missing required field description\n");
590 res = 0;
591 }
592
593 if (!has_name) {
594 ast_log(LOG_ERROR, "ARI Module missing required field name\n");
595 res = 0;
596 }
597
598 if (!has_status) {
599 ast_log(LOG_ERROR, "ARI Module missing required field status\n");
600 res = 0;
601 }
602
603 if (!has_support_level) {
604 ast_log(LOG_ERROR, "ARI Module missing required field support_level\n");
605 res = 0;
606 }
607
608 if (!has_use_count) {
609 ast_log(LOG_ERROR, "ARI Module missing required field use_count\n");
610 res = 0;
611 }
612
613 return res;
614}
615
617{
619}
620
622{
623 int res = 1;
624 struct ast_json_iter *iter;
625 int has_group = 0;
626 int has_user = 0;
627
628 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
629 if (strcmp("group", ast_json_object_iter_key(iter)) == 0) {
630 int prop_is_valid;
631 has_group = 1;
632 prop_is_valid = ast_ari_validate_string(
634 if (!prop_is_valid) {
635 ast_log(LOG_ERROR, "ARI SetId field group failed validation\n");
636 res = 0;
637 }
638 } else
639 if (strcmp("user", ast_json_object_iter_key(iter)) == 0) {
640 int prop_is_valid;
641 has_user = 1;
642 prop_is_valid = ast_ari_validate_string(
644 if (!prop_is_valid) {
645 ast_log(LOG_ERROR, "ARI SetId field user failed validation\n");
646 res = 0;
647 }
648 } else
649 {
651 "ARI SetId has undocumented field %s\n",
653 res = 0;
654 }
655 }
656
657 if (!has_group) {
658 ast_log(LOG_ERROR, "ARI SetId missing required field group\n");
659 res = 0;
660 }
661
662 if (!has_user) {
663 ast_log(LOG_ERROR, "ARI SetId missing required field user\n");
664 res = 0;
665 }
666
667 return res;
668}
669
671{
673}
674
676{
677 int res = 1;
678 struct ast_json_iter *iter;
679 int has_last_reload_time = 0;
680 int has_startup_time = 0;
681
682 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
683 if (strcmp("last_reload_time", ast_json_object_iter_key(iter)) == 0) {
684 int prop_is_valid;
685 has_last_reload_time = 1;
686 prop_is_valid = ast_ari_validate_date(
688 if (!prop_is_valid) {
689 ast_log(LOG_ERROR, "ARI StatusInfo field last_reload_time failed validation\n");
690 res = 0;
691 }
692 } else
693 if (strcmp("startup_time", ast_json_object_iter_key(iter)) == 0) {
694 int prop_is_valid;
695 has_startup_time = 1;
696 prop_is_valid = ast_ari_validate_date(
698 if (!prop_is_valid) {
699 ast_log(LOG_ERROR, "ARI StatusInfo field startup_time failed validation\n");
700 res = 0;
701 }
702 } else
703 {
705 "ARI StatusInfo has undocumented field %s\n",
707 res = 0;
708 }
709 }
710
711 if (!has_last_reload_time) {
712 ast_log(LOG_ERROR, "ARI StatusInfo missing required field last_reload_time\n");
713 res = 0;
714 }
715
716 if (!has_startup_time) {
717 ast_log(LOG_ERROR, "ARI StatusInfo missing required field startup_time\n");
718 res = 0;
719 }
720
721 return res;
722}
723
725{
727}
728
730{
731 int res = 1;
732 struct ast_json_iter *iter;
733 int has_entity_id = 0;
734 int has_version = 0;
735
736 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
737 if (strcmp("entity_id", ast_json_object_iter_key(iter)) == 0) {
738 int prop_is_valid;
739 has_entity_id = 1;
740 prop_is_valid = ast_ari_validate_string(
742 if (!prop_is_valid) {
743 ast_log(LOG_ERROR, "ARI SystemInfo field entity_id failed validation\n");
744 res = 0;
745 }
746 } else
747 if (strcmp("version", ast_json_object_iter_key(iter)) == 0) {
748 int prop_is_valid;
749 has_version = 1;
750 prop_is_valid = ast_ari_validate_string(
752 if (!prop_is_valid) {
753 ast_log(LOG_ERROR, "ARI SystemInfo field version failed validation\n");
754 res = 0;
755 }
756 } else
757 {
759 "ARI SystemInfo has undocumented field %s\n",
761 res = 0;
762 }
763 }
764
765 if (!has_entity_id) {
766 ast_log(LOG_ERROR, "ARI SystemInfo missing required field entity_id\n");
767 res = 0;
768 }
769
770 if (!has_version) {
771 ast_log(LOG_ERROR, "ARI SystemInfo missing required field version\n");
772 res = 0;
773 }
774
775 return res;
776}
777
779{
781}
782
784{
785 int res = 1;
786 struct ast_json_iter *iter;
787 int has_value = 0;
788
789 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
790 if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
791 int prop_is_valid;
792 has_value = 1;
793 prop_is_valid = ast_ari_validate_string(
795 if (!prop_is_valid) {
796 ast_log(LOG_ERROR, "ARI Variable field value failed validation\n");
797 res = 0;
798 }
799 } else
800 {
802 "ARI Variable has undocumented field %s\n",
804 res = 0;
805 }
806 }
807
808 if (!has_value) {
809 ast_log(LOG_ERROR, "ARI Variable missing required field value\n");
810 res = 0;
811 }
812
813 return res;
814}
815
817{
819}
820
822{
823 int res = 1;
824 struct ast_json_iter *iter;
825 int has_channel_ids = 0;
826 int has_resource = 0;
827 int has_technology = 0;
828
829 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
830 if (strcmp("channel_ids", ast_json_object_iter_key(iter)) == 0) {
831 int prop_is_valid;
832 has_channel_ids = 1;
833 prop_is_valid = ast_ari_validate_list(
836 if (!prop_is_valid) {
837 ast_log(LOG_ERROR, "ARI Endpoint field channel_ids failed validation\n");
838 res = 0;
839 }
840 } else
841 if (strcmp("resource", ast_json_object_iter_key(iter)) == 0) {
842 int prop_is_valid;
843 has_resource = 1;
844 prop_is_valid = ast_ari_validate_string(
846 if (!prop_is_valid) {
847 ast_log(LOG_ERROR, "ARI Endpoint field resource failed validation\n");
848 res = 0;
849 }
850 } else
851 if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
852 int prop_is_valid;
853 prop_is_valid = ast_ari_validate_string(
855 if (!prop_is_valid) {
856 ast_log(LOG_ERROR, "ARI Endpoint field state failed validation\n");
857 res = 0;
858 }
859 } else
860 if (strcmp("technology", ast_json_object_iter_key(iter)) == 0) {
861 int prop_is_valid;
862 has_technology = 1;
863 prop_is_valid = ast_ari_validate_string(
865 if (!prop_is_valid) {
866 ast_log(LOG_ERROR, "ARI Endpoint field technology failed validation\n");
867 res = 0;
868 }
869 } else
870 {
872 "ARI Endpoint has undocumented field %s\n",
874 res = 0;
875 }
876 }
877
878 if (!has_channel_ids) {
879 ast_log(LOG_ERROR, "ARI Endpoint missing required field channel_ids\n");
880 res = 0;
881 }
882
883 if (!has_resource) {
884 ast_log(LOG_ERROR, "ARI Endpoint missing required field resource\n");
885 res = 0;
886 }
887
888 if (!has_technology) {
889 ast_log(LOG_ERROR, "ARI Endpoint missing required field technology\n");
890 res = 0;
891 }
892
893 return res;
894}
895
897{
899}
900
902{
903 int res = 1;
904 struct ast_json_iter *iter;
905 int has_body = 0;
906 int has_from = 0;
907 int has_to = 0;
908
909 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
910 if (strcmp("body", ast_json_object_iter_key(iter)) == 0) {
911 int prop_is_valid;
912 has_body = 1;
913 prop_is_valid = ast_ari_validate_string(
915 if (!prop_is_valid) {
916 ast_log(LOG_ERROR, "ARI TextMessage field body failed validation\n");
917 res = 0;
918 }
919 } else
920 if (strcmp("from", ast_json_object_iter_key(iter)) == 0) {
921 int prop_is_valid;
922 has_from = 1;
923 prop_is_valid = ast_ari_validate_string(
925 if (!prop_is_valid) {
926 ast_log(LOG_ERROR, "ARI TextMessage field from failed validation\n");
927 res = 0;
928 }
929 } else
930 if (strcmp("to", ast_json_object_iter_key(iter)) == 0) {
931 int prop_is_valid;
932 has_to = 1;
933 prop_is_valid = ast_ari_validate_string(
935 if (!prop_is_valid) {
936 ast_log(LOG_ERROR, "ARI TextMessage field to failed validation\n");
937 res = 0;
938 }
939 } else
940 if (strcmp("variables", ast_json_object_iter_key(iter)) == 0) {
941 int prop_is_valid;
942 prop_is_valid = ast_ari_validate_object(
944 if (!prop_is_valid) {
945 ast_log(LOG_ERROR, "ARI TextMessage field variables failed validation\n");
946 res = 0;
947 }
948 } else
949 {
951 "ARI TextMessage has undocumented field %s\n",
953 res = 0;
954 }
955 }
956
957 if (!has_body) {
958 ast_log(LOG_ERROR, "ARI TextMessage missing required field body\n");
959 res = 0;
960 }
961
962 if (!has_from) {
963 ast_log(LOG_ERROR, "ARI TextMessage missing required field from\n");
964 res = 0;
965 }
966
967 if (!has_to) {
968 ast_log(LOG_ERROR, "ARI TextMessage missing required field to\n");
969 res = 0;
970 }
971
972 return res;
973}
974
976{
978}
979
981{
982 int res = 1;
983 struct ast_json_iter *iter;
984 int has_name = 0;
985 int has_number = 0;
986
987 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
988 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
989 int prop_is_valid;
990 has_name = 1;
991 prop_is_valid = ast_ari_validate_string(
993 if (!prop_is_valid) {
994 ast_log(LOG_ERROR, "ARI CallerID field name failed validation\n");
995 res = 0;
996 }
997 } else
998 if (strcmp("number", ast_json_object_iter_key(iter)) == 0) {
999 int prop_is_valid;
1000 has_number = 1;
1001 prop_is_valid = ast_ari_validate_string(
1003 if (!prop_is_valid) {
1004 ast_log(LOG_ERROR, "ARI CallerID field number failed validation\n");
1005 res = 0;
1006 }
1007 } else
1008 {
1010 "ARI CallerID has undocumented field %s\n",
1012 res = 0;
1013 }
1014 }
1015
1016 if (!has_name) {
1017 ast_log(LOG_ERROR, "ARI CallerID missing required field name\n");
1018 res = 0;
1019 }
1020
1021 if (!has_number) {
1022 ast_log(LOG_ERROR, "ARI CallerID missing required field number\n");
1023 res = 0;
1024 }
1025
1026 return res;
1027}
1028
1030{
1032}
1033
1035{
1036 int res = 1;
1037 struct ast_json_iter *iter;
1038 int has_accountcode = 0;
1039 int has_caller = 0;
1040 int has_connected = 0;
1041 int has_creationtime = 0;
1042 int has_dialplan = 0;
1043 int has_id = 0;
1044 int has_language = 0;
1045 int has_name = 0;
1046 int has_protocol_id = 0;
1047 int has_state = 0;
1048
1049 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
1050 if (strcmp("accountcode", ast_json_object_iter_key(iter)) == 0) {
1051 int prop_is_valid;
1052 has_accountcode = 1;
1053 prop_is_valid = ast_ari_validate_string(
1055 if (!prop_is_valid) {
1056 ast_log(LOG_ERROR, "ARI Channel field accountcode failed validation\n");
1057 res = 0;
1058 }
1059 } else
1060 if (strcmp("caller", ast_json_object_iter_key(iter)) == 0) {
1061 int prop_is_valid;
1062 has_caller = 1;
1063 prop_is_valid = ast_ari_validate_caller_id(
1065 if (!prop_is_valid) {
1066 ast_log(LOG_ERROR, "ARI Channel field caller failed validation\n");
1067 res = 0;
1068 }
1069 } else
1070 if (strcmp("caller_rdnis", ast_json_object_iter_key(iter)) == 0) {
1071 int prop_is_valid;
1072 prop_is_valid = ast_ari_validate_string(
1074 if (!prop_is_valid) {
1075 ast_log(LOG_ERROR, "ARI Channel field caller_rdnis failed validation\n");
1076 res = 0;
1077 }
1078 } else
1079 if (strcmp("channelvars", ast_json_object_iter_key(iter)) == 0) {
1080 int prop_is_valid;
1081 prop_is_valid = ast_ari_validate_object(
1083 if (!prop_is_valid) {
1084 ast_log(LOG_ERROR, "ARI Channel field channelvars failed validation\n");
1085 res = 0;
1086 }
1087 } else
1088 if (strcmp("connected", ast_json_object_iter_key(iter)) == 0) {
1089 int prop_is_valid;
1090 has_connected = 1;
1091 prop_is_valid = ast_ari_validate_caller_id(
1093 if (!prop_is_valid) {
1094 ast_log(LOG_ERROR, "ARI Channel field connected failed validation\n");
1095 res = 0;
1096 }
1097 } else
1098 if (strcmp("creationtime", ast_json_object_iter_key(iter)) == 0) {
1099 int prop_is_valid;
1100 has_creationtime = 1;
1101 prop_is_valid = ast_ari_validate_date(
1103 if (!prop_is_valid) {
1104 ast_log(LOG_ERROR, "ARI Channel field creationtime failed validation\n");
1105 res = 0;
1106 }
1107 } else
1108 if (strcmp("dialplan", ast_json_object_iter_key(iter)) == 0) {
1109 int prop_is_valid;
1110 has_dialplan = 1;
1111 prop_is_valid = ast_ari_validate_dialplan_cep(
1113 if (!prop_is_valid) {
1114 ast_log(LOG_ERROR, "ARI Channel field dialplan failed validation\n");
1115 res = 0;
1116 }
1117 } else
1118 if (strcmp("id", ast_json_object_iter_key(iter)) == 0) {
1119 int prop_is_valid;
1120 has_id = 1;
1121 prop_is_valid = ast_ari_validate_string(
1123 if (!prop_is_valid) {
1124 ast_log(LOG_ERROR, "ARI Channel field id failed validation\n");
1125 res = 0;
1126 }
1127 } else
1128 if (strcmp("language", ast_json_object_iter_key(iter)) == 0) {
1129 int prop_is_valid;
1130 has_language = 1;
1131 prop_is_valid = ast_ari_validate_string(
1133 if (!prop_is_valid) {
1134 ast_log(LOG_ERROR, "ARI Channel field language failed validation\n");
1135 res = 0;
1136 }
1137 } else
1138 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
1139 int prop_is_valid;
1140 has_name = 1;
1141 prop_is_valid = ast_ari_validate_string(
1143 if (!prop_is_valid) {
1144 ast_log(LOG_ERROR, "ARI Channel field name failed validation\n");
1145 res = 0;
1146 }
1147 } else
1148 if (strcmp("protocol_id", ast_json_object_iter_key(iter)) == 0) {
1149 int prop_is_valid;
1150 has_protocol_id = 1;
1151 prop_is_valid = ast_ari_validate_string(
1153 if (!prop_is_valid) {
1154 ast_log(LOG_ERROR, "ARI Channel field protocol_id failed validation\n");
1155 res = 0;
1156 }
1157 } else
1158 if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
1159 int prop_is_valid;
1160 has_state = 1;
1161 prop_is_valid = ast_ari_validate_string(
1163 if (!prop_is_valid) {
1164 ast_log(LOG_ERROR, "ARI Channel field state failed validation\n");
1165 res = 0;
1166 }
1167 } else
1168 if (strcmp("tenantid", ast_json_object_iter_key(iter)) == 0) {
1169 int prop_is_valid;
1170 prop_is_valid = ast_ari_validate_string(
1172 if (!prop_is_valid) {
1173 ast_log(LOG_ERROR, "ARI Channel field tenantid failed validation\n");
1174 res = 0;
1175 }
1176 } else
1177 {
1179 "ARI Channel has undocumented field %s\n",
1181 res = 0;
1182 }
1183 }
1184
1185 if (!has_accountcode) {
1186 ast_log(LOG_ERROR, "ARI Channel missing required field accountcode\n");
1187 res = 0;
1188 }
1189
1190 if (!has_caller) {
1191 ast_log(LOG_ERROR, "ARI Channel missing required field caller\n");
1192 res = 0;
1193 }
1194
1195 if (!has_connected) {
1196 ast_log(LOG_ERROR, "ARI Channel missing required field connected\n");
1197 res = 0;
1198 }
1199
1200 if (!has_creationtime) {
1201 ast_log(LOG_ERROR, "ARI Channel missing required field creationtime\n");
1202 res = 0;
1203 }
1204
1205 if (!has_dialplan) {
1206 ast_log(LOG_ERROR, "ARI Channel missing required field dialplan\n");
1207 res = 0;
1208 }
1209
1210 if (!has_id) {
1211 ast_log(LOG_ERROR, "ARI Channel missing required field id\n");
1212 res = 0;
1213 }
1214
1215 if (!has_language) {
1216 ast_log(LOG_ERROR, "ARI Channel missing required field language\n");
1217 res = 0;
1218 }
1219
1220 if (!has_name) {
1221 ast_log(LOG_ERROR, "ARI Channel missing required field name\n");
1222 res = 0;
1223 }
1224
1225 if (!has_protocol_id) {
1226 ast_log(LOG_ERROR, "ARI Channel missing required field protocol_id\n");
1227 res = 0;
1228 }
1229
1230 if (!has_state) {
1231 ast_log(LOG_ERROR, "ARI Channel missing required field state\n");
1232 res = 0;
1233 }
1234
1235 return res;
1236}
1237
1239{
1241}
1242
1244{
1245 int res = 1;
1246 struct ast_json_iter *iter;
1247
1248 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
1249 {
1251 "ARI Dialed has undocumented field %s\n",
1253 res = 0;
1254 }
1255 }
1256
1257 return res;
1258}
1259
1261{
1263}
1264
1266{
1267 int res = 1;
1268 struct ast_json_iter *iter;
1269 int has_app_data = 0;
1270 int has_app_name = 0;
1271 int has_context = 0;
1272 int has_exten = 0;
1273 int has_priority = 0;
1274
1275 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
1276 if (strcmp("app_data", ast_json_object_iter_key(iter)) == 0) {
1277 int prop_is_valid;
1278 has_app_data = 1;
1279 prop_is_valid = ast_ari_validate_string(
1281 if (!prop_is_valid) {
1282 ast_log(LOG_ERROR, "ARI DialplanCEP field app_data failed validation\n");
1283 res = 0;
1284 }
1285 } else
1286 if (strcmp("app_name", ast_json_object_iter_key(iter)) == 0) {
1287 int prop_is_valid;
1288 has_app_name = 1;
1289 prop_is_valid = ast_ari_validate_string(
1291 if (!prop_is_valid) {
1292 ast_log(LOG_ERROR, "ARI DialplanCEP field app_name failed validation\n");
1293 res = 0;
1294 }
1295 } else
1296 if (strcmp("context", ast_json_object_iter_key(iter)) == 0) {
1297 int prop_is_valid;
1298 has_context = 1;
1299 prop_is_valid = ast_ari_validate_string(
1301 if (!prop_is_valid) {
1302 ast_log(LOG_ERROR, "ARI DialplanCEP field context failed validation\n");
1303 res = 0;
1304 }
1305 } else
1306 if (strcmp("exten", ast_json_object_iter_key(iter)) == 0) {
1307 int prop_is_valid;
1308 has_exten = 1;
1309 prop_is_valid = ast_ari_validate_string(
1311 if (!prop_is_valid) {
1312 ast_log(LOG_ERROR, "ARI DialplanCEP field exten failed validation\n");
1313 res = 0;
1314 }
1315 } else
1316 if (strcmp("priority", ast_json_object_iter_key(iter)) == 0) {
1317 int prop_is_valid;
1318 has_priority = 1;
1319 prop_is_valid = ast_ari_validate_long(
1321 if (!prop_is_valid) {
1322 ast_log(LOG_ERROR, "ARI DialplanCEP field priority failed validation\n");
1323 res = 0;
1324 }
1325 } else
1326 {
1328 "ARI DialplanCEP has undocumented field %s\n",
1330 res = 0;
1331 }
1332 }
1333
1334 if (!has_app_data) {
1335 ast_log(LOG_ERROR, "ARI DialplanCEP missing required field app_data\n");
1336 res = 0;
1337 }
1338
1339 if (!has_app_name) {
1340 ast_log(LOG_ERROR, "ARI DialplanCEP missing required field app_name\n");
1341 res = 0;
1342 }
1343
1344 if (!has_context) {
1345 ast_log(LOG_ERROR, "ARI DialplanCEP missing required field context\n");
1346 res = 0;
1347 }
1348
1349 if (!has_exten) {
1350 ast_log(LOG_ERROR, "ARI DialplanCEP missing required field exten\n");
1351 res = 0;
1352 }
1353
1354 if (!has_priority) {
1355 ast_log(LOG_ERROR, "ARI DialplanCEP missing required field priority\n");
1356 res = 0;
1357 }
1358
1359 return res;
1360}
1361
1363{
1365}
1366
1368{
1369 int res = 1;
1370 struct ast_json_iter *iter;
1371 int has_channel_uniqueid = 0;
1372 int has_local_ssrc = 0;
1373 int has_remote_ssrc = 0;
1374 int has_rxcount = 0;
1375 int has_rxoctetcount = 0;
1376 int has_rxploss = 0;
1377 int has_txcount = 0;
1378 int has_txoctetcount = 0;
1379 int has_txploss = 0;
1380
1381 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
1382 if (strcmp("channel_uniqueid", ast_json_object_iter_key(iter)) == 0) {
1383 int prop_is_valid;
1384 has_channel_uniqueid = 1;
1385 prop_is_valid = ast_ari_validate_string(
1387 if (!prop_is_valid) {
1388 ast_log(LOG_ERROR, "ARI RTPstat field channel_uniqueid failed validation\n");
1389 res = 0;
1390 }
1391 } else
1392 if (strcmp("local_maxjitter", ast_json_object_iter_key(iter)) == 0) {
1393 int prop_is_valid;
1394 prop_is_valid = ast_ari_validate_double(
1396 if (!prop_is_valid) {
1397 ast_log(LOG_ERROR, "ARI RTPstat field local_maxjitter failed validation\n");
1398 res = 0;
1399 }
1400 } else
1401 if (strcmp("local_maxrxploss", ast_json_object_iter_key(iter)) == 0) {
1402 int prop_is_valid;
1403 prop_is_valid = ast_ari_validate_double(
1405 if (!prop_is_valid) {
1406 ast_log(LOG_ERROR, "ARI RTPstat field local_maxrxploss failed validation\n");
1407 res = 0;
1408 }
1409 } else
1410 if (strcmp("local_minjitter", ast_json_object_iter_key(iter)) == 0) {
1411 int prop_is_valid;
1412 prop_is_valid = ast_ari_validate_double(
1414 if (!prop_is_valid) {
1415 ast_log(LOG_ERROR, "ARI RTPstat field local_minjitter failed validation\n");
1416 res = 0;
1417 }
1418 } else
1419 if (strcmp("local_minrxploss", ast_json_object_iter_key(iter)) == 0) {
1420 int prop_is_valid;
1421 prop_is_valid = ast_ari_validate_double(
1423 if (!prop_is_valid) {
1424 ast_log(LOG_ERROR, "ARI RTPstat field local_minrxploss failed validation\n");
1425 res = 0;
1426 }
1427 } else
1428 if (strcmp("local_normdevjitter", ast_json_object_iter_key(iter)) == 0) {
1429 int prop_is_valid;
1430 prop_is_valid = ast_ari_validate_double(
1432 if (!prop_is_valid) {
1433 ast_log(LOG_ERROR, "ARI RTPstat field local_normdevjitter failed validation\n");
1434 res = 0;
1435 }
1436 } else
1437 if (strcmp("local_normdevrxploss", ast_json_object_iter_key(iter)) == 0) {
1438 int prop_is_valid;
1439 prop_is_valid = ast_ari_validate_double(
1441 if (!prop_is_valid) {
1442 ast_log(LOG_ERROR, "ARI RTPstat field local_normdevrxploss failed validation\n");
1443 res = 0;
1444 }
1445 } else
1446 if (strcmp("local_ssrc", ast_json_object_iter_key(iter)) == 0) {
1447 int prop_is_valid;
1448 has_local_ssrc = 1;
1449 prop_is_valid = ast_ari_validate_int(
1451 if (!prop_is_valid) {
1452 ast_log(LOG_ERROR, "ARI RTPstat field local_ssrc failed validation\n");
1453 res = 0;
1454 }
1455 } else
1456 if (strcmp("local_stdevjitter", ast_json_object_iter_key(iter)) == 0) {
1457 int prop_is_valid;
1458 prop_is_valid = ast_ari_validate_double(
1460 if (!prop_is_valid) {
1461 ast_log(LOG_ERROR, "ARI RTPstat field local_stdevjitter failed validation\n");
1462 res = 0;
1463 }
1464 } else
1465 if (strcmp("local_stdevrxploss", ast_json_object_iter_key(iter)) == 0) {
1466 int prop_is_valid;
1467 prop_is_valid = ast_ari_validate_double(
1469 if (!prop_is_valid) {
1470 ast_log(LOG_ERROR, "ARI RTPstat field local_stdevrxploss failed validation\n");
1471 res = 0;
1472 }
1473 } else
1474 if (strcmp("maxrtt", ast_json_object_iter_key(iter)) == 0) {
1475 int prop_is_valid;
1476 prop_is_valid = ast_ari_validate_double(
1478 if (!prop_is_valid) {
1479 ast_log(LOG_ERROR, "ARI RTPstat field maxrtt failed validation\n");
1480 res = 0;
1481 }
1482 } else
1483 if (strcmp("minrtt", ast_json_object_iter_key(iter)) == 0) {
1484 int prop_is_valid;
1485 prop_is_valid = ast_ari_validate_double(
1487 if (!prop_is_valid) {
1488 ast_log(LOG_ERROR, "ARI RTPstat field minrtt failed validation\n");
1489 res = 0;
1490 }
1491 } else
1492 if (strcmp("normdevrtt", ast_json_object_iter_key(iter)) == 0) {
1493 int prop_is_valid;
1494 prop_is_valid = ast_ari_validate_double(
1496 if (!prop_is_valid) {
1497 ast_log(LOG_ERROR, "ARI RTPstat field normdevrtt failed validation\n");
1498 res = 0;
1499 }
1500 } else
1501 if (strcmp("remote_maxjitter", ast_json_object_iter_key(iter)) == 0) {
1502 int prop_is_valid;
1503 prop_is_valid = ast_ari_validate_double(
1505 if (!prop_is_valid) {
1506 ast_log(LOG_ERROR, "ARI RTPstat field remote_maxjitter failed validation\n");
1507 res = 0;
1508 }
1509 } else
1510 if (strcmp("remote_maxrxploss", ast_json_object_iter_key(iter)) == 0) {
1511 int prop_is_valid;
1512 prop_is_valid = ast_ari_validate_double(
1514 if (!prop_is_valid) {
1515 ast_log(LOG_ERROR, "ARI RTPstat field remote_maxrxploss failed validation\n");
1516 res = 0;
1517 }
1518 } else
1519 if (strcmp("remote_minjitter", ast_json_object_iter_key(iter)) == 0) {
1520 int prop_is_valid;
1521 prop_is_valid = ast_ari_validate_double(
1523 if (!prop_is_valid) {
1524 ast_log(LOG_ERROR, "ARI RTPstat field remote_minjitter failed validation\n");
1525 res = 0;
1526 }
1527 } else
1528 if (strcmp("remote_minrxploss", ast_json_object_iter_key(iter)) == 0) {
1529 int prop_is_valid;
1530 prop_is_valid = ast_ari_validate_double(
1532 if (!prop_is_valid) {
1533 ast_log(LOG_ERROR, "ARI RTPstat field remote_minrxploss failed validation\n");
1534 res = 0;
1535 }
1536 } else
1537 if (strcmp("remote_normdevjitter", ast_json_object_iter_key(iter)) == 0) {
1538 int prop_is_valid;
1539 prop_is_valid = ast_ari_validate_double(
1541 if (!prop_is_valid) {
1542 ast_log(LOG_ERROR, "ARI RTPstat field remote_normdevjitter failed validation\n");
1543 res = 0;
1544 }
1545 } else
1546 if (strcmp("remote_normdevrxploss", ast_json_object_iter_key(iter)) == 0) {
1547 int prop_is_valid;
1548 prop_is_valid = ast_ari_validate_double(
1550 if (!prop_is_valid) {
1551 ast_log(LOG_ERROR, "ARI RTPstat field remote_normdevrxploss failed validation\n");
1552 res = 0;
1553 }
1554 } else
1555 if (strcmp("remote_ssrc", ast_json_object_iter_key(iter)) == 0) {
1556 int prop_is_valid;
1557 has_remote_ssrc = 1;
1558 prop_is_valid = ast_ari_validate_int(
1560 if (!prop_is_valid) {
1561 ast_log(LOG_ERROR, "ARI RTPstat field remote_ssrc failed validation\n");
1562 res = 0;
1563 }
1564 } else
1565 if (strcmp("remote_stdevjitter", ast_json_object_iter_key(iter)) == 0) {
1566 int prop_is_valid;
1567 prop_is_valid = ast_ari_validate_double(
1569 if (!prop_is_valid) {
1570 ast_log(LOG_ERROR, "ARI RTPstat field remote_stdevjitter failed validation\n");
1571 res = 0;
1572 }
1573 } else
1574 if (strcmp("remote_stdevrxploss", ast_json_object_iter_key(iter)) == 0) {
1575 int prop_is_valid;
1576 prop_is_valid = ast_ari_validate_double(
1578 if (!prop_is_valid) {
1579 ast_log(LOG_ERROR, "ARI RTPstat field remote_stdevrxploss failed validation\n");
1580 res = 0;
1581 }
1582 } else
1583 if (strcmp("rtt", ast_json_object_iter_key(iter)) == 0) {
1584 int prop_is_valid;
1585 prop_is_valid = ast_ari_validate_double(
1587 if (!prop_is_valid) {
1588 ast_log(LOG_ERROR, "ARI RTPstat field rtt failed validation\n");
1589 res = 0;
1590 }
1591 } else
1592 if (strcmp("rxcount", ast_json_object_iter_key(iter)) == 0) {
1593 int prop_is_valid;
1594 has_rxcount = 1;
1595 prop_is_valid = ast_ari_validate_int(
1597 if (!prop_is_valid) {
1598 ast_log(LOG_ERROR, "ARI RTPstat field rxcount failed validation\n");
1599 res = 0;
1600 }
1601 } else
1602 if (strcmp("rxjitter", ast_json_object_iter_key(iter)) == 0) {
1603 int prop_is_valid;
1604 prop_is_valid = ast_ari_validate_double(
1606 if (!prop_is_valid) {
1607 ast_log(LOG_ERROR, "ARI RTPstat field rxjitter failed validation\n");
1608 res = 0;
1609 }
1610 } else
1611 if (strcmp("rxoctetcount", ast_json_object_iter_key(iter)) == 0) {
1612 int prop_is_valid;
1613 has_rxoctetcount = 1;
1614 prop_is_valid = ast_ari_validate_int(
1616 if (!prop_is_valid) {
1617 ast_log(LOG_ERROR, "ARI RTPstat field rxoctetcount failed validation\n");
1618 res = 0;
1619 }
1620 } else
1621 if (strcmp("rxploss", ast_json_object_iter_key(iter)) == 0) {
1622 int prop_is_valid;
1623 has_rxploss = 1;
1624 prop_is_valid = ast_ari_validate_int(
1626 if (!prop_is_valid) {
1627 ast_log(LOG_ERROR, "ARI RTPstat field rxploss failed validation\n");
1628 res = 0;
1629 }
1630 } else
1631 if (strcmp("stdevrtt", ast_json_object_iter_key(iter)) == 0) {
1632 int prop_is_valid;
1633 prop_is_valid = ast_ari_validate_double(
1635 if (!prop_is_valid) {
1636 ast_log(LOG_ERROR, "ARI RTPstat field stdevrtt failed validation\n");
1637 res = 0;
1638 }
1639 } else
1640 if (strcmp("txcount", ast_json_object_iter_key(iter)) == 0) {
1641 int prop_is_valid;
1642 has_txcount = 1;
1643 prop_is_valid = ast_ari_validate_int(
1645 if (!prop_is_valid) {
1646 ast_log(LOG_ERROR, "ARI RTPstat field txcount failed validation\n");
1647 res = 0;
1648 }
1649 } else
1650 if (strcmp("txjitter", ast_json_object_iter_key(iter)) == 0) {
1651 int prop_is_valid;
1652 prop_is_valid = ast_ari_validate_double(
1654 if (!prop_is_valid) {
1655 ast_log(LOG_ERROR, "ARI RTPstat field txjitter failed validation\n");
1656 res = 0;
1657 }
1658 } else
1659 if (strcmp("txoctetcount", ast_json_object_iter_key(iter)) == 0) {
1660 int prop_is_valid;
1661 has_txoctetcount = 1;
1662 prop_is_valid = ast_ari_validate_int(
1664 if (!prop_is_valid) {
1665 ast_log(LOG_ERROR, "ARI RTPstat field txoctetcount failed validation\n");
1666 res = 0;
1667 }
1668 } else
1669 if (strcmp("txploss", ast_json_object_iter_key(iter)) == 0) {
1670 int prop_is_valid;
1671 has_txploss = 1;
1672 prop_is_valid = ast_ari_validate_int(
1674 if (!prop_is_valid) {
1675 ast_log(LOG_ERROR, "ARI RTPstat field txploss failed validation\n");
1676 res = 0;
1677 }
1678 } else
1679 {
1681 "ARI RTPstat has undocumented field %s\n",
1683 res = 0;
1684 }
1685 }
1686
1687 if (!has_channel_uniqueid) {
1688 ast_log(LOG_ERROR, "ARI RTPstat missing required field channel_uniqueid\n");
1689 res = 0;
1690 }
1691
1692 if (!has_local_ssrc) {
1693 ast_log(LOG_ERROR, "ARI RTPstat missing required field local_ssrc\n");
1694 res = 0;
1695 }
1696
1697 if (!has_remote_ssrc) {
1698 ast_log(LOG_ERROR, "ARI RTPstat missing required field remote_ssrc\n");
1699 res = 0;
1700 }
1701
1702 if (!has_rxcount) {
1703 ast_log(LOG_ERROR, "ARI RTPstat missing required field rxcount\n");
1704 res = 0;
1705 }
1706
1707 if (!has_rxoctetcount) {
1708 ast_log(LOG_ERROR, "ARI RTPstat missing required field rxoctetcount\n");
1709 res = 0;
1710 }
1711
1712 if (!has_rxploss) {
1713 ast_log(LOG_ERROR, "ARI RTPstat missing required field rxploss\n");
1714 res = 0;
1715 }
1716
1717 if (!has_txcount) {
1718 ast_log(LOG_ERROR, "ARI RTPstat missing required field txcount\n");
1719 res = 0;
1720 }
1721
1722 if (!has_txoctetcount) {
1723 ast_log(LOG_ERROR, "ARI RTPstat missing required field txoctetcount\n");
1724 res = 0;
1725 }
1726
1727 if (!has_txploss) {
1728 ast_log(LOG_ERROR, "ARI RTPstat missing required field txploss\n");
1729 res = 0;
1730 }
1731
1732 return res;
1733}
1734
1736{
1738}
1739
1741{
1742 int res = 1;
1743 struct ast_json_iter *iter;
1744 int has_bridge_class = 0;
1745 int has_bridge_type = 0;
1746 int has_channels = 0;
1747 int has_creationtime = 0;
1748 int has_creator = 0;
1749 int has_id = 0;
1750 int has_name = 0;
1751 int has_technology = 0;
1752
1753 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
1754 if (strcmp("bridge_class", ast_json_object_iter_key(iter)) == 0) {
1755 int prop_is_valid;
1756 has_bridge_class = 1;
1757 prop_is_valid = ast_ari_validate_string(
1759 if (!prop_is_valid) {
1760 ast_log(LOG_ERROR, "ARI Bridge field bridge_class failed validation\n");
1761 res = 0;
1762 }
1763 } else
1764 if (strcmp("bridge_type", ast_json_object_iter_key(iter)) == 0) {
1765 int prop_is_valid;
1766 has_bridge_type = 1;
1767 prop_is_valid = ast_ari_validate_string(
1769 if (!prop_is_valid) {
1770 ast_log(LOG_ERROR, "ARI Bridge field bridge_type failed validation\n");
1771 res = 0;
1772 }
1773 } else
1774 if (strcmp("channels", ast_json_object_iter_key(iter)) == 0) {
1775 int prop_is_valid;
1776 has_channels = 1;
1777 prop_is_valid = ast_ari_validate_list(
1780 if (!prop_is_valid) {
1781 ast_log(LOG_ERROR, "ARI Bridge field channels failed validation\n");
1782 res = 0;
1783 }
1784 } else
1785 if (strcmp("creationtime", ast_json_object_iter_key(iter)) == 0) {
1786 int prop_is_valid;
1787 has_creationtime = 1;
1788 prop_is_valid = ast_ari_validate_date(
1790 if (!prop_is_valid) {
1791 ast_log(LOG_ERROR, "ARI Bridge field creationtime failed validation\n");
1792 res = 0;
1793 }
1794 } else
1795 if (strcmp("creator", ast_json_object_iter_key(iter)) == 0) {
1796 int prop_is_valid;
1797 has_creator = 1;
1798 prop_is_valid = ast_ari_validate_string(
1800 if (!prop_is_valid) {
1801 ast_log(LOG_ERROR, "ARI Bridge field creator failed validation\n");
1802 res = 0;
1803 }
1804 } else
1805 if (strcmp("id", ast_json_object_iter_key(iter)) == 0) {
1806 int prop_is_valid;
1807 has_id = 1;
1808 prop_is_valid = ast_ari_validate_string(
1810 if (!prop_is_valid) {
1811 ast_log(LOG_ERROR, "ARI Bridge field id failed validation\n");
1812 res = 0;
1813 }
1814 } else
1815 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
1816 int prop_is_valid;
1817 has_name = 1;
1818 prop_is_valid = ast_ari_validate_string(
1820 if (!prop_is_valid) {
1821 ast_log(LOG_ERROR, "ARI Bridge field name failed validation\n");
1822 res = 0;
1823 }
1824 } else
1825 if (strcmp("technology", ast_json_object_iter_key(iter)) == 0) {
1826 int prop_is_valid;
1827 has_technology = 1;
1828 prop_is_valid = ast_ari_validate_string(
1830 if (!prop_is_valid) {
1831 ast_log(LOG_ERROR, "ARI Bridge field technology failed validation\n");
1832 res = 0;
1833 }
1834 } else
1835 if (strcmp("video_mode", ast_json_object_iter_key(iter)) == 0) {
1836 int prop_is_valid;
1837 prop_is_valid = ast_ari_validate_string(
1839 if (!prop_is_valid) {
1840 ast_log(LOG_ERROR, "ARI Bridge field video_mode failed validation\n");
1841 res = 0;
1842 }
1843 } else
1844 if (strcmp("video_source_id", ast_json_object_iter_key(iter)) == 0) {
1845 int prop_is_valid;
1846 prop_is_valid = ast_ari_validate_string(
1848 if (!prop_is_valid) {
1849 ast_log(LOG_ERROR, "ARI Bridge field video_source_id failed validation\n");
1850 res = 0;
1851 }
1852 } else
1853 {
1855 "ARI Bridge has undocumented field %s\n",
1857 res = 0;
1858 }
1859 }
1860
1861 if (!has_bridge_class) {
1862 ast_log(LOG_ERROR, "ARI Bridge missing required field bridge_class\n");
1863 res = 0;
1864 }
1865
1866 if (!has_bridge_type) {
1867 ast_log(LOG_ERROR, "ARI Bridge missing required field bridge_type\n");
1868 res = 0;
1869 }
1870
1871 if (!has_channels) {
1872 ast_log(LOG_ERROR, "ARI Bridge missing required field channels\n");
1873 res = 0;
1874 }
1875
1876 if (!has_creationtime) {
1877 ast_log(LOG_ERROR, "ARI Bridge missing required field creationtime\n");
1878 res = 0;
1879 }
1880
1881 if (!has_creator) {
1882 ast_log(LOG_ERROR, "ARI Bridge missing required field creator\n");
1883 res = 0;
1884 }
1885
1886 if (!has_id) {
1887 ast_log(LOG_ERROR, "ARI Bridge missing required field id\n");
1888 res = 0;
1889 }
1890
1891 if (!has_name) {
1892 ast_log(LOG_ERROR, "ARI Bridge missing required field name\n");
1893 res = 0;
1894 }
1895
1896 if (!has_technology) {
1897 ast_log(LOG_ERROR, "ARI Bridge missing required field technology\n");
1898 res = 0;
1899 }
1900
1901 return res;
1902}
1903
1905{
1907}
1908
1910{
1911 int res = 1;
1912 struct ast_json_iter *iter;
1913 int has_format = 0;
1914 int has_name = 0;
1915 int has_state = 0;
1916 int has_target_uri = 0;
1917
1918 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
1919 if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
1920 int prop_is_valid;
1921 prop_is_valid = ast_ari_validate_string(
1923 if (!prop_is_valid) {
1924 ast_log(LOG_ERROR, "ARI LiveRecording field cause failed validation\n");
1925 res = 0;
1926 }
1927 } else
1928 if (strcmp("duration", ast_json_object_iter_key(iter)) == 0) {
1929 int prop_is_valid;
1930 prop_is_valid = ast_ari_validate_int(
1932 if (!prop_is_valid) {
1933 ast_log(LOG_ERROR, "ARI LiveRecording field duration failed validation\n");
1934 res = 0;
1935 }
1936 } else
1937 if (strcmp("format", ast_json_object_iter_key(iter)) == 0) {
1938 int prop_is_valid;
1939 has_format = 1;
1940 prop_is_valid = ast_ari_validate_string(
1942 if (!prop_is_valid) {
1943 ast_log(LOG_ERROR, "ARI LiveRecording field format failed validation\n");
1944 res = 0;
1945 }
1946 } else
1947 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
1948 int prop_is_valid;
1949 has_name = 1;
1950 prop_is_valid = ast_ari_validate_string(
1952 if (!prop_is_valid) {
1953 ast_log(LOG_ERROR, "ARI LiveRecording field name failed validation\n");
1954 res = 0;
1955 }
1956 } else
1957 if (strcmp("silence_duration", ast_json_object_iter_key(iter)) == 0) {
1958 int prop_is_valid;
1959 prop_is_valid = ast_ari_validate_int(
1961 if (!prop_is_valid) {
1962 ast_log(LOG_ERROR, "ARI LiveRecording field silence_duration failed validation\n");
1963 res = 0;
1964 }
1965 } else
1966 if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
1967 int prop_is_valid;
1968 has_state = 1;
1969 prop_is_valid = ast_ari_validate_string(
1971 if (!prop_is_valid) {
1972 ast_log(LOG_ERROR, "ARI LiveRecording field state failed validation\n");
1973 res = 0;
1974 }
1975 } else
1976 if (strcmp("talking_duration", ast_json_object_iter_key(iter)) == 0) {
1977 int prop_is_valid;
1978 prop_is_valid = ast_ari_validate_int(
1980 if (!prop_is_valid) {
1981 ast_log(LOG_ERROR, "ARI LiveRecording field talking_duration failed validation\n");
1982 res = 0;
1983 }
1984 } else
1985 if (strcmp("target_uri", ast_json_object_iter_key(iter)) == 0) {
1986 int prop_is_valid;
1987 has_target_uri = 1;
1988 prop_is_valid = ast_ari_validate_string(
1990 if (!prop_is_valid) {
1991 ast_log(LOG_ERROR, "ARI LiveRecording field target_uri failed validation\n");
1992 res = 0;
1993 }
1994 } else
1995 {
1997 "ARI LiveRecording has undocumented field %s\n",
1999 res = 0;
2000 }
2001 }
2002
2003 if (!has_format) {
2004 ast_log(LOG_ERROR, "ARI LiveRecording missing required field format\n");
2005 res = 0;
2006 }
2007
2008 if (!has_name) {
2009 ast_log(LOG_ERROR, "ARI LiveRecording missing required field name\n");
2010 res = 0;
2011 }
2012
2013 if (!has_state) {
2014 ast_log(LOG_ERROR, "ARI LiveRecording missing required field state\n");
2015 res = 0;
2016 }
2017
2018 if (!has_target_uri) {
2019 ast_log(LOG_ERROR, "ARI LiveRecording missing required field target_uri\n");
2020 res = 0;
2021 }
2022
2023 return res;
2024}
2025
2027{
2029}
2030
2032{
2033 int res = 1;
2034 struct ast_json_iter *iter;
2035 int has_format = 0;
2036 int has_name = 0;
2037
2038 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2039 if (strcmp("format", ast_json_object_iter_key(iter)) == 0) {
2040 int prop_is_valid;
2041 has_format = 1;
2042 prop_is_valid = ast_ari_validate_string(
2044 if (!prop_is_valid) {
2045 ast_log(LOG_ERROR, "ARI StoredRecording field format failed validation\n");
2046 res = 0;
2047 }
2048 } else
2049 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
2050 int prop_is_valid;
2051 has_name = 1;
2052 prop_is_valid = ast_ari_validate_string(
2054 if (!prop_is_valid) {
2055 ast_log(LOG_ERROR, "ARI StoredRecording field name failed validation\n");
2056 res = 0;
2057 }
2058 } else
2059 {
2061 "ARI StoredRecording has undocumented field %s\n",
2063 res = 0;
2064 }
2065 }
2066
2067 if (!has_format) {
2068 ast_log(LOG_ERROR, "ARI StoredRecording missing required field format\n");
2069 res = 0;
2070 }
2071
2072 if (!has_name) {
2073 ast_log(LOG_ERROR, "ARI StoredRecording missing required field name\n");
2074 res = 0;
2075 }
2076
2077 return res;
2078}
2079
2081{
2083}
2084
2086{
2087 int res = 1;
2088 struct ast_json_iter *iter;
2089 int has_format = 0;
2090 int has_language = 0;
2091
2092 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2093 if (strcmp("format", ast_json_object_iter_key(iter)) == 0) {
2094 int prop_is_valid;
2095 has_format = 1;
2096 prop_is_valid = ast_ari_validate_string(
2098 if (!prop_is_valid) {
2099 ast_log(LOG_ERROR, "ARI FormatLangPair field format failed validation\n");
2100 res = 0;
2101 }
2102 } else
2103 if (strcmp("language", ast_json_object_iter_key(iter)) == 0) {
2104 int prop_is_valid;
2105 has_language = 1;
2106 prop_is_valid = ast_ari_validate_string(
2108 if (!prop_is_valid) {
2109 ast_log(LOG_ERROR, "ARI FormatLangPair field language failed validation\n");
2110 res = 0;
2111 }
2112 } else
2113 {
2115 "ARI FormatLangPair has undocumented field %s\n",
2117 res = 0;
2118 }
2119 }
2120
2121 if (!has_format) {
2122 ast_log(LOG_ERROR, "ARI FormatLangPair missing required field format\n");
2123 res = 0;
2124 }
2125
2126 if (!has_language) {
2127 ast_log(LOG_ERROR, "ARI FormatLangPair missing required field language\n");
2128 res = 0;
2129 }
2130
2131 return res;
2132}
2133
2135{
2137}
2138
2140{
2141 int res = 1;
2142 struct ast_json_iter *iter;
2143 int has_formats = 0;
2144 int has_id = 0;
2145
2146 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2147 if (strcmp("formats", ast_json_object_iter_key(iter)) == 0) {
2148 int prop_is_valid;
2149 has_formats = 1;
2150 prop_is_valid = ast_ari_validate_list(
2153 if (!prop_is_valid) {
2154 ast_log(LOG_ERROR, "ARI Sound field formats failed validation\n");
2155 res = 0;
2156 }
2157 } else
2158 if (strcmp("id", ast_json_object_iter_key(iter)) == 0) {
2159 int prop_is_valid;
2160 has_id = 1;
2161 prop_is_valid = ast_ari_validate_string(
2163 if (!prop_is_valid) {
2164 ast_log(LOG_ERROR, "ARI Sound field id failed validation\n");
2165 res = 0;
2166 }
2167 } else
2168 if (strcmp("text", ast_json_object_iter_key(iter)) == 0) {
2169 int prop_is_valid;
2170 prop_is_valid = ast_ari_validate_string(
2172 if (!prop_is_valid) {
2173 ast_log(LOG_ERROR, "ARI Sound field text failed validation\n");
2174 res = 0;
2175 }
2176 } else
2177 {
2179 "ARI Sound has undocumented field %s\n",
2181 res = 0;
2182 }
2183 }
2184
2185 if (!has_formats) {
2186 ast_log(LOG_ERROR, "ARI Sound missing required field formats\n");
2187 res = 0;
2188 }
2189
2190 if (!has_id) {
2191 ast_log(LOG_ERROR, "ARI Sound missing required field id\n");
2192 res = 0;
2193 }
2194
2195 return res;
2196}
2197
2199{
2201}
2202
2204{
2205 int res = 1;
2206 struct ast_json_iter *iter;
2207 int has_id = 0;
2208 int has_media_uri = 0;
2209 int has_state = 0;
2210 int has_target_uri = 0;
2211
2212 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2213 if (strcmp("id", ast_json_object_iter_key(iter)) == 0) {
2214 int prop_is_valid;
2215 has_id = 1;
2216 prop_is_valid = ast_ari_validate_string(
2218 if (!prop_is_valid) {
2219 ast_log(LOG_ERROR, "ARI Playback field id failed validation\n");
2220 res = 0;
2221 }
2222 } else
2223 if (strcmp("language", ast_json_object_iter_key(iter)) == 0) {
2224 int prop_is_valid;
2225 prop_is_valid = ast_ari_validate_string(
2227 if (!prop_is_valid) {
2228 ast_log(LOG_ERROR, "ARI Playback field language failed validation\n");
2229 res = 0;
2230 }
2231 } else
2232 if (strcmp("media_uri", ast_json_object_iter_key(iter)) == 0) {
2233 int prop_is_valid;
2234 has_media_uri = 1;
2235 prop_is_valid = ast_ari_validate_string(
2237 if (!prop_is_valid) {
2238 ast_log(LOG_ERROR, "ARI Playback field media_uri failed validation\n");
2239 res = 0;
2240 }
2241 } else
2242 if (strcmp("next_media_uri", ast_json_object_iter_key(iter)) == 0) {
2243 int prop_is_valid;
2244 prop_is_valid = ast_ari_validate_string(
2246 if (!prop_is_valid) {
2247 ast_log(LOG_ERROR, "ARI Playback field next_media_uri failed validation\n");
2248 res = 0;
2249 }
2250 } else
2251 if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
2252 int prop_is_valid;
2253 has_state = 1;
2254 prop_is_valid = ast_ari_validate_string(
2256 if (!prop_is_valid) {
2257 ast_log(LOG_ERROR, "ARI Playback field state failed validation\n");
2258 res = 0;
2259 }
2260 } else
2261 if (strcmp("target_uri", ast_json_object_iter_key(iter)) == 0) {
2262 int prop_is_valid;
2263 has_target_uri = 1;
2264 prop_is_valid = ast_ari_validate_string(
2266 if (!prop_is_valid) {
2267 ast_log(LOG_ERROR, "ARI Playback field target_uri failed validation\n");
2268 res = 0;
2269 }
2270 } else
2271 {
2273 "ARI Playback has undocumented field %s\n",
2275 res = 0;
2276 }
2277 }
2278
2279 if (!has_id) {
2280 ast_log(LOG_ERROR, "ARI Playback missing required field id\n");
2281 res = 0;
2282 }
2283
2284 if (!has_media_uri) {
2285 ast_log(LOG_ERROR, "ARI Playback missing required field media_uri\n");
2286 res = 0;
2287 }
2288
2289 if (!has_state) {
2290 ast_log(LOG_ERROR, "ARI Playback missing required field state\n");
2291 res = 0;
2292 }
2293
2294 if (!has_target_uri) {
2295 ast_log(LOG_ERROR, "ARI Playback missing required field target_uri\n");
2296 res = 0;
2297 }
2298
2299 return res;
2300}
2301
2303{
2305}
2306
2308{
2309 int res = 1;
2310 struct ast_json_iter *iter;
2311 int has_name = 0;
2312 int has_state = 0;
2313
2314 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2315 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
2316 int prop_is_valid;
2317 has_name = 1;
2318 prop_is_valid = ast_ari_validate_string(
2320 if (!prop_is_valid) {
2321 ast_log(LOG_ERROR, "ARI DeviceState field name failed validation\n");
2322 res = 0;
2323 }
2324 } else
2325 if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
2326 int prop_is_valid;
2327 has_state = 1;
2328 prop_is_valid = ast_ari_validate_string(
2330 if (!prop_is_valid) {
2331 ast_log(LOG_ERROR, "ARI DeviceState field state failed validation\n");
2332 res = 0;
2333 }
2334 } else
2335 {
2337 "ARI DeviceState has undocumented field %s\n",
2339 res = 0;
2340 }
2341 }
2342
2343 if (!has_name) {
2344 ast_log(LOG_ERROR, "ARI DeviceState missing required field name\n");
2345 res = 0;
2346 }
2347
2348 if (!has_state) {
2349 ast_log(LOG_ERROR, "ARI DeviceState missing required field state\n");
2350 res = 0;
2351 }
2352
2353 return res;
2354}
2355
2357{
2359}
2360
2362{
2363 int res = 1;
2364 struct ast_json_iter *iter;
2365 int has_name = 0;
2366 int has_new_messages = 0;
2367 int has_old_messages = 0;
2368
2369 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2370 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
2371 int prop_is_valid;
2372 has_name = 1;
2373 prop_is_valid = ast_ari_validate_string(
2375 if (!prop_is_valid) {
2376 ast_log(LOG_ERROR, "ARI Mailbox field name failed validation\n");
2377 res = 0;
2378 }
2379 } else
2380 if (strcmp("new_messages", ast_json_object_iter_key(iter)) == 0) {
2381 int prop_is_valid;
2382 has_new_messages = 1;
2383 prop_is_valid = ast_ari_validate_int(
2385 if (!prop_is_valid) {
2386 ast_log(LOG_ERROR, "ARI Mailbox field new_messages failed validation\n");
2387 res = 0;
2388 }
2389 } else
2390 if (strcmp("old_messages", ast_json_object_iter_key(iter)) == 0) {
2391 int prop_is_valid;
2392 has_old_messages = 1;
2393 prop_is_valid = ast_ari_validate_int(
2395 if (!prop_is_valid) {
2396 ast_log(LOG_ERROR, "ARI Mailbox field old_messages failed validation\n");
2397 res = 0;
2398 }
2399 } else
2400 {
2402 "ARI Mailbox has undocumented field %s\n",
2404 res = 0;
2405 }
2406 }
2407
2408 if (!has_name) {
2409 ast_log(LOG_ERROR, "ARI Mailbox missing required field name\n");
2410 res = 0;
2411 }
2412
2413 if (!has_new_messages) {
2414 ast_log(LOG_ERROR, "ARI Mailbox missing required field new_messages\n");
2415 res = 0;
2416 }
2417
2418 if (!has_old_messages) {
2419 ast_log(LOG_ERROR, "ARI Mailbox missing required field old_messages\n");
2420 res = 0;
2421 }
2422
2423 return res;
2424}
2425
2427{
2429}
2430
2432{
2433 int res = 1;
2434 struct ast_json_iter *iter;
2435 int has_parameter_name = 0;
2436 int has_parameter_value = 0;
2437
2438 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2439 if (strcmp("parameter_name", ast_json_object_iter_key(iter)) == 0) {
2440 int prop_is_valid;
2441 has_parameter_name = 1;
2442 prop_is_valid = ast_ari_validate_string(
2444 if (!prop_is_valid) {
2445 ast_log(LOG_ERROR, "ARI AdditionalParam field parameter_name failed validation\n");
2446 res = 0;
2447 }
2448 } else
2449 if (strcmp("parameter_value", ast_json_object_iter_key(iter)) == 0) {
2450 int prop_is_valid;
2451 has_parameter_value = 1;
2452 prop_is_valid = ast_ari_validate_string(
2454 if (!prop_is_valid) {
2455 ast_log(LOG_ERROR, "ARI AdditionalParam field parameter_value failed validation\n");
2456 res = 0;
2457 }
2458 } else
2459 {
2461 "ARI AdditionalParam has undocumented field %s\n",
2463 res = 0;
2464 }
2465 }
2466
2467 if (!has_parameter_name) {
2468 ast_log(LOG_ERROR, "ARI AdditionalParam missing required field parameter_name\n");
2469 res = 0;
2470 }
2471
2472 if (!has_parameter_value) {
2473 ast_log(LOG_ERROR, "ARI AdditionalParam missing required field parameter_value\n");
2474 res = 0;
2475 }
2476
2477 return res;
2478}
2479
2481{
2483}
2484
2486{
2487 int res = 1;
2488 struct ast_json_iter *iter;
2489 int has_type = 0;
2490 int has_application = 0;
2491 int has_timestamp = 0;
2492 int has_args = 0;
2493 int has_channel = 0;
2494 int has_destination = 0;
2495
2496 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2497 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2498 int prop_is_valid;
2499 prop_is_valid = ast_ari_validate_string(
2501 if (!prop_is_valid) {
2502 ast_log(LOG_ERROR, "ARI ApplicationMoveFailed field asterisk_id failed validation\n");
2503 res = 0;
2504 }
2505 } else
2506 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2507 int prop_is_valid;
2508 has_type = 1;
2509 prop_is_valid = ast_ari_validate_string(
2511 if (!prop_is_valid) {
2512 ast_log(LOG_ERROR, "ARI ApplicationMoveFailed field type failed validation\n");
2513 res = 0;
2514 }
2515 } else
2516 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2517 int prop_is_valid;
2518 has_application = 1;
2519 prop_is_valid = ast_ari_validate_string(
2521 if (!prop_is_valid) {
2522 ast_log(LOG_ERROR, "ARI ApplicationMoveFailed field application failed validation\n");
2523 res = 0;
2524 }
2525 } else
2526 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2527 int prop_is_valid;
2528 has_timestamp = 1;
2529 prop_is_valid = ast_ari_validate_date(
2531 if (!prop_is_valid) {
2532 ast_log(LOG_ERROR, "ARI ApplicationMoveFailed field timestamp failed validation\n");
2533 res = 0;
2534 }
2535 } else
2536 if (strcmp("args", ast_json_object_iter_key(iter)) == 0) {
2537 int prop_is_valid;
2538 has_args = 1;
2539 prop_is_valid = ast_ari_validate_list(
2542 if (!prop_is_valid) {
2543 ast_log(LOG_ERROR, "ARI ApplicationMoveFailed field args failed validation\n");
2544 res = 0;
2545 }
2546 } else
2547 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
2548 int prop_is_valid;
2549 has_channel = 1;
2550 prop_is_valid = ast_ari_validate_channel(
2552 if (!prop_is_valid) {
2553 ast_log(LOG_ERROR, "ARI ApplicationMoveFailed field channel failed validation\n");
2554 res = 0;
2555 }
2556 } else
2557 if (strcmp("destination", ast_json_object_iter_key(iter)) == 0) {
2558 int prop_is_valid;
2559 has_destination = 1;
2560 prop_is_valid = ast_ari_validate_string(
2562 if (!prop_is_valid) {
2563 ast_log(LOG_ERROR, "ARI ApplicationMoveFailed field destination failed validation\n");
2564 res = 0;
2565 }
2566 } else
2567 {
2569 "ARI ApplicationMoveFailed has undocumented field %s\n",
2571 res = 0;
2572 }
2573 }
2574
2575 if (!has_type) {
2576 ast_log(LOG_ERROR, "ARI ApplicationMoveFailed missing required field type\n");
2577 res = 0;
2578 }
2579
2580 if (!has_application) {
2581 ast_log(LOG_ERROR, "ARI ApplicationMoveFailed missing required field application\n");
2582 res = 0;
2583 }
2584
2585 if (!has_timestamp) {
2586 ast_log(LOG_ERROR, "ARI ApplicationMoveFailed missing required field timestamp\n");
2587 res = 0;
2588 }
2589
2590 if (!has_args) {
2591 ast_log(LOG_ERROR, "ARI ApplicationMoveFailed missing required field args\n");
2592 res = 0;
2593 }
2594
2595 if (!has_channel) {
2596 ast_log(LOG_ERROR, "ARI ApplicationMoveFailed missing required field channel\n");
2597 res = 0;
2598 }
2599
2600 if (!has_destination) {
2601 ast_log(LOG_ERROR, "ARI ApplicationMoveFailed missing required field destination\n");
2602 res = 0;
2603 }
2604
2605 return res;
2606}
2607
2609{
2611}
2612
2614{
2615 int res = 1;
2616 struct ast_json_iter *iter;
2617 int has_type = 0;
2618 int has_application = 0;
2619 int has_timestamp = 0;
2620
2621 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2622 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2623 int prop_is_valid;
2624 prop_is_valid = ast_ari_validate_string(
2626 if (!prop_is_valid) {
2627 ast_log(LOG_ERROR, "ARI ApplicationRegistered field asterisk_id failed validation\n");
2628 res = 0;
2629 }
2630 } else
2631 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2632 int prop_is_valid;
2633 has_type = 1;
2634 prop_is_valid = ast_ari_validate_string(
2636 if (!prop_is_valid) {
2637 ast_log(LOG_ERROR, "ARI ApplicationRegistered field type failed validation\n");
2638 res = 0;
2639 }
2640 } else
2641 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2642 int prop_is_valid;
2643 has_application = 1;
2644 prop_is_valid = ast_ari_validate_string(
2646 if (!prop_is_valid) {
2647 ast_log(LOG_ERROR, "ARI ApplicationRegistered field application failed validation\n");
2648 res = 0;
2649 }
2650 } else
2651 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2652 int prop_is_valid;
2653 has_timestamp = 1;
2654 prop_is_valid = ast_ari_validate_date(
2656 if (!prop_is_valid) {
2657 ast_log(LOG_ERROR, "ARI ApplicationRegistered field timestamp failed validation\n");
2658 res = 0;
2659 }
2660 } else
2661 {
2663 "ARI ApplicationRegistered has undocumented field %s\n",
2665 res = 0;
2666 }
2667 }
2668
2669 if (!has_type) {
2670 ast_log(LOG_ERROR, "ARI ApplicationRegistered missing required field type\n");
2671 res = 0;
2672 }
2673
2674 if (!has_application) {
2675 ast_log(LOG_ERROR, "ARI ApplicationRegistered missing required field application\n");
2676 res = 0;
2677 }
2678
2679 if (!has_timestamp) {
2680 ast_log(LOG_ERROR, "ARI ApplicationRegistered missing required field timestamp\n");
2681 res = 0;
2682 }
2683
2684 return res;
2685}
2686
2688{
2690}
2691
2693{
2694 int res = 1;
2695 struct ast_json_iter *iter;
2696 int has_type = 0;
2697 int has_application = 0;
2698 int has_timestamp = 0;
2699
2700 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2701 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2702 int prop_is_valid;
2703 prop_is_valid = ast_ari_validate_string(
2705 if (!prop_is_valid) {
2706 ast_log(LOG_ERROR, "ARI ApplicationReplaced field asterisk_id failed validation\n");
2707 res = 0;
2708 }
2709 } else
2710 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2711 int prop_is_valid;
2712 has_type = 1;
2713 prop_is_valid = ast_ari_validate_string(
2715 if (!prop_is_valid) {
2716 ast_log(LOG_ERROR, "ARI ApplicationReplaced field type failed validation\n");
2717 res = 0;
2718 }
2719 } else
2720 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2721 int prop_is_valid;
2722 has_application = 1;
2723 prop_is_valid = ast_ari_validate_string(
2725 if (!prop_is_valid) {
2726 ast_log(LOG_ERROR, "ARI ApplicationReplaced field application failed validation\n");
2727 res = 0;
2728 }
2729 } else
2730 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2731 int prop_is_valid;
2732 has_timestamp = 1;
2733 prop_is_valid = ast_ari_validate_date(
2735 if (!prop_is_valid) {
2736 ast_log(LOG_ERROR, "ARI ApplicationReplaced field timestamp failed validation\n");
2737 res = 0;
2738 }
2739 } else
2740 {
2742 "ARI ApplicationReplaced has undocumented field %s\n",
2744 res = 0;
2745 }
2746 }
2747
2748 if (!has_type) {
2749 ast_log(LOG_ERROR, "ARI ApplicationReplaced missing required field type\n");
2750 res = 0;
2751 }
2752
2753 if (!has_application) {
2754 ast_log(LOG_ERROR, "ARI ApplicationReplaced missing required field application\n");
2755 res = 0;
2756 }
2757
2758 if (!has_timestamp) {
2759 ast_log(LOG_ERROR, "ARI ApplicationReplaced missing required field timestamp\n");
2760 res = 0;
2761 }
2762
2763 return res;
2764}
2765
2767{
2769}
2770
2772{
2773 int res = 1;
2774 struct ast_json_iter *iter;
2775 int has_type = 0;
2776 int has_application = 0;
2777 int has_timestamp = 0;
2778
2779 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2780 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2781 int prop_is_valid;
2782 prop_is_valid = ast_ari_validate_string(
2784 if (!prop_is_valid) {
2785 ast_log(LOG_ERROR, "ARI ApplicationUnregistered field asterisk_id failed validation\n");
2786 res = 0;
2787 }
2788 } else
2789 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2790 int prop_is_valid;
2791 has_type = 1;
2792 prop_is_valid = ast_ari_validate_string(
2794 if (!prop_is_valid) {
2795 ast_log(LOG_ERROR, "ARI ApplicationUnregistered field type failed validation\n");
2796 res = 0;
2797 }
2798 } else
2799 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2800 int prop_is_valid;
2801 has_application = 1;
2802 prop_is_valid = ast_ari_validate_string(
2804 if (!prop_is_valid) {
2805 ast_log(LOG_ERROR, "ARI ApplicationUnregistered field application failed validation\n");
2806 res = 0;
2807 }
2808 } else
2809 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2810 int prop_is_valid;
2811 has_timestamp = 1;
2812 prop_is_valid = ast_ari_validate_date(
2814 if (!prop_is_valid) {
2815 ast_log(LOG_ERROR, "ARI ApplicationUnregistered field timestamp failed validation\n");
2816 res = 0;
2817 }
2818 } else
2819 {
2821 "ARI ApplicationUnregistered has undocumented field %s\n",
2823 res = 0;
2824 }
2825 }
2826
2827 if (!has_type) {
2828 ast_log(LOG_ERROR, "ARI ApplicationUnregistered missing required field type\n");
2829 res = 0;
2830 }
2831
2832 if (!has_application) {
2833 ast_log(LOG_ERROR, "ARI ApplicationUnregistered missing required field application\n");
2834 res = 0;
2835 }
2836
2837 if (!has_timestamp) {
2838 ast_log(LOG_ERROR, "ARI ApplicationUnregistered missing required field timestamp\n");
2839 res = 0;
2840 }
2841
2842 return res;
2843}
2844
2846{
2848}
2849
2851{
2852 int res = 1;
2853 struct ast_json_iter *iter;
2854 int has_type = 0;
2855 int has_application = 0;
2856 int has_timestamp = 0;
2857 int has_destination_type = 0;
2858 int has_is_external = 0;
2859 int has_result = 0;
2860 int has_transferer_first_leg = 0;
2861 int has_transferer_second_leg = 0;
2862
2863 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2864 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2865 int prop_is_valid;
2866 prop_is_valid = ast_ari_validate_string(
2868 if (!prop_is_valid) {
2869 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field asterisk_id failed validation\n");
2870 res = 0;
2871 }
2872 } else
2873 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2874 int prop_is_valid;
2875 has_type = 1;
2876 prop_is_valid = ast_ari_validate_string(
2878 if (!prop_is_valid) {
2879 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field type failed validation\n");
2880 res = 0;
2881 }
2882 } else
2883 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2884 int prop_is_valid;
2885 has_application = 1;
2886 prop_is_valid = ast_ari_validate_string(
2888 if (!prop_is_valid) {
2889 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field application failed validation\n");
2890 res = 0;
2891 }
2892 } else
2893 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2894 int prop_is_valid;
2895 has_timestamp = 1;
2896 prop_is_valid = ast_ari_validate_date(
2898 if (!prop_is_valid) {
2899 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field timestamp failed validation\n");
2900 res = 0;
2901 }
2902 } else
2903 if (strcmp("destination_application", ast_json_object_iter_key(iter)) == 0) {
2904 int prop_is_valid;
2905 prop_is_valid = ast_ari_validate_string(
2907 if (!prop_is_valid) {
2908 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_application failed validation\n");
2909 res = 0;
2910 }
2911 } else
2912 if (strcmp("destination_bridge", ast_json_object_iter_key(iter)) == 0) {
2913 int prop_is_valid;
2914 prop_is_valid = ast_ari_validate_string(
2916 if (!prop_is_valid) {
2917 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_bridge failed validation\n");
2918 res = 0;
2919 }
2920 } else
2921 if (strcmp("destination_link_first_leg", ast_json_object_iter_key(iter)) == 0) {
2922 int prop_is_valid;
2923 prop_is_valid = ast_ari_validate_channel(
2925 if (!prop_is_valid) {
2926 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_link_first_leg failed validation\n");
2927 res = 0;
2928 }
2929 } else
2930 if (strcmp("destination_link_second_leg", ast_json_object_iter_key(iter)) == 0) {
2931 int prop_is_valid;
2932 prop_is_valid = ast_ari_validate_channel(
2934 if (!prop_is_valid) {
2935 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_link_second_leg failed validation\n");
2936 res = 0;
2937 }
2938 } else
2939 if (strcmp("destination_threeway_bridge", ast_json_object_iter_key(iter)) == 0) {
2940 int prop_is_valid;
2941 prop_is_valid = ast_ari_validate_bridge(
2943 if (!prop_is_valid) {
2944 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_threeway_bridge failed validation\n");
2945 res = 0;
2946 }
2947 } else
2948 if (strcmp("destination_threeway_channel", ast_json_object_iter_key(iter)) == 0) {
2949 int prop_is_valid;
2950 prop_is_valid = ast_ari_validate_channel(
2952 if (!prop_is_valid) {
2953 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_threeway_channel failed validation\n");
2954 res = 0;
2955 }
2956 } else
2957 if (strcmp("destination_type", ast_json_object_iter_key(iter)) == 0) {
2958 int prop_is_valid;
2959 has_destination_type = 1;
2960 prop_is_valid = ast_ari_validate_string(
2962 if (!prop_is_valid) {
2963 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_type failed validation\n");
2964 res = 0;
2965 }
2966 } else
2967 if (strcmp("is_external", ast_json_object_iter_key(iter)) == 0) {
2968 int prop_is_valid;
2969 has_is_external = 1;
2970 prop_is_valid = ast_ari_validate_boolean(
2972 if (!prop_is_valid) {
2973 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field is_external failed validation\n");
2974 res = 0;
2975 }
2976 } else
2977 if (strcmp("replace_channel", ast_json_object_iter_key(iter)) == 0) {
2978 int prop_is_valid;
2979 prop_is_valid = ast_ari_validate_channel(
2981 if (!prop_is_valid) {
2982 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field replace_channel failed validation\n");
2983 res = 0;
2984 }
2985 } else
2986 if (strcmp("result", ast_json_object_iter_key(iter)) == 0) {
2987 int prop_is_valid;
2988 has_result = 1;
2989 prop_is_valid = ast_ari_validate_string(
2991 if (!prop_is_valid) {
2992 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field result failed validation\n");
2993 res = 0;
2994 }
2995 } else
2996 if (strcmp("transfer_target", ast_json_object_iter_key(iter)) == 0) {
2997 int prop_is_valid;
2998 prop_is_valid = ast_ari_validate_channel(
3000 if (!prop_is_valid) {
3001 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transfer_target failed validation\n");
3002 res = 0;
3003 }
3004 } else
3005 if (strcmp("transferee", ast_json_object_iter_key(iter)) == 0) {
3006 int prop_is_valid;
3007 prop_is_valid = ast_ari_validate_channel(
3009 if (!prop_is_valid) {
3010 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferee failed validation\n");
3011 res = 0;
3012 }
3013 } else
3014 if (strcmp("transferer_first_leg", ast_json_object_iter_key(iter)) == 0) {
3015 int prop_is_valid;
3016 has_transferer_first_leg = 1;
3017 prop_is_valid = ast_ari_validate_channel(
3019 if (!prop_is_valid) {
3020 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_first_leg failed validation\n");
3021 res = 0;
3022 }
3023 } else
3024 if (strcmp("transferer_first_leg_bridge", ast_json_object_iter_key(iter)) == 0) {
3025 int prop_is_valid;
3026 prop_is_valid = ast_ari_validate_bridge(
3028 if (!prop_is_valid) {
3029 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_first_leg_bridge failed validation\n");
3030 res = 0;
3031 }
3032 } else
3033 if (strcmp("transferer_second_leg", ast_json_object_iter_key(iter)) == 0) {
3034 int prop_is_valid;
3035 has_transferer_second_leg = 1;
3036 prop_is_valid = ast_ari_validate_channel(
3038 if (!prop_is_valid) {
3039 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_second_leg failed validation\n");
3040 res = 0;
3041 }
3042 } else
3043 if (strcmp("transferer_second_leg_bridge", ast_json_object_iter_key(iter)) == 0) {
3044 int prop_is_valid;
3045 prop_is_valid = ast_ari_validate_bridge(
3047 if (!prop_is_valid) {
3048 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_second_leg_bridge failed validation\n");
3049 res = 0;
3050 }
3051 } else
3052 {
3054 "ARI BridgeAttendedTransfer has undocumented field %s\n",
3056 res = 0;
3057 }
3058 }
3059
3060 if (!has_type) {
3061 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field type\n");
3062 res = 0;
3063 }
3064
3065 if (!has_application) {
3066 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field application\n");
3067 res = 0;
3068 }
3069
3070 if (!has_timestamp) {
3071 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field timestamp\n");
3072 res = 0;
3073 }
3074
3075 if (!has_destination_type) {
3076 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field destination_type\n");
3077 res = 0;
3078 }
3079
3080 if (!has_is_external) {
3081 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field is_external\n");
3082 res = 0;
3083 }
3084
3085 if (!has_result) {
3086 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field result\n");
3087 res = 0;
3088 }
3089
3090 if (!has_transferer_first_leg) {
3091 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field transferer_first_leg\n");
3092 res = 0;
3093 }
3094
3095 if (!has_transferer_second_leg) {
3096 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field transferer_second_leg\n");
3097 res = 0;
3098 }
3099
3100 return res;
3101}
3102
3104{
3106}
3107
3109{
3110 int res = 1;
3111 struct ast_json_iter *iter;
3112 int has_type = 0;
3113 int has_application = 0;
3114 int has_timestamp = 0;
3115 int has_channel = 0;
3116 int has_context = 0;
3117 int has_exten = 0;
3118 int has_is_external = 0;
3119 int has_result = 0;
3120
3121 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3122 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3123 int prop_is_valid;
3124 prop_is_valid = ast_ari_validate_string(
3126 if (!prop_is_valid) {
3127 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field asterisk_id failed validation\n");
3128 res = 0;
3129 }
3130 } else
3131 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3132 int prop_is_valid;
3133 has_type = 1;
3134 prop_is_valid = ast_ari_validate_string(
3136 if (!prop_is_valid) {
3137 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field type failed validation\n");
3138 res = 0;
3139 }
3140 } else
3141 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3142 int prop_is_valid;
3143 has_application = 1;
3144 prop_is_valid = ast_ari_validate_string(
3146 if (!prop_is_valid) {
3147 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field application failed validation\n");
3148 res = 0;
3149 }
3150 } else
3151 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3152 int prop_is_valid;
3153 has_timestamp = 1;
3154 prop_is_valid = ast_ari_validate_date(
3156 if (!prop_is_valid) {
3157 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field timestamp failed validation\n");
3158 res = 0;
3159 }
3160 } else
3161 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3162 int prop_is_valid;
3163 prop_is_valid = ast_ari_validate_bridge(
3165 if (!prop_is_valid) {
3166 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field bridge failed validation\n");
3167 res = 0;
3168 }
3169 } else
3170 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3171 int prop_is_valid;
3172 has_channel = 1;
3173 prop_is_valid = ast_ari_validate_channel(
3175 if (!prop_is_valid) {
3176 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field channel failed validation\n");
3177 res = 0;
3178 }
3179 } else
3180 if (strcmp("context", ast_json_object_iter_key(iter)) == 0) {
3181 int prop_is_valid;
3182 has_context = 1;
3183 prop_is_valid = ast_ari_validate_string(
3185 if (!prop_is_valid) {
3186 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field context failed validation\n");
3187 res = 0;
3188 }
3189 } else
3190 if (strcmp("exten", ast_json_object_iter_key(iter)) == 0) {
3191 int prop_is_valid;
3192 has_exten = 1;
3193 prop_is_valid = ast_ari_validate_string(
3195 if (!prop_is_valid) {
3196 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field exten failed validation\n");
3197 res = 0;
3198 }
3199 } else
3200 if (strcmp("is_external", ast_json_object_iter_key(iter)) == 0) {
3201 int prop_is_valid;
3202 has_is_external = 1;
3203 prop_is_valid = ast_ari_validate_boolean(
3205 if (!prop_is_valid) {
3206 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field is_external failed validation\n");
3207 res = 0;
3208 }
3209 } else
3210 if (strcmp("replace_channel", ast_json_object_iter_key(iter)) == 0) {
3211 int prop_is_valid;
3212 prop_is_valid = ast_ari_validate_channel(
3214 if (!prop_is_valid) {
3215 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field replace_channel failed validation\n");
3216 res = 0;
3217 }
3218 } else
3219 if (strcmp("result", ast_json_object_iter_key(iter)) == 0) {
3220 int prop_is_valid;
3221 has_result = 1;
3222 prop_is_valid = ast_ari_validate_string(
3224 if (!prop_is_valid) {
3225 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field result failed validation\n");
3226 res = 0;
3227 }
3228 } else
3229 if (strcmp("transferee", ast_json_object_iter_key(iter)) == 0) {
3230 int prop_is_valid;
3231 prop_is_valid = ast_ari_validate_channel(
3233 if (!prop_is_valid) {
3234 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field transferee failed validation\n");
3235 res = 0;
3236 }
3237 } else
3238 {
3240 "ARI BridgeBlindTransfer has undocumented field %s\n",
3242 res = 0;
3243 }
3244 }
3245
3246 if (!has_type) {
3247 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field type\n");
3248 res = 0;
3249 }
3250
3251 if (!has_application) {
3252 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field application\n");
3253 res = 0;
3254 }
3255
3256 if (!has_timestamp) {
3257 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field timestamp\n");
3258 res = 0;
3259 }
3260
3261 if (!has_channel) {
3262 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field channel\n");
3263 res = 0;
3264 }
3265
3266 if (!has_context) {
3267 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field context\n");
3268 res = 0;
3269 }
3270
3271 if (!has_exten) {
3272 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field exten\n");
3273 res = 0;
3274 }
3275
3276 if (!has_is_external) {
3277 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field is_external\n");
3278 res = 0;
3279 }
3280
3281 if (!has_result) {
3282 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field result\n");
3283 res = 0;
3284 }
3285
3286 return res;
3287}
3288
3290{
3292}
3293
3295{
3296 int res = 1;
3297 struct ast_json_iter *iter;
3298 int has_type = 0;
3299 int has_application = 0;
3300 int has_timestamp = 0;
3301 int has_bridge = 0;
3302
3303 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3304 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3305 int prop_is_valid;
3306 prop_is_valid = ast_ari_validate_string(
3308 if (!prop_is_valid) {
3309 ast_log(LOG_ERROR, "ARI BridgeCreated field asterisk_id failed validation\n");
3310 res = 0;
3311 }
3312 } else
3313 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3314 int prop_is_valid;
3315 has_type = 1;
3316 prop_is_valid = ast_ari_validate_string(
3318 if (!prop_is_valid) {
3319 ast_log(LOG_ERROR, "ARI BridgeCreated field type failed validation\n");
3320 res = 0;
3321 }
3322 } else
3323 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3324 int prop_is_valid;
3325 has_application = 1;
3326 prop_is_valid = ast_ari_validate_string(
3328 if (!prop_is_valid) {
3329 ast_log(LOG_ERROR, "ARI BridgeCreated field application failed validation\n");
3330 res = 0;
3331 }
3332 } else
3333 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3334 int prop_is_valid;
3335 has_timestamp = 1;
3336 prop_is_valid = ast_ari_validate_date(
3338 if (!prop_is_valid) {
3339 ast_log(LOG_ERROR, "ARI BridgeCreated field timestamp failed validation\n");
3340 res = 0;
3341 }
3342 } else
3343 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3344 int prop_is_valid;
3345 has_bridge = 1;
3346 prop_is_valid = ast_ari_validate_bridge(
3348 if (!prop_is_valid) {
3349 ast_log(LOG_ERROR, "ARI BridgeCreated field bridge failed validation\n");
3350 res = 0;
3351 }
3352 } else
3353 {
3355 "ARI BridgeCreated has undocumented field %s\n",
3357 res = 0;
3358 }
3359 }
3360
3361 if (!has_type) {
3362 ast_log(LOG_ERROR, "ARI BridgeCreated missing required field type\n");
3363 res = 0;
3364 }
3365
3366 if (!has_application) {
3367 ast_log(LOG_ERROR, "ARI BridgeCreated missing required field application\n");
3368 res = 0;
3369 }
3370
3371 if (!has_timestamp) {
3372 ast_log(LOG_ERROR, "ARI BridgeCreated missing required field timestamp\n");
3373 res = 0;
3374 }
3375
3376 if (!has_bridge) {
3377 ast_log(LOG_ERROR, "ARI BridgeCreated missing required field bridge\n");
3378 res = 0;
3379 }
3380
3381 return res;
3382}
3383
3385{
3387}
3388
3390{
3391 int res = 1;
3392 struct ast_json_iter *iter;
3393 int has_type = 0;
3394 int has_application = 0;
3395 int has_timestamp = 0;
3396 int has_bridge = 0;
3397
3398 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3399 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3400 int prop_is_valid;
3401 prop_is_valid = ast_ari_validate_string(
3403 if (!prop_is_valid) {
3404 ast_log(LOG_ERROR, "ARI BridgeDestroyed field asterisk_id failed validation\n");
3405 res = 0;
3406 }
3407 } else
3408 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3409 int prop_is_valid;
3410 has_type = 1;
3411 prop_is_valid = ast_ari_validate_string(
3413 if (!prop_is_valid) {
3414 ast_log(LOG_ERROR, "ARI BridgeDestroyed field type failed validation\n");
3415 res = 0;
3416 }
3417 } else
3418 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3419 int prop_is_valid;
3420 has_application = 1;
3421 prop_is_valid = ast_ari_validate_string(
3423 if (!prop_is_valid) {
3424 ast_log(LOG_ERROR, "ARI BridgeDestroyed field application failed validation\n");
3425 res = 0;
3426 }
3427 } else
3428 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3429 int prop_is_valid;
3430 has_timestamp = 1;
3431 prop_is_valid = ast_ari_validate_date(
3433 if (!prop_is_valid) {
3434 ast_log(LOG_ERROR, "ARI BridgeDestroyed field timestamp failed validation\n");
3435 res = 0;
3436 }
3437 } else
3438 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3439 int prop_is_valid;
3440 has_bridge = 1;
3441 prop_is_valid = ast_ari_validate_bridge(
3443 if (!prop_is_valid) {
3444 ast_log(LOG_ERROR, "ARI BridgeDestroyed field bridge failed validation\n");
3445 res = 0;
3446 }
3447 } else
3448 {
3450 "ARI BridgeDestroyed has undocumented field %s\n",
3452 res = 0;
3453 }
3454 }
3455
3456 if (!has_type) {
3457 ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field type\n");
3458 res = 0;
3459 }
3460
3461 if (!has_application) {
3462 ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field application\n");
3463 res = 0;
3464 }
3465
3466 if (!has_timestamp) {
3467 ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field timestamp\n");
3468 res = 0;
3469 }
3470
3471 if (!has_bridge) {
3472 ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field bridge\n");
3473 res = 0;
3474 }
3475
3476 return res;
3477}
3478
3480{
3482}
3483
3485{
3486 int res = 1;
3487 struct ast_json_iter *iter;
3488 int has_type = 0;
3489 int has_application = 0;
3490 int has_timestamp = 0;
3491 int has_bridge = 0;
3492 int has_bridge_from = 0;
3493
3494 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3495 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3496 int prop_is_valid;
3497 prop_is_valid = ast_ari_validate_string(
3499 if (!prop_is_valid) {
3500 ast_log(LOG_ERROR, "ARI BridgeMerged field asterisk_id failed validation\n");
3501 res = 0;
3502 }
3503 } else
3504 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3505 int prop_is_valid;
3506 has_type = 1;
3507 prop_is_valid = ast_ari_validate_string(
3509 if (!prop_is_valid) {
3510 ast_log(LOG_ERROR, "ARI BridgeMerged field type failed validation\n");
3511 res = 0;
3512 }
3513 } else
3514 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3515 int prop_is_valid;
3516 has_application = 1;
3517 prop_is_valid = ast_ari_validate_string(
3519 if (!prop_is_valid) {
3520 ast_log(LOG_ERROR, "ARI BridgeMerged field application failed validation\n");
3521 res = 0;
3522 }
3523 } else
3524 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3525 int prop_is_valid;
3526 has_timestamp = 1;
3527 prop_is_valid = ast_ari_validate_date(
3529 if (!prop_is_valid) {
3530 ast_log(LOG_ERROR, "ARI BridgeMerged field timestamp failed validation\n");
3531 res = 0;
3532 }
3533 } else
3534 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3535 int prop_is_valid;
3536 has_bridge = 1;
3537 prop_is_valid = ast_ari_validate_bridge(
3539 if (!prop_is_valid) {
3540 ast_log(LOG_ERROR, "ARI BridgeMerged field bridge failed validation\n");
3541 res = 0;
3542 }
3543 } else
3544 if (strcmp("bridge_from", ast_json_object_iter_key(iter)) == 0) {
3545 int prop_is_valid;
3546 has_bridge_from = 1;
3547 prop_is_valid = ast_ari_validate_bridge(
3549 if (!prop_is_valid) {
3550 ast_log(LOG_ERROR, "ARI BridgeMerged field bridge_from failed validation\n");
3551 res = 0;
3552 }
3553 } else
3554 {
3556 "ARI BridgeMerged has undocumented field %s\n",
3558 res = 0;
3559 }
3560 }
3561
3562 if (!has_type) {
3563 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field type\n");
3564 res = 0;
3565 }
3566
3567 if (!has_application) {
3568 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field application\n");
3569 res = 0;
3570 }
3571
3572 if (!has_timestamp) {
3573 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field timestamp\n");
3574 res = 0;
3575 }
3576
3577 if (!has_bridge) {
3578 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field bridge\n");
3579 res = 0;
3580 }
3581
3582 if (!has_bridge_from) {
3583 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field bridge_from\n");
3584 res = 0;
3585 }
3586
3587 return res;
3588}
3589
3591{
3593}
3594
3596{
3597 int res = 1;
3598 struct ast_json_iter *iter;
3599 int has_type = 0;
3600 int has_application = 0;
3601 int has_timestamp = 0;
3602 int has_bridge = 0;
3603
3604 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3605 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3606 int prop_is_valid;
3607 prop_is_valid = ast_ari_validate_string(
3609 if (!prop_is_valid) {
3610 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field asterisk_id failed validation\n");
3611 res = 0;
3612 }
3613 } else
3614 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3615 int prop_is_valid;
3616 has_type = 1;
3617 prop_is_valid = ast_ari_validate_string(
3619 if (!prop_is_valid) {
3620 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field type failed validation\n");
3621 res = 0;
3622 }
3623 } else
3624 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3625 int prop_is_valid;
3626 has_application = 1;
3627 prop_is_valid = ast_ari_validate_string(
3629 if (!prop_is_valid) {
3630 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field application failed validation\n");
3631 res = 0;
3632 }
3633 } else
3634 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3635 int prop_is_valid;
3636 has_timestamp = 1;
3637 prop_is_valid = ast_ari_validate_date(
3639 if (!prop_is_valid) {
3640 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field timestamp failed validation\n");
3641 res = 0;
3642 }
3643 } else
3644 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3645 int prop_is_valid;
3646 has_bridge = 1;
3647 prop_is_valid = ast_ari_validate_bridge(
3649 if (!prop_is_valid) {
3650 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field bridge failed validation\n");
3651 res = 0;
3652 }
3653 } else
3654 if (strcmp("old_video_source_id", ast_json_object_iter_key(iter)) == 0) {
3655 int prop_is_valid;
3656 prop_is_valid = ast_ari_validate_string(
3658 if (!prop_is_valid) {
3659 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field old_video_source_id failed validation\n");
3660 res = 0;
3661 }
3662 } else
3663 {
3665 "ARI BridgeVideoSourceChanged has undocumented field %s\n",
3667 res = 0;
3668 }
3669 }
3670
3671 if (!has_type) {
3672 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field type\n");
3673 res = 0;
3674 }
3675
3676 if (!has_application) {
3677 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field application\n");
3678 res = 0;
3679 }
3680
3681 if (!has_timestamp) {
3682 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field timestamp\n");
3683 res = 0;
3684 }
3685
3686 if (!has_bridge) {
3687 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field bridge\n");
3688 res = 0;
3689 }
3690
3691 return res;
3692}
3693
3695{
3697}
3698
3700{
3701 int res = 1;
3702 struct ast_json_iter *iter;
3703 int has_type = 0;
3704 int has_application = 0;
3705 int has_timestamp = 0;
3706 int has_caller_presentation = 0;
3707 int has_caller_presentation_txt = 0;
3708 int has_channel = 0;
3709
3710 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3711 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3712 int prop_is_valid;
3713 prop_is_valid = ast_ari_validate_string(
3715 if (!prop_is_valid) {
3716 ast_log(LOG_ERROR, "ARI ChannelCallerId field asterisk_id failed validation\n");
3717 res = 0;
3718 }
3719 } else
3720 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3721 int prop_is_valid;
3722 has_type = 1;
3723 prop_is_valid = ast_ari_validate_string(
3725 if (!prop_is_valid) {
3726 ast_log(LOG_ERROR, "ARI ChannelCallerId field type failed validation\n");
3727 res = 0;
3728 }
3729 } else
3730 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3731 int prop_is_valid;
3732 has_application = 1;
3733 prop_is_valid = ast_ari_validate_string(
3735 if (!prop_is_valid) {
3736 ast_log(LOG_ERROR, "ARI ChannelCallerId field application failed validation\n");
3737 res = 0;
3738 }
3739 } else
3740 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3741 int prop_is_valid;
3742 has_timestamp = 1;
3743 prop_is_valid = ast_ari_validate_date(
3745 if (!prop_is_valid) {
3746 ast_log(LOG_ERROR, "ARI ChannelCallerId field timestamp failed validation\n");
3747 res = 0;
3748 }
3749 } else
3750 if (strcmp("caller_presentation", ast_json_object_iter_key(iter)) == 0) {
3751 int prop_is_valid;
3752 has_caller_presentation = 1;
3753 prop_is_valid = ast_ari_validate_int(
3755 if (!prop_is_valid) {
3756 ast_log(LOG_ERROR, "ARI ChannelCallerId field caller_presentation failed validation\n");
3757 res = 0;
3758 }
3759 } else
3760 if (strcmp("caller_presentation_txt", ast_json_object_iter_key(iter)) == 0) {
3761 int prop_is_valid;
3762 has_caller_presentation_txt = 1;
3763 prop_is_valid = ast_ari_validate_string(
3765 if (!prop_is_valid) {
3766 ast_log(LOG_ERROR, "ARI ChannelCallerId field caller_presentation_txt failed validation\n");
3767 res = 0;
3768 }
3769 } else
3770 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3771 int prop_is_valid;
3772 has_channel = 1;
3773 prop_is_valid = ast_ari_validate_channel(
3775 if (!prop_is_valid) {
3776 ast_log(LOG_ERROR, "ARI ChannelCallerId field channel failed validation\n");
3777 res = 0;
3778 }
3779 } else
3780 {
3782 "ARI ChannelCallerId has undocumented field %s\n",
3784 res = 0;
3785 }
3786 }
3787
3788 if (!has_type) {
3789 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field type\n");
3790 res = 0;
3791 }
3792
3793 if (!has_application) {
3794 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field application\n");
3795 res = 0;
3796 }
3797
3798 if (!has_timestamp) {
3799 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field timestamp\n");
3800 res = 0;
3801 }
3802
3803 if (!has_caller_presentation) {
3804 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field caller_presentation\n");
3805 res = 0;
3806 }
3807
3808 if (!has_caller_presentation_txt) {
3809 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field caller_presentation_txt\n");
3810 res = 0;
3811 }
3812
3813 if (!has_channel) {
3814 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field channel\n");
3815 res = 0;
3816 }
3817
3818 return res;
3819}
3820
3822{
3824}
3825
3827{
3828 int res = 1;
3829 struct ast_json_iter *iter;
3830 int has_type = 0;
3831 int has_application = 0;
3832 int has_timestamp = 0;
3833 int has_channel = 0;
3834
3835 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3836 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3837 int prop_is_valid;
3838 prop_is_valid = ast_ari_validate_string(
3840 if (!prop_is_valid) {
3841 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field asterisk_id failed validation\n");
3842 res = 0;
3843 }
3844 } else
3845 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3846 int prop_is_valid;
3847 has_type = 1;
3848 prop_is_valid = ast_ari_validate_string(
3850 if (!prop_is_valid) {
3851 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field type failed validation\n");
3852 res = 0;
3853 }
3854 } else
3855 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3856 int prop_is_valid;
3857 has_application = 1;
3858 prop_is_valid = ast_ari_validate_string(
3860 if (!prop_is_valid) {
3861 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field application failed validation\n");
3862 res = 0;
3863 }
3864 } else
3865 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3866 int prop_is_valid;
3867 has_timestamp = 1;
3868 prop_is_valid = ast_ari_validate_date(
3870 if (!prop_is_valid) {
3871 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field timestamp failed validation\n");
3872 res = 0;
3873 }
3874 } else
3875 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3876 int prop_is_valid;
3877 has_channel = 1;
3878 prop_is_valid = ast_ari_validate_channel(
3880 if (!prop_is_valid) {
3881 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field channel failed validation\n");
3882 res = 0;
3883 }
3884 } else
3885 {
3887 "ARI ChannelConnectedLine has undocumented field %s\n",
3889 res = 0;
3890 }
3891 }
3892
3893 if (!has_type) {
3894 ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field type\n");
3895 res = 0;
3896 }
3897
3898 if (!has_application) {
3899 ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field application\n");
3900 res = 0;
3901 }
3902
3903 if (!has_timestamp) {
3904 ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field timestamp\n");
3905 res = 0;
3906 }
3907
3908 if (!has_channel) {
3909 ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field channel\n");
3910 res = 0;
3911 }
3912
3913 return res;
3914}
3915
3917{
3919}
3920
3922{
3923 int res = 1;
3924 struct ast_json_iter *iter;
3925 int has_type = 0;
3926 int has_application = 0;
3927 int has_timestamp = 0;
3928 int has_channel = 0;
3929
3930 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3931 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3932 int prop_is_valid;
3933 prop_is_valid = ast_ari_validate_string(
3935 if (!prop_is_valid) {
3936 ast_log(LOG_ERROR, "ARI ChannelCreated field asterisk_id failed validation\n");
3937 res = 0;
3938 }
3939 } else
3940 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3941 int prop_is_valid;
3942 has_type = 1;
3943 prop_is_valid = ast_ari_validate_string(
3945 if (!prop_is_valid) {
3946 ast_log(LOG_ERROR, "ARI ChannelCreated field type failed validation\n");
3947 res = 0;
3948 }
3949 } else
3950 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3951 int prop_is_valid;
3952 has_application = 1;
3953 prop_is_valid = ast_ari_validate_string(
3955 if (!prop_is_valid) {
3956 ast_log(LOG_ERROR, "ARI ChannelCreated field application failed validation\n");
3957 res = 0;
3958 }
3959 } else
3960 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3961 int prop_is_valid;
3962 has_timestamp = 1;
3963 prop_is_valid = ast_ari_validate_date(
3965 if (!prop_is_valid) {
3966 ast_log(LOG_ERROR, "ARI ChannelCreated field timestamp failed validation\n");
3967 res = 0;
3968 }
3969 } else
3970 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3971 int prop_is_valid;
3972 has_channel = 1;
3973 prop_is_valid = ast_ari_validate_channel(
3975 if (!prop_is_valid) {
3976 ast_log(LOG_ERROR, "ARI ChannelCreated field channel failed validation\n");
3977 res = 0;
3978 }
3979 } else
3980 {
3982 "ARI ChannelCreated has undocumented field %s\n",
3984 res = 0;
3985 }
3986 }
3987
3988 if (!has_type) {
3989 ast_log(LOG_ERROR, "ARI ChannelCreated missing required field type\n");
3990 res = 0;
3991 }
3992
3993 if (!has_application) {
3994 ast_log(LOG_ERROR, "ARI ChannelCreated missing required field application\n");
3995 res = 0;
3996 }
3997
3998 if (!has_timestamp) {
3999 ast_log(LOG_ERROR, "ARI ChannelCreated missing required field timestamp\n");
4000 res = 0;
4001 }
4002
4003 if (!has_channel) {
4004 ast_log(LOG_ERROR, "ARI ChannelCreated missing required field channel\n");
4005 res = 0;
4006 }
4007
4008 return res;
4009}
4010
4012{
4014}
4015
4017{
4018 int res = 1;
4019 struct ast_json_iter *iter;
4020 int has_type = 0;
4021 int has_application = 0;
4022 int has_timestamp = 0;
4023 int has_cause = 0;
4024 int has_cause_txt = 0;
4025 int has_channel = 0;
4026
4027 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4028 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4029 int prop_is_valid;
4030 prop_is_valid = ast_ari_validate_string(
4032 if (!prop_is_valid) {
4033 ast_log(LOG_ERROR, "ARI ChannelDestroyed field asterisk_id failed validation\n");
4034 res = 0;
4035 }
4036 } else
4037 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4038 int prop_is_valid;
4039 has_type = 1;
4040 prop_is_valid = ast_ari_validate_string(
4042 if (!prop_is_valid) {
4043 ast_log(LOG_ERROR, "ARI ChannelDestroyed field type failed validation\n");
4044 res = 0;
4045 }
4046 } else
4047 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4048 int prop_is_valid;
4049 has_application = 1;
4050 prop_is_valid = ast_ari_validate_string(
4052 if (!prop_is_valid) {
4053 ast_log(LOG_ERROR, "ARI ChannelDestroyed field application failed validation\n");
4054 res = 0;
4055 }
4056 } else
4057 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4058 int prop_is_valid;
4059 has_timestamp = 1;
4060 prop_is_valid = ast_ari_validate_date(
4062 if (!prop_is_valid) {
4063 ast_log(LOG_ERROR, "ARI ChannelDestroyed field timestamp failed validation\n");
4064 res = 0;
4065 }
4066 } else
4067 if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
4068 int prop_is_valid;
4069 has_cause = 1;
4070 prop_is_valid = ast_ari_validate_int(
4072 if (!prop_is_valid) {
4073 ast_log(LOG_ERROR, "ARI ChannelDestroyed field cause failed validation\n");
4074 res = 0;
4075 }
4076 } else
4077 if (strcmp("cause_txt", ast_json_object_iter_key(iter)) == 0) {
4078 int prop_is_valid;
4079 has_cause_txt = 1;
4080 prop_is_valid = ast_ari_validate_string(
4082 if (!prop_is_valid) {
4083 ast_log(LOG_ERROR, "ARI ChannelDestroyed field cause_txt failed validation\n");
4084 res = 0;
4085 }
4086 } else
4087 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4088 int prop_is_valid;
4089 has_channel = 1;
4090 prop_is_valid = ast_ari_validate_channel(
4092 if (!prop_is_valid) {
4093 ast_log(LOG_ERROR, "ARI ChannelDestroyed field channel failed validation\n");
4094 res = 0;
4095 }
4096 } else
4097 {
4099 "ARI ChannelDestroyed has undocumented field %s\n",
4101 res = 0;
4102 }
4103 }
4104
4105 if (!has_type) {
4106 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field type\n");
4107 res = 0;
4108 }
4109
4110 if (!has_application) {
4111 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field application\n");
4112 res = 0;
4113 }
4114
4115 if (!has_timestamp) {
4116 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field timestamp\n");
4117 res = 0;
4118 }
4119
4120 if (!has_cause) {
4121 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field cause\n");
4122 res = 0;
4123 }
4124
4125 if (!has_cause_txt) {
4126 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field cause_txt\n");
4127 res = 0;
4128 }
4129
4130 if (!has_channel) {
4131 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field channel\n");
4132 res = 0;
4133 }
4134
4135 return res;
4136}
4137
4139{
4141}
4142
4144{
4145 int res = 1;
4146 struct ast_json_iter *iter;
4147 int has_type = 0;
4148 int has_application = 0;
4149 int has_timestamp = 0;
4150 int has_channel = 0;
4151 int has_dialplan_app = 0;
4152 int has_dialplan_app_data = 0;
4153
4154 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4155 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4156 int prop_is_valid;
4157 prop_is_valid = ast_ari_validate_string(
4159 if (!prop_is_valid) {
4160 ast_log(LOG_ERROR, "ARI ChannelDialplan field asterisk_id failed validation\n");
4161 res = 0;
4162 }
4163 } else
4164 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4165 int prop_is_valid;
4166 has_type = 1;
4167 prop_is_valid = ast_ari_validate_string(
4169 if (!prop_is_valid) {
4170 ast_log(LOG_ERROR, "ARI ChannelDialplan field type failed validation\n");
4171 res = 0;
4172 }
4173 } else
4174 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4175 int prop_is_valid;
4176 has_application = 1;
4177 prop_is_valid = ast_ari_validate_string(
4179 if (!prop_is_valid) {
4180 ast_log(LOG_ERROR, "ARI ChannelDialplan field application failed validation\n");
4181 res = 0;
4182 }
4183 } else
4184 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4185 int prop_is_valid;
4186 has_timestamp = 1;
4187 prop_is_valid = ast_ari_validate_date(
4189 if (!prop_is_valid) {
4190 ast_log(LOG_ERROR, "ARI ChannelDialplan field timestamp failed validation\n");
4191 res = 0;
4192 }
4193 } else
4194 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4195 int prop_is_valid;
4196 has_channel = 1;
4197 prop_is_valid = ast_ari_validate_channel(
4199 if (!prop_is_valid) {
4200 ast_log(LOG_ERROR, "ARI ChannelDialplan field channel failed validation\n");
4201 res = 0;
4202 }
4203 } else
4204 if (strcmp("dialplan_app", ast_json_object_iter_key(iter)) == 0) {
4205 int prop_is_valid;
4206 has_dialplan_app = 1;
4207 prop_is_valid = ast_ari_validate_string(
4209 if (!prop_is_valid) {
4210 ast_log(LOG_ERROR, "ARI ChannelDialplan field dialplan_app failed validation\n");
4211 res = 0;
4212 }
4213 } else
4214 if (strcmp("dialplan_app_data", ast_json_object_iter_key(iter)) == 0) {
4215 int prop_is_valid;
4216 has_dialplan_app_data = 1;
4217 prop_is_valid = ast_ari_validate_string(
4219 if (!prop_is_valid) {
4220 ast_log(LOG_ERROR, "ARI ChannelDialplan field dialplan_app_data failed validation\n");
4221 res = 0;
4222 }
4223 } else
4224 {
4226 "ARI ChannelDialplan has undocumented field %s\n",
4228 res = 0;
4229 }
4230 }
4231
4232 if (!has_type) {
4233 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field type\n");
4234 res = 0;
4235 }
4236
4237 if (!has_application) {
4238 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field application\n");
4239 res = 0;
4240 }
4241
4242 if (!has_timestamp) {
4243 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field timestamp\n");
4244 res = 0;
4245 }
4246
4247 if (!has_channel) {
4248 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field channel\n");
4249 res = 0;
4250 }
4251
4252 if (!has_dialplan_app) {
4253 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field dialplan_app\n");
4254 res = 0;
4255 }
4256
4257 if (!has_dialplan_app_data) {
4258 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field dialplan_app_data\n");
4259 res = 0;
4260 }
4261
4262 return res;
4263}
4264
4266{
4268}
4269
4271{
4272 int res = 1;
4273 struct ast_json_iter *iter;
4274 int has_type = 0;
4275 int has_application = 0;
4276 int has_timestamp = 0;
4277 int has_channel = 0;
4278 int has_digit = 0;
4279 int has_duration_ms = 0;
4280
4281 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4282 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4283 int prop_is_valid;
4284 prop_is_valid = ast_ari_validate_string(
4286 if (!prop_is_valid) {
4287 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field asterisk_id failed validation\n");
4288 res = 0;
4289 }
4290 } else
4291 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4292 int prop_is_valid;
4293 has_type = 1;
4294 prop_is_valid = ast_ari_validate_string(
4296 if (!prop_is_valid) {
4297 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field type failed validation\n");
4298 res = 0;
4299 }
4300 } else
4301 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4302 int prop_is_valid;
4303 has_application = 1;
4304 prop_is_valid = ast_ari_validate_string(
4306 if (!prop_is_valid) {
4307 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field application failed validation\n");
4308 res = 0;
4309 }
4310 } else
4311 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4312 int prop_is_valid;
4313 has_timestamp = 1;
4314 prop_is_valid = ast_ari_validate_date(
4316 if (!prop_is_valid) {
4317 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field timestamp failed validation\n");
4318 res = 0;
4319 }
4320 } else
4321 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4322 int prop_is_valid;
4323 has_channel = 1;
4324 prop_is_valid = ast_ari_validate_channel(
4326 if (!prop_is_valid) {
4327 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field channel failed validation\n");
4328 res = 0;
4329 }
4330 } else
4331 if (strcmp("digit", ast_json_object_iter_key(iter)) == 0) {
4332 int prop_is_valid;
4333 has_digit = 1;
4334 prop_is_valid = ast_ari_validate_string(
4336 if (!prop_is_valid) {
4337 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field digit failed validation\n");
4338 res = 0;
4339 }
4340 } else
4341 if (strcmp("duration_ms", ast_json_object_iter_key(iter)) == 0) {
4342 int prop_is_valid;
4343 has_duration_ms = 1;
4344 prop_is_valid = ast_ari_validate_int(
4346 if (!prop_is_valid) {
4347 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field duration_ms failed validation\n");
4348 res = 0;
4349 }
4350 } else
4351 {
4353 "ARI ChannelDtmfReceived has undocumented field %s\n",
4355 res = 0;
4356 }
4357 }
4358
4359 if (!has_type) {
4360 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field type\n");
4361 res = 0;
4362 }
4363
4364 if (!has_application) {
4365 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field application\n");
4366 res = 0;
4367 }
4368
4369 if (!has_timestamp) {
4370 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field timestamp\n");
4371 res = 0;
4372 }
4373
4374 if (!has_channel) {
4375 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field channel\n");
4376 res = 0;
4377 }
4378
4379 if (!has_digit) {
4380 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field digit\n");
4381 res = 0;
4382 }
4383
4384 if (!has_duration_ms) {
4385 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field duration_ms\n");
4386 res = 0;
4387 }
4388
4389 return res;
4390}
4391
4393{
4395}
4396
4398{
4399 int res = 1;
4400 struct ast_json_iter *iter;
4401 int has_type = 0;
4402 int has_application = 0;
4403 int has_timestamp = 0;
4404 int has_bridge = 0;
4405
4406 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4407 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4408 int prop_is_valid;
4409 prop_is_valid = ast_ari_validate_string(
4411 if (!prop_is_valid) {
4412 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field asterisk_id failed validation\n");
4413 res = 0;
4414 }
4415 } else
4416 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4417 int prop_is_valid;
4418 has_type = 1;
4419 prop_is_valid = ast_ari_validate_string(
4421 if (!prop_is_valid) {
4422 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field type failed validation\n");
4423 res = 0;
4424 }
4425 } else
4426 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4427 int prop_is_valid;
4428 has_application = 1;
4429 prop_is_valid = ast_ari_validate_string(
4431 if (!prop_is_valid) {
4432 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field application failed validation\n");
4433 res = 0;
4434 }
4435 } else
4436 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4437 int prop_is_valid;
4438 has_timestamp = 1;
4439 prop_is_valid = ast_ari_validate_date(
4441 if (!prop_is_valid) {
4442 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field timestamp failed validation\n");
4443 res = 0;
4444 }
4445 } else
4446 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
4447 int prop_is_valid;
4448 has_bridge = 1;
4449 prop_is_valid = ast_ari_validate_bridge(
4451 if (!prop_is_valid) {
4452 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field bridge failed validation\n");
4453 res = 0;
4454 }
4455 } else
4456 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4457 int prop_is_valid;
4458 prop_is_valid = ast_ari_validate_channel(
4460 if (!prop_is_valid) {
4461 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field channel failed validation\n");
4462 res = 0;
4463 }
4464 } else
4465 {
4467 "ARI ChannelEnteredBridge has undocumented field %s\n",
4469 res = 0;
4470 }
4471 }
4472
4473 if (!has_type) {
4474 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field type\n");
4475 res = 0;
4476 }
4477
4478 if (!has_application) {
4479 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field application\n");
4480 res = 0;
4481 }
4482
4483 if (!has_timestamp) {
4484 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field timestamp\n");
4485 res = 0;
4486 }
4487
4488 if (!has_bridge) {
4489 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field bridge\n");
4490 res = 0;
4491 }
4492
4493 return res;
4494}
4495
4497{
4499}
4500
4502{
4503 int res = 1;
4504 struct ast_json_iter *iter;
4505 int has_type = 0;
4506 int has_application = 0;
4507 int has_timestamp = 0;
4508 int has_channel = 0;
4509
4510 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4511 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4512 int prop_is_valid;
4513 prop_is_valid = ast_ari_validate_string(
4515 if (!prop_is_valid) {
4516 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field asterisk_id failed validation\n");
4517 res = 0;
4518 }
4519 } else
4520 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4521 int prop_is_valid;
4522 has_type = 1;
4523 prop_is_valid = ast_ari_validate_string(
4525 if (!prop_is_valid) {
4526 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field type failed validation\n");
4527 res = 0;
4528 }
4529 } else
4530 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4531 int prop_is_valid;
4532 has_application = 1;
4533 prop_is_valid = ast_ari_validate_string(
4535 if (!prop_is_valid) {
4536 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field application failed validation\n");
4537 res = 0;
4538 }
4539 } else
4540 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4541 int prop_is_valid;
4542 has_timestamp = 1;
4543 prop_is_valid = ast_ari_validate_date(
4545 if (!prop_is_valid) {
4546 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field timestamp failed validation\n");
4547 res = 0;
4548 }
4549 } else
4550 if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
4551 int prop_is_valid;
4552 prop_is_valid = ast_ari_validate_int(
4554 if (!prop_is_valid) {
4555 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field cause failed validation\n");
4556 res = 0;
4557 }
4558 } else
4559 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4560 int prop_is_valid;
4561 has_channel = 1;
4562 prop_is_valid = ast_ari_validate_channel(
4564 if (!prop_is_valid) {
4565 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field channel failed validation\n");
4566 res = 0;
4567 }
4568 } else
4569 if (strcmp("soft", ast_json_object_iter_key(iter)) == 0) {
4570 int prop_is_valid;
4571 prop_is_valid = ast_ari_validate_boolean(
4573 if (!prop_is_valid) {
4574 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field soft failed validation\n");
4575 res = 0;
4576 }
4577 } else
4578 {
4580 "ARI ChannelHangupRequest has undocumented field %s\n",
4582 res = 0;
4583 }
4584 }
4585
4586 if (!has_type) {
4587 ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field type\n");
4588 res = 0;
4589 }
4590
4591 if (!has_application) {
4592 ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field application\n");
4593 res = 0;
4594 }
4595
4596 if (!has_timestamp) {
4597 ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field timestamp\n");
4598 res = 0;
4599 }
4600
4601 if (!has_channel) {
4602 ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field channel\n");
4603 res = 0;
4604 }
4605
4606 return res;
4607}
4608
4610{
4612}
4613
4615{
4616 int res = 1;
4617 struct ast_json_iter *iter;
4618 int has_type = 0;
4619 int has_application = 0;
4620 int has_timestamp = 0;
4621 int has_channel = 0;
4622
4623 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4624 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4625 int prop_is_valid;
4626 prop_is_valid = ast_ari_validate_string(
4628 if (!prop_is_valid) {
4629 ast_log(LOG_ERROR, "ARI ChannelHold field asterisk_id failed validation\n");
4630 res = 0;
4631 }
4632 } else
4633 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4634 int prop_is_valid;
4635 has_type = 1;
4636 prop_is_valid = ast_ari_validate_string(
4638 if (!prop_is_valid) {
4639 ast_log(LOG_ERROR, "ARI ChannelHold field type failed validation\n");
4640 res = 0;
4641 }
4642 } else
4643 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4644 int prop_is_valid;
4645 has_application = 1;
4646 prop_is_valid = ast_ari_validate_string(
4648 if (!prop_is_valid) {
4649 ast_log(LOG_ERROR, "ARI ChannelHold field application failed validation\n");
4650 res = 0;
4651 }
4652 } else
4653 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4654 int prop_is_valid;
4655 has_timestamp = 1;
4656 prop_is_valid = ast_ari_validate_date(
4658 if (!prop_is_valid) {
4659 ast_log(LOG_ERROR, "ARI ChannelHold field timestamp failed validation\n");
4660 res = 0;
4661 }
4662 } else
4663 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4664 int prop_is_valid;
4665 has_channel = 1;
4666 prop_is_valid = ast_ari_validate_channel(
4668 if (!prop_is_valid) {
4669 ast_log(LOG_ERROR, "ARI ChannelHold field channel failed validation\n");
4670 res = 0;
4671 }
4672 } else
4673 if (strcmp("musicclass", ast_json_object_iter_key(iter)) == 0) {
4674 int prop_is_valid;
4675 prop_is_valid = ast_ari_validate_string(
4677 if (!prop_is_valid) {
4678 ast_log(LOG_ERROR, "ARI ChannelHold field musicclass failed validation\n");
4679 res = 0;
4680 }
4681 } else
4682 {
4684 "ARI ChannelHold has undocumented field %s\n",
4686 res = 0;
4687 }
4688 }
4689
4690 if (!has_type) {
4691 ast_log(LOG_ERROR, "ARI ChannelHold missing required field type\n");
4692 res = 0;
4693 }
4694
4695 if (!has_application) {
4696 ast_log(LOG_ERROR, "ARI ChannelHold missing required field application\n");
4697 res = 0;
4698 }
4699
4700 if (!has_timestamp) {
4701 ast_log(LOG_ERROR, "ARI ChannelHold missing required field timestamp\n");
4702 res = 0;
4703 }
4704
4705 if (!has_channel) {
4706 ast_log(LOG_ERROR, "ARI ChannelHold missing required field channel\n");
4707 res = 0;
4708 }
4709
4710 return res;
4711}
4712
4714{
4716}
4717
4719{
4720 int res = 1;
4721 struct ast_json_iter *iter;
4722 int has_type = 0;
4723 int has_application = 0;
4724 int has_timestamp = 0;
4725 int has_bridge = 0;
4726 int has_channel = 0;
4727
4728 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4729 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4730 int prop_is_valid;
4731 prop_is_valid = ast_ari_validate_string(
4733 if (!prop_is_valid) {
4734 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field asterisk_id failed validation\n");
4735 res = 0;
4736 }
4737 } else
4738 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4739 int prop_is_valid;
4740 has_type = 1;
4741 prop_is_valid = ast_ari_validate_string(
4743 if (!prop_is_valid) {
4744 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field type failed validation\n");
4745 res = 0;
4746 }
4747 } else
4748 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4749 int prop_is_valid;
4750 has_application = 1;
4751 prop_is_valid = ast_ari_validate_string(
4753 if (!prop_is_valid) {
4754 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field application failed validation\n");
4755 res = 0;
4756 }
4757 } else
4758 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4759 int prop_is_valid;
4760 has_timestamp = 1;
4761 prop_is_valid = ast_ari_validate_date(
4763 if (!prop_is_valid) {
4764 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field timestamp failed validation\n");
4765 res = 0;
4766 }
4767 } else
4768 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
4769 int prop_is_valid;
4770 has_bridge = 1;
4771 prop_is_valid = ast_ari_validate_bridge(
4773 if (!prop_is_valid) {
4774 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field bridge failed validation\n");
4775 res = 0;
4776 }
4777 } else
4778 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4779 int prop_is_valid;
4780 has_channel = 1;
4781 prop_is_valid = ast_ari_validate_channel(
4783 if (!prop_is_valid) {
4784 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field channel failed validation\n");
4785 res = 0;
4786 }
4787 } else
4788 {
4790 "ARI ChannelLeftBridge has undocumented field %s\n",
4792 res = 0;
4793 }
4794 }
4795
4796 if (!has_type) {
4797 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field type\n");
4798 res = 0;
4799 }
4800
4801 if (!has_application) {
4802 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field application\n");
4803 res = 0;
4804 }
4805
4806 if (!has_timestamp) {
4807 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field timestamp\n");
4808 res = 0;
4809 }
4810
4811 if (!has_bridge) {
4812 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field bridge\n");
4813 res = 0;
4814 }
4815
4816 if (!has_channel) {
4817 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field channel\n");
4818 res = 0;
4819 }
4820
4821 return res;
4822}
4823
4825{
4827}
4828
4830{
4831 int res = 1;
4832 struct ast_json_iter *iter;
4833 int has_type = 0;
4834 int has_application = 0;
4835 int has_timestamp = 0;
4836 int has_channel = 0;
4837
4838 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4839 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4840 int prop_is_valid;
4841 prop_is_valid = ast_ari_validate_string(
4843 if (!prop_is_valid) {
4844 ast_log(LOG_ERROR, "ARI ChannelStateChange field asterisk_id failed validation\n");
4845 res = 0;
4846 }
4847 } else
4848 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4849 int prop_is_valid;
4850 has_type = 1;
4851 prop_is_valid = ast_ari_validate_string(
4853 if (!prop_is_valid) {
4854 ast_log(LOG_ERROR, "ARI ChannelStateChange field type failed validation\n");
4855 res = 0;
4856 }
4857 } else
4858 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4859 int prop_is_valid;
4860 has_application = 1;
4861 prop_is_valid = ast_ari_validate_string(
4863 if (!prop_is_valid) {
4864 ast_log(LOG_ERROR, "ARI ChannelStateChange field application failed validation\n");
4865 res = 0;
4866 }
4867 } else
4868 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4869 int prop_is_valid;
4870 has_timestamp = 1;
4871 prop_is_valid = ast_ari_validate_date(
4873 if (!prop_is_valid) {
4874 ast_log(LOG_ERROR, "ARI ChannelStateChange field timestamp failed validation\n");
4875 res = 0;
4876 }
4877 } else
4878 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4879 int prop_is_valid;
4880 has_channel = 1;
4881 prop_is_valid = ast_ari_validate_channel(
4883 if (!prop_is_valid) {
4884 ast_log(LOG_ERROR, "ARI ChannelStateChange field channel failed validation\n");
4885 res = 0;
4886 }
4887 } else
4888 {
4890 "ARI ChannelStateChange has undocumented field %s\n",
4892 res = 0;
4893 }
4894 }
4895
4896 if (!has_type) {
4897 ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field type\n");
4898 res = 0;
4899 }
4900
4901 if (!has_application) {
4902 ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field application\n");
4903 res = 0;
4904 }
4905
4906 if (!has_timestamp) {
4907 ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field timestamp\n");
4908 res = 0;
4909 }
4910
4911 if (!has_channel) {
4912 ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field channel\n");
4913 res = 0;
4914 }
4915
4916 return res;
4917}
4918
4920{
4922}
4923
4925{
4926 int res = 1;
4927 struct ast_json_iter *iter;
4928 int has_type = 0;
4929 int has_application = 0;
4930 int has_timestamp = 0;
4931 int has_channel = 0;
4932 int has_duration = 0;
4933
4934 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4935 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4936 int prop_is_valid;
4937 prop_is_valid = ast_ari_validate_string(
4939 if (!prop_is_valid) {
4940 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field asterisk_id failed validation\n");
4941 res = 0;
4942 }
4943 } else
4944 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4945 int prop_is_valid;
4946 has_type = 1;
4947 prop_is_valid = ast_ari_validate_string(
4949 if (!prop_is_valid) {
4950 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field type failed validation\n");
4951 res = 0;
4952 }
4953 } else
4954 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4955 int prop_is_valid;
4956 has_application = 1;
4957 prop_is_valid = ast_ari_validate_string(
4959 if (!prop_is_valid) {
4960 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field application failed validation\n");
4961 res = 0;
4962 }
4963 } else
4964 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4965 int prop_is_valid;
4966 has_timestamp = 1;
4967 prop_is_valid = ast_ari_validate_date(
4969 if (!prop_is_valid) {
4970 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field timestamp failed validation\n");
4971 res = 0;
4972 }
4973 } else
4974 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4975 int prop_is_valid;
4976 has_channel = 1;
4977 prop_is_valid = ast_ari_validate_channel(
4979 if (!prop_is_valid) {
4980 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field channel failed validation\n");
4981 res = 0;
4982 }
4983 } else
4984 if (strcmp("duration", ast_json_object_iter_key(iter)) == 0) {
4985 int prop_is_valid;
4986 has_duration = 1;
4987 prop_is_valid = ast_ari_validate_int(
4989 if (!prop_is_valid) {
4990 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field duration failed validation\n");
4991 res = 0;
4992 }
4993 } else
4994 {
4996 "ARI ChannelTalkingFinished has undocumented field %s\n",
4998 res = 0;
4999 }
5000 }
5001
5002 if (!has_type) {
5003 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field type\n");
5004 res = 0;
5005 }
5006
5007 if (!has_application) {
5008 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field application\n");
5009 res = 0;
5010 }
5011
5012 if (!has_timestamp) {
5013 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field timestamp\n");
5014 res = 0;
5015 }
5016
5017 if (!has_channel) {
5018 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field channel\n");
5019 res = 0;
5020 }
5021
5022 if (!has_duration) {
5023 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field duration\n");
5024 res = 0;
5025 }
5026
5027 return res;
5028}
5029
5031{
5033}
5034
5036{
5037 int res = 1;
5038 struct ast_json_iter *iter;
5039 int has_type = 0;
5040 int has_application = 0;
5041 int has_timestamp = 0;
5042 int has_channel = 0;
5043
5044 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5045 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5046 int prop_is_valid;
5047 prop_is_valid = ast_ari_validate_string(
5049 if (!prop_is_valid) {
5050 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field asterisk_id failed validation\n");
5051 res = 0;
5052 }
5053 } else
5054 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5055 int prop_is_valid;
5056 has_type = 1;
5057 prop_is_valid = ast_ari_validate_string(
5059 if (!prop_is_valid) {
5060 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field type failed validation\n");
5061 res = 0;
5062 }
5063 } else
5064 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5065 int prop_is_valid;
5066 has_application = 1;
5067 prop_is_valid = ast_ari_validate_string(
5069 if (!prop_is_valid) {
5070 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field application failed validation\n");
5071 res = 0;
5072 }
5073 } else
5074 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5075 int prop_is_valid;
5076 has_timestamp = 1;
5077 prop_is_valid = ast_ari_validate_date(
5079 if (!prop_is_valid) {
5080 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field timestamp failed validation\n");
5081 res = 0;
5082 }
5083 } else
5084 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5085 int prop_is_valid;
5086 has_channel = 1;
5087 prop_is_valid = ast_ari_validate_channel(
5089 if (!prop_is_valid) {
5090 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field channel failed validation\n");
5091 res = 0;
5092 }
5093 } else
5094 {
5096 "ARI ChannelTalkingStarted has undocumented field %s\n",
5098 res = 0;
5099 }
5100 }
5101
5102 if (!has_type) {
5103 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field type\n");
5104 res = 0;
5105 }
5106
5107 if (!has_application) {
5108 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field application\n");
5109 res = 0;
5110 }
5111
5112 if (!has_timestamp) {
5113 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field timestamp\n");
5114 res = 0;
5115 }
5116
5117 if (!has_channel) {
5118 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field channel\n");
5119 res = 0;
5120 }
5121
5122 return res;
5123}
5124
5126{
5128}
5129
5131{
5132 int res = 1;
5133 struct ast_json_iter *iter;
5134 int has_type = 0;
5135 int has_application = 0;
5136 int has_timestamp = 0;
5137 int has_channel = 0;
5138
5139 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5140 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5141 int prop_is_valid;
5142 prop_is_valid = ast_ari_validate_string(
5144 if (!prop_is_valid) {
5145 ast_log(LOG_ERROR, "ARI ChannelToneDetected field asterisk_id failed validation\n");
5146 res = 0;
5147 }
5148 } else
5149 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5150 int prop_is_valid;
5151 has_type = 1;
5152 prop_is_valid = ast_ari_validate_string(
5154 if (!prop_is_valid) {
5155 ast_log(LOG_ERROR, "ARI ChannelToneDetected field type failed validation\n");
5156 res = 0;
5157 }
5158 } else
5159 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5160 int prop_is_valid;
5161 has_application = 1;
5162 prop_is_valid = ast_ari_validate_string(
5164 if (!prop_is_valid) {
5165 ast_log(LOG_ERROR, "ARI ChannelToneDetected field application failed validation\n");
5166 res = 0;
5167 }
5168 } else
5169 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5170 int prop_is_valid;
5171 has_timestamp = 1;
5172 prop_is_valid = ast_ari_validate_date(
5174 if (!prop_is_valid) {
5175 ast_log(LOG_ERROR, "ARI ChannelToneDetected field timestamp failed validation\n");
5176 res = 0;
5177 }
5178 } else
5179 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5180 int prop_is_valid;
5181 has_channel = 1;
5182 prop_is_valid = ast_ari_validate_channel(
5184 if (!prop_is_valid) {
5185 ast_log(LOG_ERROR, "ARI ChannelToneDetected field channel failed validation\n");
5186 res = 0;
5187 }
5188 } else
5189 {
5191 "ARI ChannelToneDetected has undocumented field %s\n",
5193 res = 0;
5194 }
5195 }
5196
5197 if (!has_type) {
5198 ast_log(LOG_ERROR, "ARI ChannelToneDetected missing required field type\n");
5199 res = 0;
5200 }
5201
5202 if (!has_application) {
5203 ast_log(LOG_ERROR, "ARI ChannelToneDetected missing required field application\n");
5204 res = 0;
5205 }
5206
5207 if (!has_timestamp) {
5208 ast_log(LOG_ERROR, "ARI ChannelToneDetected missing required field timestamp\n");
5209 res = 0;
5210 }
5211
5212 if (!has_channel) {
5213 ast_log(LOG_ERROR, "ARI ChannelToneDetected missing required field channel\n");
5214 res = 0;
5215 }
5216
5217 return res;
5218}
5219
5221{
5223}
5224
5226{
5227 int res = 1;
5228 struct ast_json_iter *iter;
5229 int has_type = 0;
5230 int has_application = 0;
5231 int has_timestamp = 0;
5232 int has_refer_to = 0;
5233 int has_referred_by = 0;
5234
5235 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5236 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5237 int prop_is_valid;
5238 prop_is_valid = ast_ari_validate_string(
5240 if (!prop_is_valid) {
5241 ast_log(LOG_ERROR, "ARI ChannelTransfer field asterisk_id failed validation\n");
5242 res = 0;
5243 }
5244 } else
5245 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5246 int prop_is_valid;
5247 has_type = 1;
5248 prop_is_valid = ast_ari_validate_string(
5250 if (!prop_is_valid) {
5251 ast_log(LOG_ERROR, "ARI ChannelTransfer field type failed validation\n");
5252 res = 0;
5253 }
5254 } else
5255 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5256 int prop_is_valid;
5257 has_application = 1;
5258 prop_is_valid = ast_ari_validate_string(
5260 if (!prop_is_valid) {
5261 ast_log(LOG_ERROR, "ARI ChannelTransfer field application failed validation\n");
5262 res = 0;
5263 }
5264 } else
5265 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5266 int prop_is_valid;
5267 has_timestamp = 1;
5268 prop_is_valid = ast_ari_validate_date(
5270 if (!prop_is_valid) {
5271 ast_log(LOG_ERROR, "ARI ChannelTransfer field timestamp failed validation\n");
5272 res = 0;
5273 }
5274 } else
5275 if (strcmp("refer_to", ast_json_object_iter_key(iter)) == 0) {
5276 int prop_is_valid;
5277 has_refer_to = 1;
5278 prop_is_valid = ast_ari_validate_refer_to(
5280 if (!prop_is_valid) {
5281 ast_log(LOG_ERROR, "ARI ChannelTransfer field refer_to failed validation\n");
5282 res = 0;
5283 }
5284 } else
5285 if (strcmp("referred_by", ast_json_object_iter_key(iter)) == 0) {
5286 int prop_is_valid;
5287 has_referred_by = 1;
5288 prop_is_valid = ast_ari_validate_referred_by(
5290 if (!prop_is_valid) {
5291 ast_log(LOG_ERROR, "ARI ChannelTransfer field referred_by failed validation\n");
5292 res = 0;
5293 }
5294 } else
5295 if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
5296 int prop_is_valid;
5297 prop_is_valid = ast_ari_validate_string(
5299 if (!prop_is_valid) {
5300 ast_log(LOG_ERROR, "ARI ChannelTransfer field state failed validation\n");
5301 res = 0;
5302 }
5303 } else
5304 {
5306 "ARI ChannelTransfer has undocumented field %s\n",
5308 res = 0;
5309 }
5310 }
5311
5312 if (!has_type) {
5313 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field type\n");
5314 res = 0;
5315 }
5316
5317 if (!has_application) {
5318 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field application\n");
5319 res = 0;
5320 }
5321
5322 if (!has_timestamp) {
5323 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field timestamp\n");
5324 res = 0;
5325 }
5326
5327 if (!has_refer_to) {
5328 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field refer_to\n");
5329 res = 0;
5330 }
5331
5332 if (!has_referred_by) {
5333 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field referred_by\n");
5334 res = 0;
5335 }
5336
5337 return res;
5338}
5339
5341{
5343}
5344
5346{
5347 int res = 1;
5348 struct ast_json_iter *iter;
5349 int has_type = 0;
5350 int has_application = 0;
5351 int has_timestamp = 0;
5352 int has_channel = 0;
5353
5354 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5355 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5356 int prop_is_valid;
5357 prop_is_valid = ast_ari_validate_string(
5359 if (!prop_is_valid) {
5360 ast_log(LOG_ERROR, "ARI ChannelUnhold field asterisk_id failed validation\n");
5361 res = 0;
5362 }
5363 } else
5364 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5365 int prop_is_valid;
5366 has_type = 1;
5367 prop_is_valid = ast_ari_validate_string(
5369 if (!prop_is_valid) {
5370 ast_log(LOG_ERROR, "ARI ChannelUnhold field type failed validation\n");
5371 res = 0;
5372 }
5373 } else
5374 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5375 int prop_is_valid;
5376 has_application = 1;
5377 prop_is_valid = ast_ari_validate_string(
5379 if (!prop_is_valid) {
5380 ast_log(LOG_ERROR, "ARI ChannelUnhold field application failed validation\n");
5381 res = 0;
5382 }
5383 } else
5384 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5385 int prop_is_valid;
5386 has_timestamp = 1;
5387 prop_is_valid = ast_ari_validate_date(
5389 if (!prop_is_valid) {
5390 ast_log(LOG_ERROR, "ARI ChannelUnhold field timestamp failed validation\n");
5391 res = 0;
5392 }
5393 } else
5394 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5395 int prop_is_valid;
5396 has_channel = 1;
5397 prop_is_valid = ast_ari_validate_channel(
5399 if (!prop_is_valid) {
5400 ast_log(LOG_ERROR, "ARI ChannelUnhold field channel failed validation\n");
5401 res = 0;
5402 }
5403 } else
5404 {
5406 "ARI ChannelUnhold has undocumented field %s\n",
5408 res = 0;
5409 }
5410 }
5411
5412 if (!has_type) {
5413 ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field type\n");
5414 res = 0;
5415 }
5416
5417 if (!has_application) {
5418 ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field application\n");
5419 res = 0;
5420 }
5421
5422 if (!has_timestamp) {
5423 ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field timestamp\n");
5424 res = 0;
5425 }
5426
5427 if (!has_channel) {
5428 ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field channel\n");
5429 res = 0;
5430 }
5431
5432 return res;
5433}
5434
5436{
5438}
5439
5441{
5442 int res = 1;
5443 struct ast_json_iter *iter;
5444 int has_type = 0;
5445 int has_application = 0;
5446 int has_timestamp = 0;
5447 int has_eventname = 0;
5448 int has_userevent = 0;
5449
5450 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5451 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5452 int prop_is_valid;
5453 prop_is_valid = ast_ari_validate_string(
5455 if (!prop_is_valid) {
5456 ast_log(LOG_ERROR, "ARI ChannelUserevent field asterisk_id failed validation\n");
5457 res = 0;
5458 }
5459 } else
5460 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5461 int prop_is_valid;
5462 has_type = 1;
5463 prop_is_valid = ast_ari_validate_string(
5465 if (!prop_is_valid) {
5466 ast_log(LOG_ERROR, "ARI ChannelUserevent field type failed validation\n");
5467 res = 0;
5468 }
5469 } else
5470 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5471 int prop_is_valid;
5472 has_application = 1;
5473 prop_is_valid = ast_ari_validate_string(
5475 if (!prop_is_valid) {
5476 ast_log(LOG_ERROR, "ARI ChannelUserevent field application failed validation\n");
5477 res = 0;
5478 }
5479 } else
5480 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5481 int prop_is_valid;
5482 has_timestamp = 1;
5483 prop_is_valid = ast_ari_validate_date(
5485 if (!prop_is_valid) {
5486 ast_log(LOG_ERROR, "ARI ChannelUserevent field timestamp failed validation\n");
5487 res = 0;
5488 }
5489 } else
5490 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
5491 int prop_is_valid;
5492 prop_is_valid = ast_ari_validate_bridge(
5494 if (!prop_is_valid) {
5495 ast_log(LOG_ERROR, "ARI ChannelUserevent field bridge failed validation\n");
5496 res = 0;
5497 }
5498 } else
5499 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5500 int prop_is_valid;
5501 prop_is_valid = ast_ari_validate_channel(
5503 if (!prop_is_valid) {
5504 ast_log(LOG_ERROR, "ARI ChannelUserevent field channel failed validation\n");
5505 res = 0;
5506 }
5507 } else
5508 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
5509 int prop_is_valid;
5510 prop_is_valid = ast_ari_validate_endpoint(
5512 if (!prop_is_valid) {
5513 ast_log(LOG_ERROR, "ARI ChannelUserevent field endpoint failed validation\n");
5514 res = 0;
5515 }
5516 } else
5517 if (strcmp("eventname", ast_json_object_iter_key(iter)) == 0) {
5518 int prop_is_valid;
5519 has_eventname = 1;
5520 prop_is_valid = ast_ari_validate_string(
5522 if (!prop_is_valid) {
5523 ast_log(LOG_ERROR, "ARI ChannelUserevent field eventname failed validation\n");
5524 res = 0;
5525 }
5526 } else
5527 if (strcmp("userevent", ast_json_object_iter_key(iter)) == 0) {
5528 int prop_is_valid;
5529 has_userevent = 1;
5530 prop_is_valid = ast_ari_validate_object(
5532 if (!prop_is_valid) {
5533 ast_log(LOG_ERROR, "ARI ChannelUserevent field userevent failed validation\n");
5534 res = 0;
5535 }
5536 } else
5537 {
5539 "ARI ChannelUserevent has undocumented field %s\n",
5541 res = 0;
5542 }
5543 }
5544
5545 if (!has_type) {
5546 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field type\n");
5547 res = 0;
5548 }
5549
5550 if (!has_application) {
5551 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field application\n");
5552 res = 0;
5553 }
5554
5555 if (!has_timestamp) {
5556 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field timestamp\n");
5557 res = 0;
5558 }
5559
5560 if (!has_eventname) {
5561 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field eventname\n");
5562 res = 0;
5563 }
5564
5565 if (!has_userevent) {
5566 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field userevent\n");
5567 res = 0;
5568 }
5569
5570 return res;
5571}
5572
5574{
5576}
5577
5579{
5580 int res = 1;
5581 struct ast_json_iter *iter;
5582 int has_type = 0;
5583 int has_application = 0;
5584 int has_timestamp = 0;
5585 int has_value = 0;
5586 int has_variable = 0;
5587
5588 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5589 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5590 int prop_is_valid;
5591 prop_is_valid = ast_ari_validate_string(
5593 if (!prop_is_valid) {
5594 ast_log(LOG_ERROR, "ARI ChannelVarset field asterisk_id failed validation\n");
5595 res = 0;
5596 }
5597 } else
5598 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5599 int prop_is_valid;
5600 has_type = 1;
5601 prop_is_valid = ast_ari_validate_string(
5603 if (!prop_is_valid) {
5604 ast_log(LOG_ERROR, "ARI ChannelVarset field type failed validation\n");
5605 res = 0;
5606 }
5607 } else
5608 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5609 int prop_is_valid;
5610 has_application = 1;
5611 prop_is_valid = ast_ari_validate_string(
5613 if (!prop_is_valid) {
5614 ast_log(LOG_ERROR, "ARI ChannelVarset field application failed validation\n");
5615 res = 0;
5616 }
5617 } else
5618 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5619 int prop_is_valid;
5620 has_timestamp = 1;
5621 prop_is_valid = ast_ari_validate_date(
5623 if (!prop_is_valid) {
5624 ast_log(LOG_ERROR, "ARI ChannelVarset field timestamp failed validation\n");
5625 res = 0;
5626 }
5627 } else
5628 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5629 int prop_is_valid;
5630 prop_is_valid = ast_ari_validate_channel(
5632 if (!prop_is_valid) {
5633 ast_log(LOG_ERROR, "ARI ChannelVarset field channel failed validation\n");
5634 res = 0;
5635 }
5636 } else
5637 if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
5638 int prop_is_valid;
5639 has_value = 1;
5640 prop_is_valid = ast_ari_validate_string(
5642 if (!prop_is_valid) {
5643 ast_log(LOG_ERROR, "ARI ChannelVarset field value failed validation\n");
5644 res = 0;
5645 }
5646 } else
5647 if (strcmp("variable", ast_json_object_iter_key(iter)) == 0) {
5648 int prop_is_valid;
5649 has_variable = 1;
5650 prop_is_valid = ast_ari_validate_string(
5652 if (!prop_is_valid) {
5653 ast_log(LOG_ERROR, "ARI ChannelVarset field variable failed validation\n");
5654 res = 0;
5655 }
5656 } else
5657 {
5659 "ARI ChannelVarset has undocumented field %s\n",
5661 res = 0;
5662 }
5663 }
5664
5665 if (!has_type) {
5666 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field type\n");
5667 res = 0;
5668 }
5669
5670 if (!has_application) {
5671 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field application\n");
5672 res = 0;
5673 }
5674
5675 if (!has_timestamp) {
5676 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field timestamp\n");
5677 res = 0;
5678 }
5679
5680 if (!has_value) {
5681 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field value\n");
5682 res = 0;
5683 }
5684
5685 if (!has_variable) {
5686 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field variable\n");
5687 res = 0;
5688 }
5689
5690 return res;
5691}
5692
5694{
5696}
5697
5699{
5700 int res = 1;
5701 struct ast_json_iter *iter;
5702 int has_aor = 0;
5703 int has_contact_status = 0;
5704 int has_uri = 0;
5705
5706 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5707 if (strcmp("aor", ast_json_object_iter_key(iter)) == 0) {
5708 int prop_is_valid;
5709 has_aor = 1;
5710 prop_is_valid = ast_ari_validate_string(
5712 if (!prop_is_valid) {
5713 ast_log(LOG_ERROR, "ARI ContactInfo field aor failed validation\n");
5714 res = 0;
5715 }
5716 } else
5717 if (strcmp("contact_status", ast_json_object_iter_key(iter)) == 0) {
5718 int prop_is_valid;
5719 has_contact_status = 1;
5720 prop_is_valid = ast_ari_validate_string(
5722 if (!prop_is_valid) {
5723 ast_log(LOG_ERROR, "ARI ContactInfo field contact_status failed validation\n");
5724 res = 0;
5725 }
5726 } else
5727 if (strcmp("roundtrip_usec", ast_json_object_iter_key(iter)) == 0) {
5728 int prop_is_valid;
5729 prop_is_valid = ast_ari_validate_string(
5731 if (!prop_is_valid) {
5732 ast_log(LOG_ERROR, "ARI ContactInfo field roundtrip_usec failed validation\n");
5733 res = 0;
5734 }
5735 } else
5736 if (strcmp("uri", ast_json_object_iter_key(iter)) == 0) {
5737 int prop_is_valid;
5738 has_uri = 1;
5739 prop_is_valid = ast_ari_validate_string(
5741 if (!prop_is_valid) {
5742 ast_log(LOG_ERROR, "ARI ContactInfo field uri failed validation\n");
5743 res = 0;
5744 }
5745 } else
5746 {
5748 "ARI ContactInfo has undocumented field %s\n",
5750 res = 0;
5751 }
5752 }
5753
5754 if (!has_aor) {
5755 ast_log(LOG_ERROR, "ARI ContactInfo missing required field aor\n");
5756 res = 0;
5757 }
5758
5759 if (!has_contact_status) {
5760 ast_log(LOG_ERROR, "ARI ContactInfo missing required field contact_status\n");
5761 res = 0;
5762 }
5763
5764 if (!has_uri) {
5765 ast_log(LOG_ERROR, "ARI ContactInfo missing required field uri\n");
5766 res = 0;
5767 }
5768
5769 return res;
5770}
5771
5773{
5775}
5776
5778{
5779 int res = 1;
5780 struct ast_json_iter *iter;
5781 int has_type = 0;
5782 int has_application = 0;
5783 int has_timestamp = 0;
5784 int has_contact_info = 0;
5785 int has_endpoint = 0;
5786
5787 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5788 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5789 int prop_is_valid;
5790 prop_is_valid = ast_ari_validate_string(
5792 if (!prop_is_valid) {
5793 ast_log(LOG_ERROR, "ARI ContactStatusChange field asterisk_id failed validation\n");
5794 res = 0;
5795 }
5796 } else
5797 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5798 int prop_is_valid;
5799 has_type = 1;
5800 prop_is_valid = ast_ari_validate_string(
5802 if (!prop_is_valid) {
5803 ast_log(LOG_ERROR, "ARI ContactStatusChange field type failed validation\n");
5804 res = 0;
5805 }
5806 } else
5807 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5808 int prop_is_valid;
5809 has_application = 1;
5810 prop_is_valid = ast_ari_validate_string(
5812 if (!prop_is_valid) {
5813 ast_log(LOG_ERROR, "ARI ContactStatusChange field application failed validation\n");
5814 res = 0;
5815 }
5816 } else
5817 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5818 int prop_is_valid;
5819 has_timestamp = 1;
5820 prop_is_valid = ast_ari_validate_date(
5822 if (!prop_is_valid) {
5823 ast_log(LOG_ERROR, "ARI ContactStatusChange field timestamp failed validation\n");
5824 res = 0;
5825 }
5826 } else
5827 if (strcmp("contact_info", ast_json_object_iter_key(iter)) == 0) {
5828 int prop_is_valid;
5829 has_contact_info = 1;
5830 prop_is_valid = ast_ari_validate_contact_info(
5832 if (!prop_is_valid) {
5833 ast_log(LOG_ERROR, "ARI ContactStatusChange field contact_info failed validation\n");
5834 res = 0;
5835 }
5836 } else
5837 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
5838 int prop_is_valid;
5839 has_endpoint = 1;
5840 prop_is_valid = ast_ari_validate_endpoint(
5842 if (!prop_is_valid) {
5843 ast_log(LOG_ERROR, "ARI ContactStatusChange field endpoint failed validation\n");
5844 res = 0;
5845 }
5846 } else
5847 {
5849 "ARI ContactStatusChange has undocumented field %s\n",
5851 res = 0;
5852 }
5853 }
5854
5855 if (!has_type) {
5856 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field type\n");
5857 res = 0;
5858 }
5859
5860 if (!has_application) {
5861 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field application\n");
5862 res = 0;
5863 }
5864
5865 if (!has_timestamp) {
5866 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field timestamp\n");
5867 res = 0;
5868 }
5869
5870 if (!has_contact_info) {
5871 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field contact_info\n");
5872 res = 0;
5873 }
5874
5875 if (!has_endpoint) {
5876 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field endpoint\n");
5877 res = 0;
5878 }
5879
5880 return res;
5881}
5882
5884{
5886}
5887
5889{
5890 int res = 1;
5891 struct ast_json_iter *iter;
5892 int has_type = 0;
5893 int has_application = 0;
5894 int has_timestamp = 0;
5895 int has_device_state = 0;
5896
5897 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5898 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5899 int prop_is_valid;
5900 prop_is_valid = ast_ari_validate_string(
5902 if (!prop_is_valid) {
5903 ast_log(LOG_ERROR, "ARI DeviceStateChanged field asterisk_id failed validation\n");
5904 res = 0;
5905 }
5906 } else
5907 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5908 int prop_is_valid;
5909 has_type = 1;
5910 prop_is_valid = ast_ari_validate_string(
5912 if (!prop_is_valid) {
5913 ast_log(LOG_ERROR, "ARI DeviceStateChanged field type failed validation\n");
5914 res = 0;
5915 }
5916 } else
5917 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5918 int prop_is_valid;
5919 has_application = 1;
5920 prop_is_valid = ast_ari_validate_string(
5922 if (!prop_is_valid) {
5923 ast_log(LOG_ERROR, "ARI DeviceStateChanged field application failed validation\n");
5924 res = 0;
5925 }
5926 } else
5927 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5928 int prop_is_valid;
5929 has_timestamp = 1;
5930 prop_is_valid = ast_ari_validate_date(
5932 if (!prop_is_valid) {
5933 ast_log(LOG_ERROR, "ARI DeviceStateChanged field timestamp failed validation\n");
5934 res = 0;
5935 }
5936 } else
5937 if (strcmp("device_state", ast_json_object_iter_key(iter)) == 0) {
5938 int prop_is_valid;
5939 has_device_state = 1;
5940 prop_is_valid = ast_ari_validate_device_state(
5942 if (!prop_is_valid) {
5943 ast_log(LOG_ERROR, "ARI DeviceStateChanged field device_state failed validation\n");
5944 res = 0;
5945 }
5946 } else
5947 {
5949 "ARI DeviceStateChanged has undocumented field %s\n",
5951 res = 0;
5952 }
5953 }
5954
5955 if (!has_type) {
5956 ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field type\n");
5957 res = 0;
5958 }
5959
5960 if (!has_application) {
5961 ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field application\n");
5962 res = 0;
5963 }
5964
5965 if (!has_timestamp) {
5966 ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field timestamp\n");
5967 res = 0;
5968 }
5969
5970 if (!has_device_state) {
5971 ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field device_state\n");
5972 res = 0;
5973 }
5974
5975 return res;
5976}
5977
5979{
5981}
5982
5984{
5985 int res = 1;
5986 struct ast_json_iter *iter;
5987 int has_type = 0;
5988 int has_application = 0;
5989 int has_timestamp = 0;
5990 int has_dialstatus = 0;
5991 int has_peer = 0;
5992
5993 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5994 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5995 int prop_is_valid;
5996 prop_is_valid = ast_ari_validate_string(
5998 if (!prop_is_valid) {
5999 ast_log(LOG_ERROR, "ARI Dial field asterisk_id failed validation\n");
6000 res = 0;
6001 }
6002 } else
6003 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6004 int prop_is_valid;
6005 has_type = 1;
6006 prop_is_valid = ast_ari_validate_string(
6008 if (!prop_is_valid) {
6009 ast_log(LOG_ERROR, "ARI Dial field type failed validation\n");
6010 res = 0;
6011 }
6012 } else
6013 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6014 int prop_is_valid;
6015 has_application = 1;
6016 prop_is_valid = ast_ari_validate_string(
6018 if (!prop_is_valid) {
6019 ast_log(LOG_ERROR, "ARI Dial field application failed validation\n");
6020 res = 0;
6021 }
6022 } else
6023 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6024 int prop_is_valid;
6025 has_timestamp = 1;
6026 prop_is_valid = ast_ari_validate_date(
6028 if (!prop_is_valid) {
6029 ast_log(LOG_ERROR, "ARI Dial field timestamp failed validation\n");
6030 res = 0;
6031 }
6032 } else
6033 if (strcmp("caller", ast_json_object_iter_key(iter)) == 0) {
6034 int prop_is_valid;
6035 prop_is_valid = ast_ari_validate_channel(
6037 if (!prop_is_valid) {
6038 ast_log(LOG_ERROR, "ARI Dial field caller failed validation\n");
6039 res = 0;
6040 }
6041 } else
6042 if (strcmp("dialstatus", ast_json_object_iter_key(iter)) == 0) {
6043 int prop_is_valid;
6044 has_dialstatus = 1;
6045 prop_is_valid = ast_ari_validate_string(
6047 if (!prop_is_valid) {
6048 ast_log(LOG_ERROR, "ARI Dial field dialstatus failed validation\n");
6049 res = 0;
6050 }
6051 } else
6052 if (strcmp("dialstring", ast_json_object_iter_key(iter)) == 0) {
6053 int prop_is_valid;
6054 prop_is_valid = ast_ari_validate_string(
6056 if (!prop_is_valid) {
6057 ast_log(LOG_ERROR, "ARI Dial field dialstring failed validation\n");
6058 res = 0;
6059 }
6060 } else
6061 if (strcmp("forward", ast_json_object_iter_key(iter)) == 0) {
6062 int prop_is_valid;
6063 prop_is_valid = ast_ari_validate_string(
6065 if (!prop_is_valid) {
6066 ast_log(LOG_ERROR, "ARI Dial field forward failed validation\n");
6067 res = 0;
6068 }
6069 } else
6070 if (strcmp("forwarded", ast_json_object_iter_key(iter)) == 0) {
6071 int prop_is_valid;
6072 prop_is_valid = ast_ari_validate_channel(
6074 if (!prop_is_valid) {
6075 ast_log(LOG_ERROR, "ARI Dial field forwarded failed validation\n");
6076 res = 0;
6077 }
6078 } else
6079 if (strcmp("peer", ast_json_object_iter_key(iter)) == 0) {
6080 int prop_is_valid;
6081 has_peer = 1;
6082 prop_is_valid = ast_ari_validate_channel(
6084 if (!prop_is_valid) {
6085 ast_log(LOG_ERROR, "ARI Dial field peer failed validation\n");
6086 res = 0;
6087 }
6088 } else
6089 {
6091 "ARI Dial has undocumented field %s\n",
6093 res = 0;
6094 }
6095 }
6096
6097 if (!has_type) {
6098 ast_log(LOG_ERROR, "ARI Dial missing required field type\n");
6099 res = 0;
6100 }
6101
6102 if (!has_application) {
6103 ast_log(LOG_ERROR, "ARI Dial missing required field application\n");
6104 res = 0;
6105 }
6106
6107 if (!has_timestamp) {
6108 ast_log(LOG_ERROR, "ARI Dial missing required field timestamp\n");
6109 res = 0;
6110 }
6111
6112 if (!has_dialstatus) {
6113 ast_log(LOG_ERROR, "ARI Dial missing required field dialstatus\n");
6114 res = 0;
6115 }
6116
6117 if (!has_peer) {
6118 ast_log(LOG_ERROR, "ARI Dial missing required field peer\n");
6119 res = 0;
6120 }
6121
6122 return res;
6123}
6124
6126{
6127 return ast_ari_validate_dial;
6128}
6129
6131{
6132 int res = 1;
6133 struct ast_json_iter *iter;
6134 int has_type = 0;
6135 int has_application = 0;
6136 int has_timestamp = 0;
6137 int has_endpoint = 0;
6138
6139 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6140 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6141 int prop_is_valid;
6142 prop_is_valid = ast_ari_validate_string(
6144 if (!prop_is_valid) {
6145 ast_log(LOG_ERROR, "ARI EndpointStateChange field asterisk_id failed validation\n");
6146 res = 0;
6147 }
6148 } else
6149 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6150 int prop_is_valid;
6151 has_type = 1;
6152 prop_is_valid = ast_ari_validate_string(
6154 if (!prop_is_valid) {
6155 ast_log(LOG_ERROR, "ARI EndpointStateChange field type failed validation\n");
6156 res = 0;
6157 }
6158 } else
6159 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6160 int prop_is_valid;
6161 has_application = 1;
6162 prop_is_valid = ast_ari_validate_string(
6164 if (!prop_is_valid) {
6165 ast_log(LOG_ERROR, "ARI EndpointStateChange field application failed validation\n");
6166 res = 0;
6167 }
6168 } else
6169 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6170 int prop_is_valid;
6171 has_timestamp = 1;
6172 prop_is_valid = ast_ari_validate_date(
6174 if (!prop_is_valid) {
6175 ast_log(LOG_ERROR, "ARI EndpointStateChange field timestamp failed validation\n");
6176 res = 0;
6177 }
6178 } else
6179 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
6180 int prop_is_valid;
6181 has_endpoint = 1;
6182 prop_is_valid = ast_ari_validate_endpoint(
6184 if (!prop_is_valid) {
6185 ast_log(LOG_ERROR, "ARI EndpointStateChange field endpoint failed validation\n");
6186 res = 0;
6187 }
6188 } else
6189 {
6191 "ARI EndpointStateChange has undocumented field %s\n",
6193 res = 0;
6194 }
6195 }
6196
6197 if (!has_type) {
6198 ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field type\n");
6199 res = 0;
6200 }
6201
6202 if (!has_application) {
6203 ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field application\n");
6204 res = 0;
6205 }
6206
6207 if (!has_timestamp) {
6208 ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field timestamp\n");
6209 res = 0;
6210 }
6211
6212 if (!has_endpoint) {
6213 ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field endpoint\n");
6214 res = 0;
6215 }
6216
6217 return res;
6218}
6219
6221{
6223}
6224
6226{
6227 int res = 1;
6228 struct ast_json_iter *iter;
6229 int has_type = 0;
6230 int has_application = 0;
6231 int has_timestamp = 0;
6232 const char *discriminator;
6233
6234 discriminator = ast_json_string_get(ast_json_object_get(json, "type"));
6235 if (!discriminator) {
6236 ast_log(LOG_ERROR, "ARI Event missing required field type\n");
6237 return 0;
6238 }
6239
6240 if (strcmp("Event", discriminator) == 0) {
6241 /* Self type; fall through */
6242 } else
6243 if (strcmp("ApplicationMoveFailed", discriminator) == 0) {
6245 } else
6246 if (strcmp("ApplicationRegistered", discriminator) == 0) {
6248 } else
6249 if (strcmp("ApplicationReplaced", discriminator) == 0) {
6251 } else
6252 if (strcmp("ApplicationUnregistered", discriminator) == 0) {
6254 } else
6255 if (strcmp("BridgeAttendedTransfer", discriminator) == 0) {
6257 } else
6258 if (strcmp("BridgeBlindTransfer", discriminator) == 0) {
6260 } else
6261 if (strcmp("BridgeCreated", discriminator) == 0) {
6263 } else
6264 if (strcmp("BridgeDestroyed", discriminator) == 0) {
6266 } else
6267 if (strcmp("BridgeMerged", discriminator) == 0) {
6268 return ast_ari_validate_bridge_merged(json);
6269 } else
6270 if (strcmp("BridgeVideoSourceChanged", discriminator) == 0) {
6272 } else
6273 if (strcmp("ChannelCallerId", discriminator) == 0) {
6275 } else
6276 if (strcmp("ChannelConnectedLine", discriminator) == 0) {
6278 } else
6279 if (strcmp("ChannelCreated", discriminator) == 0) {
6281 } else
6282 if (strcmp("ChannelDestroyed", discriminator) == 0) {
6284 } else
6285 if (strcmp("ChannelDialplan", discriminator) == 0) {
6287 } else
6288 if (strcmp("ChannelDtmfReceived", discriminator) == 0) {
6290 } else
6291 if (strcmp("ChannelEnteredBridge", discriminator) == 0) {
6293 } else
6294 if (strcmp("ChannelHangupRequest", discriminator) == 0) {
6296 } else
6297 if (strcmp("ChannelHold", discriminator) == 0) {
6298 return ast_ari_validate_channel_hold(json);
6299 } else
6300 if (strcmp("ChannelLeftBridge", discriminator) == 0) {
6302 } else
6303 if (strcmp("ChannelStateChange", discriminator) == 0) {
6305 } else
6306 if (strcmp("ChannelTalkingFinished", discriminator) == 0) {
6308 } else
6309 if (strcmp("ChannelTalkingStarted", discriminator) == 0) {
6311 } else
6312 if (strcmp("ChannelToneDetected", discriminator) == 0) {
6314 } else
6315 if (strcmp("ChannelTransfer", discriminator) == 0) {
6317 } else
6318 if (strcmp("ChannelUnhold", discriminator) == 0) {
6320 } else
6321 if (strcmp("ChannelUserevent", discriminator) == 0) {
6323 } else
6324 if (strcmp("ChannelVarset", discriminator) == 0) {
6326 } else
6327 if (strcmp("ContactStatusChange", discriminator) == 0) {
6329 } else
6330 if (strcmp("DeviceStateChanged", discriminator) == 0) {
6332 } else
6333 if (strcmp("Dial", discriminator) == 0) {
6334 return ast_ari_validate_dial(json);
6335 } else
6336 if (strcmp("EndpointStateChange", discriminator) == 0) {
6338 } else
6339 if (strcmp("PeerStatusChange", discriminator) == 0) {
6341 } else
6342 if (strcmp("PlaybackContinuing", discriminator) == 0) {
6344 } else
6345 if (strcmp("PlaybackFinished", discriminator) == 0) {
6347 } else
6348 if (strcmp("PlaybackStarted", discriminator) == 0) {
6350 } else
6351 if (strcmp("RESTResponse", discriminator) == 0) {
6352 return ast_ari_validate_restresponse(json);
6353 } else
6354 if (strcmp("RecordingFailed", discriminator) == 0) {
6356 } else
6357 if (strcmp("RecordingFinished", discriminator) == 0) {
6359 } else
6360 if (strcmp("RecordingStarted", discriminator) == 0) {
6362 } else
6363 if (strcmp("StasisEnd", discriminator) == 0) {
6364 return ast_ari_validate_stasis_end(json);
6365 } else
6366 if (strcmp("StasisStart", discriminator) == 0) {
6367 return ast_ari_validate_stasis_start(json);
6368 } else
6369 if (strcmp("TextMessageReceived", discriminator) == 0) {
6371 } else
6372 {
6373 ast_log(LOG_ERROR, "ARI Event has undocumented subtype %s\n",
6374 discriminator);
6375 res = 0;
6376 }
6377
6378 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6379 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6380 int prop_is_valid;
6381 prop_is_valid = ast_ari_validate_string(
6383 if (!prop_is_valid) {
6384 ast_log(LOG_ERROR, "ARI Event field asterisk_id failed validation\n");
6385 res = 0;
6386 }
6387 } else
6388 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6389 int prop_is_valid;
6390 has_type = 1;
6391 prop_is_valid = ast_ari_validate_string(
6393 if (!prop_is_valid) {
6394 ast_log(LOG_ERROR, "ARI Event field type failed validation\n");
6395 res = 0;
6396 }
6397 } else
6398 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6399 int prop_is_valid;
6400 has_application = 1;
6401 prop_is_valid = ast_ari_validate_string(
6403 if (!prop_is_valid) {
6404 ast_log(LOG_ERROR, "ARI Event field application failed validation\n");
6405 res = 0;
6406 }
6407 } else
6408 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6409 int prop_is_valid;
6410 has_timestamp = 1;
6411 prop_is_valid = ast_ari_validate_date(
6413 if (!prop_is_valid) {
6414 ast_log(LOG_ERROR, "ARI Event field timestamp failed validation\n");
6415 res = 0;
6416 }
6417 } else
6418 {
6420 "ARI Event has undocumented field %s\n",
6422 res = 0;
6423 }
6424 }
6425
6426 if (!has_type) {
6427 ast_log(LOG_ERROR, "ARI Event missing required field type\n");
6428 res = 0;
6429 }
6430
6431 if (!has_application) {
6432 ast_log(LOG_ERROR, "ARI Event missing required field application\n");
6433 res = 0;
6434 }
6435
6436 if (!has_timestamp) {
6437 ast_log(LOG_ERROR, "ARI Event missing required field timestamp\n");
6438 res = 0;
6439 }
6440
6441 return res;
6442}
6443
6445{
6447}
6448
6450{
6451 int res = 1;
6452 struct ast_json_iter *iter;
6453 int has_type = 0;
6454 const char *discriminator;
6455
6456 discriminator = ast_json_string_get(ast_json_object_get(json, "type"));
6457 if (!discriminator) {
6458 ast_log(LOG_ERROR, "ARI Message missing required field type\n");
6459 return 0;
6460 }
6461
6462 if (strcmp("Message", discriminator) == 0) {
6463 /* Self type; fall through */
6464 } else
6465 if (strcmp("ApplicationMoveFailed", discriminator) == 0) {
6467 } else
6468 if (strcmp("ApplicationRegistered", discriminator) == 0) {
6470 } else
6471 if (strcmp("ApplicationReplaced", discriminator) == 0) {
6473 } else
6474 if (strcmp("ApplicationUnregistered", discriminator) == 0) {
6476 } else
6477 if (strcmp("BridgeAttendedTransfer", discriminator) == 0) {
6479 } else
6480 if (strcmp("BridgeBlindTransfer", discriminator) == 0) {
6482 } else
6483 if (strcmp("BridgeCreated", discriminator) == 0) {
6485 } else
6486 if (strcmp("BridgeDestroyed", discriminator) == 0) {
6488 } else
6489 if (strcmp("BridgeMerged", discriminator) == 0) {
6490 return ast_ari_validate_bridge_merged(json);
6491 } else
6492 if (strcmp("BridgeVideoSourceChanged", discriminator) == 0) {
6494 } else
6495 if (strcmp("ChannelCallerId", discriminator) == 0) {
6497 } else
6498 if (strcmp("ChannelConnectedLine", discriminator) == 0) {
6500 } else
6501 if (strcmp("ChannelCreated", discriminator) == 0) {
6503 } else
6504 if (strcmp("ChannelDestroyed", discriminator) == 0) {
6506 } else
6507 if (strcmp("ChannelDialplan", discriminator) == 0) {
6509 } else
6510 if (strcmp("ChannelDtmfReceived", discriminator) == 0) {
6512 } else
6513 if (strcmp("ChannelEnteredBridge", discriminator) == 0) {
6515 } else
6516 if (strcmp("ChannelHangupRequest", discriminator) == 0) {
6518 } else
6519 if (strcmp("ChannelHold", discriminator) == 0) {
6520 return ast_ari_validate_channel_hold(json);
6521 } else
6522 if (strcmp("ChannelLeftBridge", discriminator) == 0) {
6524 } else
6525 if (strcmp("ChannelStateChange", discriminator) == 0) {
6527 } else
6528 if (strcmp("ChannelTalkingFinished", discriminator) == 0) {
6530 } else
6531 if (strcmp("ChannelTalkingStarted", discriminator) == 0) {
6533 } else
6534 if (strcmp("ChannelToneDetected", discriminator) == 0) {
6536 } else
6537 if (strcmp("ChannelTransfer", discriminator) == 0) {
6539 } else
6540 if (strcmp("ChannelUnhold", discriminator) == 0) {
6542 } else
6543 if (strcmp("ChannelUserevent", discriminator) == 0) {
6545 } else
6546 if (strcmp("ChannelVarset", discriminator) == 0) {
6548 } else
6549 if (strcmp("ContactStatusChange", discriminator) == 0) {
6551 } else
6552 if (strcmp("DeviceStateChanged", discriminator) == 0) {
6554 } else
6555 if (strcmp("Dial", discriminator) == 0) {
6556 return ast_ari_validate_dial(json);
6557 } else
6558 if (strcmp("EndpointStateChange", discriminator) == 0) {
6560 } else
6561 if (strcmp("Event", discriminator) == 0) {
6562 return ast_ari_validate_event(json);
6563 } else
6564 if (strcmp("MissingParams", discriminator) == 0) {
6566 } else
6567 if (strcmp("PeerStatusChange", discriminator) == 0) {
6569 } else
6570 if (strcmp("PlaybackContinuing", discriminator) == 0) {
6572 } else
6573 if (strcmp("PlaybackFinished", discriminator) == 0) {
6575 } else
6576 if (strcmp("PlaybackStarted", discriminator) == 0) {
6578 } else
6579 if (strcmp("RESTResponse", discriminator) == 0) {
6580 return ast_ari_validate_restresponse(json);
6581 } else
6582 if (strcmp("RecordingFailed", discriminator) == 0) {
6584 } else
6585 if (strcmp("RecordingFinished", discriminator) == 0) {
6587 } else
6588 if (strcmp("RecordingStarted", discriminator) == 0) {
6590 } else
6591 if (strcmp("StasisEnd", discriminator) == 0) {
6592 return ast_ari_validate_stasis_end(json);
6593 } else
6594 if (strcmp("StasisStart", discriminator) == 0) {
6595 return ast_ari_validate_stasis_start(json);
6596 } else
6597 if (strcmp("TextMessageReceived", discriminator) == 0) {
6599 } else
6600 {
6601 ast_log(LOG_ERROR, "ARI Message has undocumented subtype %s\n",
6602 discriminator);
6603 res = 0;
6604 }
6605
6606 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6607 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6608 int prop_is_valid;
6609 prop_is_valid = ast_ari_validate_string(
6611 if (!prop_is_valid) {
6612 ast_log(LOG_ERROR, "ARI Message field asterisk_id failed validation\n");
6613 res = 0;
6614 }
6615 } else
6616 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6617 int prop_is_valid;
6618 has_type = 1;
6619 prop_is_valid = ast_ari_validate_string(
6621 if (!prop_is_valid) {
6622 ast_log(LOG_ERROR, "ARI Message field type failed validation\n");
6623 res = 0;
6624 }
6625 } else
6626 {
6628 "ARI Message has undocumented field %s\n",
6630 res = 0;
6631 }
6632 }
6633
6634 if (!has_type) {
6635 ast_log(LOG_ERROR, "ARI Message missing required field type\n");
6636 res = 0;
6637 }
6638
6639 return res;
6640}
6641
6643{
6645}
6646
6648{
6649 int res = 1;
6650 struct ast_json_iter *iter;
6651 int has_type = 0;
6652 int has_params = 0;
6653
6654 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6655 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6656 int prop_is_valid;
6657 prop_is_valid = ast_ari_validate_string(
6659 if (!prop_is_valid) {
6660 ast_log(LOG_ERROR, "ARI MissingParams field asterisk_id failed validation\n");
6661 res = 0;
6662 }
6663 } else
6664 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6665 int prop_is_valid;
6666 has_type = 1;
6667 prop_is_valid = ast_ari_validate_string(
6669 if (!prop_is_valid) {
6670 ast_log(LOG_ERROR, "ARI MissingParams field type failed validation\n");
6671 res = 0;
6672 }
6673 } else
6674 if (strcmp("params", ast_json_object_iter_key(iter)) == 0) {
6675 int prop_is_valid;
6676 has_params = 1;
6677 prop_is_valid = ast_ari_validate_list(
6680 if (!prop_is_valid) {
6681 ast_log(LOG_ERROR, "ARI MissingParams field params failed validation\n");
6682 res = 0;
6683 }
6684 } else
6685 {
6687 "ARI MissingParams has undocumented field %s\n",
6689 res = 0;
6690 }
6691 }
6692
6693 if (!has_type) {
6694 ast_log(LOG_ERROR, "ARI MissingParams missing required field type\n");
6695 res = 0;
6696 }
6697
6698 if (!has_params) {
6699 ast_log(LOG_ERROR, "ARI MissingParams missing required field params\n");
6700 res = 0;
6701 }
6702
6703 return res;
6704}
6705
6707{
6709}
6710
6712{
6713 int res = 1;
6714 struct ast_json_iter *iter;
6715 int has_peer_status = 0;
6716
6717 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6718 if (strcmp("address", ast_json_object_iter_key(iter)) == 0) {
6719 int prop_is_valid;
6720 prop_is_valid = ast_ari_validate_string(
6722 if (!prop_is_valid) {
6723 ast_log(LOG_ERROR, "ARI Peer field address failed validation\n");
6724 res = 0;
6725 }
6726 } else
6727 if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
6728 int prop_is_valid;
6729 prop_is_valid = ast_ari_validate_string(
6731 if (!prop_is_valid) {
6732 ast_log(LOG_ERROR, "ARI Peer field cause failed validation\n");
6733 res = 0;
6734 }
6735 } else
6736 if (strcmp("peer_status", ast_json_object_iter_key(iter)) == 0) {
6737 int prop_is_valid;
6738 has_peer_status = 1;
6739 prop_is_valid = ast_ari_validate_string(
6741 if (!prop_is_valid) {
6742 ast_log(LOG_ERROR, "ARI Peer field peer_status failed validation\n");
6743 res = 0;
6744 }
6745 } else
6746 if (strcmp("port", ast_json_object_iter_key(iter)) == 0) {
6747 int prop_is_valid;
6748 prop_is_valid = ast_ari_validate_string(
6750 if (!prop_is_valid) {
6751 ast_log(LOG_ERROR, "ARI Peer field port failed validation\n");
6752 res = 0;
6753 }
6754 } else
6755 if (strcmp("time", ast_json_object_iter_key(iter)) == 0) {
6756 int prop_is_valid;
6757 prop_is_valid = ast_ari_validate_string(
6759 if (!prop_is_valid) {
6760 ast_log(LOG_ERROR, "ARI Peer field time failed validation\n");
6761 res = 0;
6762 }
6763 } else
6764 {
6766 "ARI Peer has undocumented field %s\n",
6768 res = 0;
6769 }
6770 }
6771
6772 if (!has_peer_status) {
6773 ast_log(LOG_ERROR, "ARI Peer missing required field peer_status\n");
6774 res = 0;
6775 }
6776
6777 return res;
6778}
6779
6781{
6782 return ast_ari_validate_peer;
6783}
6784
6786{
6787 int res = 1;
6788 struct ast_json_iter *iter;
6789 int has_type = 0;
6790 int has_application = 0;
6791 int has_timestamp = 0;
6792 int has_endpoint = 0;
6793 int has_peer = 0;
6794
6795 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6796 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6797 int prop_is_valid;
6798 prop_is_valid = ast_ari_validate_string(
6800 if (!prop_is_valid) {
6801 ast_log(LOG_ERROR, "ARI PeerStatusChange field asterisk_id failed validation\n");
6802 res = 0;
6803 }
6804 } else
6805 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6806 int prop_is_valid;
6807 has_type = 1;
6808 prop_is_valid = ast_ari_validate_string(
6810 if (!prop_is_valid) {
6811 ast_log(LOG_ERROR, "ARI PeerStatusChange field type failed validation\n");
6812 res = 0;
6813 }
6814 } else
6815 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6816 int prop_is_valid;
6817 has_application = 1;
6818 prop_is_valid = ast_ari_validate_string(
6820 if (!prop_is_valid) {
6821 ast_log(LOG_ERROR, "ARI PeerStatusChange field application failed validation\n");
6822 res = 0;
6823 }
6824 } else
6825 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6826 int prop_is_valid;
6827 has_timestamp = 1;
6828 prop_is_valid = ast_ari_validate_date(
6830 if (!prop_is_valid) {
6831 ast_log(LOG_ERROR, "ARI PeerStatusChange field timestamp failed validation\n");
6832 res = 0;
6833 }
6834 } else
6835 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
6836 int prop_is_valid;
6837 has_endpoint = 1;
6838 prop_is_valid = ast_ari_validate_endpoint(
6840 if (!prop_is_valid) {
6841 ast_log(LOG_ERROR, "ARI PeerStatusChange field endpoint failed validation\n");
6842 res = 0;
6843 }
6844 } else
6845 if (strcmp("peer", ast_json_object_iter_key(iter)) == 0) {
6846 int prop_is_valid;
6847 has_peer = 1;
6848 prop_is_valid = ast_ari_validate_peer(
6850 if (!prop_is_valid) {
6851 ast_log(LOG_ERROR, "ARI PeerStatusChange field peer failed validation\n");
6852 res = 0;
6853 }
6854 } else
6855 {
6857 "ARI PeerStatusChange has undocumented field %s\n",
6859 res = 0;
6860 }
6861 }
6862
6863 if (!has_type) {
6864 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field type\n");
6865 res = 0;
6866 }
6867
6868 if (!has_application) {
6869 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field application\n");
6870 res = 0;
6871 }
6872
6873 if (!has_timestamp) {
6874 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field timestamp\n");
6875 res = 0;
6876 }
6877
6878 if (!has_endpoint) {
6879 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field endpoint\n");
6880 res = 0;
6881 }
6882
6883 if (!has_peer) {
6884 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field peer\n");
6885 res = 0;
6886 }
6887
6888 return res;
6889}
6890
6892{
6894}
6895
6897{
6898 int res = 1;
6899 struct ast_json_iter *iter;
6900 int has_type = 0;
6901 int has_application = 0;
6902 int has_timestamp = 0;
6903 int has_playback = 0;
6904
6905 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6906 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6907 int prop_is_valid;
6908 prop_is_valid = ast_ari_validate_string(
6910 if (!prop_is_valid) {
6911 ast_log(LOG_ERROR, "ARI PlaybackContinuing field asterisk_id failed validation\n");
6912 res = 0;
6913 }
6914 } else
6915 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6916 int prop_is_valid;
6917 has_type = 1;
6918 prop_is_valid = ast_ari_validate_string(
6920 if (!prop_is_valid) {
6921 ast_log(LOG_ERROR, "ARI PlaybackContinuing field type failed validation\n");
6922 res = 0;
6923 }
6924 } else
6925 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6926 int prop_is_valid;
6927 has_application = 1;
6928 prop_is_valid = ast_ari_validate_string(
6930 if (!prop_is_valid) {
6931 ast_log(LOG_ERROR, "ARI PlaybackContinuing field application failed validation\n");
6932 res = 0;
6933 }
6934 } else
6935 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6936 int prop_is_valid;
6937 has_timestamp = 1;
6938 prop_is_valid = ast_ari_validate_date(
6940 if (!prop_is_valid) {
6941 ast_log(LOG_ERROR, "ARI PlaybackContinuing field timestamp failed validation\n");
6942 res = 0;
6943 }
6944 } else
6945 if (strcmp("playback", ast_json_object_iter_key(iter)) == 0) {
6946 int prop_is_valid;
6947 has_playback = 1;
6948 prop_is_valid = ast_ari_validate_playback(
6950 if (!prop_is_valid) {
6951 ast_log(LOG_ERROR, "ARI PlaybackContinuing field playback failed validation\n");
6952 res = 0;
6953 }
6954 } else
6955 {
6957 "ARI PlaybackContinuing has undocumented field %s\n",
6959 res = 0;
6960 }
6961 }
6962
6963 if (!has_type) {
6964 ast_log(LOG_ERROR, "ARI PlaybackContinuing missing required field type\n");
6965 res = 0;
6966 }
6967
6968 if (!has_application) {
6969 ast_log(LOG_ERROR, "ARI PlaybackContinuing missing required field application\n");
6970 res = 0;
6971 }
6972
6973 if (!has_timestamp) {
6974 ast_log(LOG_ERROR, "ARI PlaybackContinuing missing required field timestamp\n");
6975 res = 0;
6976 }
6977
6978 if (!has_playback) {
6979 ast_log(LOG_ERROR, "ARI PlaybackContinuing missing required field playback\n");
6980 res = 0;
6981 }
6982
6983 return res;
6984}
6985
6987{
6989}
6990
6992{
6993 int res = 1;
6994 struct ast_json_iter *iter;
6995 int has_type = 0;
6996 int has_application = 0;
6997 int has_timestamp = 0;
6998 int has_playback = 0;
6999
7000 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7001 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7002 int prop_is_valid;
7003 prop_is_valid = ast_ari_validate_string(
7005 if (!prop_is_valid) {
7006 ast_log(LOG_ERROR, "ARI PlaybackFinished field asterisk_id failed validation\n");
7007 res = 0;
7008 }
7009 } else
7010 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7011 int prop_is_valid;
7012 has_type = 1;
7013 prop_is_valid = ast_ari_validate_string(
7015 if (!prop_is_valid) {
7016 ast_log(LOG_ERROR, "ARI PlaybackFinished field type failed validation\n");
7017 res = 0;
7018 }
7019 } else
7020 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7021 int prop_is_valid;
7022 has_application = 1;
7023 prop_is_valid = ast_ari_validate_string(
7025 if (!prop_is_valid) {
7026 ast_log(LOG_ERROR, "ARI PlaybackFinished field application failed validation\n");
7027 res = 0;
7028 }
7029 } else
7030 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7031 int prop_is_valid;
7032 has_timestamp = 1;
7033 prop_is_valid = ast_ari_validate_date(
7035 if (!prop_is_valid) {
7036 ast_log(LOG_ERROR, "ARI PlaybackFinished field timestamp failed validation\n");
7037 res = 0;
7038 }
7039 } else
7040 if (strcmp("playback", ast_json_object_iter_key(iter)) == 0) {
7041 int prop_is_valid;
7042 has_playback = 1;
7043 prop_is_valid = ast_ari_validate_playback(
7045 if (!prop_is_valid) {
7046 ast_log(LOG_ERROR, "ARI PlaybackFinished field playback failed validation\n");
7047 res = 0;
7048 }
7049 } else
7050 {
7052 "ARI PlaybackFinished has undocumented field %s\n",
7054 res = 0;
7055 }
7056 }
7057
7058 if (!has_type) {
7059 ast_log(LOG_ERROR, "ARI PlaybackFinished missing required field type\n");
7060 res = 0;
7061 }
7062
7063 if (!has_application) {
7064 ast_log(LOG_ERROR, "ARI PlaybackFinished missing required field application\n");
7065 res = 0;
7066 }
7067
7068 if (!has_timestamp) {
7069 ast_log(LOG_ERROR, "ARI PlaybackFinished missing required field timestamp\n");
7070 res = 0;
7071 }
7072
7073 if (!has_playback) {
7074 ast_log(LOG_ERROR, "ARI PlaybackFinished missing required field playback\n");
7075 res = 0;
7076 }
7077
7078 return res;
7079}
7080
7082{
7084}
7085
7087{
7088 int res = 1;
7089 struct ast_json_iter *iter;
7090 int has_type = 0;
7091 int has_application = 0;
7092 int has_timestamp = 0;
7093 int has_playback = 0;
7094
7095 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7096 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7097 int prop_is_valid;
7098 prop_is_valid = ast_ari_validate_string(
7100 if (!prop_is_valid) {
7101 ast_log(LOG_ERROR, "ARI PlaybackStarted field asterisk_id failed validation\n");
7102 res = 0;
7103 }
7104 } else
7105 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7106 int prop_is_valid;
7107 has_type = 1;
7108 prop_is_valid = ast_ari_validate_string(
7110 if (!prop_is_valid) {
7111 ast_log(LOG_ERROR, "ARI PlaybackStarted field type failed validation\n");
7112 res = 0;
7113 }
7114 } else
7115 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7116 int prop_is_valid;
7117 has_application = 1;
7118 prop_is_valid = ast_ari_validate_string(
7120 if (!prop_is_valid) {
7121 ast_log(LOG_ERROR, "ARI PlaybackStarted field application failed validation\n");
7122 res = 0;
7123 }
7124 } else
7125 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7126 int prop_is_valid;
7127 has_timestamp = 1;
7128 prop_is_valid = ast_ari_validate_date(
7130 if (!prop_is_valid) {
7131 ast_log(LOG_ERROR, "ARI PlaybackStarted field timestamp failed validation\n");
7132 res = 0;
7133 }
7134 } else
7135 if (strcmp("playback", ast_json_object_iter_key(iter)) == 0) {
7136 int prop_is_valid;
7137 has_playback = 1;
7138 prop_is_valid = ast_ari_validate_playback(
7140 if (!prop_is_valid) {
7141 ast_log(LOG_ERROR, "ARI PlaybackStarted field playback failed validation\n");
7142 res = 0;
7143 }
7144 } else
7145 {
7147 "ARI PlaybackStarted has undocumented field %s\n",
7149 res = 0;
7150 }
7151 }
7152
7153 if (!has_type) {
7154 ast_log(LOG_ERROR, "ARI PlaybackStarted missing required field type\n");
7155 res = 0;
7156 }
7157
7158 if (!has_application) {
7159 ast_log(LOG_ERROR, "ARI PlaybackStarted missing required field application\n");
7160 res = 0;
7161 }
7162
7163 if (!has_timestamp) {
7164 ast_log(LOG_ERROR, "ARI PlaybackStarted missing required field timestamp\n");
7165 res = 0;
7166 }
7167
7168 if (!has_playback) {
7169 ast_log(LOG_ERROR, "ARI PlaybackStarted missing required field playback\n");
7170 res = 0;
7171 }
7172
7173 return res;
7174}
7175
7177{
7179}
7180
7182{
7183 int res = 1;
7184 struct ast_json_iter *iter;
7185 int has_name = 0;
7186 int has_value = 0;
7187
7188 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7189 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
7190 int prop_is_valid;
7191 has_name = 1;
7192 prop_is_valid = ast_ari_validate_string(
7194 if (!prop_is_valid) {
7195 ast_log(LOG_ERROR, "ARI RESTHeader field name failed validation\n");
7196 res = 0;
7197 }
7198 } else
7199 if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
7200 int prop_is_valid;
7201 has_value = 1;
7202 prop_is_valid = ast_ari_validate_string(
7204 if (!prop_is_valid) {
7205 ast_log(LOG_ERROR, "ARI RESTHeader field value failed validation\n");
7206 res = 0;
7207 }
7208 } else
7209 {
7211 "ARI RESTHeader has undocumented field %s\n",
7213 res = 0;
7214 }
7215 }
7216
7217 if (!has_name) {
7218 ast_log(LOG_ERROR, "ARI RESTHeader missing required field name\n");
7219 res = 0;
7220 }
7221
7222 if (!has_value) {
7223 ast_log(LOG_ERROR, "ARI RESTHeader missing required field value\n");
7224 res = 0;
7225 }
7226
7227 return res;
7228}
7229
7231{
7233}
7234
7236{
7237 int res = 1;
7238 struct ast_json_iter *iter;
7239 int has_name = 0;
7240 int has_value = 0;
7241
7242 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7243 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
7244 int prop_is_valid;
7245 has_name = 1;
7246 prop_is_valid = ast_ari_validate_string(
7248 if (!prop_is_valid) {
7249 ast_log(LOG_ERROR, "ARI RESTQueryStringParameter field name failed validation\n");
7250 res = 0;
7251 }
7252 } else
7253 if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
7254 int prop_is_valid;
7255 has_value = 1;
7256 prop_is_valid = ast_ari_validate_string(
7258 if (!prop_is_valid) {
7259 ast_log(LOG_ERROR, "ARI RESTQueryStringParameter field value failed validation\n");
7260 res = 0;
7261 }
7262 } else
7263 {
7265 "ARI RESTQueryStringParameter has undocumented field %s\n",
7267 res = 0;
7268 }
7269 }
7270
7271 if (!has_name) {
7272 ast_log(LOG_ERROR, "ARI RESTQueryStringParameter missing required field name\n");
7273 res = 0;
7274 }
7275
7276 if (!has_value) {
7277 ast_log(LOG_ERROR, "ARI RESTQueryStringParameter missing required field value\n");
7278 res = 0;
7279 }
7280
7281 return res;
7282}
7283
7285{
7287}
7288
7290{
7291 int res = 1;
7292 struct ast_json_iter *iter;
7293 int has_method = 0;
7294 int has_request_id = 0;
7295 int has_transaction_id = 0;
7296 int has_type = 0;
7297 int has_uri = 0;
7298
7299 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7300 if (strcmp("content_type", ast_json_object_iter_key(iter)) == 0) {
7301 int prop_is_valid;
7302 prop_is_valid = ast_ari_validate_string(
7304 if (!prop_is_valid) {
7305 ast_log(LOG_ERROR, "ARI RESTRequest field content_type failed validation\n");
7306 res = 0;
7307 }
7308 } else
7309 if (strcmp("message_body", ast_json_object_iter_key(iter)) == 0) {
7310 int prop_is_valid;
7311 prop_is_valid = ast_ari_validate_string(
7313 if (!prop_is_valid) {
7314 ast_log(LOG_ERROR, "ARI RESTRequest field message_body failed validation\n");
7315 res = 0;
7316 }
7317 } else
7318 if (strcmp("method", ast_json_object_iter_key(iter)) == 0) {
7319 int prop_is_valid;
7320 has_method = 1;
7321 prop_is_valid = ast_ari_validate_string(
7323 if (!prop_is_valid) {
7324 ast_log(LOG_ERROR, "ARI RESTRequest field method failed validation\n");
7325 res = 0;
7326 }
7327 } else
7328 if (strcmp("query_strings", ast_json_object_iter_key(iter)) == 0) {
7329 int prop_is_valid;
7330 prop_is_valid = ast_ari_validate_list(
7333 if (!prop_is_valid) {
7334 ast_log(LOG_ERROR, "ARI RESTRequest field query_strings failed validation\n");
7335 res = 0;
7336 }
7337 } else
7338 if (strcmp("request_id", ast_json_object_iter_key(iter)) == 0) {
7339 int prop_is_valid;
7340 has_request_id = 1;
7341 prop_is_valid = ast_ari_validate_string(
7343 if (!prop_is_valid) {
7344 ast_log(LOG_ERROR, "ARI RESTRequest field request_id failed validation\n");
7345 res = 0;
7346 }
7347 } else
7348 if (strcmp("transaction_id", ast_json_object_iter_key(iter)) == 0) {
7349 int prop_is_valid;
7350 has_transaction_id = 1;
7351 prop_is_valid = ast_ari_validate_string(
7353 if (!prop_is_valid) {
7354 ast_log(LOG_ERROR, "ARI RESTRequest field transaction_id failed validation\n");
7355 res = 0;
7356 }
7357 } else
7358 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7359 int prop_is_valid;
7360 has_type = 1;
7361 prop_is_valid = ast_ari_validate_string(
7363 if (!prop_is_valid) {
7364 ast_log(LOG_ERROR, "ARI RESTRequest field type failed validation\n");
7365 res = 0;
7366 }
7367 } else
7368 if (strcmp("uri", ast_json_object_iter_key(iter)) == 0) {
7369 int prop_is_valid;
7370 has_uri = 1;
7371 prop_is_valid = ast_ari_validate_string(
7373 if (!prop_is_valid) {
7374 ast_log(LOG_ERROR, "ARI RESTRequest field uri failed validation\n");
7375 res = 0;
7376 }
7377 } else
7378 {
7380 "ARI RESTRequest has undocumented field %s\n",
7382 res = 0;
7383 }
7384 }
7385
7386 if (!has_method) {
7387 ast_log(LOG_ERROR, "ARI RESTRequest missing required field method\n");
7388 res = 0;
7389 }
7390
7391 if (!has_request_id) {
7392 ast_log(LOG_ERROR, "ARI RESTRequest missing required field request_id\n");
7393 res = 0;
7394 }
7395
7396 if (!has_transaction_id) {
7397 ast_log(LOG_ERROR, "ARI RESTRequest missing required field transaction_id\n");
7398 res = 0;
7399 }
7400
7401 if (!has_type) {
7402 ast_log(LOG_ERROR, "ARI RESTRequest missing required field type\n");
7403 res = 0;
7404 }
7405
7406 if (!has_uri) {
7407 ast_log(LOG_ERROR, "ARI RESTRequest missing required field uri\n");
7408 res = 0;
7409 }
7410
7411 return res;
7412}
7413
7415{
7417}
7418
7420{
7421 int res = 1;
7422 struct ast_json_iter *iter;
7423 int has_type = 0;
7424 int has_application = 0;
7425 int has_timestamp = 0;
7426 int has_reason_phrase = 0;
7427 int has_request_id = 0;
7428 int has_status_code = 0;
7429 int has_transaction_id = 0;
7430 int has_uri = 0;
7431
7432 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7433 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7434 int prop_is_valid;
7435 prop_is_valid = ast_ari_validate_string(
7437 if (!prop_is_valid) {
7438 ast_log(LOG_ERROR, "ARI RESTResponse field asterisk_id failed validation\n");
7439 res = 0;
7440 }
7441 } else
7442 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7443 int prop_is_valid;
7444 has_type = 1;
7445 prop_is_valid = ast_ari_validate_string(
7447 if (!prop_is_valid) {
7448 ast_log(LOG_ERROR, "ARI RESTResponse field type failed validation\n");
7449 res = 0;
7450 }
7451 } else
7452 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7453 int prop_is_valid;
7454 has_application = 1;
7455 prop_is_valid = ast_ari_validate_string(
7457 if (!prop_is_valid) {
7458 ast_log(LOG_ERROR, "ARI RESTResponse field application failed validation\n");
7459 res = 0;
7460 }
7461 } else
7462 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7463 int prop_is_valid;
7464 has_timestamp = 1;
7465 prop_is_valid = ast_ari_validate_date(
7467 if (!prop_is_valid) {
7468 ast_log(LOG_ERROR, "ARI RESTResponse field timestamp failed validation\n");
7469 res = 0;
7470 }
7471 } else
7472 if (strcmp("content_type", ast_json_object_iter_key(iter)) == 0) {
7473 int prop_is_valid;
7474 prop_is_valid = ast_ari_validate_string(
7476 if (!prop_is_valid) {
7477 ast_log(LOG_ERROR, "ARI RESTResponse field content_type failed validation\n");
7478 res = 0;
7479 }
7480 } else
7481 if (strcmp("message_body", ast_json_object_iter_key(iter)) == 0) {
7482 int prop_is_valid;
7483 prop_is_valid = ast_ari_validate_string(
7485 if (!prop_is_valid) {
7486 ast_log(LOG_ERROR, "ARI RESTResponse field message_body failed validation\n");
7487 res = 0;
7488 }
7489 } else
7490 if (strcmp("reason_phrase", ast_json_object_iter_key(iter)) == 0) {
7491 int prop_is_valid;
7492 has_reason_phrase = 1;
7493 prop_is_valid = ast_ari_validate_string(
7495 if (!prop_is_valid) {
7496 ast_log(LOG_ERROR, "ARI RESTResponse field reason_phrase failed validation\n");
7497 res = 0;
7498 }
7499 } else
7500 if (strcmp("request_id", ast_json_object_iter_key(iter)) == 0) {
7501 int prop_is_valid;
7502 has_request_id = 1;
7503 prop_is_valid = ast_ari_validate_string(
7505 if (!prop_is_valid) {
7506 ast_log(LOG_ERROR, "ARI RESTResponse field request_id failed validation\n");
7507 res = 0;
7508 }
7509 } else
7510 if (strcmp("status_code", ast_json_object_iter_key(iter)) == 0) {
7511 int prop_is_valid;
7512 has_status_code = 1;
7513 prop_is_valid = ast_ari_validate_int(
7515 if (!prop_is_valid) {
7516 ast_log(LOG_ERROR, "ARI RESTResponse field status_code failed validation\n");
7517 res = 0;
7518 }
7519 } else
7520 if (strcmp("transaction_id", ast_json_object_iter_key(iter)) == 0) {
7521 int prop_is_valid;
7522 has_transaction_id = 1;
7523 prop_is_valid = ast_ari_validate_string(
7525 if (!prop_is_valid) {
7526 ast_log(LOG_ERROR, "ARI RESTResponse field transaction_id failed validation\n");
7527 res = 0;
7528 }
7529 } else
7530 if (strcmp("uri", ast_json_object_iter_key(iter)) == 0) {
7531 int prop_is_valid;
7532 has_uri = 1;
7533 prop_is_valid = ast_ari_validate_string(
7535 if (!prop_is_valid) {
7536 ast_log(LOG_ERROR, "ARI RESTResponse field uri failed validation\n");
7537 res = 0;
7538 }
7539 } else
7540 {
7542 "ARI RESTResponse has undocumented field %s\n",
7544 res = 0;
7545 }
7546 }
7547
7548 if (!has_type) {
7549 ast_log(LOG_ERROR, "ARI RESTResponse missing required field type\n");
7550 res = 0;
7551 }
7552
7553 if (!has_application) {
7554 ast_log(LOG_ERROR, "ARI RESTResponse missing required field application\n");
7555 res = 0;
7556 }
7557
7558 if (!has_timestamp) {
7559 ast_log(LOG_ERROR, "ARI RESTResponse missing required field timestamp\n");
7560 res = 0;
7561 }
7562
7563 if (!has_reason_phrase) {
7564 ast_log(LOG_ERROR, "ARI RESTResponse missing required field reason_phrase\n");
7565 res = 0;
7566 }
7567
7568 if (!has_request_id) {
7569 ast_log(LOG_ERROR, "ARI RESTResponse missing required field request_id\n");
7570 res = 0;
7571 }
7572
7573 if (!has_status_code) {
7574 ast_log(LOG_ERROR, "ARI RESTResponse missing required field status_code\n");
7575 res = 0;
7576 }
7577
7578 if (!has_transaction_id) {
7579 ast_log(LOG_ERROR, "ARI RESTResponse missing required field transaction_id\n");
7580 res = 0;
7581 }
7582
7583 if (!has_uri) {
7584 ast_log(LOG_ERROR, "ARI RESTResponse missing required field uri\n");
7585 res = 0;
7586 }
7587
7588 return res;
7589}
7590
7592{
7594}
7595
7597{
7598 int res = 1;
7599 struct ast_json_iter *iter;
7600 int has_type = 0;
7601 int has_application = 0;
7602 int has_timestamp = 0;
7603 int has_recording = 0;
7604
7605 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7606 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7607 int prop_is_valid;
7608 prop_is_valid = ast_ari_validate_string(
7610 if (!prop_is_valid) {
7611 ast_log(LOG_ERROR, "ARI RecordingFailed field asterisk_id failed validation\n");
7612 res = 0;
7613 }
7614 } else
7615 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7616 int prop_is_valid;
7617 has_type = 1;
7618 prop_is_valid = ast_ari_validate_string(
7620 if (!prop_is_valid) {
7621 ast_log(LOG_ERROR, "ARI RecordingFailed field type failed validation\n");
7622 res = 0;
7623 }
7624 } else
7625 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7626 int prop_is_valid;
7627 has_application = 1;
7628 prop_is_valid = ast_ari_validate_string(
7630 if (!prop_is_valid) {
7631 ast_log(LOG_ERROR, "ARI RecordingFailed field application failed validation\n");
7632 res = 0;
7633 }
7634 } else
7635 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7636 int prop_is_valid;
7637 has_timestamp = 1;
7638 prop_is_valid = ast_ari_validate_date(
7640 if (!prop_is_valid) {
7641 ast_log(LOG_ERROR, "ARI RecordingFailed field timestamp failed validation\n");
7642 res = 0;
7643 }
7644 } else
7645 if (strcmp("recording", ast_json_object_iter_key(iter)) == 0) {
7646 int prop_is_valid;
7647 has_recording = 1;
7648 prop_is_valid = ast_ari_validate_live_recording(
7650 if (!prop_is_valid) {
7651 ast_log(LOG_ERROR, "ARI RecordingFailed field recording failed validation\n");
7652 res = 0;
7653 }
7654 } else
7655 {
7657 "ARI RecordingFailed has undocumented field %s\n",
7659 res = 0;
7660 }
7661 }
7662
7663 if (!has_type) {
7664 ast_log(LOG_ERROR, "ARI RecordingFailed missing required field type\n");
7665 res = 0;
7666 }
7667
7668 if (!has_application) {
7669 ast_log(LOG_ERROR, "ARI RecordingFailed missing required field application\n");
7670 res = 0;
7671 }
7672
7673 if (!has_timestamp) {
7674 ast_log(LOG_ERROR, "ARI RecordingFailed missing required field timestamp\n");
7675 res = 0;
7676 }
7677
7678 if (!has_recording) {
7679 ast_log(LOG_ERROR, "ARI RecordingFailed missing required field recording\n");
7680 res = 0;
7681 }
7682
7683 return res;
7684}
7685
7687{
7689}
7690
7692{
7693 int res = 1;
7694 struct ast_json_iter *iter;
7695 int has_type = 0;
7696 int has_application = 0;
7697 int has_timestamp = 0;
7698 int has_recording = 0;
7699
7700 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7701 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7702 int prop_is_valid;
7703 prop_is_valid = ast_ari_validate_string(
7705 if (!prop_is_valid) {
7706 ast_log(LOG_ERROR, "ARI RecordingFinished field asterisk_id failed validation\n");
7707 res = 0;
7708 }
7709 } else
7710 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7711 int prop_is_valid;
7712 has_type = 1;
7713 prop_is_valid = ast_ari_validate_string(
7715 if (!prop_is_valid) {
7716 ast_log(LOG_ERROR, "ARI RecordingFinished field type failed validation\n");
7717 res = 0;
7718 }
7719 } else
7720 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7721 int prop_is_valid;
7722 has_application = 1;
7723 prop_is_valid = ast_ari_validate_string(
7725 if (!prop_is_valid) {
7726 ast_log(LOG_ERROR, "ARI RecordingFinished field application failed validation\n");
7727 res = 0;
7728 }
7729 } else
7730 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7731 int prop_is_valid;
7732 has_timestamp = 1;
7733 prop_is_valid = ast_ari_validate_date(
7735 if (!prop_is_valid) {
7736 ast_log(LOG_ERROR, "ARI RecordingFinished field timestamp failed validation\n");
7737 res = 0;
7738 }
7739 } else
7740 if (strcmp("recording", ast_json_object_iter_key(iter)) == 0) {
7741 int prop_is_valid;
7742 has_recording = 1;
7743 prop_is_valid = ast_ari_validate_live_recording(
7745 if (!prop_is_valid) {
7746 ast_log(LOG_ERROR, "ARI RecordingFinished field recording failed validation\n");
7747 res = 0;
7748 }
7749 } else
7750 {
7752 "ARI RecordingFinished has undocumented field %s\n",
7754 res = 0;
7755 }
7756 }
7757
7758 if (!has_type) {
7759 ast_log(LOG_ERROR, "ARI RecordingFinished missing required field type\n");
7760 res = 0;
7761 }
7762
7763 if (!has_application) {
7764 ast_log(LOG_ERROR, "ARI RecordingFinished missing required field application\n");
7765 res = 0;
7766 }
7767
7768 if (!has_timestamp) {
7769 ast_log(LOG_ERROR, "ARI RecordingFinished missing required field timestamp\n");
7770 res = 0;
7771 }
7772
7773 if (!has_recording) {
7774 ast_log(LOG_ERROR, "ARI RecordingFinished missing required field recording\n");
7775 res = 0;
7776 }
7777
7778 return res;
7779}
7780
7782{
7784}
7785
7787{
7788 int res = 1;
7789 struct ast_json_iter *iter;
7790 int has_type = 0;
7791 int has_application = 0;
7792 int has_timestamp = 0;
7793 int has_recording = 0;
7794
7795 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7796 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7797 int prop_is_valid;
7798 prop_is_valid = ast_ari_validate_string(
7800 if (!prop_is_valid) {
7801 ast_log(LOG_ERROR, "ARI RecordingStarted field asterisk_id failed validation\n");
7802 res = 0;
7803 }
7804 } else
7805 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7806 int prop_is_valid;
7807 has_type = 1;
7808 prop_is_valid = ast_ari_validate_string(
7810 if (!prop_is_valid) {
7811 ast_log(LOG_ERROR, "ARI RecordingStarted field type failed validation\n");
7812 res = 0;
7813 }
7814 } else
7815 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7816 int prop_is_valid;
7817 has_application = 1;
7818 prop_is_valid = ast_ari_validate_string(
7820 if (!prop_is_valid) {
7821 ast_log(LOG_ERROR, "ARI RecordingStarted field application failed validation\n");
7822 res = 0;
7823 }
7824 } else
7825 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7826 int prop_is_valid;
7827 has_timestamp = 1;
7828 prop_is_valid = ast_ari_validate_date(
7830 if (!prop_is_valid) {
7831 ast_log(LOG_ERROR, "ARI RecordingStarted field timestamp failed validation\n");
7832 res = 0;
7833 }
7834 } else
7835 if (strcmp("recording", ast_json_object_iter_key(iter)) == 0) {
7836 int prop_is_valid;
7837 has_recording = 1;
7838 prop_is_valid = ast_ari_validate_live_recording(
7840 if (!prop_is_valid) {
7841 ast_log(LOG_ERROR, "ARI RecordingStarted field recording failed validation\n");
7842 res = 0;
7843 }
7844 } else
7845 {
7847 "ARI RecordingStarted has undocumented field %s\n",
7849 res = 0;
7850 }
7851 }
7852
7853 if (!has_type) {
7854 ast_log(LOG_ERROR, "ARI RecordingStarted missing required field type\n");
7855 res = 0;
7856 }
7857
7858 if (!has_application) {
7859 ast_log(LOG_ERROR, "ARI RecordingStarted missing required field application\n");
7860 res = 0;
7861 }
7862
7863 if (!has_timestamp) {
7864 ast_log(LOG_ERROR, "ARI RecordingStarted missing required field timestamp\n");
7865 res = 0;
7866 }
7867
7868 if (!has_recording) {
7869 ast_log(LOG_ERROR, "ARI RecordingStarted missing required field recording\n");
7870 res = 0;
7871 }
7872
7873 return res;
7874}
7875
7877{
7879}
7880
7882{
7883 int res = 1;
7884 struct ast_json_iter *iter;
7885 int has_requested_destination = 0;
7886
7887 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7888 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
7889 int prop_is_valid;
7890 prop_is_valid = ast_ari_validate_bridge(
7892 if (!prop_is_valid) {
7893 ast_log(LOG_ERROR, "ARI ReferTo field bridge failed validation\n");
7894 res = 0;
7895 }
7896 } else
7897 if (strcmp("connected_channel", ast_json_object_iter_key(iter)) == 0) {
7898 int prop_is_valid;
7899 prop_is_valid = ast_ari_validate_channel(
7901 if (!prop_is_valid) {
7902 ast_log(LOG_ERROR, "ARI ReferTo field connected_channel failed validation\n");
7903 res = 0;
7904 }
7905 } else
7906 if (strcmp("destination_channel", ast_json_object_iter_key(iter)) == 0) {
7907 int prop_is_valid;
7908 prop_is_valid = ast_ari_validate_channel(
7910 if (!prop_is_valid) {
7911 ast_log(LOG_ERROR, "ARI ReferTo field destination_channel failed validation\n");
7912 res = 0;
7913 }
7914 } else
7915 if (strcmp("requested_destination", ast_json_object_iter_key(iter)) == 0) {
7916 int prop_is_valid;
7917 has_requested_destination = 1;
7920 if (!prop_is_valid) {
7921 ast_log(LOG_ERROR, "ARI ReferTo field requested_destination failed validation\n");
7922 res = 0;
7923 }
7924 } else
7925 {
7927 "ARI ReferTo has undocumented field %s\n",
7929 res = 0;
7930 }
7931 }
7932
7933 if (!has_requested_destination) {
7934 ast_log(LOG_ERROR, "ARI ReferTo missing required field requested_destination\n");
7935 res = 0;
7936 }
7937
7938 return res;
7939}
7940
7942{
7944}
7945
7947{
7948 int res = 1;
7949 struct ast_json_iter *iter;
7950 int has_source_channel = 0;
7951
7952 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7953 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
7954 int prop_is_valid;
7955 prop_is_valid = ast_ari_validate_bridge(
7957 if (!prop_is_valid) {
7958 ast_log(LOG_ERROR, "ARI ReferredBy field bridge failed validation\n");
7959 res = 0;
7960 }
7961 } else
7962 if (strcmp("connected_channel", ast_json_object_iter_key(iter)) == 0) {
7963 int prop_is_valid;
7964 prop_is_valid = ast_ari_validate_channel(
7966 if (!prop_is_valid) {
7967 ast_log(LOG_ERROR, "ARI ReferredBy field connected_channel failed validation\n");
7968 res = 0;
7969 }
7970 } else
7971 if (strcmp("source_channel", ast_json_object_iter_key(iter)) == 0) {
7972 int prop_is_valid;
7973 has_source_channel = 1;
7974 prop_is_valid = ast_ari_validate_channel(
7976 if (!prop_is_valid) {
7977 ast_log(LOG_ERROR, "ARI ReferredBy field source_channel failed validation\n");
7978 res = 0;
7979 }
7980 } else
7981 {
7983 "ARI ReferredBy has undocumented field %s\n",
7985 res = 0;
7986 }
7987 }
7988
7989 if (!has_source_channel) {
7990 ast_log(LOG_ERROR, "ARI ReferredBy missing required field source_channel\n");
7991 res = 0;
7992 }
7993
7994 return res;
7995}
7996
7998{
8000}
8001
8003{
8004 int res = 1;
8005 struct ast_json_iter *iter;
8006
8007 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
8008 if (strcmp("additional_protocol_params", ast_json_object_iter_key(iter)) == 0) {
8009 int prop_is_valid;
8010 prop_is_valid = ast_ari_validate_list(
8013 if (!prop_is_valid) {
8014 ast_log(LOG_ERROR, "ARI RequiredDestination field additional_protocol_params failed validation\n");
8015 res = 0;
8016 }
8017 } else
8018 if (strcmp("destination", ast_json_object_iter_key(iter)) == 0) {
8019 int prop_is_valid;
8020 prop_is_valid = ast_ari_validate_string(
8022 if (!prop_is_valid) {
8023 ast_log(LOG_ERROR, "ARI RequiredDestination field destination failed validation\n");
8024 res = 0;
8025 }
8026 } else
8027 if (strcmp("protocol_id", ast_json_object_iter_key(iter)) == 0) {
8028 int prop_is_valid;
8029 prop_is_valid = ast_ari_validate_string(
8031 if (!prop_is_valid) {
8032 ast_log(LOG_ERROR, "ARI RequiredDestination field protocol_id failed validation\n");
8033 res = 0;
8034 }
8035 } else
8036 {
8038 "ARI RequiredDestination has undocumented field %s\n",
8040 res = 0;
8041 }
8042 }
8043
8044 return res;
8045}
8046
8048{
8050}
8051
8053{
8054 int res = 1;
8055 struct ast_json_iter *iter;
8056 int has_type = 0;
8057 int has_application = 0;
8058 int has_timestamp = 0;
8059 int has_channel = 0;
8060
8061 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
8062 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
8063 int prop_is_valid;
8064 prop_is_valid = ast_ari_validate_string(
8066 if (!prop_is_valid) {
8067 ast_log(LOG_ERROR, "ARI StasisEnd field asterisk_id failed validation\n");
8068 res = 0;
8069 }
8070 } else
8071 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
8072 int prop_is_valid;
8073 has_type = 1;
8074 prop_is_valid = ast_ari_validate_string(
8076 if (!prop_is_valid) {
8077 ast_log(LOG_ERROR, "ARI StasisEnd field type failed validation\n");
8078 res = 0;
8079 }
8080 } else
8081 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
8082 int prop_is_valid;
8083 has_application = 1;
8084 prop_is_valid = ast_ari_validate_string(
8086 if (!prop_is_valid) {
8087 ast_log(LOG_ERROR, "ARI StasisEnd field application failed validation\n");
8088 res = 0;
8089 }
8090 } else
8091 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
8092 int prop_is_valid;
8093 has_timestamp = 1;
8094 prop_is_valid = ast_ari_validate_date(
8096 if (!prop_is_valid) {
8097 ast_log(LOG_ERROR, "ARI StasisEnd field timestamp failed validation\n");
8098 res = 0;
8099 }
8100 } else
8101 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
8102 int prop_is_valid;
8103 has_channel = 1;
8104 prop_is_valid = ast_ari_validate_channel(
8106 if (!prop_is_valid) {
8107 ast_log(LOG_ERROR, "ARI StasisEnd field channel failed validation\n");
8108 res = 0;
8109 }
8110 } else
8111 {
8113 "ARI StasisEnd has undocumented field %s\n",
8115 res = 0;
8116 }
8117 }
8118
8119 if (!has_type) {
8120 ast_log(LOG_ERROR, "ARI StasisEnd missing required field type\n");
8121 res = 0;
8122 }
8123
8124 if (!has_application) {
8125 ast_log(LOG_ERROR, "ARI StasisEnd missing required field application\n");
8126 res = 0;
8127 }
8128
8129 if (!has_timestamp) {
8130 ast_log(LOG_ERROR, "ARI StasisEnd missing required field timestamp\n");
8131 res = 0;
8132 }
8133
8134 if (!has_channel) {
8135 ast_log(LOG_ERROR, "ARI StasisEnd missing required field channel\n");
8136 res = 0;
8137 }
8138
8139 return res;
8140}
8141
8143{
8145}
8146
8148{
8149 int res = 1;
8150 struct ast_json_iter *iter;
8151 int has_type = 0;
8152 int has_application = 0;
8153 int has_timestamp = 0;
8154 int has_args = 0;
8155 int has_channel = 0;
8156
8157 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
8158 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
8159 int prop_is_valid;
8160 prop_is_valid = ast_ari_validate_string(
8162 if (!prop_is_valid) {
8163 ast_log(LOG_ERROR, "ARI StasisStart field asterisk_id failed validation\n");
8164 res = 0;
8165 }
8166 } else
8167 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
8168 int prop_is_valid;
8169 has_type = 1;
8170 prop_is_valid = ast_ari_validate_string(
8172 if (!prop_is_valid) {
8173 ast_log(LOG_ERROR, "ARI StasisStart field type failed validation\n");
8174 res = 0;
8175 }
8176 } else
8177 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
8178 int prop_is_valid;
8179 has_application = 1;
8180 prop_is_valid = ast_ari_validate_string(
8182 if (!prop_is_valid) {
8183 ast_log(LOG_ERROR, "ARI StasisStart field application failed validation\n");
8184 res = 0;
8185 }
8186 } else
8187 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
8188 int prop_is_valid;
8189 has_timestamp = 1;
8190 prop_is_valid = ast_ari_validate_date(
8192 if (!prop_is_valid) {
8193 ast_log(LOG_ERROR, "ARI StasisStart field timestamp failed validation\n");
8194 res = 0;
8195 }
8196 } else
8197 if (strcmp("args", ast_json_object_iter_key(iter)) == 0) {
8198 int prop_is_valid;
8199 has_args = 1;
8200 prop_is_valid = ast_ari_validate_list(
8203 if (!prop_is_valid) {
8204 ast_log(LOG_ERROR, "ARI StasisStart field args failed validation\n");
8205 res = 0;
8206 }
8207 } else
8208 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
8209 int prop_is_valid;
8210 has_channel = 1;
8211 prop_is_valid = ast_ari_validate_channel(
8213 if (!prop_is_valid) {
8214 ast_log(LOG_ERROR, "ARI StasisStart field channel failed validation\n");
8215 res = 0;
8216 }
8217 } else
8218 if (strcmp("replace_channel", ast_json_object_iter_key(iter)) == 0) {
8219 int prop_is_valid;
8220 prop_is_valid = ast_ari_validate_channel(
8222 if (!prop_is_valid) {
8223 ast_log(LOG_ERROR, "ARI StasisStart field replace_channel failed validation\n");
8224 res = 0;
8225 }
8226 } else
8227 {
8229 "ARI StasisStart has undocumented field %s\n",
8231 res = 0;
8232 }
8233 }
8234
8235 if (!has_type) {
8236 ast_log(LOG_ERROR, "ARI StasisStart missing required field type\n");
8237 res = 0;
8238 }
8239
8240 if (!has_application) {
8241 ast_log(LOG_ERROR, "ARI StasisStart missing required field application\n");
8242 res = 0;
8243 }
8244
8245 if (!has_timestamp) {
8246 ast_log(LOG_ERROR, "ARI StasisStart missing required field timestamp\n");
8247 res = 0;
8248 }
8249
8250 if (!has_args) {
8251 ast_log(LOG_ERROR, "ARI StasisStart missing required field args\n");
8252 res = 0;
8253 }
8254
8255 if (!has_channel) {
8256 ast_log(LOG_ERROR, "ARI StasisStart missing required field channel\n");
8257 res = 0;
8258 }
8259
8260 return res;
8261}
8262
8264{
8266}
8267
8269{
8270 int res = 1;
8271 struct ast_json_iter *iter;
8272 int has_type = 0;
8273 int has_application = 0;
8274 int has_timestamp = 0;
8275 int has_message = 0;
8276
8277 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
8278 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
8279 int prop_is_valid;
8280 prop_is_valid = ast_ari_validate_string(
8282 if (!prop_is_valid) {
8283 ast_log(LOG_ERROR, "ARI TextMessageReceived field asterisk_id failed validation\n");
8284 res = 0;
8285 }
8286 } else
8287 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
8288 int prop_is_valid;
8289 has_type = 1;
8290 prop_is_valid = ast_ari_validate_string(
8292 if (!prop_is_valid) {
8293 ast_log(LOG_ERROR, "ARI TextMessageReceived field type failed validation\n");
8294 res = 0;
8295 }
8296 } else
8297 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
8298 int prop_is_valid;
8299 has_application = 1;
8300 prop_is_valid = ast_ari_validate_string(
8302 if (!prop_is_valid) {
8303 ast_log(LOG_ERROR, "ARI TextMessageReceived field application failed validation\n");
8304 res = 0;
8305 }
8306 } else
8307 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
8308 int prop_is_valid;
8309 has_timestamp = 1;
8310 prop_is_valid = ast_ari_validate_date(
8312 if (!prop_is_valid) {
8313 ast_log(LOG_ERROR, "ARI TextMessageReceived field timestamp failed validation\n");
8314 res = 0;
8315 }
8316 } else
8317 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
8318 int prop_is_valid;
8319 prop_is_valid = ast_ari_validate_endpoint(
8321 if (!prop_is_valid) {
8322 ast_log(LOG_ERROR, "ARI TextMessageReceived field endpoint failed validation\n");
8323 res = 0;
8324 }
8325 } else
8326 if (strcmp("message", ast_json_object_iter_key(iter)) == 0) {
8327 int prop_is_valid;
8328 has_message = 1;
8329 prop_is_valid = ast_ari_validate_text_message(
8331 if (!prop_is_valid) {
8332 ast_log(LOG_ERROR, "ARI TextMessageReceived field message failed validation\n");
8333 res = 0;
8334 }
8335 } else
8336 {
8338 "ARI TextMessageReceived has undocumented field %s\n",
8340 res = 0;
8341 }
8342 }
8343
8344 if (!has_type) {
8345 ast_log(LOG_ERROR, "ARI TextMessageReceived missing required field type\n");
8346 res = 0;
8347 }
8348
8349 if (!has_application) {
8350 ast_log(LOG_ERROR, "ARI TextMessageReceived missing required field application\n");
8351 res = 0;
8352 }
8353
8354 if (!has_timestamp) {
8355 ast_log(LOG_ERROR, "ARI TextMessageReceived missing required field timestamp\n");
8356 res = 0;
8357 }
8358
8359 if (!has_message) {
8360 ast_log(LOG_ERROR, "ARI TextMessageReceived missing required field message\n");
8361 res = 0;
8362 }
8363
8364 return res;
8365}
8366
8368{
8370}
8371
8373{
8374 int res = 1;
8375 struct ast_json_iter *iter;
8376 int has_bridge_ids = 0;
8377 int has_channel_ids = 0;
8378 int has_device_names = 0;
8379 int has_endpoint_ids = 0;
8380 int has_events_allowed = 0;
8381 int has_events_disallowed = 0;
8382 int has_name = 0;
8383
8384 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
8385 if (strcmp("bridge_ids", ast_json_object_iter_key(iter)) == 0) {
8386 int prop_is_valid;
8387 has_bridge_ids = 1;
8388 prop_is_valid = ast_ari_validate_list(
8391 if (!prop_is_valid) {
8392 ast_log(LOG_ERROR, "ARI Application field bridge_ids failed validation\n");
8393 res = 0;
8394 }
8395 } else
8396 if (strcmp("channel_ids", ast_json_object_iter_key(iter)) == 0) {
8397 int prop_is_valid;
8398 has_channel_ids = 1;
8399 prop_is_valid = ast_ari_validate_list(
8402 if (!prop_is_valid) {
8403 ast_log(LOG_ERROR, "ARI Application field channel_ids failed validation\n");
8404 res = 0;
8405 }
8406 } else
8407 if (strcmp("device_names", ast_json_object_iter_key(iter)) == 0) {
8408 int prop_is_valid;
8409 has_device_names = 1;
8410 prop_is_valid = ast_ari_validate_list(
8413 if (!prop_is_valid) {
8414 ast_log(LOG_ERROR, "ARI Application field device_names failed validation\n");
8415 res = 0;
8416 }
8417 } else
8418 if (strcmp("endpoint_ids", ast_json_object_iter_key(iter)) == 0) {
8419 int prop_is_valid;
8420 has_endpoint_ids = 1;
8421 prop_is_valid = ast_ari_validate_list(
8424 if (!prop_is_valid) {
8425 ast_log(LOG_ERROR, "ARI Application field endpoint_ids failed validation\n");
8426 res = 0;
8427 }
8428 } else
8429 if (strcmp("events_allowed", ast_json_object_iter_key(iter)) == 0) {
8430 int prop_is_valid;
8431 has_events_allowed = 1;
8432 prop_is_valid = ast_ari_validate_list(
8435 if (!prop_is_valid) {
8436 ast_log(LOG_ERROR, "ARI Application field events_allowed failed validation\n");
8437 res = 0;
8438 }
8439 } else
8440 if (strcmp("events_disallowed", ast_json_object_iter_key(iter)) == 0) {
8441 int prop_is_valid;
8442 has_events_disallowed = 1;
8443 prop_is_valid = ast_ari_validate_list(
8446 if (!prop_is_valid) {
8447 ast_log(LOG_ERROR, "ARI Application field events_disallowed failed validation\n");
8448 res = 0;
8449 }
8450 } else
8451 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
8452 int prop_is_valid;
8453 has_name = 1;
8454 prop_is_valid = ast_ari_validate_string(
8456 if (!prop_is_valid) {
8457 ast_log(LOG_ERROR, "ARI Application field name failed validation\n");
8458 res = 0;
8459 }
8460 } else
8461 {
8463 "ARI Application has undocumented field %s\n",
8465 res = 0;
8466 }
8467 }
8468
8469 if (!has_bridge_ids) {
8470 ast_log(LOG_ERROR, "ARI Application missing required field bridge_ids\n");
8471 res = 0;
8472 }
8473
8474 if (!has_channel_ids) {
8475 ast_log(LOG_ERROR, "ARI Application missing required field channel_ids\n");
8476 res = 0;
8477 }
8478
8479 if (!has_device_names) {
8480 ast_log(LOG_ERROR, "ARI Application missing required field device_names\n");
8481 res = 0;
8482 }
8483
8484 if (!has_endpoint_ids) {
8485 ast_log(LOG_ERROR, "ARI Application missing required field endpoint_ids\n");
8486 res = 0;
8487 }
8488
8489 if (!has_events_allowed) {
8490 ast_log(LOG_ERROR, "ARI Application missing required field events_allowed\n");
8491 res = 0;
8492 }
8493
8494 if (!has_events_disallowed) {
8495 ast_log(LOG_ERROR, "ARI Application missing required field events_disallowed\n");
8496 res = 0;
8497 }
8498
8499 if (!has_name) {
8500 ast_log(LOG_ERROR, "ARI Application missing required field name\n");
8501 res = 0;
8502 }
8503
8504 return res;
8505}
8506
8508{
8510}
ari_validator ast_ari_validate_restheader_fn(void)
Function pointer to ast_ari_validate_restheader().
ari_validator ast_ari_validate_set_id_fn(void)
Function pointer to ast_ari_validate_set_id().
ari_validator ast_ari_validate_config_info_fn(void)
Function pointer to ast_ari_validate_config_info().
ari_validator ast_ari_validate_sound_fn(void)
Function pointer to ast_ari_validate_sound().
int ast_ari_validate_missing_params(struct ast_json *json)
Validator for MissingParams.
int ast_ari_validate_variable(struct ast_json *json)
Validator for Variable.
ari_validator ast_ari_validate_live_recording_fn(void)
Function pointer to ast_ari_validate_live_recording().
int ast_ari_validate_application_replaced(struct ast_json *json)
Validator for ApplicationReplaced.
int ast_ari_validate_log_channel(struct ast_json *json)
Validator for LogChannel.
ari_validator ast_ari_validate_peer_fn(void)
Function pointer to ast_ari_validate_peer().
ari_validator ast_ari_validate_channel_talking_started_fn(void)
Function pointer to ast_ari_validate_channel_talking_started().
ari_validator ast_ari_validate_asterisk_ping_fn(void)
Function pointer to ast_ari_validate_asterisk_ping().
ari_validator ast_ari_validate_application_fn(void)
Function pointer to ast_ari_validate_application().
ari_validator ast_ari_validate_application_replaced_fn(void)
Function pointer to ast_ari_validate_application_replaced().
int ast_ari_validate_text_message_received(struct ast_json *json)
Validator for TextMessageReceived.
ari_validator ast_ari_validate_channel_dtmf_received_fn(void)
Function pointer to ast_ari_validate_channel_dtmf_received().
ari_validator ast_ari_validate_contact_status_change_fn(void)
Function pointer to ast_ari_validate_contact_status_change().
ari_validator ast_ari_validate_bridge_destroyed_fn(void)
Function pointer to ast_ari_validate_bridge_destroyed().
int ast_ari_validate_playback_finished(struct ast_json *json)
Validator for PlaybackFinished.
ari_validator ast_ari_validate_build_info_fn(void)
Function pointer to ast_ari_validate_build_info().
ari_validator ast_ari_validate_recording_started_fn(void)
Function pointer to ast_ari_validate_recording_started().
ari_validator ast_ari_validate_contact_info_fn(void)
Function pointer to ast_ari_validate_contact_info().
int ast_ari_validate_text_message(struct ast_json *json)
Validator for TextMessage.
int ast_ari_validate_bridge_blind_transfer(struct ast_json *json)
Validator for BridgeBlindTransfer.
int ast_ari_validate_channel_destroyed(struct ast_json *json)
Validator for ChannelDestroyed.
ari_validator ast_ari_validate_playback_started_fn(void)
Function pointer to ast_ari_validate_playback_started().
int ast_ari_validate_endpoint_state_change(struct ast_json *json)
Validator for EndpointStateChange.
int ast_ari_validate_restrequest(struct ast_json *json)
Validator for RESTRequest.
int ast_ari_validate_playback(struct ast_json *json)
Validator for Playback.
ari_validator ast_ari_validate_playback_continuing_fn(void)
Function pointer to ast_ari_validate_playback_continuing().
int ast_ari_validate_channel_tone_detected(struct ast_json *json)
Validator for ChannelToneDetected.
ari_validator ast_ari_validate_application_registered_fn(void)
Function pointer to ast_ari_validate_application_registered().
ari_validator ast_ari_validate_stasis_end_fn(void)
Function pointer to ast_ari_validate_stasis_end().
ari_validator ast_ari_validate_variable_fn(void)
Function pointer to ast_ari_validate_variable().
ari_validator ast_ari_validate_application_unregistered_fn(void)
Function pointer to ast_ari_validate_application_unregistered().
ari_validator ast_ari_validate_channel_left_bridge_fn(void)
Function pointer to ast_ari_validate_channel_left_bridge().
int ast_ari_validate_application(struct ast_json *json)
Validator for Application.
int ast_ari_validate_dialed(struct ast_json *json)
Validator for Dialed.
int ast_ari_validate_live_recording(struct ast_json *json)
Validator for LiveRecording.
ari_validator ast_ari_validate_stored_recording_fn(void)
Function pointer to ast_ari_validate_stored_recording().
ari_validator ast_ari_validate_channel_userevent_fn(void)
Function pointer to ast_ari_validate_channel_userevent().
ari_validator ast_ari_validate_channel_created_fn(void)
Function pointer to ast_ari_validate_channel_created().
ari_validator ast_ari_validate_refer_to_fn(void)
Function pointer to ast_ari_validate_refer_to().
int ast_ari_validate_module(struct ast_json *json)
Validator for Module.
int ast_ari_validate_additional_param(struct ast_json *json)
Validator for AdditionalParam.
int ast_ari_validate_stasis_start(struct ast_json *json)
Validator for StasisStart.
ari_validator ast_ari_validate_required_destination_fn(void)
Function pointer to ast_ari_validate_required_destination().
ari_validator ast_ari_validate_channel_talking_finished_fn(void)
Function pointer to ast_ari_validate_channel_talking_finished().
int ast_ari_validate_mailbox(struct ast_json *json)
Validator for Mailbox.
ari_validator ast_ari_validate_playback_finished_fn(void)
Function pointer to ast_ari_validate_playback_finished().
ari_validator ast_ari_validate_channel_tone_detected_fn(void)
Function pointer to ast_ari_validate_channel_tone_detected().
int ast_ari_validate_channel_hangup_request(struct ast_json *json)
Validator for ChannelHangupRequest.
int ast_ari_validate_bridge(struct ast_json *json)
Validator for Bridge.
int ast_ari_validate_message(struct ast_json *json)
Validator for Message.
ari_validator ast_ari_validate_dialed_fn(void)
Function pointer to ast_ari_validate_dialed().
int ast_ari_validate_contact_info(struct ast_json *json)
Validator for ContactInfo.
int ast_ari_validate_refer_to(struct ast_json *json)
Validator for ReferTo.
int ast_ari_validate_dialplan_cep(struct ast_json *json)
Validator for DialplanCEP.
int ast_ari_validate_set_id(struct ast_json *json)
Validator for SetId.
ari_validator ast_ari_validate_channel_varset_fn(void)
Function pointer to ast_ari_validate_channel_varset().
ari_validator ast_ari_validate_playback_fn(void)
Function pointer to ast_ari_validate_playback().
ari_validator ast_ari_validate_system_info_fn(void)
Function pointer to ast_ari_validate_system_info().
ari_validator ast_ari_validate_caller_id_fn(void)
Function pointer to ast_ari_validate_caller_id().
int ast_ari_validate_stasis_end(struct ast_json *json)
Validator for StasisEnd.
ari_validator ast_ari_validate_dialplan_cep_fn(void)
Function pointer to ast_ari_validate_dialplan_cep().
int ast_ari_validate_playback_started(struct ast_json *json)
Validator for PlaybackStarted.
ari_validator ast_ari_validate_bridge_blind_transfer_fn(void)
Function pointer to ast_ari_validate_bridge_blind_transfer().
int ast_ari_validate_bridge_attended_transfer(struct ast_json *json)
Validator for BridgeAttendedTransfer.
ari_validator ast_ari_validate_additional_param_fn(void)
Function pointer to ast_ari_validate_additional_param().
int ast_ari_validate_channel_dialplan(struct ast_json *json)
Validator for ChannelDialplan.
int ast_ari_validate_channel_state_change(struct ast_json *json)
Validator for ChannelStateChange.
ari_validator ast_ari_validate_bridge_attended_transfer_fn(void)
Function pointer to ast_ari_validate_bridge_attended_transfer().
int ast_ari_validate_channel_talking_finished(struct ast_json *json)
Validator for ChannelTalkingFinished.
ari_validator ast_ari_validate_missing_params_fn(void)
Function pointer to ast_ari_validate_missing_params().
int ast_ari_validate_channel_dtmf_received(struct ast_json *json)
Validator for ChannelDtmfReceived.
ari_validator ast_ari_validate_restquery_string_parameter_fn(void)
Function pointer to ast_ari_validate_restquery_string_parameter().
ari_validator ast_ari_validate_config_tuple_fn(void)
Function pointer to ast_ari_validate_config_tuple().
int ast_ari_validate_peer_status_change(struct ast_json *json)
Validator for PeerStatusChange.
int ast_ari_validate_restquery_string_parameter(struct ast_json *json)
Validator for RESTQueryStringParameter.
int ast_ari_validate_bridge_created(struct ast_json *json)
Validator for BridgeCreated.
ari_validator ast_ari_validate_dial_fn(void)
Function pointer to ast_ari_validate_dial().
ari_validator ast_ari_validate_bridge_fn(void)
Function pointer to ast_ari_validate_bridge().
ari_validator ast_ari_validate_event_fn(void)
Function pointer to ast_ari_validate_event().
int ast_ari_validate_application_move_failed(struct ast_json *json)
Validator for ApplicationMoveFailed.
ari_validator ast_ari_validate_message_fn(void)
Function pointer to ast_ari_validate_message().
int ast_ari_validate_asterisk_info(struct ast_json *json)
Validator for AsteriskInfo.
int ast_ari_validate_channel_varset(struct ast_json *json)
Validator for ChannelVarset.
int ast_ari_validate_referred_by(struct ast_json *json)
Validator for ReferredBy.
int ast_ari_validate_asterisk_ping(struct ast_json *json)
Validator for AsteriskPing.
ari_validator ast_ari_validate_recording_finished_fn(void)
Function pointer to ast_ari_validate_recording_finished().
int ast_ari_validate_stored_recording(struct ast_json *json)
Validator for StoredRecording.
int ast_ari_validate_bridge_destroyed(struct ast_json *json)
Validator for BridgeDestroyed.
ari_validator ast_ari_validate_mailbox_fn(void)
Function pointer to ast_ari_validate_mailbox().
ari_validator ast_ari_validate_status_info_fn(void)
Function pointer to ast_ari_validate_status_info().
int ast_ari_validate_format_lang_pair(struct ast_json *json)
Validator for FormatLangPair.
int ast_ari_validate_application_registered(struct ast_json *json)
Validator for ApplicationRegistered.
int ast_ari_validate_caller_id(struct ast_json *json)
Validator for CallerID.
int ast_ari_validate_endpoint(struct ast_json *json)
Validator for Endpoint.
int ast_ari_validate_status_info(struct ast_json *json)
Validator for StatusInfo.
ari_validator ast_ari_validate_log_channel_fn(void)
Function pointer to ast_ari_validate_log_channel().
ari_validator ast_ari_validate_rtpstat_fn(void)
Function pointer to ast_ari_validate_rtpstat().
int ast_ari_validate_playback_continuing(struct ast_json *json)
Validator for PlaybackContinuing.
int ast_ari_validate_channel_caller_id(struct ast_json *json)
Validator for ChannelCallerId.
ari_validator ast_ari_validate_peer_status_change_fn(void)
Function pointer to ast_ari_validate_peer_status_change().
ari_validator ast_ari_validate_text_message_fn(void)
Function pointer to ast_ari_validate_text_message().
ari_validator ast_ari_validate_restrequest_fn(void)
Function pointer to ast_ari_validate_restrequest().
int ast_ari_validate_required_destination(struct ast_json *json)
Validator for RequiredDestination.
ari_validator ast_ari_validate_stasis_start_fn(void)
Function pointer to ast_ari_validate_stasis_start().
int ast_ari_validate_recording_finished(struct ast_json *json)
Validator for RecordingFinished.
ari_validator ast_ari_validate_channel_connected_line_fn(void)
Function pointer to ast_ari_validate_channel_connected_line().
ari_validator ast_ari_validate_channel_dialplan_fn(void)
Function pointer to ast_ari_validate_channel_dialplan().
ari_validator ast_ari_validate_text_message_received_fn(void)
Function pointer to ast_ari_validate_text_message_received().
int ast_ari_validate_device_state(struct ast_json *json)
Validator for DeviceState.
int ast_ari_validate_channel_left_bridge(struct ast_json *json)
Validator for ChannelLeftBridge.
int ast_ari_validate_device_state_changed(struct ast_json *json)
Validator for DeviceStateChanged.
int ast_ari_validate_channel_entered_bridge(struct ast_json *json)
Validator for ChannelEnteredBridge.
ari_validator ast_ari_validate_recording_failed_fn(void)
Function pointer to ast_ari_validate_recording_failed().
int ast_ari_validate_restresponse(struct ast_json *json)
Validator for RESTResponse.
int ast_ari_validate_channel_unhold(struct ast_json *json)
Validator for ChannelUnhold.
ari_validator ast_ari_validate_device_state_fn(void)
Function pointer to ast_ari_validate_device_state().
ari_validator ast_ari_validate_bridge_video_source_changed_fn(void)
Function pointer to ast_ari_validate_bridge_video_source_changed().
int ast_ari_validate_event(struct ast_json *json)
Validator for Event.
int ast_ari_validate_bridge_video_source_changed(struct ast_json *json)
Validator for BridgeVideoSourceChanged.
int ast_ari_validate_system_info(struct ast_json *json)
Validator for SystemInfo.
ari_validator ast_ari_validate_channel_hold_fn(void)
Function pointer to ast_ari_validate_channel_hold().
int ast_ari_validate_recording_started(struct ast_json *json)
Validator for RecordingStarted.
int ast_ari_validate_channel(struct ast_json *json)
Validator for Channel.
ari_validator ast_ari_validate_module_fn(void)
Function pointer to ast_ari_validate_module().
int ast_ari_validate_build_info(struct ast_json *json)
Validator for BuildInfo.
int ast_ari_validate_rtpstat(struct ast_json *json)
Validator for RTPstat.
int ast_ari_validate_recording_failed(struct ast_json *json)
Validator for RecordingFailed.
int ast_ari_validate_contact_status_change(struct ast_json *json)
Validator for ContactStatusChange.
ari_validator ast_ari_validate_restresponse_fn(void)
Function pointer to ast_ari_validate_restresponse().
ari_validator ast_ari_validate_channel_caller_id_fn(void)
Function pointer to ast_ari_validate_channel_caller_id().
ari_validator ast_ari_validate_channel_state_change_fn(void)
Function pointer to ast_ari_validate_channel_state_change().
ari_validator ast_ari_validate_referred_by_fn(void)
Function pointer to ast_ari_validate_referred_by().
ari_validator ast_ari_validate_format_lang_pair_fn(void)
Function pointer to ast_ari_validate_format_lang_pair().
ari_validator ast_ari_validate_application_move_failed_fn(void)
Function pointer to ast_ari_validate_application_move_failed().
int ast_ari_validate_config_info(struct ast_json *json)
Validator for ConfigInfo.
ari_validator ast_ari_validate_channel_entered_bridge_fn(void)
Function pointer to ast_ari_validate_channel_entered_bridge().
ari_validator ast_ari_validate_channel_destroyed_fn(void)
Function pointer to ast_ari_validate_channel_destroyed().
ari_validator ast_ari_validate_endpoint_state_change_fn(void)
Function pointer to ast_ari_validate_endpoint_state_change().
int ast_ari_validate_restheader(struct ast_json *json)
Validator for RESTHeader.
ari_validator ast_ari_validate_channel_hangup_request_fn(void)
Function pointer to ast_ari_validate_channel_hangup_request().
int ast_ari_validate_config_tuple(struct ast_json *json)
Validator for ConfigTuple.
int ast_ari_validate_sound(struct ast_json *json)
Validator for Sound.
int ast_ari_validate_dial(struct ast_json *json)
Validator for Dial.
int ast_ari_validate_channel_created(struct ast_json *json)
Validator for ChannelCreated.
ari_validator ast_ari_validate_device_state_changed_fn(void)
Function pointer to ast_ari_validate_device_state_changed().
int ast_ari_validate_channel_userevent(struct ast_json *json)
Validator for ChannelUserevent.
int ast_ari_validate_application_unregistered(struct ast_json *json)
Validator for ApplicationUnregistered.
int ast_ari_validate_bridge_merged(struct ast_json *json)
Validator for BridgeMerged.
int ast_ari_validate_channel_talking_started(struct ast_json *json)
Validator for ChannelTalkingStarted.
ari_validator ast_ari_validate_channel_unhold_fn(void)
Function pointer to ast_ari_validate_channel_unhold().
int ast_ari_validate_peer(struct ast_json *json)
Validator for Peer.
int ast_ari_validate_channel_transfer(struct ast_json *json)
Validator for ChannelTransfer.
int ast_ari_validate_channel_connected_line(struct ast_json *json)
Validator for ChannelConnectedLine.
ari_validator ast_ari_validate_channel_transfer_fn(void)
Function pointer to ast_ari_validate_channel_transfer().
ari_validator ast_ari_validate_bridge_merged_fn(void)
Function pointer to ast_ari_validate_bridge_merged().
ari_validator ast_ari_validate_channel_fn(void)
Function pointer to ast_ari_validate_channel().
ari_validator ast_ari_validate_endpoint_fn(void)
Function pointer to ast_ari_validate_endpoint().
ari_validator ast_ari_validate_bridge_created_fn(void)
Function pointer to ast_ari_validate_bridge_created().
ari_validator ast_ari_validate_asterisk_info_fn(void)
Function pointer to ast_ari_validate_asterisk_info().
int ast_ari_validate_channel_hold(struct ast_json *json)
Validator for ChannelHold.
Generated file - Build validators for ARI model objects.
int ast_ari_validate_object(struct ast_json *json)
Validator for native Swagger object.
Definition: res_ari_model.c:96
int ast_ari_validate_int(struct ast_json *json)
Validator for native Swagger int.
int ast_ari_validate_long(struct ast_json *json)
Validator for native Swagger long.
int ast_ari_validate_string(struct ast_json *json)
Validator for native Swagger string.
int ast_ari_validate_boolean(struct ast_json *json)
Validator for native Swagger boolean.
int ast_ari_validate_double(struct ast_json *json)
Validator for native Swagger double.
int ast_ari_validate_date(struct ast_json *json)
Validator for native Swagger date.
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.
int(* ari_validator)(struct ast_json *json)
Function type for validator functions. Allows for.
static int has_priority(void)
Check whether we were set to high(er) priority.
Definition: asterisk.c:1790
Asterisk main include file. File version handling, generic pbx functions.
#define ast_log
Definition: astobj2.c:42
Support for logging to various files, console and syslog Configuration in file logger....
#define LOG_ERROR
struct ast_json * ast_json_object_iter_value(struct ast_json_iter *iter)
Get the value from an iterator.
Definition: json.c:455
struct ast_json_iter * ast_json_object_iter_next(struct ast_json *object, struct ast_json_iter *iter)
Get the next iterator.
Definition: json.c:447
struct ast_json_iter * ast_json_object_iter(struct ast_json *object)
Get an iterator pointing to the first field in a JSON object.
Definition: json.c:439
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
Definition: json.c:283
const char * ast_json_object_iter_key(struct ast_json_iter *iter)
Get the key from an iterator.
Definition: json.c:451
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Definition: json.c:407
Asterisk module definitions.
Iterator for JSON object key/values.
Abstract JSON element (object, array, string, int, ...).