Asterisk - The Open Source Telephony Project GIT-master-8924258
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 ApplicationReplaced 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 ApplicationReplaced 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 ApplicationReplaced 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 ApplicationReplaced field timestamp failed validation\n");
2658 res = 0;
2659 }
2660 } else
2661 {
2663 "ARI ApplicationReplaced has undocumented field %s\n",
2665 res = 0;
2666 }
2667 }
2668
2669 if (!has_type) {
2670 ast_log(LOG_ERROR, "ARI ApplicationReplaced missing required field type\n");
2671 res = 0;
2672 }
2673
2674 if (!has_application) {
2675 ast_log(LOG_ERROR, "ARI ApplicationReplaced missing required field application\n");
2676 res = 0;
2677 }
2678
2679 if (!has_timestamp) {
2680 ast_log(LOG_ERROR, "ARI ApplicationReplaced 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 int has_destination_type = 0;
2700 int has_is_external = 0;
2701 int has_result = 0;
2702 int has_transferer_first_leg = 0;
2703 int has_transferer_second_leg = 0;
2704
2705 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2706 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2707 int prop_is_valid;
2708 prop_is_valid = ast_ari_validate_string(
2710 if (!prop_is_valid) {
2711 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field asterisk_id failed validation\n");
2712 res = 0;
2713 }
2714 } else
2715 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2716 int prop_is_valid;
2717 has_type = 1;
2718 prop_is_valid = ast_ari_validate_string(
2720 if (!prop_is_valid) {
2721 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field type failed validation\n");
2722 res = 0;
2723 }
2724 } else
2725 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2726 int prop_is_valid;
2727 has_application = 1;
2728 prop_is_valid = ast_ari_validate_string(
2730 if (!prop_is_valid) {
2731 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field application failed validation\n");
2732 res = 0;
2733 }
2734 } else
2735 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2736 int prop_is_valid;
2737 has_timestamp = 1;
2738 prop_is_valid = ast_ari_validate_date(
2740 if (!prop_is_valid) {
2741 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field timestamp failed validation\n");
2742 res = 0;
2743 }
2744 } else
2745 if (strcmp("destination_application", ast_json_object_iter_key(iter)) == 0) {
2746 int prop_is_valid;
2747 prop_is_valid = ast_ari_validate_string(
2749 if (!prop_is_valid) {
2750 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_application failed validation\n");
2751 res = 0;
2752 }
2753 } else
2754 if (strcmp("destination_bridge", ast_json_object_iter_key(iter)) == 0) {
2755 int prop_is_valid;
2756 prop_is_valid = ast_ari_validate_string(
2758 if (!prop_is_valid) {
2759 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_bridge failed validation\n");
2760 res = 0;
2761 }
2762 } else
2763 if (strcmp("destination_link_first_leg", ast_json_object_iter_key(iter)) == 0) {
2764 int prop_is_valid;
2765 prop_is_valid = ast_ari_validate_channel(
2767 if (!prop_is_valid) {
2768 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_link_first_leg failed validation\n");
2769 res = 0;
2770 }
2771 } else
2772 if (strcmp("destination_link_second_leg", ast_json_object_iter_key(iter)) == 0) {
2773 int prop_is_valid;
2774 prop_is_valid = ast_ari_validate_channel(
2776 if (!prop_is_valid) {
2777 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_link_second_leg failed validation\n");
2778 res = 0;
2779 }
2780 } else
2781 if (strcmp("destination_threeway_bridge", ast_json_object_iter_key(iter)) == 0) {
2782 int prop_is_valid;
2783 prop_is_valid = ast_ari_validate_bridge(
2785 if (!prop_is_valid) {
2786 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_threeway_bridge failed validation\n");
2787 res = 0;
2788 }
2789 } else
2790 if (strcmp("destination_threeway_channel", ast_json_object_iter_key(iter)) == 0) {
2791 int prop_is_valid;
2792 prop_is_valid = ast_ari_validate_channel(
2794 if (!prop_is_valid) {
2795 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_threeway_channel failed validation\n");
2796 res = 0;
2797 }
2798 } else
2799 if (strcmp("destination_type", ast_json_object_iter_key(iter)) == 0) {
2800 int prop_is_valid;
2801 has_destination_type = 1;
2802 prop_is_valid = ast_ari_validate_string(
2804 if (!prop_is_valid) {
2805 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_type failed validation\n");
2806 res = 0;
2807 }
2808 } else
2809 if (strcmp("is_external", ast_json_object_iter_key(iter)) == 0) {
2810 int prop_is_valid;
2811 has_is_external = 1;
2812 prop_is_valid = ast_ari_validate_boolean(
2814 if (!prop_is_valid) {
2815 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field is_external failed validation\n");
2816 res = 0;
2817 }
2818 } else
2819 if (strcmp("replace_channel", ast_json_object_iter_key(iter)) == 0) {
2820 int prop_is_valid;
2821 prop_is_valid = ast_ari_validate_channel(
2823 if (!prop_is_valid) {
2824 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field replace_channel failed validation\n");
2825 res = 0;
2826 }
2827 } else
2828 if (strcmp("result", ast_json_object_iter_key(iter)) == 0) {
2829 int prop_is_valid;
2830 has_result = 1;
2831 prop_is_valid = ast_ari_validate_string(
2833 if (!prop_is_valid) {
2834 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field result failed validation\n");
2835 res = 0;
2836 }
2837 } else
2838 if (strcmp("transfer_target", ast_json_object_iter_key(iter)) == 0) {
2839 int prop_is_valid;
2840 prop_is_valid = ast_ari_validate_channel(
2842 if (!prop_is_valid) {
2843 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transfer_target failed validation\n");
2844 res = 0;
2845 }
2846 } else
2847 if (strcmp("transferee", ast_json_object_iter_key(iter)) == 0) {
2848 int prop_is_valid;
2849 prop_is_valid = ast_ari_validate_channel(
2851 if (!prop_is_valid) {
2852 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferee failed validation\n");
2853 res = 0;
2854 }
2855 } else
2856 if (strcmp("transferer_first_leg", ast_json_object_iter_key(iter)) == 0) {
2857 int prop_is_valid;
2858 has_transferer_first_leg = 1;
2859 prop_is_valid = ast_ari_validate_channel(
2861 if (!prop_is_valid) {
2862 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_first_leg failed validation\n");
2863 res = 0;
2864 }
2865 } else
2866 if (strcmp("transferer_first_leg_bridge", ast_json_object_iter_key(iter)) == 0) {
2867 int prop_is_valid;
2868 prop_is_valid = ast_ari_validate_bridge(
2870 if (!prop_is_valid) {
2871 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_first_leg_bridge failed validation\n");
2872 res = 0;
2873 }
2874 } else
2875 if (strcmp("transferer_second_leg", ast_json_object_iter_key(iter)) == 0) {
2876 int prop_is_valid;
2877 has_transferer_second_leg = 1;
2878 prop_is_valid = ast_ari_validate_channel(
2880 if (!prop_is_valid) {
2881 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_second_leg failed validation\n");
2882 res = 0;
2883 }
2884 } else
2885 if (strcmp("transferer_second_leg_bridge", ast_json_object_iter_key(iter)) == 0) {
2886 int prop_is_valid;
2887 prop_is_valid = ast_ari_validate_bridge(
2889 if (!prop_is_valid) {
2890 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_second_leg_bridge failed validation\n");
2891 res = 0;
2892 }
2893 } else
2894 {
2896 "ARI BridgeAttendedTransfer has undocumented field %s\n",
2898 res = 0;
2899 }
2900 }
2901
2902 if (!has_type) {
2903 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field type\n");
2904 res = 0;
2905 }
2906
2907 if (!has_application) {
2908 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field application\n");
2909 res = 0;
2910 }
2911
2912 if (!has_timestamp) {
2913 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field timestamp\n");
2914 res = 0;
2915 }
2916
2917 if (!has_destination_type) {
2918 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field destination_type\n");
2919 res = 0;
2920 }
2921
2922 if (!has_is_external) {
2923 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field is_external\n");
2924 res = 0;
2925 }
2926
2927 if (!has_result) {
2928 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field result\n");
2929 res = 0;
2930 }
2931
2932 if (!has_transferer_first_leg) {
2933 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field transferer_first_leg\n");
2934 res = 0;
2935 }
2936
2937 if (!has_transferer_second_leg) {
2938 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field transferer_second_leg\n");
2939 res = 0;
2940 }
2941
2942 return res;
2943}
2944
2946{
2948}
2949
2951{
2952 int res = 1;
2953 struct ast_json_iter *iter;
2954 int has_type = 0;
2955 int has_application = 0;
2956 int has_timestamp = 0;
2957 int has_channel = 0;
2958 int has_context = 0;
2959 int has_exten = 0;
2960 int has_is_external = 0;
2961 int has_result = 0;
2962
2963 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2964 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2965 int prop_is_valid;
2966 prop_is_valid = ast_ari_validate_string(
2968 if (!prop_is_valid) {
2969 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field asterisk_id failed validation\n");
2970 res = 0;
2971 }
2972 } else
2973 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2974 int prop_is_valid;
2975 has_type = 1;
2976 prop_is_valid = ast_ari_validate_string(
2978 if (!prop_is_valid) {
2979 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field type failed validation\n");
2980 res = 0;
2981 }
2982 } else
2983 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2984 int prop_is_valid;
2985 has_application = 1;
2986 prop_is_valid = ast_ari_validate_string(
2988 if (!prop_is_valid) {
2989 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field application failed validation\n");
2990 res = 0;
2991 }
2992 } else
2993 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2994 int prop_is_valid;
2995 has_timestamp = 1;
2996 prop_is_valid = ast_ari_validate_date(
2998 if (!prop_is_valid) {
2999 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field timestamp failed validation\n");
3000 res = 0;
3001 }
3002 } else
3003 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3004 int prop_is_valid;
3005 prop_is_valid = ast_ari_validate_bridge(
3007 if (!prop_is_valid) {
3008 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field bridge failed validation\n");
3009 res = 0;
3010 }
3011 } else
3012 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3013 int prop_is_valid;
3014 has_channel = 1;
3015 prop_is_valid = ast_ari_validate_channel(
3017 if (!prop_is_valid) {
3018 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field channel failed validation\n");
3019 res = 0;
3020 }
3021 } else
3022 if (strcmp("context", ast_json_object_iter_key(iter)) == 0) {
3023 int prop_is_valid;
3024 has_context = 1;
3025 prop_is_valid = ast_ari_validate_string(
3027 if (!prop_is_valid) {
3028 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field context failed validation\n");
3029 res = 0;
3030 }
3031 } else
3032 if (strcmp("exten", ast_json_object_iter_key(iter)) == 0) {
3033 int prop_is_valid;
3034 has_exten = 1;
3035 prop_is_valid = ast_ari_validate_string(
3037 if (!prop_is_valid) {
3038 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field exten failed validation\n");
3039 res = 0;
3040 }
3041 } else
3042 if (strcmp("is_external", ast_json_object_iter_key(iter)) == 0) {
3043 int prop_is_valid;
3044 has_is_external = 1;
3045 prop_is_valid = ast_ari_validate_boolean(
3047 if (!prop_is_valid) {
3048 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field is_external failed validation\n");
3049 res = 0;
3050 }
3051 } else
3052 if (strcmp("replace_channel", ast_json_object_iter_key(iter)) == 0) {
3053 int prop_is_valid;
3054 prop_is_valid = ast_ari_validate_channel(
3056 if (!prop_is_valid) {
3057 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field replace_channel failed validation\n");
3058 res = 0;
3059 }
3060 } else
3061 if (strcmp("result", ast_json_object_iter_key(iter)) == 0) {
3062 int prop_is_valid;
3063 has_result = 1;
3064 prop_is_valid = ast_ari_validate_string(
3066 if (!prop_is_valid) {
3067 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field result failed validation\n");
3068 res = 0;
3069 }
3070 } else
3071 if (strcmp("transferee", ast_json_object_iter_key(iter)) == 0) {
3072 int prop_is_valid;
3073 prop_is_valid = ast_ari_validate_channel(
3075 if (!prop_is_valid) {
3076 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field transferee failed validation\n");
3077 res = 0;
3078 }
3079 } else
3080 {
3082 "ARI BridgeBlindTransfer has undocumented field %s\n",
3084 res = 0;
3085 }
3086 }
3087
3088 if (!has_type) {
3089 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field type\n");
3090 res = 0;
3091 }
3092
3093 if (!has_application) {
3094 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field application\n");
3095 res = 0;
3096 }
3097
3098 if (!has_timestamp) {
3099 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field timestamp\n");
3100 res = 0;
3101 }
3102
3103 if (!has_channel) {
3104 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field channel\n");
3105 res = 0;
3106 }
3107
3108 if (!has_context) {
3109 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field context\n");
3110 res = 0;
3111 }
3112
3113 if (!has_exten) {
3114 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field exten\n");
3115 res = 0;
3116 }
3117
3118 if (!has_is_external) {
3119 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field is_external\n");
3120 res = 0;
3121 }
3122
3123 if (!has_result) {
3124 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field result\n");
3125 res = 0;
3126 }
3127
3128 return res;
3129}
3130
3132{
3134}
3135
3137{
3138 int res = 1;
3139 struct ast_json_iter *iter;
3140 int has_type = 0;
3141 int has_application = 0;
3142 int has_timestamp = 0;
3143 int has_bridge = 0;
3144
3145 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3146 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3147 int prop_is_valid;
3148 prop_is_valid = ast_ari_validate_string(
3150 if (!prop_is_valid) {
3151 ast_log(LOG_ERROR, "ARI BridgeCreated field asterisk_id failed validation\n");
3152 res = 0;
3153 }
3154 } else
3155 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3156 int prop_is_valid;
3157 has_type = 1;
3158 prop_is_valid = ast_ari_validate_string(
3160 if (!prop_is_valid) {
3161 ast_log(LOG_ERROR, "ARI BridgeCreated field type failed validation\n");
3162 res = 0;
3163 }
3164 } else
3165 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3166 int prop_is_valid;
3167 has_application = 1;
3168 prop_is_valid = ast_ari_validate_string(
3170 if (!prop_is_valid) {
3171 ast_log(LOG_ERROR, "ARI BridgeCreated field application failed validation\n");
3172 res = 0;
3173 }
3174 } else
3175 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3176 int prop_is_valid;
3177 has_timestamp = 1;
3178 prop_is_valid = ast_ari_validate_date(
3180 if (!prop_is_valid) {
3181 ast_log(LOG_ERROR, "ARI BridgeCreated field timestamp failed validation\n");
3182 res = 0;
3183 }
3184 } else
3185 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3186 int prop_is_valid;
3187 has_bridge = 1;
3188 prop_is_valid = ast_ari_validate_bridge(
3190 if (!prop_is_valid) {
3191 ast_log(LOG_ERROR, "ARI BridgeCreated field bridge failed validation\n");
3192 res = 0;
3193 }
3194 } else
3195 {
3197 "ARI BridgeCreated has undocumented field %s\n",
3199 res = 0;
3200 }
3201 }
3202
3203 if (!has_type) {
3204 ast_log(LOG_ERROR, "ARI BridgeCreated missing required field type\n");
3205 res = 0;
3206 }
3207
3208 if (!has_application) {
3209 ast_log(LOG_ERROR, "ARI BridgeCreated missing required field application\n");
3210 res = 0;
3211 }
3212
3213 if (!has_timestamp) {
3214 ast_log(LOG_ERROR, "ARI BridgeCreated missing required field timestamp\n");
3215 res = 0;
3216 }
3217
3218 if (!has_bridge) {
3219 ast_log(LOG_ERROR, "ARI BridgeCreated missing required field bridge\n");
3220 res = 0;
3221 }
3222
3223 return res;
3224}
3225
3227{
3229}
3230
3232{
3233 int res = 1;
3234 struct ast_json_iter *iter;
3235 int has_type = 0;
3236 int has_application = 0;
3237 int has_timestamp = 0;
3238 int has_bridge = 0;
3239
3240 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3241 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3242 int prop_is_valid;
3243 prop_is_valid = ast_ari_validate_string(
3245 if (!prop_is_valid) {
3246 ast_log(LOG_ERROR, "ARI BridgeDestroyed field asterisk_id failed validation\n");
3247 res = 0;
3248 }
3249 } else
3250 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3251 int prop_is_valid;
3252 has_type = 1;
3253 prop_is_valid = ast_ari_validate_string(
3255 if (!prop_is_valid) {
3256 ast_log(LOG_ERROR, "ARI BridgeDestroyed field type failed validation\n");
3257 res = 0;
3258 }
3259 } else
3260 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3261 int prop_is_valid;
3262 has_application = 1;
3263 prop_is_valid = ast_ari_validate_string(
3265 if (!prop_is_valid) {
3266 ast_log(LOG_ERROR, "ARI BridgeDestroyed field application failed validation\n");
3267 res = 0;
3268 }
3269 } else
3270 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3271 int prop_is_valid;
3272 has_timestamp = 1;
3273 prop_is_valid = ast_ari_validate_date(
3275 if (!prop_is_valid) {
3276 ast_log(LOG_ERROR, "ARI BridgeDestroyed field timestamp failed validation\n");
3277 res = 0;
3278 }
3279 } else
3280 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3281 int prop_is_valid;
3282 has_bridge = 1;
3283 prop_is_valid = ast_ari_validate_bridge(
3285 if (!prop_is_valid) {
3286 ast_log(LOG_ERROR, "ARI BridgeDestroyed field bridge failed validation\n");
3287 res = 0;
3288 }
3289 } else
3290 {
3292 "ARI BridgeDestroyed has undocumented field %s\n",
3294 res = 0;
3295 }
3296 }
3297
3298 if (!has_type) {
3299 ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field type\n");
3300 res = 0;
3301 }
3302
3303 if (!has_application) {
3304 ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field application\n");
3305 res = 0;
3306 }
3307
3308 if (!has_timestamp) {
3309 ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field timestamp\n");
3310 res = 0;
3311 }
3312
3313 if (!has_bridge) {
3314 ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field bridge\n");
3315 res = 0;
3316 }
3317
3318 return res;
3319}
3320
3322{
3324}
3325
3327{
3328 int res = 1;
3329 struct ast_json_iter *iter;
3330 int has_type = 0;
3331 int has_application = 0;
3332 int has_timestamp = 0;
3333 int has_bridge = 0;
3334 int has_bridge_from = 0;
3335
3336 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3337 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3338 int prop_is_valid;
3339 prop_is_valid = ast_ari_validate_string(
3341 if (!prop_is_valid) {
3342 ast_log(LOG_ERROR, "ARI BridgeMerged field asterisk_id failed validation\n");
3343 res = 0;
3344 }
3345 } else
3346 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3347 int prop_is_valid;
3348 has_type = 1;
3349 prop_is_valid = ast_ari_validate_string(
3351 if (!prop_is_valid) {
3352 ast_log(LOG_ERROR, "ARI BridgeMerged field type failed validation\n");
3353 res = 0;
3354 }
3355 } else
3356 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3357 int prop_is_valid;
3358 has_application = 1;
3359 prop_is_valid = ast_ari_validate_string(
3361 if (!prop_is_valid) {
3362 ast_log(LOG_ERROR, "ARI BridgeMerged field application failed validation\n");
3363 res = 0;
3364 }
3365 } else
3366 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3367 int prop_is_valid;
3368 has_timestamp = 1;
3369 prop_is_valid = ast_ari_validate_date(
3371 if (!prop_is_valid) {
3372 ast_log(LOG_ERROR, "ARI BridgeMerged field timestamp failed validation\n");
3373 res = 0;
3374 }
3375 } else
3376 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3377 int prop_is_valid;
3378 has_bridge = 1;
3379 prop_is_valid = ast_ari_validate_bridge(
3381 if (!prop_is_valid) {
3382 ast_log(LOG_ERROR, "ARI BridgeMerged field bridge failed validation\n");
3383 res = 0;
3384 }
3385 } else
3386 if (strcmp("bridge_from", ast_json_object_iter_key(iter)) == 0) {
3387 int prop_is_valid;
3388 has_bridge_from = 1;
3389 prop_is_valid = ast_ari_validate_bridge(
3391 if (!prop_is_valid) {
3392 ast_log(LOG_ERROR, "ARI BridgeMerged field bridge_from failed validation\n");
3393 res = 0;
3394 }
3395 } else
3396 {
3398 "ARI BridgeMerged has undocumented field %s\n",
3400 res = 0;
3401 }
3402 }
3403
3404 if (!has_type) {
3405 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field type\n");
3406 res = 0;
3407 }
3408
3409 if (!has_application) {
3410 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field application\n");
3411 res = 0;
3412 }
3413
3414 if (!has_timestamp) {
3415 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field timestamp\n");
3416 res = 0;
3417 }
3418
3419 if (!has_bridge) {
3420 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field bridge\n");
3421 res = 0;
3422 }
3423
3424 if (!has_bridge_from) {
3425 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field bridge_from\n");
3426 res = 0;
3427 }
3428
3429 return res;
3430}
3431
3433{
3435}
3436
3438{
3439 int res = 1;
3440 struct ast_json_iter *iter;
3441 int has_type = 0;
3442 int has_application = 0;
3443 int has_timestamp = 0;
3444 int has_bridge = 0;
3445
3446 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3447 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3448 int prop_is_valid;
3449 prop_is_valid = ast_ari_validate_string(
3451 if (!prop_is_valid) {
3452 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field asterisk_id failed validation\n");
3453 res = 0;
3454 }
3455 } else
3456 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3457 int prop_is_valid;
3458 has_type = 1;
3459 prop_is_valid = ast_ari_validate_string(
3461 if (!prop_is_valid) {
3462 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field type failed validation\n");
3463 res = 0;
3464 }
3465 } else
3466 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3467 int prop_is_valid;
3468 has_application = 1;
3469 prop_is_valid = ast_ari_validate_string(
3471 if (!prop_is_valid) {
3472 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field application failed validation\n");
3473 res = 0;
3474 }
3475 } else
3476 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3477 int prop_is_valid;
3478 has_timestamp = 1;
3479 prop_is_valid = ast_ari_validate_date(
3481 if (!prop_is_valid) {
3482 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field timestamp failed validation\n");
3483 res = 0;
3484 }
3485 } else
3486 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3487 int prop_is_valid;
3488 has_bridge = 1;
3489 prop_is_valid = ast_ari_validate_bridge(
3491 if (!prop_is_valid) {
3492 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field bridge failed validation\n");
3493 res = 0;
3494 }
3495 } else
3496 if (strcmp("old_video_source_id", ast_json_object_iter_key(iter)) == 0) {
3497 int prop_is_valid;
3498 prop_is_valid = ast_ari_validate_string(
3500 if (!prop_is_valid) {
3501 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field old_video_source_id failed validation\n");
3502 res = 0;
3503 }
3504 } else
3505 {
3507 "ARI BridgeVideoSourceChanged has undocumented field %s\n",
3509 res = 0;
3510 }
3511 }
3512
3513 if (!has_type) {
3514 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field type\n");
3515 res = 0;
3516 }
3517
3518 if (!has_application) {
3519 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field application\n");
3520 res = 0;
3521 }
3522
3523 if (!has_timestamp) {
3524 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field timestamp\n");
3525 res = 0;
3526 }
3527
3528 if (!has_bridge) {
3529 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field bridge\n");
3530 res = 0;
3531 }
3532
3533 return res;
3534}
3535
3537{
3539}
3540
3542{
3543 int res = 1;
3544 struct ast_json_iter *iter;
3545 int has_type = 0;
3546 int has_application = 0;
3547 int has_timestamp = 0;
3548 int has_caller_presentation = 0;
3549 int has_caller_presentation_txt = 0;
3550 int has_channel = 0;
3551
3552 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3553 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3554 int prop_is_valid;
3555 prop_is_valid = ast_ari_validate_string(
3557 if (!prop_is_valid) {
3558 ast_log(LOG_ERROR, "ARI ChannelCallerId field asterisk_id failed validation\n");
3559 res = 0;
3560 }
3561 } else
3562 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3563 int prop_is_valid;
3564 has_type = 1;
3565 prop_is_valid = ast_ari_validate_string(
3567 if (!prop_is_valid) {
3568 ast_log(LOG_ERROR, "ARI ChannelCallerId field type failed validation\n");
3569 res = 0;
3570 }
3571 } else
3572 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3573 int prop_is_valid;
3574 has_application = 1;
3575 prop_is_valid = ast_ari_validate_string(
3577 if (!prop_is_valid) {
3578 ast_log(LOG_ERROR, "ARI ChannelCallerId field application failed validation\n");
3579 res = 0;
3580 }
3581 } else
3582 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3583 int prop_is_valid;
3584 has_timestamp = 1;
3585 prop_is_valid = ast_ari_validate_date(
3587 if (!prop_is_valid) {
3588 ast_log(LOG_ERROR, "ARI ChannelCallerId field timestamp failed validation\n");
3589 res = 0;
3590 }
3591 } else
3592 if (strcmp("caller_presentation", ast_json_object_iter_key(iter)) == 0) {
3593 int prop_is_valid;
3594 has_caller_presentation = 1;
3595 prop_is_valid = ast_ari_validate_int(
3597 if (!prop_is_valid) {
3598 ast_log(LOG_ERROR, "ARI ChannelCallerId field caller_presentation failed validation\n");
3599 res = 0;
3600 }
3601 } else
3602 if (strcmp("caller_presentation_txt", ast_json_object_iter_key(iter)) == 0) {
3603 int prop_is_valid;
3604 has_caller_presentation_txt = 1;
3605 prop_is_valid = ast_ari_validate_string(
3607 if (!prop_is_valid) {
3608 ast_log(LOG_ERROR, "ARI ChannelCallerId field caller_presentation_txt failed validation\n");
3609 res = 0;
3610 }
3611 } else
3612 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3613 int prop_is_valid;
3614 has_channel = 1;
3615 prop_is_valid = ast_ari_validate_channel(
3617 if (!prop_is_valid) {
3618 ast_log(LOG_ERROR, "ARI ChannelCallerId field channel failed validation\n");
3619 res = 0;
3620 }
3621 } else
3622 {
3624 "ARI ChannelCallerId has undocumented field %s\n",
3626 res = 0;
3627 }
3628 }
3629
3630 if (!has_type) {
3631 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field type\n");
3632 res = 0;
3633 }
3634
3635 if (!has_application) {
3636 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field application\n");
3637 res = 0;
3638 }
3639
3640 if (!has_timestamp) {
3641 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field timestamp\n");
3642 res = 0;
3643 }
3644
3645 if (!has_caller_presentation) {
3646 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field caller_presentation\n");
3647 res = 0;
3648 }
3649
3650 if (!has_caller_presentation_txt) {
3651 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field caller_presentation_txt\n");
3652 res = 0;
3653 }
3654
3655 if (!has_channel) {
3656 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field channel\n");
3657 res = 0;
3658 }
3659
3660 return res;
3661}
3662
3664{
3666}
3667
3669{
3670 int res = 1;
3671 struct ast_json_iter *iter;
3672 int has_type = 0;
3673 int has_application = 0;
3674 int has_timestamp = 0;
3675 int has_channel = 0;
3676
3677 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3678 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3679 int prop_is_valid;
3680 prop_is_valid = ast_ari_validate_string(
3682 if (!prop_is_valid) {
3683 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field asterisk_id failed validation\n");
3684 res = 0;
3685 }
3686 } else
3687 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3688 int prop_is_valid;
3689 has_type = 1;
3690 prop_is_valid = ast_ari_validate_string(
3692 if (!prop_is_valid) {
3693 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field type failed validation\n");
3694 res = 0;
3695 }
3696 } else
3697 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3698 int prop_is_valid;
3699 has_application = 1;
3700 prop_is_valid = ast_ari_validate_string(
3702 if (!prop_is_valid) {
3703 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field application failed validation\n");
3704 res = 0;
3705 }
3706 } else
3707 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3708 int prop_is_valid;
3709 has_timestamp = 1;
3710 prop_is_valid = ast_ari_validate_date(
3712 if (!prop_is_valid) {
3713 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field timestamp failed validation\n");
3714 res = 0;
3715 }
3716 } else
3717 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3718 int prop_is_valid;
3719 has_channel = 1;
3720 prop_is_valid = ast_ari_validate_channel(
3722 if (!prop_is_valid) {
3723 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field channel failed validation\n");
3724 res = 0;
3725 }
3726 } else
3727 {
3729 "ARI ChannelConnectedLine has undocumented field %s\n",
3731 res = 0;
3732 }
3733 }
3734
3735 if (!has_type) {
3736 ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field type\n");
3737 res = 0;
3738 }
3739
3740 if (!has_application) {
3741 ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field application\n");
3742 res = 0;
3743 }
3744
3745 if (!has_timestamp) {
3746 ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field timestamp\n");
3747 res = 0;
3748 }
3749
3750 if (!has_channel) {
3751 ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field channel\n");
3752 res = 0;
3753 }
3754
3755 return res;
3756}
3757
3759{
3761}
3762
3764{
3765 int res = 1;
3766 struct ast_json_iter *iter;
3767 int has_type = 0;
3768 int has_application = 0;
3769 int has_timestamp = 0;
3770 int has_channel = 0;
3771
3772 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3773 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3774 int prop_is_valid;
3775 prop_is_valid = ast_ari_validate_string(
3777 if (!prop_is_valid) {
3778 ast_log(LOG_ERROR, "ARI ChannelCreated field asterisk_id failed validation\n");
3779 res = 0;
3780 }
3781 } else
3782 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3783 int prop_is_valid;
3784 has_type = 1;
3785 prop_is_valid = ast_ari_validate_string(
3787 if (!prop_is_valid) {
3788 ast_log(LOG_ERROR, "ARI ChannelCreated field type failed validation\n");
3789 res = 0;
3790 }
3791 } else
3792 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3793 int prop_is_valid;
3794 has_application = 1;
3795 prop_is_valid = ast_ari_validate_string(
3797 if (!prop_is_valid) {
3798 ast_log(LOG_ERROR, "ARI ChannelCreated field application failed validation\n");
3799 res = 0;
3800 }
3801 } else
3802 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3803 int prop_is_valid;
3804 has_timestamp = 1;
3805 prop_is_valid = ast_ari_validate_date(
3807 if (!prop_is_valid) {
3808 ast_log(LOG_ERROR, "ARI ChannelCreated field timestamp failed validation\n");
3809 res = 0;
3810 }
3811 } else
3812 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3813 int prop_is_valid;
3814 has_channel = 1;
3815 prop_is_valid = ast_ari_validate_channel(
3817 if (!prop_is_valid) {
3818 ast_log(LOG_ERROR, "ARI ChannelCreated field channel failed validation\n");
3819 res = 0;
3820 }
3821 } else
3822 {
3824 "ARI ChannelCreated has undocumented field %s\n",
3826 res = 0;
3827 }
3828 }
3829
3830 if (!has_type) {
3831 ast_log(LOG_ERROR, "ARI ChannelCreated missing required field type\n");
3832 res = 0;
3833 }
3834
3835 if (!has_application) {
3836 ast_log(LOG_ERROR, "ARI ChannelCreated missing required field application\n");
3837 res = 0;
3838 }
3839
3840 if (!has_timestamp) {
3841 ast_log(LOG_ERROR, "ARI ChannelCreated missing required field timestamp\n");
3842 res = 0;
3843 }
3844
3845 if (!has_channel) {
3846 ast_log(LOG_ERROR, "ARI ChannelCreated missing required field channel\n");
3847 res = 0;
3848 }
3849
3850 return res;
3851}
3852
3854{
3856}
3857
3859{
3860 int res = 1;
3861 struct ast_json_iter *iter;
3862 int has_type = 0;
3863 int has_application = 0;
3864 int has_timestamp = 0;
3865 int has_cause = 0;
3866 int has_cause_txt = 0;
3867 int has_channel = 0;
3868
3869 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3870 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3871 int prop_is_valid;
3872 prop_is_valid = ast_ari_validate_string(
3874 if (!prop_is_valid) {
3875 ast_log(LOG_ERROR, "ARI ChannelDestroyed field asterisk_id failed validation\n");
3876 res = 0;
3877 }
3878 } else
3879 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3880 int prop_is_valid;
3881 has_type = 1;
3882 prop_is_valid = ast_ari_validate_string(
3884 if (!prop_is_valid) {
3885 ast_log(LOG_ERROR, "ARI ChannelDestroyed field type failed validation\n");
3886 res = 0;
3887 }
3888 } else
3889 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3890 int prop_is_valid;
3891 has_application = 1;
3892 prop_is_valid = ast_ari_validate_string(
3894 if (!prop_is_valid) {
3895 ast_log(LOG_ERROR, "ARI ChannelDestroyed field application failed validation\n");
3896 res = 0;
3897 }
3898 } else
3899 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3900 int prop_is_valid;
3901 has_timestamp = 1;
3902 prop_is_valid = ast_ari_validate_date(
3904 if (!prop_is_valid) {
3905 ast_log(LOG_ERROR, "ARI ChannelDestroyed field timestamp failed validation\n");
3906 res = 0;
3907 }
3908 } else
3909 if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
3910 int prop_is_valid;
3911 has_cause = 1;
3912 prop_is_valid = ast_ari_validate_int(
3914 if (!prop_is_valid) {
3915 ast_log(LOG_ERROR, "ARI ChannelDestroyed field cause failed validation\n");
3916 res = 0;
3917 }
3918 } else
3919 if (strcmp("cause_txt", ast_json_object_iter_key(iter)) == 0) {
3920 int prop_is_valid;
3921 has_cause_txt = 1;
3922 prop_is_valid = ast_ari_validate_string(
3924 if (!prop_is_valid) {
3925 ast_log(LOG_ERROR, "ARI ChannelDestroyed field cause_txt failed validation\n");
3926 res = 0;
3927 }
3928 } else
3929 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3930 int prop_is_valid;
3931 has_channel = 1;
3932 prop_is_valid = ast_ari_validate_channel(
3934 if (!prop_is_valid) {
3935 ast_log(LOG_ERROR, "ARI ChannelDestroyed field channel failed validation\n");
3936 res = 0;
3937 }
3938 } else
3939 {
3941 "ARI ChannelDestroyed has undocumented field %s\n",
3943 res = 0;
3944 }
3945 }
3946
3947 if (!has_type) {
3948 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field type\n");
3949 res = 0;
3950 }
3951
3952 if (!has_application) {
3953 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field application\n");
3954 res = 0;
3955 }
3956
3957 if (!has_timestamp) {
3958 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field timestamp\n");
3959 res = 0;
3960 }
3961
3962 if (!has_cause) {
3963 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field cause\n");
3964 res = 0;
3965 }
3966
3967 if (!has_cause_txt) {
3968 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field cause_txt\n");
3969 res = 0;
3970 }
3971
3972 if (!has_channel) {
3973 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field channel\n");
3974 res = 0;
3975 }
3976
3977 return res;
3978}
3979
3981{
3983}
3984
3986{
3987 int res = 1;
3988 struct ast_json_iter *iter;
3989 int has_type = 0;
3990 int has_application = 0;
3991 int has_timestamp = 0;
3992 int has_channel = 0;
3993 int has_dialplan_app = 0;
3994 int has_dialplan_app_data = 0;
3995
3996 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3997 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3998 int prop_is_valid;
3999 prop_is_valid = ast_ari_validate_string(
4001 if (!prop_is_valid) {
4002 ast_log(LOG_ERROR, "ARI ChannelDialplan field asterisk_id failed validation\n");
4003 res = 0;
4004 }
4005 } else
4006 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4007 int prop_is_valid;
4008 has_type = 1;
4009 prop_is_valid = ast_ari_validate_string(
4011 if (!prop_is_valid) {
4012 ast_log(LOG_ERROR, "ARI ChannelDialplan field type failed validation\n");
4013 res = 0;
4014 }
4015 } else
4016 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4017 int prop_is_valid;
4018 has_application = 1;
4019 prop_is_valid = ast_ari_validate_string(
4021 if (!prop_is_valid) {
4022 ast_log(LOG_ERROR, "ARI ChannelDialplan field application failed validation\n");
4023 res = 0;
4024 }
4025 } else
4026 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4027 int prop_is_valid;
4028 has_timestamp = 1;
4029 prop_is_valid = ast_ari_validate_date(
4031 if (!prop_is_valid) {
4032 ast_log(LOG_ERROR, "ARI ChannelDialplan field timestamp failed validation\n");
4033 res = 0;
4034 }
4035 } else
4036 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4037 int prop_is_valid;
4038 has_channel = 1;
4039 prop_is_valid = ast_ari_validate_channel(
4041 if (!prop_is_valid) {
4042 ast_log(LOG_ERROR, "ARI ChannelDialplan field channel failed validation\n");
4043 res = 0;
4044 }
4045 } else
4046 if (strcmp("dialplan_app", ast_json_object_iter_key(iter)) == 0) {
4047 int prop_is_valid;
4048 has_dialplan_app = 1;
4049 prop_is_valid = ast_ari_validate_string(
4051 if (!prop_is_valid) {
4052 ast_log(LOG_ERROR, "ARI ChannelDialplan field dialplan_app failed validation\n");
4053 res = 0;
4054 }
4055 } else
4056 if (strcmp("dialplan_app_data", ast_json_object_iter_key(iter)) == 0) {
4057 int prop_is_valid;
4058 has_dialplan_app_data = 1;
4059 prop_is_valid = ast_ari_validate_string(
4061 if (!prop_is_valid) {
4062 ast_log(LOG_ERROR, "ARI ChannelDialplan field dialplan_app_data failed validation\n");
4063 res = 0;
4064 }
4065 } else
4066 {
4068 "ARI ChannelDialplan has undocumented field %s\n",
4070 res = 0;
4071 }
4072 }
4073
4074 if (!has_type) {
4075 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field type\n");
4076 res = 0;
4077 }
4078
4079 if (!has_application) {
4080 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field application\n");
4081 res = 0;
4082 }
4083
4084 if (!has_timestamp) {
4085 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field timestamp\n");
4086 res = 0;
4087 }
4088
4089 if (!has_channel) {
4090 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field channel\n");
4091 res = 0;
4092 }
4093
4094 if (!has_dialplan_app) {
4095 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field dialplan_app\n");
4096 res = 0;
4097 }
4098
4099 if (!has_dialplan_app_data) {
4100 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field dialplan_app_data\n");
4101 res = 0;
4102 }
4103
4104 return res;
4105}
4106
4108{
4110}
4111
4113{
4114 int res = 1;
4115 struct ast_json_iter *iter;
4116 int has_type = 0;
4117 int has_application = 0;
4118 int has_timestamp = 0;
4119 int has_channel = 0;
4120 int has_digit = 0;
4121 int has_duration_ms = 0;
4122
4123 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4124 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4125 int prop_is_valid;
4126 prop_is_valid = ast_ari_validate_string(
4128 if (!prop_is_valid) {
4129 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field asterisk_id failed validation\n");
4130 res = 0;
4131 }
4132 } else
4133 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4134 int prop_is_valid;
4135 has_type = 1;
4136 prop_is_valid = ast_ari_validate_string(
4138 if (!prop_is_valid) {
4139 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field type failed validation\n");
4140 res = 0;
4141 }
4142 } else
4143 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4144 int prop_is_valid;
4145 has_application = 1;
4146 prop_is_valid = ast_ari_validate_string(
4148 if (!prop_is_valid) {
4149 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field application failed validation\n");
4150 res = 0;
4151 }
4152 } else
4153 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4154 int prop_is_valid;
4155 has_timestamp = 1;
4156 prop_is_valid = ast_ari_validate_date(
4158 if (!prop_is_valid) {
4159 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field timestamp failed validation\n");
4160 res = 0;
4161 }
4162 } else
4163 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4164 int prop_is_valid;
4165 has_channel = 1;
4166 prop_is_valid = ast_ari_validate_channel(
4168 if (!prop_is_valid) {
4169 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field channel failed validation\n");
4170 res = 0;
4171 }
4172 } else
4173 if (strcmp("digit", ast_json_object_iter_key(iter)) == 0) {
4174 int prop_is_valid;
4175 has_digit = 1;
4176 prop_is_valid = ast_ari_validate_string(
4178 if (!prop_is_valid) {
4179 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field digit failed validation\n");
4180 res = 0;
4181 }
4182 } else
4183 if (strcmp("duration_ms", ast_json_object_iter_key(iter)) == 0) {
4184 int prop_is_valid;
4185 has_duration_ms = 1;
4186 prop_is_valid = ast_ari_validate_int(
4188 if (!prop_is_valid) {
4189 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field duration_ms failed validation\n");
4190 res = 0;
4191 }
4192 } else
4193 {
4195 "ARI ChannelDtmfReceived has undocumented field %s\n",
4197 res = 0;
4198 }
4199 }
4200
4201 if (!has_type) {
4202 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field type\n");
4203 res = 0;
4204 }
4205
4206 if (!has_application) {
4207 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field application\n");
4208 res = 0;
4209 }
4210
4211 if (!has_timestamp) {
4212 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field timestamp\n");
4213 res = 0;
4214 }
4215
4216 if (!has_channel) {
4217 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field channel\n");
4218 res = 0;
4219 }
4220
4221 if (!has_digit) {
4222 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field digit\n");
4223 res = 0;
4224 }
4225
4226 if (!has_duration_ms) {
4227 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field duration_ms\n");
4228 res = 0;
4229 }
4230
4231 return res;
4232}
4233
4235{
4237}
4238
4240{
4241 int res = 1;
4242 struct ast_json_iter *iter;
4243 int has_type = 0;
4244 int has_application = 0;
4245 int has_timestamp = 0;
4246 int has_bridge = 0;
4247
4248 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4249 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4250 int prop_is_valid;
4251 prop_is_valid = ast_ari_validate_string(
4253 if (!prop_is_valid) {
4254 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field asterisk_id failed validation\n");
4255 res = 0;
4256 }
4257 } else
4258 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4259 int prop_is_valid;
4260 has_type = 1;
4261 prop_is_valid = ast_ari_validate_string(
4263 if (!prop_is_valid) {
4264 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field type failed validation\n");
4265 res = 0;
4266 }
4267 } else
4268 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4269 int prop_is_valid;
4270 has_application = 1;
4271 prop_is_valid = ast_ari_validate_string(
4273 if (!prop_is_valid) {
4274 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field application failed validation\n");
4275 res = 0;
4276 }
4277 } else
4278 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4279 int prop_is_valid;
4280 has_timestamp = 1;
4281 prop_is_valid = ast_ari_validate_date(
4283 if (!prop_is_valid) {
4284 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field timestamp failed validation\n");
4285 res = 0;
4286 }
4287 } else
4288 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
4289 int prop_is_valid;
4290 has_bridge = 1;
4291 prop_is_valid = ast_ari_validate_bridge(
4293 if (!prop_is_valid) {
4294 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field bridge failed validation\n");
4295 res = 0;
4296 }
4297 } else
4298 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4299 int prop_is_valid;
4300 prop_is_valid = ast_ari_validate_channel(
4302 if (!prop_is_valid) {
4303 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field channel failed validation\n");
4304 res = 0;
4305 }
4306 } else
4307 {
4309 "ARI ChannelEnteredBridge has undocumented field %s\n",
4311 res = 0;
4312 }
4313 }
4314
4315 if (!has_type) {
4316 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field type\n");
4317 res = 0;
4318 }
4319
4320 if (!has_application) {
4321 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field application\n");
4322 res = 0;
4323 }
4324
4325 if (!has_timestamp) {
4326 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field timestamp\n");
4327 res = 0;
4328 }
4329
4330 if (!has_bridge) {
4331 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field bridge\n");
4332 res = 0;
4333 }
4334
4335 return res;
4336}
4337
4339{
4341}
4342
4344{
4345 int res = 1;
4346 struct ast_json_iter *iter;
4347 int has_type = 0;
4348 int has_application = 0;
4349 int has_timestamp = 0;
4350 int has_channel = 0;
4351
4352 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4353 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4354 int prop_is_valid;
4355 prop_is_valid = ast_ari_validate_string(
4357 if (!prop_is_valid) {
4358 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field asterisk_id failed validation\n");
4359 res = 0;
4360 }
4361 } else
4362 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4363 int prop_is_valid;
4364 has_type = 1;
4365 prop_is_valid = ast_ari_validate_string(
4367 if (!prop_is_valid) {
4368 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field type failed validation\n");
4369 res = 0;
4370 }
4371 } else
4372 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4373 int prop_is_valid;
4374 has_application = 1;
4375 prop_is_valid = ast_ari_validate_string(
4377 if (!prop_is_valid) {
4378 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field application failed validation\n");
4379 res = 0;
4380 }
4381 } else
4382 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4383 int prop_is_valid;
4384 has_timestamp = 1;
4385 prop_is_valid = ast_ari_validate_date(
4387 if (!prop_is_valid) {
4388 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field timestamp failed validation\n");
4389 res = 0;
4390 }
4391 } else
4392 if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
4393 int prop_is_valid;
4394 prop_is_valid = ast_ari_validate_int(
4396 if (!prop_is_valid) {
4397 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field cause failed validation\n");
4398 res = 0;
4399 }
4400 } else
4401 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4402 int prop_is_valid;
4403 has_channel = 1;
4404 prop_is_valid = ast_ari_validate_channel(
4406 if (!prop_is_valid) {
4407 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field channel failed validation\n");
4408 res = 0;
4409 }
4410 } else
4411 if (strcmp("soft", ast_json_object_iter_key(iter)) == 0) {
4412 int prop_is_valid;
4413 prop_is_valid = ast_ari_validate_boolean(
4415 if (!prop_is_valid) {
4416 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field soft failed validation\n");
4417 res = 0;
4418 }
4419 } else
4420 {
4422 "ARI ChannelHangupRequest has undocumented field %s\n",
4424 res = 0;
4425 }
4426 }
4427
4428 if (!has_type) {
4429 ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field type\n");
4430 res = 0;
4431 }
4432
4433 if (!has_application) {
4434 ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field application\n");
4435 res = 0;
4436 }
4437
4438 if (!has_timestamp) {
4439 ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field timestamp\n");
4440 res = 0;
4441 }
4442
4443 if (!has_channel) {
4444 ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field channel\n");
4445 res = 0;
4446 }
4447
4448 return res;
4449}
4450
4452{
4454}
4455
4457{
4458 int res = 1;
4459 struct ast_json_iter *iter;
4460 int has_type = 0;
4461 int has_application = 0;
4462 int has_timestamp = 0;
4463 int has_channel = 0;
4464
4465 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4466 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4467 int prop_is_valid;
4468 prop_is_valid = ast_ari_validate_string(
4470 if (!prop_is_valid) {
4471 ast_log(LOG_ERROR, "ARI ChannelHold field asterisk_id failed validation\n");
4472 res = 0;
4473 }
4474 } else
4475 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4476 int prop_is_valid;
4477 has_type = 1;
4478 prop_is_valid = ast_ari_validate_string(
4480 if (!prop_is_valid) {
4481 ast_log(LOG_ERROR, "ARI ChannelHold field type failed validation\n");
4482 res = 0;
4483 }
4484 } else
4485 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4486 int prop_is_valid;
4487 has_application = 1;
4488 prop_is_valid = ast_ari_validate_string(
4490 if (!prop_is_valid) {
4491 ast_log(LOG_ERROR, "ARI ChannelHold field application failed validation\n");
4492 res = 0;
4493 }
4494 } else
4495 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4496 int prop_is_valid;
4497 has_timestamp = 1;
4498 prop_is_valid = ast_ari_validate_date(
4500 if (!prop_is_valid) {
4501 ast_log(LOG_ERROR, "ARI ChannelHold field timestamp failed validation\n");
4502 res = 0;
4503 }
4504 } else
4505 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4506 int prop_is_valid;
4507 has_channel = 1;
4508 prop_is_valid = ast_ari_validate_channel(
4510 if (!prop_is_valid) {
4511 ast_log(LOG_ERROR, "ARI ChannelHold field channel failed validation\n");
4512 res = 0;
4513 }
4514 } else
4515 if (strcmp("musicclass", ast_json_object_iter_key(iter)) == 0) {
4516 int prop_is_valid;
4517 prop_is_valid = ast_ari_validate_string(
4519 if (!prop_is_valid) {
4520 ast_log(LOG_ERROR, "ARI ChannelHold field musicclass failed validation\n");
4521 res = 0;
4522 }
4523 } else
4524 {
4526 "ARI ChannelHold has undocumented field %s\n",
4528 res = 0;
4529 }
4530 }
4531
4532 if (!has_type) {
4533 ast_log(LOG_ERROR, "ARI ChannelHold missing required field type\n");
4534 res = 0;
4535 }
4536
4537 if (!has_application) {
4538 ast_log(LOG_ERROR, "ARI ChannelHold missing required field application\n");
4539 res = 0;
4540 }
4541
4542 if (!has_timestamp) {
4543 ast_log(LOG_ERROR, "ARI ChannelHold missing required field timestamp\n");
4544 res = 0;
4545 }
4546
4547 if (!has_channel) {
4548 ast_log(LOG_ERROR, "ARI ChannelHold missing required field channel\n");
4549 res = 0;
4550 }
4551
4552 return res;
4553}
4554
4556{
4558}
4559
4561{
4562 int res = 1;
4563 struct ast_json_iter *iter;
4564 int has_type = 0;
4565 int has_application = 0;
4566 int has_timestamp = 0;
4567 int has_bridge = 0;
4568 int has_channel = 0;
4569
4570 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4571 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4572 int prop_is_valid;
4573 prop_is_valid = ast_ari_validate_string(
4575 if (!prop_is_valid) {
4576 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field asterisk_id failed validation\n");
4577 res = 0;
4578 }
4579 } else
4580 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4581 int prop_is_valid;
4582 has_type = 1;
4583 prop_is_valid = ast_ari_validate_string(
4585 if (!prop_is_valid) {
4586 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field type failed validation\n");
4587 res = 0;
4588 }
4589 } else
4590 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4591 int prop_is_valid;
4592 has_application = 1;
4593 prop_is_valid = ast_ari_validate_string(
4595 if (!prop_is_valid) {
4596 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field application failed validation\n");
4597 res = 0;
4598 }
4599 } else
4600 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4601 int prop_is_valid;
4602 has_timestamp = 1;
4603 prop_is_valid = ast_ari_validate_date(
4605 if (!prop_is_valid) {
4606 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field timestamp failed validation\n");
4607 res = 0;
4608 }
4609 } else
4610 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
4611 int prop_is_valid;
4612 has_bridge = 1;
4613 prop_is_valid = ast_ari_validate_bridge(
4615 if (!prop_is_valid) {
4616 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field bridge failed validation\n");
4617 res = 0;
4618 }
4619 } else
4620 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4621 int prop_is_valid;
4622 has_channel = 1;
4623 prop_is_valid = ast_ari_validate_channel(
4625 if (!prop_is_valid) {
4626 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field channel failed validation\n");
4627 res = 0;
4628 }
4629 } else
4630 {
4632 "ARI ChannelLeftBridge has undocumented field %s\n",
4634 res = 0;
4635 }
4636 }
4637
4638 if (!has_type) {
4639 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field type\n");
4640 res = 0;
4641 }
4642
4643 if (!has_application) {
4644 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field application\n");
4645 res = 0;
4646 }
4647
4648 if (!has_timestamp) {
4649 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field timestamp\n");
4650 res = 0;
4651 }
4652
4653 if (!has_bridge) {
4654 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field bridge\n");
4655 res = 0;
4656 }
4657
4658 if (!has_channel) {
4659 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field channel\n");
4660 res = 0;
4661 }
4662
4663 return res;
4664}
4665
4667{
4669}
4670
4672{
4673 int res = 1;
4674 struct ast_json_iter *iter;
4675 int has_type = 0;
4676 int has_application = 0;
4677 int has_timestamp = 0;
4678 int has_channel = 0;
4679
4680 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4681 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4682 int prop_is_valid;
4683 prop_is_valid = ast_ari_validate_string(
4685 if (!prop_is_valid) {
4686 ast_log(LOG_ERROR, "ARI ChannelStateChange field asterisk_id failed validation\n");
4687 res = 0;
4688 }
4689 } else
4690 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4691 int prop_is_valid;
4692 has_type = 1;
4693 prop_is_valid = ast_ari_validate_string(
4695 if (!prop_is_valid) {
4696 ast_log(LOG_ERROR, "ARI ChannelStateChange field type failed validation\n");
4697 res = 0;
4698 }
4699 } else
4700 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4701 int prop_is_valid;
4702 has_application = 1;
4703 prop_is_valid = ast_ari_validate_string(
4705 if (!prop_is_valid) {
4706 ast_log(LOG_ERROR, "ARI ChannelStateChange field application failed validation\n");
4707 res = 0;
4708 }
4709 } else
4710 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4711 int prop_is_valid;
4712 has_timestamp = 1;
4713 prop_is_valid = ast_ari_validate_date(
4715 if (!prop_is_valid) {
4716 ast_log(LOG_ERROR, "ARI ChannelStateChange field timestamp failed validation\n");
4717 res = 0;
4718 }
4719 } else
4720 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4721 int prop_is_valid;
4722 has_channel = 1;
4723 prop_is_valid = ast_ari_validate_channel(
4725 if (!prop_is_valid) {
4726 ast_log(LOG_ERROR, "ARI ChannelStateChange field channel failed validation\n");
4727 res = 0;
4728 }
4729 } else
4730 {
4732 "ARI ChannelStateChange has undocumented field %s\n",
4734 res = 0;
4735 }
4736 }
4737
4738 if (!has_type) {
4739 ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field type\n");
4740 res = 0;
4741 }
4742
4743 if (!has_application) {
4744 ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field application\n");
4745 res = 0;
4746 }
4747
4748 if (!has_timestamp) {
4749 ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field timestamp\n");
4750 res = 0;
4751 }
4752
4753 if (!has_channel) {
4754 ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field channel\n");
4755 res = 0;
4756 }
4757
4758 return res;
4759}
4760
4762{
4764}
4765
4767{
4768 int res = 1;
4769 struct ast_json_iter *iter;
4770 int has_type = 0;
4771 int has_application = 0;
4772 int has_timestamp = 0;
4773 int has_channel = 0;
4774 int has_duration = 0;
4775
4776 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4777 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4778 int prop_is_valid;
4779 prop_is_valid = ast_ari_validate_string(
4781 if (!prop_is_valid) {
4782 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field asterisk_id failed validation\n");
4783 res = 0;
4784 }
4785 } else
4786 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4787 int prop_is_valid;
4788 has_type = 1;
4789 prop_is_valid = ast_ari_validate_string(
4791 if (!prop_is_valid) {
4792 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field type failed validation\n");
4793 res = 0;
4794 }
4795 } else
4796 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4797 int prop_is_valid;
4798 has_application = 1;
4799 prop_is_valid = ast_ari_validate_string(
4801 if (!prop_is_valid) {
4802 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field application failed validation\n");
4803 res = 0;
4804 }
4805 } else
4806 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4807 int prop_is_valid;
4808 has_timestamp = 1;
4809 prop_is_valid = ast_ari_validate_date(
4811 if (!prop_is_valid) {
4812 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field timestamp failed validation\n");
4813 res = 0;
4814 }
4815 } else
4816 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4817 int prop_is_valid;
4818 has_channel = 1;
4819 prop_is_valid = ast_ari_validate_channel(
4821 if (!prop_is_valid) {
4822 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field channel failed validation\n");
4823 res = 0;
4824 }
4825 } else
4826 if (strcmp("duration", ast_json_object_iter_key(iter)) == 0) {
4827 int prop_is_valid;
4828 has_duration = 1;
4829 prop_is_valid = ast_ari_validate_int(
4831 if (!prop_is_valid) {
4832 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field duration failed validation\n");
4833 res = 0;
4834 }
4835 } else
4836 {
4838 "ARI ChannelTalkingFinished has undocumented field %s\n",
4840 res = 0;
4841 }
4842 }
4843
4844 if (!has_type) {
4845 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field type\n");
4846 res = 0;
4847 }
4848
4849 if (!has_application) {
4850 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field application\n");
4851 res = 0;
4852 }
4853
4854 if (!has_timestamp) {
4855 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field timestamp\n");
4856 res = 0;
4857 }
4858
4859 if (!has_channel) {
4860 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field channel\n");
4861 res = 0;
4862 }
4863
4864 if (!has_duration) {
4865 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field duration\n");
4866 res = 0;
4867 }
4868
4869 return res;
4870}
4871
4873{
4875}
4876
4878{
4879 int res = 1;
4880 struct ast_json_iter *iter;
4881 int has_type = 0;
4882 int has_application = 0;
4883 int has_timestamp = 0;
4884 int has_channel = 0;
4885
4886 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4887 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4888 int prop_is_valid;
4889 prop_is_valid = ast_ari_validate_string(
4891 if (!prop_is_valid) {
4892 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field asterisk_id failed validation\n");
4893 res = 0;
4894 }
4895 } else
4896 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4897 int prop_is_valid;
4898 has_type = 1;
4899 prop_is_valid = ast_ari_validate_string(
4901 if (!prop_is_valid) {
4902 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field type failed validation\n");
4903 res = 0;
4904 }
4905 } else
4906 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4907 int prop_is_valid;
4908 has_application = 1;
4909 prop_is_valid = ast_ari_validate_string(
4911 if (!prop_is_valid) {
4912 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field application failed validation\n");
4913 res = 0;
4914 }
4915 } else
4916 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4917 int prop_is_valid;
4918 has_timestamp = 1;
4919 prop_is_valid = ast_ari_validate_date(
4921 if (!prop_is_valid) {
4922 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field timestamp failed validation\n");
4923 res = 0;
4924 }
4925 } else
4926 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4927 int prop_is_valid;
4928 has_channel = 1;
4929 prop_is_valid = ast_ari_validate_channel(
4931 if (!prop_is_valid) {
4932 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field channel failed validation\n");
4933 res = 0;
4934 }
4935 } else
4936 {
4938 "ARI ChannelTalkingStarted has undocumented field %s\n",
4940 res = 0;
4941 }
4942 }
4943
4944 if (!has_type) {
4945 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field type\n");
4946 res = 0;
4947 }
4948
4949 if (!has_application) {
4950 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field application\n");
4951 res = 0;
4952 }
4953
4954 if (!has_timestamp) {
4955 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field timestamp\n");
4956 res = 0;
4957 }
4958
4959 if (!has_channel) {
4960 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field channel\n");
4961 res = 0;
4962 }
4963
4964 return res;
4965}
4966
4968{
4970}
4971
4973{
4974 int res = 1;
4975 struct ast_json_iter *iter;
4976 int has_type = 0;
4977 int has_application = 0;
4978 int has_timestamp = 0;
4979 int has_channel = 0;
4980
4981 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4982 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4983 int prop_is_valid;
4984 prop_is_valid = ast_ari_validate_string(
4986 if (!prop_is_valid) {
4987 ast_log(LOG_ERROR, "ARI ChannelToneDetected field asterisk_id failed validation\n");
4988 res = 0;
4989 }
4990 } else
4991 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4992 int prop_is_valid;
4993 has_type = 1;
4994 prop_is_valid = ast_ari_validate_string(
4996 if (!prop_is_valid) {
4997 ast_log(LOG_ERROR, "ARI ChannelToneDetected field type failed validation\n");
4998 res = 0;
4999 }
5000 } else
5001 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5002 int prop_is_valid;
5003 has_application = 1;
5004 prop_is_valid = ast_ari_validate_string(
5006 if (!prop_is_valid) {
5007 ast_log(LOG_ERROR, "ARI ChannelToneDetected field application failed validation\n");
5008 res = 0;
5009 }
5010 } else
5011 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5012 int prop_is_valid;
5013 has_timestamp = 1;
5014 prop_is_valid = ast_ari_validate_date(
5016 if (!prop_is_valid) {
5017 ast_log(LOG_ERROR, "ARI ChannelToneDetected field timestamp failed validation\n");
5018 res = 0;
5019 }
5020 } else
5021 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5022 int prop_is_valid;
5023 has_channel = 1;
5024 prop_is_valid = ast_ari_validate_channel(
5026 if (!prop_is_valid) {
5027 ast_log(LOG_ERROR, "ARI ChannelToneDetected field channel failed validation\n");
5028 res = 0;
5029 }
5030 } else
5031 {
5033 "ARI ChannelToneDetected has undocumented field %s\n",
5035 res = 0;
5036 }
5037 }
5038
5039 if (!has_type) {
5040 ast_log(LOG_ERROR, "ARI ChannelToneDetected missing required field type\n");
5041 res = 0;
5042 }
5043
5044 if (!has_application) {
5045 ast_log(LOG_ERROR, "ARI ChannelToneDetected missing required field application\n");
5046 res = 0;
5047 }
5048
5049 if (!has_timestamp) {
5050 ast_log(LOG_ERROR, "ARI ChannelToneDetected missing required field timestamp\n");
5051 res = 0;
5052 }
5053
5054 if (!has_channel) {
5055 ast_log(LOG_ERROR, "ARI ChannelToneDetected missing required field channel\n");
5056 res = 0;
5057 }
5058
5059 return res;
5060}
5061
5063{
5065}
5066
5068{
5069 int res = 1;
5070 struct ast_json_iter *iter;
5071 int has_type = 0;
5072 int has_application = 0;
5073 int has_timestamp = 0;
5074 int has_refer_to = 0;
5075 int has_referred_by = 0;
5076
5077 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5078 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5079 int prop_is_valid;
5080 prop_is_valid = ast_ari_validate_string(
5082 if (!prop_is_valid) {
5083 ast_log(LOG_ERROR, "ARI ChannelTransfer field asterisk_id failed validation\n");
5084 res = 0;
5085 }
5086 } else
5087 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5088 int prop_is_valid;
5089 has_type = 1;
5090 prop_is_valid = ast_ari_validate_string(
5092 if (!prop_is_valid) {
5093 ast_log(LOG_ERROR, "ARI ChannelTransfer field type failed validation\n");
5094 res = 0;
5095 }
5096 } else
5097 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5098 int prop_is_valid;
5099 has_application = 1;
5100 prop_is_valid = ast_ari_validate_string(
5102 if (!prop_is_valid) {
5103 ast_log(LOG_ERROR, "ARI ChannelTransfer field application failed validation\n");
5104 res = 0;
5105 }
5106 } else
5107 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5108 int prop_is_valid;
5109 has_timestamp = 1;
5110 prop_is_valid = ast_ari_validate_date(
5112 if (!prop_is_valid) {
5113 ast_log(LOG_ERROR, "ARI ChannelTransfer field timestamp failed validation\n");
5114 res = 0;
5115 }
5116 } else
5117 if (strcmp("refer_to", ast_json_object_iter_key(iter)) == 0) {
5118 int prop_is_valid;
5119 has_refer_to = 1;
5120 prop_is_valid = ast_ari_validate_refer_to(
5122 if (!prop_is_valid) {
5123 ast_log(LOG_ERROR, "ARI ChannelTransfer field refer_to failed validation\n");
5124 res = 0;
5125 }
5126 } else
5127 if (strcmp("referred_by", ast_json_object_iter_key(iter)) == 0) {
5128 int prop_is_valid;
5129 has_referred_by = 1;
5130 prop_is_valid = ast_ari_validate_referred_by(
5132 if (!prop_is_valid) {
5133 ast_log(LOG_ERROR, "ARI ChannelTransfer field referred_by failed validation\n");
5134 res = 0;
5135 }
5136 } else
5137 if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
5138 int prop_is_valid;
5139 prop_is_valid = ast_ari_validate_string(
5141 if (!prop_is_valid) {
5142 ast_log(LOG_ERROR, "ARI ChannelTransfer field state failed validation\n");
5143 res = 0;
5144 }
5145 } else
5146 {
5148 "ARI ChannelTransfer has undocumented field %s\n",
5150 res = 0;
5151 }
5152 }
5153
5154 if (!has_type) {
5155 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field type\n");
5156 res = 0;
5157 }
5158
5159 if (!has_application) {
5160 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field application\n");
5161 res = 0;
5162 }
5163
5164 if (!has_timestamp) {
5165 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field timestamp\n");
5166 res = 0;
5167 }
5168
5169 if (!has_refer_to) {
5170 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field refer_to\n");
5171 res = 0;
5172 }
5173
5174 if (!has_referred_by) {
5175 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field referred_by\n");
5176 res = 0;
5177 }
5178
5179 return res;
5180}
5181
5183{
5185}
5186
5188{
5189 int res = 1;
5190 struct ast_json_iter *iter;
5191 int has_type = 0;
5192 int has_application = 0;
5193 int has_timestamp = 0;
5194 int has_channel = 0;
5195
5196 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5197 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5198 int prop_is_valid;
5199 prop_is_valid = ast_ari_validate_string(
5201 if (!prop_is_valid) {
5202 ast_log(LOG_ERROR, "ARI ChannelUnhold field asterisk_id failed validation\n");
5203 res = 0;
5204 }
5205 } else
5206 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5207 int prop_is_valid;
5208 has_type = 1;
5209 prop_is_valid = ast_ari_validate_string(
5211 if (!prop_is_valid) {
5212 ast_log(LOG_ERROR, "ARI ChannelUnhold field type failed validation\n");
5213 res = 0;
5214 }
5215 } else
5216 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5217 int prop_is_valid;
5218 has_application = 1;
5219 prop_is_valid = ast_ari_validate_string(
5221 if (!prop_is_valid) {
5222 ast_log(LOG_ERROR, "ARI ChannelUnhold field application failed validation\n");
5223 res = 0;
5224 }
5225 } else
5226 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5227 int prop_is_valid;
5228 has_timestamp = 1;
5229 prop_is_valid = ast_ari_validate_date(
5231 if (!prop_is_valid) {
5232 ast_log(LOG_ERROR, "ARI ChannelUnhold field timestamp failed validation\n");
5233 res = 0;
5234 }
5235 } else
5236 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5237 int prop_is_valid;
5238 has_channel = 1;
5239 prop_is_valid = ast_ari_validate_channel(
5241 if (!prop_is_valid) {
5242 ast_log(LOG_ERROR, "ARI ChannelUnhold field channel failed validation\n");
5243 res = 0;
5244 }
5245 } else
5246 {
5248 "ARI ChannelUnhold has undocumented field %s\n",
5250 res = 0;
5251 }
5252 }
5253
5254 if (!has_type) {
5255 ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field type\n");
5256 res = 0;
5257 }
5258
5259 if (!has_application) {
5260 ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field application\n");
5261 res = 0;
5262 }
5263
5264 if (!has_timestamp) {
5265 ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field timestamp\n");
5266 res = 0;
5267 }
5268
5269 if (!has_channel) {
5270 ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field channel\n");
5271 res = 0;
5272 }
5273
5274 return res;
5275}
5276
5278{
5280}
5281
5283{
5284 int res = 1;
5285 struct ast_json_iter *iter;
5286 int has_type = 0;
5287 int has_application = 0;
5288 int has_timestamp = 0;
5289 int has_eventname = 0;
5290 int has_userevent = 0;
5291
5292 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5293 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5294 int prop_is_valid;
5295 prop_is_valid = ast_ari_validate_string(
5297 if (!prop_is_valid) {
5298 ast_log(LOG_ERROR, "ARI ChannelUserevent field asterisk_id failed validation\n");
5299 res = 0;
5300 }
5301 } else
5302 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5303 int prop_is_valid;
5304 has_type = 1;
5305 prop_is_valid = ast_ari_validate_string(
5307 if (!prop_is_valid) {
5308 ast_log(LOG_ERROR, "ARI ChannelUserevent field type failed validation\n");
5309 res = 0;
5310 }
5311 } else
5312 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5313 int prop_is_valid;
5314 has_application = 1;
5315 prop_is_valid = ast_ari_validate_string(
5317 if (!prop_is_valid) {
5318 ast_log(LOG_ERROR, "ARI ChannelUserevent field application failed validation\n");
5319 res = 0;
5320 }
5321 } else
5322 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5323 int prop_is_valid;
5324 has_timestamp = 1;
5325 prop_is_valid = ast_ari_validate_date(
5327 if (!prop_is_valid) {
5328 ast_log(LOG_ERROR, "ARI ChannelUserevent field timestamp failed validation\n");
5329 res = 0;
5330 }
5331 } else
5332 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
5333 int prop_is_valid;
5334 prop_is_valid = ast_ari_validate_bridge(
5336 if (!prop_is_valid) {
5337 ast_log(LOG_ERROR, "ARI ChannelUserevent field bridge failed validation\n");
5338 res = 0;
5339 }
5340 } else
5341 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5342 int prop_is_valid;
5343 prop_is_valid = ast_ari_validate_channel(
5345 if (!prop_is_valid) {
5346 ast_log(LOG_ERROR, "ARI ChannelUserevent field channel failed validation\n");
5347 res = 0;
5348 }
5349 } else
5350 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
5351 int prop_is_valid;
5352 prop_is_valid = ast_ari_validate_endpoint(
5354 if (!prop_is_valid) {
5355 ast_log(LOG_ERROR, "ARI ChannelUserevent field endpoint failed validation\n");
5356 res = 0;
5357 }
5358 } else
5359 if (strcmp("eventname", ast_json_object_iter_key(iter)) == 0) {
5360 int prop_is_valid;
5361 has_eventname = 1;
5362 prop_is_valid = ast_ari_validate_string(
5364 if (!prop_is_valid) {
5365 ast_log(LOG_ERROR, "ARI ChannelUserevent field eventname failed validation\n");
5366 res = 0;
5367 }
5368 } else
5369 if (strcmp("userevent", ast_json_object_iter_key(iter)) == 0) {
5370 int prop_is_valid;
5371 has_userevent = 1;
5372 prop_is_valid = ast_ari_validate_object(
5374 if (!prop_is_valid) {
5375 ast_log(LOG_ERROR, "ARI ChannelUserevent field userevent failed validation\n");
5376 res = 0;
5377 }
5378 } else
5379 {
5381 "ARI ChannelUserevent has undocumented field %s\n",
5383 res = 0;
5384 }
5385 }
5386
5387 if (!has_type) {
5388 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field type\n");
5389 res = 0;
5390 }
5391
5392 if (!has_application) {
5393 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field application\n");
5394 res = 0;
5395 }
5396
5397 if (!has_timestamp) {
5398 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field timestamp\n");
5399 res = 0;
5400 }
5401
5402 if (!has_eventname) {
5403 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field eventname\n");
5404 res = 0;
5405 }
5406
5407 if (!has_userevent) {
5408 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field userevent\n");
5409 res = 0;
5410 }
5411
5412 return res;
5413}
5414
5416{
5418}
5419
5421{
5422 int res = 1;
5423 struct ast_json_iter *iter;
5424 int has_type = 0;
5425 int has_application = 0;
5426 int has_timestamp = 0;
5427 int has_value = 0;
5428 int has_variable = 0;
5429
5430 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5431 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5432 int prop_is_valid;
5433 prop_is_valid = ast_ari_validate_string(
5435 if (!prop_is_valid) {
5436 ast_log(LOG_ERROR, "ARI ChannelVarset field asterisk_id failed validation\n");
5437 res = 0;
5438 }
5439 } else
5440 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5441 int prop_is_valid;
5442 has_type = 1;
5443 prop_is_valid = ast_ari_validate_string(
5445 if (!prop_is_valid) {
5446 ast_log(LOG_ERROR, "ARI ChannelVarset field type failed validation\n");
5447 res = 0;
5448 }
5449 } else
5450 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5451 int prop_is_valid;
5452 has_application = 1;
5453 prop_is_valid = ast_ari_validate_string(
5455 if (!prop_is_valid) {
5456 ast_log(LOG_ERROR, "ARI ChannelVarset field application failed validation\n");
5457 res = 0;
5458 }
5459 } else
5460 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5461 int prop_is_valid;
5462 has_timestamp = 1;
5463 prop_is_valid = ast_ari_validate_date(
5465 if (!prop_is_valid) {
5466 ast_log(LOG_ERROR, "ARI ChannelVarset field timestamp failed validation\n");
5467 res = 0;
5468 }
5469 } else
5470 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5471 int prop_is_valid;
5472 prop_is_valid = ast_ari_validate_channel(
5474 if (!prop_is_valid) {
5475 ast_log(LOG_ERROR, "ARI ChannelVarset field channel failed validation\n");
5476 res = 0;
5477 }
5478 } else
5479 if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
5480 int prop_is_valid;
5481 has_value = 1;
5482 prop_is_valid = ast_ari_validate_string(
5484 if (!prop_is_valid) {
5485 ast_log(LOG_ERROR, "ARI ChannelVarset field value failed validation\n");
5486 res = 0;
5487 }
5488 } else
5489 if (strcmp("variable", ast_json_object_iter_key(iter)) == 0) {
5490 int prop_is_valid;
5491 has_variable = 1;
5492 prop_is_valid = ast_ari_validate_string(
5494 if (!prop_is_valid) {
5495 ast_log(LOG_ERROR, "ARI ChannelVarset field variable failed validation\n");
5496 res = 0;
5497 }
5498 } else
5499 {
5501 "ARI ChannelVarset has undocumented field %s\n",
5503 res = 0;
5504 }
5505 }
5506
5507 if (!has_type) {
5508 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field type\n");
5509 res = 0;
5510 }
5511
5512 if (!has_application) {
5513 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field application\n");
5514 res = 0;
5515 }
5516
5517 if (!has_timestamp) {
5518 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field timestamp\n");
5519 res = 0;
5520 }
5521
5522 if (!has_value) {
5523 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field value\n");
5524 res = 0;
5525 }
5526
5527 if (!has_variable) {
5528 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field variable\n");
5529 res = 0;
5530 }
5531
5532 return res;
5533}
5534
5536{
5538}
5539
5541{
5542 int res = 1;
5543 struct ast_json_iter *iter;
5544 int has_aor = 0;
5545 int has_contact_status = 0;
5546 int has_uri = 0;
5547
5548 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5549 if (strcmp("aor", ast_json_object_iter_key(iter)) == 0) {
5550 int prop_is_valid;
5551 has_aor = 1;
5552 prop_is_valid = ast_ari_validate_string(
5554 if (!prop_is_valid) {
5555 ast_log(LOG_ERROR, "ARI ContactInfo field aor failed validation\n");
5556 res = 0;
5557 }
5558 } else
5559 if (strcmp("contact_status", ast_json_object_iter_key(iter)) == 0) {
5560 int prop_is_valid;
5561 has_contact_status = 1;
5562 prop_is_valid = ast_ari_validate_string(
5564 if (!prop_is_valid) {
5565 ast_log(LOG_ERROR, "ARI ContactInfo field contact_status failed validation\n");
5566 res = 0;
5567 }
5568 } else
5569 if (strcmp("roundtrip_usec", ast_json_object_iter_key(iter)) == 0) {
5570 int prop_is_valid;
5571 prop_is_valid = ast_ari_validate_string(
5573 if (!prop_is_valid) {
5574 ast_log(LOG_ERROR, "ARI ContactInfo field roundtrip_usec failed validation\n");
5575 res = 0;
5576 }
5577 } else
5578 if (strcmp("uri", ast_json_object_iter_key(iter)) == 0) {
5579 int prop_is_valid;
5580 has_uri = 1;
5581 prop_is_valid = ast_ari_validate_string(
5583 if (!prop_is_valid) {
5584 ast_log(LOG_ERROR, "ARI ContactInfo field uri failed validation\n");
5585 res = 0;
5586 }
5587 } else
5588 {
5590 "ARI ContactInfo has undocumented field %s\n",
5592 res = 0;
5593 }
5594 }
5595
5596 if (!has_aor) {
5597 ast_log(LOG_ERROR, "ARI ContactInfo missing required field aor\n");
5598 res = 0;
5599 }
5600
5601 if (!has_contact_status) {
5602 ast_log(LOG_ERROR, "ARI ContactInfo missing required field contact_status\n");
5603 res = 0;
5604 }
5605
5606 if (!has_uri) {
5607 ast_log(LOG_ERROR, "ARI ContactInfo missing required field uri\n");
5608 res = 0;
5609 }
5610
5611 return res;
5612}
5613
5615{
5617}
5618
5620{
5621 int res = 1;
5622 struct ast_json_iter *iter;
5623 int has_type = 0;
5624 int has_application = 0;
5625 int has_timestamp = 0;
5626 int has_contact_info = 0;
5627 int has_endpoint = 0;
5628
5629 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5630 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5631 int prop_is_valid;
5632 prop_is_valid = ast_ari_validate_string(
5634 if (!prop_is_valid) {
5635 ast_log(LOG_ERROR, "ARI ContactStatusChange field asterisk_id failed validation\n");
5636 res = 0;
5637 }
5638 } else
5639 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5640 int prop_is_valid;
5641 has_type = 1;
5642 prop_is_valid = ast_ari_validate_string(
5644 if (!prop_is_valid) {
5645 ast_log(LOG_ERROR, "ARI ContactStatusChange field type failed validation\n");
5646 res = 0;
5647 }
5648 } else
5649 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5650 int prop_is_valid;
5651 has_application = 1;
5652 prop_is_valid = ast_ari_validate_string(
5654 if (!prop_is_valid) {
5655 ast_log(LOG_ERROR, "ARI ContactStatusChange field application failed validation\n");
5656 res = 0;
5657 }
5658 } else
5659 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5660 int prop_is_valid;
5661 has_timestamp = 1;
5662 prop_is_valid = ast_ari_validate_date(
5664 if (!prop_is_valid) {
5665 ast_log(LOG_ERROR, "ARI ContactStatusChange field timestamp failed validation\n");
5666 res = 0;
5667 }
5668 } else
5669 if (strcmp("contact_info", ast_json_object_iter_key(iter)) == 0) {
5670 int prop_is_valid;
5671 has_contact_info = 1;
5672 prop_is_valid = ast_ari_validate_contact_info(
5674 if (!prop_is_valid) {
5675 ast_log(LOG_ERROR, "ARI ContactStatusChange field contact_info failed validation\n");
5676 res = 0;
5677 }
5678 } else
5679 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
5680 int prop_is_valid;
5681 has_endpoint = 1;
5682 prop_is_valid = ast_ari_validate_endpoint(
5684 if (!prop_is_valid) {
5685 ast_log(LOG_ERROR, "ARI ContactStatusChange field endpoint failed validation\n");
5686 res = 0;
5687 }
5688 } else
5689 {
5691 "ARI ContactStatusChange has undocumented field %s\n",
5693 res = 0;
5694 }
5695 }
5696
5697 if (!has_type) {
5698 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field type\n");
5699 res = 0;
5700 }
5701
5702 if (!has_application) {
5703 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field application\n");
5704 res = 0;
5705 }
5706
5707 if (!has_timestamp) {
5708 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field timestamp\n");
5709 res = 0;
5710 }
5711
5712 if (!has_contact_info) {
5713 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field contact_info\n");
5714 res = 0;
5715 }
5716
5717 if (!has_endpoint) {
5718 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field endpoint\n");
5719 res = 0;
5720 }
5721
5722 return res;
5723}
5724
5726{
5728}
5729
5731{
5732 int res = 1;
5733 struct ast_json_iter *iter;
5734 int has_type = 0;
5735 int has_application = 0;
5736 int has_timestamp = 0;
5737 int has_device_state = 0;
5738
5739 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5740 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5741 int prop_is_valid;
5742 prop_is_valid = ast_ari_validate_string(
5744 if (!prop_is_valid) {
5745 ast_log(LOG_ERROR, "ARI DeviceStateChanged field asterisk_id failed validation\n");
5746 res = 0;
5747 }
5748 } else
5749 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5750 int prop_is_valid;
5751 has_type = 1;
5752 prop_is_valid = ast_ari_validate_string(
5754 if (!prop_is_valid) {
5755 ast_log(LOG_ERROR, "ARI DeviceStateChanged field type failed validation\n");
5756 res = 0;
5757 }
5758 } else
5759 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5760 int prop_is_valid;
5761 has_application = 1;
5762 prop_is_valid = ast_ari_validate_string(
5764 if (!prop_is_valid) {
5765 ast_log(LOG_ERROR, "ARI DeviceStateChanged field application failed validation\n");
5766 res = 0;
5767 }
5768 } else
5769 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5770 int prop_is_valid;
5771 has_timestamp = 1;
5772 prop_is_valid = ast_ari_validate_date(
5774 if (!prop_is_valid) {
5775 ast_log(LOG_ERROR, "ARI DeviceStateChanged field timestamp failed validation\n");
5776 res = 0;
5777 }
5778 } else
5779 if (strcmp("device_state", ast_json_object_iter_key(iter)) == 0) {
5780 int prop_is_valid;
5781 has_device_state = 1;
5782 prop_is_valid = ast_ari_validate_device_state(
5784 if (!prop_is_valid) {
5785 ast_log(LOG_ERROR, "ARI DeviceStateChanged field device_state failed validation\n");
5786 res = 0;
5787 }
5788 } else
5789 {
5791 "ARI DeviceStateChanged has undocumented field %s\n",
5793 res = 0;
5794 }
5795 }
5796
5797 if (!has_type) {
5798 ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field type\n");
5799 res = 0;
5800 }
5801
5802 if (!has_application) {
5803 ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field application\n");
5804 res = 0;
5805 }
5806
5807 if (!has_timestamp) {
5808 ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field timestamp\n");
5809 res = 0;
5810 }
5811
5812 if (!has_device_state) {
5813 ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field device_state\n");
5814 res = 0;
5815 }
5816
5817 return res;
5818}
5819
5821{
5823}
5824
5826{
5827 int res = 1;
5828 struct ast_json_iter *iter;
5829 int has_type = 0;
5830 int has_application = 0;
5831 int has_timestamp = 0;
5832 int has_dialstatus = 0;
5833 int has_peer = 0;
5834
5835 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5836 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5837 int prop_is_valid;
5838 prop_is_valid = ast_ari_validate_string(
5840 if (!prop_is_valid) {
5841 ast_log(LOG_ERROR, "ARI Dial field asterisk_id failed validation\n");
5842 res = 0;
5843 }
5844 } else
5845 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5846 int prop_is_valid;
5847 has_type = 1;
5848 prop_is_valid = ast_ari_validate_string(
5850 if (!prop_is_valid) {
5851 ast_log(LOG_ERROR, "ARI Dial field type failed validation\n");
5852 res = 0;
5853 }
5854 } else
5855 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5856 int prop_is_valid;
5857 has_application = 1;
5858 prop_is_valid = ast_ari_validate_string(
5860 if (!prop_is_valid) {
5861 ast_log(LOG_ERROR, "ARI Dial field application failed validation\n");
5862 res = 0;
5863 }
5864 } else
5865 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5866 int prop_is_valid;
5867 has_timestamp = 1;
5868 prop_is_valid = ast_ari_validate_date(
5870 if (!prop_is_valid) {
5871 ast_log(LOG_ERROR, "ARI Dial field timestamp failed validation\n");
5872 res = 0;
5873 }
5874 } else
5875 if (strcmp("caller", ast_json_object_iter_key(iter)) == 0) {
5876 int prop_is_valid;
5877 prop_is_valid = ast_ari_validate_channel(
5879 if (!prop_is_valid) {
5880 ast_log(LOG_ERROR, "ARI Dial field caller failed validation\n");
5881 res = 0;
5882 }
5883 } else
5884 if (strcmp("dialstatus", ast_json_object_iter_key(iter)) == 0) {
5885 int prop_is_valid;
5886 has_dialstatus = 1;
5887 prop_is_valid = ast_ari_validate_string(
5889 if (!prop_is_valid) {
5890 ast_log(LOG_ERROR, "ARI Dial field dialstatus failed validation\n");
5891 res = 0;
5892 }
5893 } else
5894 if (strcmp("dialstring", ast_json_object_iter_key(iter)) == 0) {
5895 int prop_is_valid;
5896 prop_is_valid = ast_ari_validate_string(
5898 if (!prop_is_valid) {
5899 ast_log(LOG_ERROR, "ARI Dial field dialstring failed validation\n");
5900 res = 0;
5901 }
5902 } else
5903 if (strcmp("forward", ast_json_object_iter_key(iter)) == 0) {
5904 int prop_is_valid;
5905 prop_is_valid = ast_ari_validate_string(
5907 if (!prop_is_valid) {
5908 ast_log(LOG_ERROR, "ARI Dial field forward failed validation\n");
5909 res = 0;
5910 }
5911 } else
5912 if (strcmp("forwarded", ast_json_object_iter_key(iter)) == 0) {
5913 int prop_is_valid;
5914 prop_is_valid = ast_ari_validate_channel(
5916 if (!prop_is_valid) {
5917 ast_log(LOG_ERROR, "ARI Dial field forwarded failed validation\n");
5918 res = 0;
5919 }
5920 } else
5921 if (strcmp("peer", ast_json_object_iter_key(iter)) == 0) {
5922 int prop_is_valid;
5923 has_peer = 1;
5924 prop_is_valid = ast_ari_validate_channel(
5926 if (!prop_is_valid) {
5927 ast_log(LOG_ERROR, "ARI Dial field peer failed validation\n");
5928 res = 0;
5929 }
5930 } else
5931 {
5933 "ARI Dial has undocumented field %s\n",
5935 res = 0;
5936 }
5937 }
5938
5939 if (!has_type) {
5940 ast_log(LOG_ERROR, "ARI Dial missing required field type\n");
5941 res = 0;
5942 }
5943
5944 if (!has_application) {
5945 ast_log(LOG_ERROR, "ARI Dial missing required field application\n");
5946 res = 0;
5947 }
5948
5949 if (!has_timestamp) {
5950 ast_log(LOG_ERROR, "ARI Dial missing required field timestamp\n");
5951 res = 0;
5952 }
5953
5954 if (!has_dialstatus) {
5955 ast_log(LOG_ERROR, "ARI Dial missing required field dialstatus\n");
5956 res = 0;
5957 }
5958
5959 if (!has_peer) {
5960 ast_log(LOG_ERROR, "ARI Dial missing required field peer\n");
5961 res = 0;
5962 }
5963
5964 return res;
5965}
5966
5968{
5969 return ast_ari_validate_dial;
5970}
5971
5973{
5974 int res = 1;
5975 struct ast_json_iter *iter;
5976 int has_type = 0;
5977 int has_application = 0;
5978 int has_timestamp = 0;
5979 int has_endpoint = 0;
5980
5981 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5982 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5983 int prop_is_valid;
5984 prop_is_valid = ast_ari_validate_string(
5986 if (!prop_is_valid) {
5987 ast_log(LOG_ERROR, "ARI EndpointStateChange field asterisk_id failed validation\n");
5988 res = 0;
5989 }
5990 } else
5991 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5992 int prop_is_valid;
5993 has_type = 1;
5994 prop_is_valid = ast_ari_validate_string(
5996 if (!prop_is_valid) {
5997 ast_log(LOG_ERROR, "ARI EndpointStateChange field type failed validation\n");
5998 res = 0;
5999 }
6000 } else
6001 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6002 int prop_is_valid;
6003 has_application = 1;
6004 prop_is_valid = ast_ari_validate_string(
6006 if (!prop_is_valid) {
6007 ast_log(LOG_ERROR, "ARI EndpointStateChange field application failed validation\n");
6008 res = 0;
6009 }
6010 } else
6011 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6012 int prop_is_valid;
6013 has_timestamp = 1;
6014 prop_is_valid = ast_ari_validate_date(
6016 if (!prop_is_valid) {
6017 ast_log(LOG_ERROR, "ARI EndpointStateChange field timestamp failed validation\n");
6018 res = 0;
6019 }
6020 } else
6021 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
6022 int prop_is_valid;
6023 has_endpoint = 1;
6024 prop_is_valid = ast_ari_validate_endpoint(
6026 if (!prop_is_valid) {
6027 ast_log(LOG_ERROR, "ARI EndpointStateChange field endpoint failed validation\n");
6028 res = 0;
6029 }
6030 } else
6031 {
6033 "ARI EndpointStateChange has undocumented field %s\n",
6035 res = 0;
6036 }
6037 }
6038
6039 if (!has_type) {
6040 ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field type\n");
6041 res = 0;
6042 }
6043
6044 if (!has_application) {
6045 ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field application\n");
6046 res = 0;
6047 }
6048
6049 if (!has_timestamp) {
6050 ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field timestamp\n");
6051 res = 0;
6052 }
6053
6054 if (!has_endpoint) {
6055 ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field endpoint\n");
6056 res = 0;
6057 }
6058
6059 return res;
6060}
6061
6063{
6065}
6066
6068{
6069 int res = 1;
6070 struct ast_json_iter *iter;
6071 int has_type = 0;
6072 int has_application = 0;
6073 int has_timestamp = 0;
6074 const char *discriminator;
6075
6076 discriminator = ast_json_string_get(ast_json_object_get(json, "type"));
6077 if (!discriminator) {
6078 ast_log(LOG_ERROR, "ARI Event missing required field type\n");
6079 return 0;
6080 }
6081
6082 if (strcmp("Event", discriminator) == 0) {
6083 /* Self type; fall through */
6084 } else
6085 if (strcmp("ApplicationMoveFailed", discriminator) == 0) {
6087 } else
6088 if (strcmp("ApplicationReplaced", discriminator) == 0) {
6090 } else
6091 if (strcmp("BridgeAttendedTransfer", discriminator) == 0) {
6093 } else
6094 if (strcmp("BridgeBlindTransfer", discriminator) == 0) {
6096 } else
6097 if (strcmp("BridgeCreated", discriminator) == 0) {
6099 } else
6100 if (strcmp("BridgeDestroyed", discriminator) == 0) {
6102 } else
6103 if (strcmp("BridgeMerged", discriminator) == 0) {
6104 return ast_ari_validate_bridge_merged(json);
6105 } else
6106 if (strcmp("BridgeVideoSourceChanged", discriminator) == 0) {
6108 } else
6109 if (strcmp("ChannelCallerId", discriminator) == 0) {
6111 } else
6112 if (strcmp("ChannelConnectedLine", discriminator) == 0) {
6114 } else
6115 if (strcmp("ChannelCreated", discriminator) == 0) {
6117 } else
6118 if (strcmp("ChannelDestroyed", discriminator) == 0) {
6120 } else
6121 if (strcmp("ChannelDialplan", discriminator) == 0) {
6123 } else
6124 if (strcmp("ChannelDtmfReceived", discriminator) == 0) {
6126 } else
6127 if (strcmp("ChannelEnteredBridge", discriminator) == 0) {
6129 } else
6130 if (strcmp("ChannelHangupRequest", discriminator) == 0) {
6132 } else
6133 if (strcmp("ChannelHold", discriminator) == 0) {
6134 return ast_ari_validate_channel_hold(json);
6135 } else
6136 if (strcmp("ChannelLeftBridge", discriminator) == 0) {
6138 } else
6139 if (strcmp("ChannelStateChange", discriminator) == 0) {
6141 } else
6142 if (strcmp("ChannelTalkingFinished", discriminator) == 0) {
6144 } else
6145 if (strcmp("ChannelTalkingStarted", discriminator) == 0) {
6147 } else
6148 if (strcmp("ChannelToneDetected", discriminator) == 0) {
6150 } else
6151 if (strcmp("ChannelTransfer", discriminator) == 0) {
6153 } else
6154 if (strcmp("ChannelUnhold", discriminator) == 0) {
6156 } else
6157 if (strcmp("ChannelUserevent", discriminator) == 0) {
6159 } else
6160 if (strcmp("ChannelVarset", discriminator) == 0) {
6162 } else
6163 if (strcmp("ContactStatusChange", discriminator) == 0) {
6165 } else
6166 if (strcmp("DeviceStateChanged", discriminator) == 0) {
6168 } else
6169 if (strcmp("Dial", discriminator) == 0) {
6170 return ast_ari_validate_dial(json);
6171 } else
6172 if (strcmp("EndpointStateChange", discriminator) == 0) {
6174 } else
6175 if (strcmp("PeerStatusChange", discriminator) == 0) {
6177 } else
6178 if (strcmp("PlaybackContinuing", discriminator) == 0) {
6180 } else
6181 if (strcmp("PlaybackFinished", discriminator) == 0) {
6183 } else
6184 if (strcmp("PlaybackStarted", discriminator) == 0) {
6186 } else
6187 if (strcmp("RESTResponse", discriminator) == 0) {
6188 return ast_ari_validate_restresponse(json);
6189 } else
6190 if (strcmp("RecordingFailed", discriminator) == 0) {
6192 } else
6193 if (strcmp("RecordingFinished", discriminator) == 0) {
6195 } else
6196 if (strcmp("RecordingStarted", discriminator) == 0) {
6198 } else
6199 if (strcmp("StasisEnd", discriminator) == 0) {
6200 return ast_ari_validate_stasis_end(json);
6201 } else
6202 if (strcmp("StasisStart", discriminator) == 0) {
6203 return ast_ari_validate_stasis_start(json);
6204 } else
6205 if (strcmp("TextMessageReceived", discriminator) == 0) {
6207 } else
6208 {
6209 ast_log(LOG_ERROR, "ARI Event has undocumented subtype %s\n",
6210 discriminator);
6211 res = 0;
6212 }
6213
6214 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6215 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6216 int prop_is_valid;
6217 prop_is_valid = ast_ari_validate_string(
6219 if (!prop_is_valid) {
6220 ast_log(LOG_ERROR, "ARI Event field asterisk_id failed validation\n");
6221 res = 0;
6222 }
6223 } else
6224 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6225 int prop_is_valid;
6226 has_type = 1;
6227 prop_is_valid = ast_ari_validate_string(
6229 if (!prop_is_valid) {
6230 ast_log(LOG_ERROR, "ARI Event field type failed validation\n");
6231 res = 0;
6232 }
6233 } else
6234 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6235 int prop_is_valid;
6236 has_application = 1;
6237 prop_is_valid = ast_ari_validate_string(
6239 if (!prop_is_valid) {
6240 ast_log(LOG_ERROR, "ARI Event field application failed validation\n");
6241 res = 0;
6242 }
6243 } else
6244 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6245 int prop_is_valid;
6246 has_timestamp = 1;
6247 prop_is_valid = ast_ari_validate_date(
6249 if (!prop_is_valid) {
6250 ast_log(LOG_ERROR, "ARI Event field timestamp failed validation\n");
6251 res = 0;
6252 }
6253 } else
6254 {
6256 "ARI Event has undocumented field %s\n",
6258 res = 0;
6259 }
6260 }
6261
6262 if (!has_type) {
6263 ast_log(LOG_ERROR, "ARI Event missing required field type\n");
6264 res = 0;
6265 }
6266
6267 if (!has_application) {
6268 ast_log(LOG_ERROR, "ARI Event missing required field application\n");
6269 res = 0;
6270 }
6271
6272 if (!has_timestamp) {
6273 ast_log(LOG_ERROR, "ARI Event missing required field timestamp\n");
6274 res = 0;
6275 }
6276
6277 return res;
6278}
6279
6281{
6283}
6284
6286{
6287 int res = 1;
6288 struct ast_json_iter *iter;
6289 int has_type = 0;
6290 const char *discriminator;
6291
6292 discriminator = ast_json_string_get(ast_json_object_get(json, "type"));
6293 if (!discriminator) {
6294 ast_log(LOG_ERROR, "ARI Message missing required field type\n");
6295 return 0;
6296 }
6297
6298 if (strcmp("Message", discriminator) == 0) {
6299 /* Self type; fall through */
6300 } else
6301 if (strcmp("ApplicationMoveFailed", discriminator) == 0) {
6303 } else
6304 if (strcmp("ApplicationReplaced", discriminator) == 0) {
6306 } else
6307 if (strcmp("BridgeAttendedTransfer", discriminator) == 0) {
6309 } else
6310 if (strcmp("BridgeBlindTransfer", discriminator) == 0) {
6312 } else
6313 if (strcmp("BridgeCreated", discriminator) == 0) {
6315 } else
6316 if (strcmp("BridgeDestroyed", discriminator) == 0) {
6318 } else
6319 if (strcmp("BridgeMerged", discriminator) == 0) {
6320 return ast_ari_validate_bridge_merged(json);
6321 } else
6322 if (strcmp("BridgeVideoSourceChanged", discriminator) == 0) {
6324 } else
6325 if (strcmp("ChannelCallerId", discriminator) == 0) {
6327 } else
6328 if (strcmp("ChannelConnectedLine", discriminator) == 0) {
6330 } else
6331 if (strcmp("ChannelCreated", discriminator) == 0) {
6333 } else
6334 if (strcmp("ChannelDestroyed", discriminator) == 0) {
6336 } else
6337 if (strcmp("ChannelDialplan", discriminator) == 0) {
6339 } else
6340 if (strcmp("ChannelDtmfReceived", discriminator) == 0) {
6342 } else
6343 if (strcmp("ChannelEnteredBridge", discriminator) == 0) {
6345 } else
6346 if (strcmp("ChannelHangupRequest", discriminator) == 0) {
6348 } else
6349 if (strcmp("ChannelHold", discriminator) == 0) {
6350 return ast_ari_validate_channel_hold(json);
6351 } else
6352 if (strcmp("ChannelLeftBridge", discriminator) == 0) {
6354 } else
6355 if (strcmp("ChannelStateChange", discriminator) == 0) {
6357 } else
6358 if (strcmp("ChannelTalkingFinished", discriminator) == 0) {
6360 } else
6361 if (strcmp("ChannelTalkingStarted", discriminator) == 0) {
6363 } else
6364 if (strcmp("ChannelToneDetected", discriminator) == 0) {
6366 } else
6367 if (strcmp("ChannelTransfer", discriminator) == 0) {
6369 } else
6370 if (strcmp("ChannelUnhold", discriminator) == 0) {
6372 } else
6373 if (strcmp("ChannelUserevent", discriminator) == 0) {
6375 } else
6376 if (strcmp("ChannelVarset", discriminator) == 0) {
6378 } else
6379 if (strcmp("ContactStatusChange", discriminator) == 0) {
6381 } else
6382 if (strcmp("DeviceStateChanged", discriminator) == 0) {
6384 } else
6385 if (strcmp("Dial", discriminator) == 0) {
6386 return ast_ari_validate_dial(json);
6387 } else
6388 if (strcmp("EndpointStateChange", discriminator) == 0) {
6390 } else
6391 if (strcmp("Event", discriminator) == 0) {
6392 return ast_ari_validate_event(json);
6393 } else
6394 if (strcmp("MissingParams", discriminator) == 0) {
6396 } else
6397 if (strcmp("PeerStatusChange", discriminator) == 0) {
6399 } else
6400 if (strcmp("PlaybackContinuing", discriminator) == 0) {
6402 } else
6403 if (strcmp("PlaybackFinished", discriminator) == 0) {
6405 } else
6406 if (strcmp("PlaybackStarted", discriminator) == 0) {
6408 } else
6409 if (strcmp("RESTResponse", discriminator) == 0) {
6410 return ast_ari_validate_restresponse(json);
6411 } else
6412 if (strcmp("RecordingFailed", discriminator) == 0) {
6414 } else
6415 if (strcmp("RecordingFinished", discriminator) == 0) {
6417 } else
6418 if (strcmp("RecordingStarted", discriminator) == 0) {
6420 } else
6421 if (strcmp("StasisEnd", discriminator) == 0) {
6422 return ast_ari_validate_stasis_end(json);
6423 } else
6424 if (strcmp("StasisStart", discriminator) == 0) {
6425 return ast_ari_validate_stasis_start(json);
6426 } else
6427 if (strcmp("TextMessageReceived", discriminator) == 0) {
6429 } else
6430 {
6431 ast_log(LOG_ERROR, "ARI Message has undocumented subtype %s\n",
6432 discriminator);
6433 res = 0;
6434 }
6435
6436 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6437 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6438 int prop_is_valid;
6439 prop_is_valid = ast_ari_validate_string(
6441 if (!prop_is_valid) {
6442 ast_log(LOG_ERROR, "ARI Message field asterisk_id failed validation\n");
6443 res = 0;
6444 }
6445 } else
6446 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6447 int prop_is_valid;
6448 has_type = 1;
6449 prop_is_valid = ast_ari_validate_string(
6451 if (!prop_is_valid) {
6452 ast_log(LOG_ERROR, "ARI Message field type failed validation\n");
6453 res = 0;
6454 }
6455 } else
6456 {
6458 "ARI Message has undocumented field %s\n",
6460 res = 0;
6461 }
6462 }
6463
6464 if (!has_type) {
6465 ast_log(LOG_ERROR, "ARI Message missing required field type\n");
6466 res = 0;
6467 }
6468
6469 return res;
6470}
6471
6473{
6475}
6476
6478{
6479 int res = 1;
6480 struct ast_json_iter *iter;
6481 int has_type = 0;
6482 int has_params = 0;
6483
6484 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6485 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6486 int prop_is_valid;
6487 prop_is_valid = ast_ari_validate_string(
6489 if (!prop_is_valid) {
6490 ast_log(LOG_ERROR, "ARI MissingParams field asterisk_id failed validation\n");
6491 res = 0;
6492 }
6493 } else
6494 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6495 int prop_is_valid;
6496 has_type = 1;
6497 prop_is_valid = ast_ari_validate_string(
6499 if (!prop_is_valid) {
6500 ast_log(LOG_ERROR, "ARI MissingParams field type failed validation\n");
6501 res = 0;
6502 }
6503 } else
6504 if (strcmp("params", ast_json_object_iter_key(iter)) == 0) {
6505 int prop_is_valid;
6506 has_params = 1;
6507 prop_is_valid = ast_ari_validate_list(
6510 if (!prop_is_valid) {
6511 ast_log(LOG_ERROR, "ARI MissingParams field params failed validation\n");
6512 res = 0;
6513 }
6514 } else
6515 {
6517 "ARI MissingParams has undocumented field %s\n",
6519 res = 0;
6520 }
6521 }
6522
6523 if (!has_type) {
6524 ast_log(LOG_ERROR, "ARI MissingParams missing required field type\n");
6525 res = 0;
6526 }
6527
6528 if (!has_params) {
6529 ast_log(LOG_ERROR, "ARI MissingParams missing required field params\n");
6530 res = 0;
6531 }
6532
6533 return res;
6534}
6535
6537{
6539}
6540
6542{
6543 int res = 1;
6544 struct ast_json_iter *iter;
6545 int has_peer_status = 0;
6546
6547 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6548 if (strcmp("address", ast_json_object_iter_key(iter)) == 0) {
6549 int prop_is_valid;
6550 prop_is_valid = ast_ari_validate_string(
6552 if (!prop_is_valid) {
6553 ast_log(LOG_ERROR, "ARI Peer field address failed validation\n");
6554 res = 0;
6555 }
6556 } else
6557 if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
6558 int prop_is_valid;
6559 prop_is_valid = ast_ari_validate_string(
6561 if (!prop_is_valid) {
6562 ast_log(LOG_ERROR, "ARI Peer field cause failed validation\n");
6563 res = 0;
6564 }
6565 } else
6566 if (strcmp("peer_status", ast_json_object_iter_key(iter)) == 0) {
6567 int prop_is_valid;
6568 has_peer_status = 1;
6569 prop_is_valid = ast_ari_validate_string(
6571 if (!prop_is_valid) {
6572 ast_log(LOG_ERROR, "ARI Peer field peer_status failed validation\n");
6573 res = 0;
6574 }
6575 } else
6576 if (strcmp("port", ast_json_object_iter_key(iter)) == 0) {
6577 int prop_is_valid;
6578 prop_is_valid = ast_ari_validate_string(
6580 if (!prop_is_valid) {
6581 ast_log(LOG_ERROR, "ARI Peer field port failed validation\n");
6582 res = 0;
6583 }
6584 } else
6585 if (strcmp("time", ast_json_object_iter_key(iter)) == 0) {
6586 int prop_is_valid;
6587 prop_is_valid = ast_ari_validate_string(
6589 if (!prop_is_valid) {
6590 ast_log(LOG_ERROR, "ARI Peer field time failed validation\n");
6591 res = 0;
6592 }
6593 } else
6594 {
6596 "ARI Peer has undocumented field %s\n",
6598 res = 0;
6599 }
6600 }
6601
6602 if (!has_peer_status) {
6603 ast_log(LOG_ERROR, "ARI Peer missing required field peer_status\n");
6604 res = 0;
6605 }
6606
6607 return res;
6608}
6609
6611{
6612 return ast_ari_validate_peer;
6613}
6614
6616{
6617 int res = 1;
6618 struct ast_json_iter *iter;
6619 int has_type = 0;
6620 int has_application = 0;
6621 int has_timestamp = 0;
6622 int has_endpoint = 0;
6623 int has_peer = 0;
6624
6625 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6626 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6627 int prop_is_valid;
6628 prop_is_valid = ast_ari_validate_string(
6630 if (!prop_is_valid) {
6631 ast_log(LOG_ERROR, "ARI PeerStatusChange field asterisk_id failed validation\n");
6632 res = 0;
6633 }
6634 } else
6635 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6636 int prop_is_valid;
6637 has_type = 1;
6638 prop_is_valid = ast_ari_validate_string(
6640 if (!prop_is_valid) {
6641 ast_log(LOG_ERROR, "ARI PeerStatusChange field type failed validation\n");
6642 res = 0;
6643 }
6644 } else
6645 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6646 int prop_is_valid;
6647 has_application = 1;
6648 prop_is_valid = ast_ari_validate_string(
6650 if (!prop_is_valid) {
6651 ast_log(LOG_ERROR, "ARI PeerStatusChange field application failed validation\n");
6652 res = 0;
6653 }
6654 } else
6655 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6656 int prop_is_valid;
6657 has_timestamp = 1;
6658 prop_is_valid = ast_ari_validate_date(
6660 if (!prop_is_valid) {
6661 ast_log(LOG_ERROR, "ARI PeerStatusChange field timestamp failed validation\n");
6662 res = 0;
6663 }
6664 } else
6665 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
6666 int prop_is_valid;
6667 has_endpoint = 1;
6668 prop_is_valid = ast_ari_validate_endpoint(
6670 if (!prop_is_valid) {
6671 ast_log(LOG_ERROR, "ARI PeerStatusChange field endpoint failed validation\n");
6672 res = 0;
6673 }
6674 } else
6675 if (strcmp("peer", ast_json_object_iter_key(iter)) == 0) {
6676 int prop_is_valid;
6677 has_peer = 1;
6678 prop_is_valid = ast_ari_validate_peer(
6680 if (!prop_is_valid) {
6681 ast_log(LOG_ERROR, "ARI PeerStatusChange field peer failed validation\n");
6682 res = 0;
6683 }
6684 } else
6685 {
6687 "ARI PeerStatusChange has undocumented field %s\n",
6689 res = 0;
6690 }
6691 }
6692
6693 if (!has_type) {
6694 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field type\n");
6695 res = 0;
6696 }
6697
6698 if (!has_application) {
6699 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field application\n");
6700 res = 0;
6701 }
6702
6703 if (!has_timestamp) {
6704 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field timestamp\n");
6705 res = 0;
6706 }
6707
6708 if (!has_endpoint) {
6709 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field endpoint\n");
6710 res = 0;
6711 }
6712
6713 if (!has_peer) {
6714 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field peer\n");
6715 res = 0;
6716 }
6717
6718 return res;
6719}
6720
6722{
6724}
6725
6727{
6728 int res = 1;
6729 struct ast_json_iter *iter;
6730 int has_type = 0;
6731 int has_application = 0;
6732 int has_timestamp = 0;
6733 int has_playback = 0;
6734
6735 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6736 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6737 int prop_is_valid;
6738 prop_is_valid = ast_ari_validate_string(
6740 if (!prop_is_valid) {
6741 ast_log(LOG_ERROR, "ARI PlaybackContinuing field asterisk_id failed validation\n");
6742 res = 0;
6743 }
6744 } else
6745 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6746 int prop_is_valid;
6747 has_type = 1;
6748 prop_is_valid = ast_ari_validate_string(
6750 if (!prop_is_valid) {
6751 ast_log(LOG_ERROR, "ARI PlaybackContinuing field type failed validation\n");
6752 res = 0;
6753 }
6754 } else
6755 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6756 int prop_is_valid;
6757 has_application = 1;
6758 prop_is_valid = ast_ari_validate_string(
6760 if (!prop_is_valid) {
6761 ast_log(LOG_ERROR, "ARI PlaybackContinuing field application failed validation\n");
6762 res = 0;
6763 }
6764 } else
6765 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6766 int prop_is_valid;
6767 has_timestamp = 1;
6768 prop_is_valid = ast_ari_validate_date(
6770 if (!prop_is_valid) {
6771 ast_log(LOG_ERROR, "ARI PlaybackContinuing field timestamp failed validation\n");
6772 res = 0;
6773 }
6774 } else
6775 if (strcmp("playback", ast_json_object_iter_key(iter)) == 0) {
6776 int prop_is_valid;
6777 has_playback = 1;
6778 prop_is_valid = ast_ari_validate_playback(
6780 if (!prop_is_valid) {
6781 ast_log(LOG_ERROR, "ARI PlaybackContinuing field playback failed validation\n");
6782 res = 0;
6783 }
6784 } else
6785 {
6787 "ARI PlaybackContinuing has undocumented field %s\n",
6789 res = 0;
6790 }
6791 }
6792
6793 if (!has_type) {
6794 ast_log(LOG_ERROR, "ARI PlaybackContinuing missing required field type\n");
6795 res = 0;
6796 }
6797
6798 if (!has_application) {
6799 ast_log(LOG_ERROR, "ARI PlaybackContinuing missing required field application\n");
6800 res = 0;
6801 }
6802
6803 if (!has_timestamp) {
6804 ast_log(LOG_ERROR, "ARI PlaybackContinuing missing required field timestamp\n");
6805 res = 0;
6806 }
6807
6808 if (!has_playback) {
6809 ast_log(LOG_ERROR, "ARI PlaybackContinuing missing required field playback\n");
6810 res = 0;
6811 }
6812
6813 return res;
6814}
6815
6817{
6819}
6820
6822{
6823 int res = 1;
6824 struct ast_json_iter *iter;
6825 int has_type = 0;
6826 int has_application = 0;
6827 int has_timestamp = 0;
6828 int has_playback = 0;
6829
6830 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6831 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6832 int prop_is_valid;
6833 prop_is_valid = ast_ari_validate_string(
6835 if (!prop_is_valid) {
6836 ast_log(LOG_ERROR, "ARI PlaybackFinished field asterisk_id failed validation\n");
6837 res = 0;
6838 }
6839 } else
6840 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6841 int prop_is_valid;
6842 has_type = 1;
6843 prop_is_valid = ast_ari_validate_string(
6845 if (!prop_is_valid) {
6846 ast_log(LOG_ERROR, "ARI PlaybackFinished field type failed validation\n");
6847 res = 0;
6848 }
6849 } else
6850 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6851 int prop_is_valid;
6852 has_application = 1;
6853 prop_is_valid = ast_ari_validate_string(
6855 if (!prop_is_valid) {
6856 ast_log(LOG_ERROR, "ARI PlaybackFinished field application failed validation\n");
6857 res = 0;
6858 }
6859 } else
6860 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6861 int prop_is_valid;
6862 has_timestamp = 1;
6863 prop_is_valid = ast_ari_validate_date(
6865 if (!prop_is_valid) {
6866 ast_log(LOG_ERROR, "ARI PlaybackFinished field timestamp failed validation\n");
6867 res = 0;
6868 }
6869 } else
6870 if (strcmp("playback", ast_json_object_iter_key(iter)) == 0) {
6871 int prop_is_valid;
6872 has_playback = 1;
6873 prop_is_valid = ast_ari_validate_playback(
6875 if (!prop_is_valid) {
6876 ast_log(LOG_ERROR, "ARI PlaybackFinished field playback failed validation\n");
6877 res = 0;
6878 }
6879 } else
6880 {
6882 "ARI PlaybackFinished has undocumented field %s\n",
6884 res = 0;
6885 }
6886 }
6887
6888 if (!has_type) {
6889 ast_log(LOG_ERROR, "ARI PlaybackFinished missing required field type\n");
6890 res = 0;
6891 }
6892
6893 if (!has_application) {
6894 ast_log(LOG_ERROR, "ARI PlaybackFinished missing required field application\n");
6895 res = 0;
6896 }
6897
6898 if (!has_timestamp) {
6899 ast_log(LOG_ERROR, "ARI PlaybackFinished missing required field timestamp\n");
6900 res = 0;
6901 }
6902
6903 if (!has_playback) {
6904 ast_log(LOG_ERROR, "ARI PlaybackFinished missing required field playback\n");
6905 res = 0;
6906 }
6907
6908 return res;
6909}
6910
6912{
6914}
6915
6917{
6918 int res = 1;
6919 struct ast_json_iter *iter;
6920 int has_type = 0;
6921 int has_application = 0;
6922 int has_timestamp = 0;
6923 int has_playback = 0;
6924
6925 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6926 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6927 int prop_is_valid;
6928 prop_is_valid = ast_ari_validate_string(
6930 if (!prop_is_valid) {
6931 ast_log(LOG_ERROR, "ARI PlaybackStarted field asterisk_id failed validation\n");
6932 res = 0;
6933 }
6934 } else
6935 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6936 int prop_is_valid;
6937 has_type = 1;
6938 prop_is_valid = ast_ari_validate_string(
6940 if (!prop_is_valid) {
6941 ast_log(LOG_ERROR, "ARI PlaybackStarted field type failed validation\n");
6942 res = 0;
6943 }
6944 } else
6945 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6946 int prop_is_valid;
6947 has_application = 1;
6948 prop_is_valid = ast_ari_validate_string(
6950 if (!prop_is_valid) {
6951 ast_log(LOG_ERROR, "ARI PlaybackStarted field application failed validation\n");
6952 res = 0;
6953 }
6954 } else
6955 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6956 int prop_is_valid;
6957 has_timestamp = 1;
6958 prop_is_valid = ast_ari_validate_date(
6960 if (!prop_is_valid) {
6961 ast_log(LOG_ERROR, "ARI PlaybackStarted field timestamp failed validation\n");
6962 res = 0;
6963 }
6964 } else
6965 if (strcmp("playback", ast_json_object_iter_key(iter)) == 0) {
6966 int prop_is_valid;
6967 has_playback = 1;
6968 prop_is_valid = ast_ari_validate_playback(
6970 if (!prop_is_valid) {
6971 ast_log(LOG_ERROR, "ARI PlaybackStarted field playback failed validation\n");
6972 res = 0;
6973 }
6974 } else
6975 {
6977 "ARI PlaybackStarted has undocumented field %s\n",
6979 res = 0;
6980 }
6981 }
6982
6983 if (!has_type) {
6984 ast_log(LOG_ERROR, "ARI PlaybackStarted missing required field type\n");
6985 res = 0;
6986 }
6987
6988 if (!has_application) {
6989 ast_log(LOG_ERROR, "ARI PlaybackStarted missing required field application\n");
6990 res = 0;
6991 }
6992
6993 if (!has_timestamp) {
6994 ast_log(LOG_ERROR, "ARI PlaybackStarted missing required field timestamp\n");
6995 res = 0;
6996 }
6997
6998 if (!has_playback) {
6999 ast_log(LOG_ERROR, "ARI PlaybackStarted missing required field playback\n");
7000 res = 0;
7001 }
7002
7003 return res;
7004}
7005
7007{
7009}
7010
7012{
7013 int res = 1;
7014 struct ast_json_iter *iter;
7015 int has_name = 0;
7016 int has_value = 0;
7017
7018 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7019 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
7020 int prop_is_valid;
7021 has_name = 1;
7022 prop_is_valid = ast_ari_validate_string(
7024 if (!prop_is_valid) {
7025 ast_log(LOG_ERROR, "ARI RESTHeader field name failed validation\n");
7026 res = 0;
7027 }
7028 } else
7029 if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
7030 int prop_is_valid;
7031 has_value = 1;
7032 prop_is_valid = ast_ari_validate_string(
7034 if (!prop_is_valid) {
7035 ast_log(LOG_ERROR, "ARI RESTHeader field value failed validation\n");
7036 res = 0;
7037 }
7038 } else
7039 {
7041 "ARI RESTHeader has undocumented field %s\n",
7043 res = 0;
7044 }
7045 }
7046
7047 if (!has_name) {
7048 ast_log(LOG_ERROR, "ARI RESTHeader missing required field name\n");
7049 res = 0;
7050 }
7051
7052 if (!has_value) {
7053 ast_log(LOG_ERROR, "ARI RESTHeader missing required field value\n");
7054 res = 0;
7055 }
7056
7057 return res;
7058}
7059
7061{
7063}
7064
7066{
7067 int res = 1;
7068 struct ast_json_iter *iter;
7069 int has_name = 0;
7070 int has_value = 0;
7071
7072 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7073 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
7074 int prop_is_valid;
7075 has_name = 1;
7076 prop_is_valid = ast_ari_validate_string(
7078 if (!prop_is_valid) {
7079 ast_log(LOG_ERROR, "ARI RESTQueryStringParameter field name failed validation\n");
7080 res = 0;
7081 }
7082 } else
7083 if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
7084 int prop_is_valid;
7085 has_value = 1;
7086 prop_is_valid = ast_ari_validate_string(
7088 if (!prop_is_valid) {
7089 ast_log(LOG_ERROR, "ARI RESTQueryStringParameter field value failed validation\n");
7090 res = 0;
7091 }
7092 } else
7093 {
7095 "ARI RESTQueryStringParameter has undocumented field %s\n",
7097 res = 0;
7098 }
7099 }
7100
7101 if (!has_name) {
7102 ast_log(LOG_ERROR, "ARI RESTQueryStringParameter missing required field name\n");
7103 res = 0;
7104 }
7105
7106 if (!has_value) {
7107 ast_log(LOG_ERROR, "ARI RESTQueryStringParameter missing required field value\n");
7108 res = 0;
7109 }
7110
7111 return res;
7112}
7113
7115{
7117}
7118
7120{
7121 int res = 1;
7122 struct ast_json_iter *iter;
7123 int has_method = 0;
7124 int has_request_id = 0;
7125 int has_transaction_id = 0;
7126 int has_type = 0;
7127 int has_uri = 0;
7128
7129 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7130 if (strcmp("content_type", ast_json_object_iter_key(iter)) == 0) {
7131 int prop_is_valid;
7132 prop_is_valid = ast_ari_validate_string(
7134 if (!prop_is_valid) {
7135 ast_log(LOG_ERROR, "ARI RESTRequest field content_type failed validation\n");
7136 res = 0;
7137 }
7138 } else
7139 if (strcmp("message_body", ast_json_object_iter_key(iter)) == 0) {
7140 int prop_is_valid;
7141 prop_is_valid = ast_ari_validate_string(
7143 if (!prop_is_valid) {
7144 ast_log(LOG_ERROR, "ARI RESTRequest field message_body failed validation\n");
7145 res = 0;
7146 }
7147 } else
7148 if (strcmp("method", ast_json_object_iter_key(iter)) == 0) {
7149 int prop_is_valid;
7150 has_method = 1;
7151 prop_is_valid = ast_ari_validate_string(
7153 if (!prop_is_valid) {
7154 ast_log(LOG_ERROR, "ARI RESTRequest field method failed validation\n");
7155 res = 0;
7156 }
7157 } else
7158 if (strcmp("query_strings", ast_json_object_iter_key(iter)) == 0) {
7159 int prop_is_valid;
7160 prop_is_valid = ast_ari_validate_list(
7163 if (!prop_is_valid) {
7164 ast_log(LOG_ERROR, "ARI RESTRequest field query_strings failed validation\n");
7165 res = 0;
7166 }
7167 } else
7168 if (strcmp("request_id", ast_json_object_iter_key(iter)) == 0) {
7169 int prop_is_valid;
7170 has_request_id = 1;
7171 prop_is_valid = ast_ari_validate_string(
7173 if (!prop_is_valid) {
7174 ast_log(LOG_ERROR, "ARI RESTRequest field request_id failed validation\n");
7175 res = 0;
7176 }
7177 } else
7178 if (strcmp("transaction_id", ast_json_object_iter_key(iter)) == 0) {
7179 int prop_is_valid;
7180 has_transaction_id = 1;
7181 prop_is_valid = ast_ari_validate_string(
7183 if (!prop_is_valid) {
7184 ast_log(LOG_ERROR, "ARI RESTRequest field transaction_id failed validation\n");
7185 res = 0;
7186 }
7187 } else
7188 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7189 int prop_is_valid;
7190 has_type = 1;
7191 prop_is_valid = ast_ari_validate_string(
7193 if (!prop_is_valid) {
7194 ast_log(LOG_ERROR, "ARI RESTRequest field type failed validation\n");
7195 res = 0;
7196 }
7197 } else
7198 if (strcmp("uri", ast_json_object_iter_key(iter)) == 0) {
7199 int prop_is_valid;
7200 has_uri = 1;
7201 prop_is_valid = ast_ari_validate_string(
7203 if (!prop_is_valid) {
7204 ast_log(LOG_ERROR, "ARI RESTRequest field uri failed validation\n");
7205 res = 0;
7206 }
7207 } else
7208 {
7210 "ARI RESTRequest has undocumented field %s\n",
7212 res = 0;
7213 }
7214 }
7215
7216 if (!has_method) {
7217 ast_log(LOG_ERROR, "ARI RESTRequest missing required field method\n");
7218 res = 0;
7219 }
7220
7221 if (!has_request_id) {
7222 ast_log(LOG_ERROR, "ARI RESTRequest missing required field request_id\n");
7223 res = 0;
7224 }
7225
7226 if (!has_transaction_id) {
7227 ast_log(LOG_ERROR, "ARI RESTRequest missing required field transaction_id\n");
7228 res = 0;
7229 }
7230
7231 if (!has_type) {
7232 ast_log(LOG_ERROR, "ARI RESTRequest missing required field type\n");
7233 res = 0;
7234 }
7235
7236 if (!has_uri) {
7237 ast_log(LOG_ERROR, "ARI RESTRequest missing required field uri\n");
7238 res = 0;
7239 }
7240
7241 return res;
7242}
7243
7245{
7247}
7248
7250{
7251 int res = 1;
7252 struct ast_json_iter *iter;
7253 int has_type = 0;
7254 int has_application = 0;
7255 int has_timestamp = 0;
7256 int has_reason_phrase = 0;
7257 int has_request_id = 0;
7258 int has_status_code = 0;
7259 int has_transaction_id = 0;
7260 int has_uri = 0;
7261
7262 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7263 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7264 int prop_is_valid;
7265 prop_is_valid = ast_ari_validate_string(
7267 if (!prop_is_valid) {
7268 ast_log(LOG_ERROR, "ARI RESTResponse field asterisk_id failed validation\n");
7269 res = 0;
7270 }
7271 } else
7272 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7273 int prop_is_valid;
7274 has_type = 1;
7275 prop_is_valid = ast_ari_validate_string(
7277 if (!prop_is_valid) {
7278 ast_log(LOG_ERROR, "ARI RESTResponse field type failed validation\n");
7279 res = 0;
7280 }
7281 } else
7282 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7283 int prop_is_valid;
7284 has_application = 1;
7285 prop_is_valid = ast_ari_validate_string(
7287 if (!prop_is_valid) {
7288 ast_log(LOG_ERROR, "ARI RESTResponse field application failed validation\n");
7289 res = 0;
7290 }
7291 } else
7292 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7293 int prop_is_valid;
7294 has_timestamp = 1;
7295 prop_is_valid = ast_ari_validate_date(
7297 if (!prop_is_valid) {
7298 ast_log(LOG_ERROR, "ARI RESTResponse field timestamp failed validation\n");
7299 res = 0;
7300 }
7301 } else
7302 if (strcmp("content_type", ast_json_object_iter_key(iter)) == 0) {
7303 int prop_is_valid;
7304 prop_is_valid = ast_ari_validate_string(
7306 if (!prop_is_valid) {
7307 ast_log(LOG_ERROR, "ARI RESTResponse field content_type failed validation\n");
7308 res = 0;
7309 }
7310 } else
7311 if (strcmp("message_body", ast_json_object_iter_key(iter)) == 0) {
7312 int prop_is_valid;
7313 prop_is_valid = ast_ari_validate_string(
7315 if (!prop_is_valid) {
7316 ast_log(LOG_ERROR, "ARI RESTResponse field message_body failed validation\n");
7317 res = 0;
7318 }
7319 } else
7320 if (strcmp("reason_phrase", ast_json_object_iter_key(iter)) == 0) {
7321 int prop_is_valid;
7322 has_reason_phrase = 1;
7323 prop_is_valid = ast_ari_validate_string(
7325 if (!prop_is_valid) {
7326 ast_log(LOG_ERROR, "ARI RESTResponse field reason_phrase failed validation\n");
7327 res = 0;
7328 }
7329 } else
7330 if (strcmp("request_id", ast_json_object_iter_key(iter)) == 0) {
7331 int prop_is_valid;
7332 has_request_id = 1;
7333 prop_is_valid = ast_ari_validate_string(
7335 if (!prop_is_valid) {
7336 ast_log(LOG_ERROR, "ARI RESTResponse field request_id failed validation\n");
7337 res = 0;
7338 }
7339 } else
7340 if (strcmp("status_code", ast_json_object_iter_key(iter)) == 0) {
7341 int prop_is_valid;
7342 has_status_code = 1;
7343 prop_is_valid = ast_ari_validate_int(
7345 if (!prop_is_valid) {
7346 ast_log(LOG_ERROR, "ARI RESTResponse field status_code failed validation\n");
7347 res = 0;
7348 }
7349 } else
7350 if (strcmp("transaction_id", ast_json_object_iter_key(iter)) == 0) {
7351 int prop_is_valid;
7352 has_transaction_id = 1;
7353 prop_is_valid = ast_ari_validate_string(
7355 if (!prop_is_valid) {
7356 ast_log(LOG_ERROR, "ARI RESTResponse field transaction_id failed validation\n");
7357 res = 0;
7358 }
7359 } else
7360 if (strcmp("uri", ast_json_object_iter_key(iter)) == 0) {
7361 int prop_is_valid;
7362 has_uri = 1;
7363 prop_is_valid = ast_ari_validate_string(
7365 if (!prop_is_valid) {
7366 ast_log(LOG_ERROR, "ARI RESTResponse field uri failed validation\n");
7367 res = 0;
7368 }
7369 } else
7370 {
7372 "ARI RESTResponse has undocumented field %s\n",
7374 res = 0;
7375 }
7376 }
7377
7378 if (!has_type) {
7379 ast_log(LOG_ERROR, "ARI RESTResponse missing required field type\n");
7380 res = 0;
7381 }
7382
7383 if (!has_application) {
7384 ast_log(LOG_ERROR, "ARI RESTResponse missing required field application\n");
7385 res = 0;
7386 }
7387
7388 if (!has_timestamp) {
7389 ast_log(LOG_ERROR, "ARI RESTResponse missing required field timestamp\n");
7390 res = 0;
7391 }
7392
7393 if (!has_reason_phrase) {
7394 ast_log(LOG_ERROR, "ARI RESTResponse missing required field reason_phrase\n");
7395 res = 0;
7396 }
7397
7398 if (!has_request_id) {
7399 ast_log(LOG_ERROR, "ARI RESTResponse missing required field request_id\n");
7400 res = 0;
7401 }
7402
7403 if (!has_status_code) {
7404 ast_log(LOG_ERROR, "ARI RESTResponse missing required field status_code\n");
7405 res = 0;
7406 }
7407
7408 if (!has_transaction_id) {
7409 ast_log(LOG_ERROR, "ARI RESTResponse missing required field transaction_id\n");
7410 res = 0;
7411 }
7412
7413 if (!has_uri) {
7414 ast_log(LOG_ERROR, "ARI RESTResponse missing required field uri\n");
7415 res = 0;
7416 }
7417
7418 return res;
7419}
7420
7422{
7424}
7425
7427{
7428 int res = 1;
7429 struct ast_json_iter *iter;
7430 int has_type = 0;
7431 int has_application = 0;
7432 int has_timestamp = 0;
7433 int has_recording = 0;
7434
7435 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7436 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7437 int prop_is_valid;
7438 prop_is_valid = ast_ari_validate_string(
7440 if (!prop_is_valid) {
7441 ast_log(LOG_ERROR, "ARI RecordingFailed field asterisk_id failed validation\n");
7442 res = 0;
7443 }
7444 } else
7445 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7446 int prop_is_valid;
7447 has_type = 1;
7448 prop_is_valid = ast_ari_validate_string(
7450 if (!prop_is_valid) {
7451 ast_log(LOG_ERROR, "ARI RecordingFailed field type failed validation\n");
7452 res = 0;
7453 }
7454 } else
7455 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7456 int prop_is_valid;
7457 has_application = 1;
7458 prop_is_valid = ast_ari_validate_string(
7460 if (!prop_is_valid) {
7461 ast_log(LOG_ERROR, "ARI RecordingFailed field application failed validation\n");
7462 res = 0;
7463 }
7464 } else
7465 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7466 int prop_is_valid;
7467 has_timestamp = 1;
7468 prop_is_valid = ast_ari_validate_date(
7470 if (!prop_is_valid) {
7471 ast_log(LOG_ERROR, "ARI RecordingFailed field timestamp failed validation\n");
7472 res = 0;
7473 }
7474 } else
7475 if (strcmp("recording", ast_json_object_iter_key(iter)) == 0) {
7476 int prop_is_valid;
7477 has_recording = 1;
7478 prop_is_valid = ast_ari_validate_live_recording(
7480 if (!prop_is_valid) {
7481 ast_log(LOG_ERROR, "ARI RecordingFailed field recording failed validation\n");
7482 res = 0;
7483 }
7484 } else
7485 {
7487 "ARI RecordingFailed has undocumented field %s\n",
7489 res = 0;
7490 }
7491 }
7492
7493 if (!has_type) {
7494 ast_log(LOG_ERROR, "ARI RecordingFailed missing required field type\n");
7495 res = 0;
7496 }
7497
7498 if (!has_application) {
7499 ast_log(LOG_ERROR, "ARI RecordingFailed missing required field application\n");
7500 res = 0;
7501 }
7502
7503 if (!has_timestamp) {
7504 ast_log(LOG_ERROR, "ARI RecordingFailed missing required field timestamp\n");
7505 res = 0;
7506 }
7507
7508 if (!has_recording) {
7509 ast_log(LOG_ERROR, "ARI RecordingFailed missing required field recording\n");
7510 res = 0;
7511 }
7512
7513 return res;
7514}
7515
7517{
7519}
7520
7522{
7523 int res = 1;
7524 struct ast_json_iter *iter;
7525 int has_type = 0;
7526 int has_application = 0;
7527 int has_timestamp = 0;
7528 int has_recording = 0;
7529
7530 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7531 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7532 int prop_is_valid;
7533 prop_is_valid = ast_ari_validate_string(
7535 if (!prop_is_valid) {
7536 ast_log(LOG_ERROR, "ARI RecordingFinished field asterisk_id failed validation\n");
7537 res = 0;
7538 }
7539 } else
7540 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7541 int prop_is_valid;
7542 has_type = 1;
7543 prop_is_valid = ast_ari_validate_string(
7545 if (!prop_is_valid) {
7546 ast_log(LOG_ERROR, "ARI RecordingFinished field type failed validation\n");
7547 res = 0;
7548 }
7549 } else
7550 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7551 int prop_is_valid;
7552 has_application = 1;
7553 prop_is_valid = ast_ari_validate_string(
7555 if (!prop_is_valid) {
7556 ast_log(LOG_ERROR, "ARI RecordingFinished field application failed validation\n");
7557 res = 0;
7558 }
7559 } else
7560 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7561 int prop_is_valid;
7562 has_timestamp = 1;
7563 prop_is_valid = ast_ari_validate_date(
7565 if (!prop_is_valid) {
7566 ast_log(LOG_ERROR, "ARI RecordingFinished field timestamp failed validation\n");
7567 res = 0;
7568 }
7569 } else
7570 if (strcmp("recording", ast_json_object_iter_key(iter)) == 0) {
7571 int prop_is_valid;
7572 has_recording = 1;
7573 prop_is_valid = ast_ari_validate_live_recording(
7575 if (!prop_is_valid) {
7576 ast_log(LOG_ERROR, "ARI RecordingFinished field recording failed validation\n");
7577 res = 0;
7578 }
7579 } else
7580 {
7582 "ARI RecordingFinished has undocumented field %s\n",
7584 res = 0;
7585 }
7586 }
7587
7588 if (!has_type) {
7589 ast_log(LOG_ERROR, "ARI RecordingFinished missing required field type\n");
7590 res = 0;
7591 }
7592
7593 if (!has_application) {
7594 ast_log(LOG_ERROR, "ARI RecordingFinished missing required field application\n");
7595 res = 0;
7596 }
7597
7598 if (!has_timestamp) {
7599 ast_log(LOG_ERROR, "ARI RecordingFinished missing required field timestamp\n");
7600 res = 0;
7601 }
7602
7603 if (!has_recording) {
7604 ast_log(LOG_ERROR, "ARI RecordingFinished missing required field recording\n");
7605 res = 0;
7606 }
7607
7608 return res;
7609}
7610
7612{
7614}
7615
7617{
7618 int res = 1;
7619 struct ast_json_iter *iter;
7620 int has_type = 0;
7621 int has_application = 0;
7622 int has_timestamp = 0;
7623 int has_recording = 0;
7624
7625 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7626 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7627 int prop_is_valid;
7628 prop_is_valid = ast_ari_validate_string(
7630 if (!prop_is_valid) {
7631 ast_log(LOG_ERROR, "ARI RecordingStarted field asterisk_id failed validation\n");
7632 res = 0;
7633 }
7634 } else
7635 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7636 int prop_is_valid;
7637 has_type = 1;
7638 prop_is_valid = ast_ari_validate_string(
7640 if (!prop_is_valid) {
7641 ast_log(LOG_ERROR, "ARI RecordingStarted field type failed validation\n");
7642 res = 0;
7643 }
7644 } else
7645 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7646 int prop_is_valid;
7647 has_application = 1;
7648 prop_is_valid = ast_ari_validate_string(
7650 if (!prop_is_valid) {
7651 ast_log(LOG_ERROR, "ARI RecordingStarted field application failed validation\n");
7652 res = 0;
7653 }
7654 } else
7655 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7656 int prop_is_valid;
7657 has_timestamp = 1;
7658 prop_is_valid = ast_ari_validate_date(
7660 if (!prop_is_valid) {
7661 ast_log(LOG_ERROR, "ARI RecordingStarted field timestamp failed validation\n");
7662 res = 0;
7663 }
7664 } else
7665 if (strcmp("recording", ast_json_object_iter_key(iter)) == 0) {
7666 int prop_is_valid;
7667 has_recording = 1;
7668 prop_is_valid = ast_ari_validate_live_recording(
7670 if (!prop_is_valid) {
7671 ast_log(LOG_ERROR, "ARI RecordingStarted field recording failed validation\n");
7672 res = 0;
7673 }
7674 } else
7675 {
7677 "ARI RecordingStarted has undocumented field %s\n",
7679 res = 0;
7680 }
7681 }
7682
7683 if (!has_type) {
7684 ast_log(LOG_ERROR, "ARI RecordingStarted missing required field type\n");
7685 res = 0;
7686 }
7687
7688 if (!has_application) {
7689 ast_log(LOG_ERROR, "ARI RecordingStarted missing required field application\n");
7690 res = 0;
7691 }
7692
7693 if (!has_timestamp) {
7694 ast_log(LOG_ERROR, "ARI RecordingStarted missing required field timestamp\n");
7695 res = 0;
7696 }
7697
7698 if (!has_recording) {
7699 ast_log(LOG_ERROR, "ARI RecordingStarted missing required field recording\n");
7700 res = 0;
7701 }
7702
7703 return res;
7704}
7705
7707{
7709}
7710
7712{
7713 int res = 1;
7714 struct ast_json_iter *iter;
7715 int has_requested_destination = 0;
7716
7717 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7718 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
7719 int prop_is_valid;
7720 prop_is_valid = ast_ari_validate_bridge(
7722 if (!prop_is_valid) {
7723 ast_log(LOG_ERROR, "ARI ReferTo field bridge failed validation\n");
7724 res = 0;
7725 }
7726 } else
7727 if (strcmp("connected_channel", ast_json_object_iter_key(iter)) == 0) {
7728 int prop_is_valid;
7729 prop_is_valid = ast_ari_validate_channel(
7731 if (!prop_is_valid) {
7732 ast_log(LOG_ERROR, "ARI ReferTo field connected_channel failed validation\n");
7733 res = 0;
7734 }
7735 } else
7736 if (strcmp("destination_channel", ast_json_object_iter_key(iter)) == 0) {
7737 int prop_is_valid;
7738 prop_is_valid = ast_ari_validate_channel(
7740 if (!prop_is_valid) {
7741 ast_log(LOG_ERROR, "ARI ReferTo field destination_channel failed validation\n");
7742 res = 0;
7743 }
7744 } else
7745 if (strcmp("requested_destination", ast_json_object_iter_key(iter)) == 0) {
7746 int prop_is_valid;
7747 has_requested_destination = 1;
7750 if (!prop_is_valid) {
7751 ast_log(LOG_ERROR, "ARI ReferTo field requested_destination failed validation\n");
7752 res = 0;
7753 }
7754 } else
7755 {
7757 "ARI ReferTo has undocumented field %s\n",
7759 res = 0;
7760 }
7761 }
7762
7763 if (!has_requested_destination) {
7764 ast_log(LOG_ERROR, "ARI ReferTo missing required field requested_destination\n");
7765 res = 0;
7766 }
7767
7768 return res;
7769}
7770
7772{
7774}
7775
7777{
7778 int res = 1;
7779 struct ast_json_iter *iter;
7780 int has_source_channel = 0;
7781
7782 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7783 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
7784 int prop_is_valid;
7785 prop_is_valid = ast_ari_validate_bridge(
7787 if (!prop_is_valid) {
7788 ast_log(LOG_ERROR, "ARI ReferredBy field bridge failed validation\n");
7789 res = 0;
7790 }
7791 } else
7792 if (strcmp("connected_channel", ast_json_object_iter_key(iter)) == 0) {
7793 int prop_is_valid;
7794 prop_is_valid = ast_ari_validate_channel(
7796 if (!prop_is_valid) {
7797 ast_log(LOG_ERROR, "ARI ReferredBy field connected_channel failed validation\n");
7798 res = 0;
7799 }
7800 } else
7801 if (strcmp("source_channel", ast_json_object_iter_key(iter)) == 0) {
7802 int prop_is_valid;
7803 has_source_channel = 1;
7804 prop_is_valid = ast_ari_validate_channel(
7806 if (!prop_is_valid) {
7807 ast_log(LOG_ERROR, "ARI ReferredBy field source_channel failed validation\n");
7808 res = 0;
7809 }
7810 } else
7811 {
7813 "ARI ReferredBy has undocumented field %s\n",
7815 res = 0;
7816 }
7817 }
7818
7819 if (!has_source_channel) {
7820 ast_log(LOG_ERROR, "ARI ReferredBy missing required field source_channel\n");
7821 res = 0;
7822 }
7823
7824 return res;
7825}
7826
7828{
7830}
7831
7833{
7834 int res = 1;
7835 struct ast_json_iter *iter;
7836
7837 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7838 if (strcmp("additional_protocol_params", ast_json_object_iter_key(iter)) == 0) {
7839 int prop_is_valid;
7840 prop_is_valid = ast_ari_validate_list(
7843 if (!prop_is_valid) {
7844 ast_log(LOG_ERROR, "ARI RequiredDestination field additional_protocol_params failed validation\n");
7845 res = 0;
7846 }
7847 } else
7848 if (strcmp("destination", ast_json_object_iter_key(iter)) == 0) {
7849 int prop_is_valid;
7850 prop_is_valid = ast_ari_validate_string(
7852 if (!prop_is_valid) {
7853 ast_log(LOG_ERROR, "ARI RequiredDestination field destination failed validation\n");
7854 res = 0;
7855 }
7856 } else
7857 if (strcmp("protocol_id", ast_json_object_iter_key(iter)) == 0) {
7858 int prop_is_valid;
7859 prop_is_valid = ast_ari_validate_string(
7861 if (!prop_is_valid) {
7862 ast_log(LOG_ERROR, "ARI RequiredDestination field protocol_id failed validation\n");
7863 res = 0;
7864 }
7865 } else
7866 {
7868 "ARI RequiredDestination has undocumented field %s\n",
7870 res = 0;
7871 }
7872 }
7873
7874 return res;
7875}
7876
7878{
7880}
7881
7883{
7884 int res = 1;
7885 struct ast_json_iter *iter;
7886 int has_type = 0;
7887 int has_application = 0;
7888 int has_timestamp = 0;
7889 int has_channel = 0;
7890
7891 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7892 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7893 int prop_is_valid;
7894 prop_is_valid = ast_ari_validate_string(
7896 if (!prop_is_valid) {
7897 ast_log(LOG_ERROR, "ARI StasisEnd field asterisk_id failed validation\n");
7898 res = 0;
7899 }
7900 } else
7901 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7902 int prop_is_valid;
7903 has_type = 1;
7904 prop_is_valid = ast_ari_validate_string(
7906 if (!prop_is_valid) {
7907 ast_log(LOG_ERROR, "ARI StasisEnd field type failed validation\n");
7908 res = 0;
7909 }
7910 } else
7911 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7912 int prop_is_valid;
7913 has_application = 1;
7914 prop_is_valid = ast_ari_validate_string(
7916 if (!prop_is_valid) {
7917 ast_log(LOG_ERROR, "ARI StasisEnd field application failed validation\n");
7918 res = 0;
7919 }
7920 } else
7921 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7922 int prop_is_valid;
7923 has_timestamp = 1;
7924 prop_is_valid = ast_ari_validate_date(
7926 if (!prop_is_valid) {
7927 ast_log(LOG_ERROR, "ARI StasisEnd field timestamp failed validation\n");
7928 res = 0;
7929 }
7930 } else
7931 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
7932 int prop_is_valid;
7933 has_channel = 1;
7934 prop_is_valid = ast_ari_validate_channel(
7936 if (!prop_is_valid) {
7937 ast_log(LOG_ERROR, "ARI StasisEnd field channel failed validation\n");
7938 res = 0;
7939 }
7940 } else
7941 {
7943 "ARI StasisEnd has undocumented field %s\n",
7945 res = 0;
7946 }
7947 }
7948
7949 if (!has_type) {
7950 ast_log(LOG_ERROR, "ARI StasisEnd missing required field type\n");
7951 res = 0;
7952 }
7953
7954 if (!has_application) {
7955 ast_log(LOG_ERROR, "ARI StasisEnd missing required field application\n");
7956 res = 0;
7957 }
7958
7959 if (!has_timestamp) {
7960 ast_log(LOG_ERROR, "ARI StasisEnd missing required field timestamp\n");
7961 res = 0;
7962 }
7963
7964 if (!has_channel) {
7965 ast_log(LOG_ERROR, "ARI StasisEnd missing required field channel\n");
7966 res = 0;
7967 }
7968
7969 return res;
7970}
7971
7973{
7975}
7976
7978{
7979 int res = 1;
7980 struct ast_json_iter *iter;
7981 int has_type = 0;
7982 int has_application = 0;
7983 int has_timestamp = 0;
7984 int has_args = 0;
7985 int has_channel = 0;
7986
7987 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7988 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7989 int prop_is_valid;
7990 prop_is_valid = ast_ari_validate_string(
7992 if (!prop_is_valid) {
7993 ast_log(LOG_ERROR, "ARI StasisStart field asterisk_id failed validation\n");
7994 res = 0;
7995 }
7996 } else
7997 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7998 int prop_is_valid;
7999 has_type = 1;
8000 prop_is_valid = ast_ari_validate_string(
8002 if (!prop_is_valid) {
8003 ast_log(LOG_ERROR, "ARI StasisStart field type failed validation\n");
8004 res = 0;
8005 }
8006 } else
8007 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
8008 int prop_is_valid;
8009 has_application = 1;
8010 prop_is_valid = ast_ari_validate_string(
8012 if (!prop_is_valid) {
8013 ast_log(LOG_ERROR, "ARI StasisStart field application failed validation\n");
8014 res = 0;
8015 }
8016 } else
8017 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
8018 int prop_is_valid;
8019 has_timestamp = 1;
8020 prop_is_valid = ast_ari_validate_date(
8022 if (!prop_is_valid) {
8023 ast_log(LOG_ERROR, "ARI StasisStart field timestamp failed validation\n");
8024 res = 0;
8025 }
8026 } else
8027 if (strcmp("args", ast_json_object_iter_key(iter)) == 0) {
8028 int prop_is_valid;
8029 has_args = 1;
8030 prop_is_valid = ast_ari_validate_list(
8033 if (!prop_is_valid) {
8034 ast_log(LOG_ERROR, "ARI StasisStart field args failed validation\n");
8035 res = 0;
8036 }
8037 } else
8038 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
8039 int prop_is_valid;
8040 has_channel = 1;
8041 prop_is_valid = ast_ari_validate_channel(
8043 if (!prop_is_valid) {
8044 ast_log(LOG_ERROR, "ARI StasisStart field channel failed validation\n");
8045 res = 0;
8046 }
8047 } else
8048 if (strcmp("replace_channel", ast_json_object_iter_key(iter)) == 0) {
8049 int prop_is_valid;
8050 prop_is_valid = ast_ari_validate_channel(
8052 if (!prop_is_valid) {
8053 ast_log(LOG_ERROR, "ARI StasisStart field replace_channel failed validation\n");
8054 res = 0;
8055 }
8056 } else
8057 {
8059 "ARI StasisStart has undocumented field %s\n",
8061 res = 0;
8062 }
8063 }
8064
8065 if (!has_type) {
8066 ast_log(LOG_ERROR, "ARI StasisStart missing required field type\n");
8067 res = 0;
8068 }
8069
8070 if (!has_application) {
8071 ast_log(LOG_ERROR, "ARI StasisStart missing required field application\n");
8072 res = 0;
8073 }
8074
8075 if (!has_timestamp) {
8076 ast_log(LOG_ERROR, "ARI StasisStart missing required field timestamp\n");
8077 res = 0;
8078 }
8079
8080 if (!has_args) {
8081 ast_log(LOG_ERROR, "ARI StasisStart missing required field args\n");
8082 res = 0;
8083 }
8084
8085 if (!has_channel) {
8086 ast_log(LOG_ERROR, "ARI StasisStart missing required field channel\n");
8087 res = 0;
8088 }
8089
8090 return res;
8091}
8092
8094{
8096}
8097
8099{
8100 int res = 1;
8101 struct ast_json_iter *iter;
8102 int has_type = 0;
8103 int has_application = 0;
8104 int has_timestamp = 0;
8105 int has_message = 0;
8106
8107 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
8108 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
8109 int prop_is_valid;
8110 prop_is_valid = ast_ari_validate_string(
8112 if (!prop_is_valid) {
8113 ast_log(LOG_ERROR, "ARI TextMessageReceived field asterisk_id failed validation\n");
8114 res = 0;
8115 }
8116 } else
8117 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
8118 int prop_is_valid;
8119 has_type = 1;
8120 prop_is_valid = ast_ari_validate_string(
8122 if (!prop_is_valid) {
8123 ast_log(LOG_ERROR, "ARI TextMessageReceived field type failed validation\n");
8124 res = 0;
8125 }
8126 } else
8127 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
8128 int prop_is_valid;
8129 has_application = 1;
8130 prop_is_valid = ast_ari_validate_string(
8132 if (!prop_is_valid) {
8133 ast_log(LOG_ERROR, "ARI TextMessageReceived field application failed validation\n");
8134 res = 0;
8135 }
8136 } else
8137 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
8138 int prop_is_valid;
8139 has_timestamp = 1;
8140 prop_is_valid = ast_ari_validate_date(
8142 if (!prop_is_valid) {
8143 ast_log(LOG_ERROR, "ARI TextMessageReceived field timestamp failed validation\n");
8144 res = 0;
8145 }
8146 } else
8147 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
8148 int prop_is_valid;
8149 prop_is_valid = ast_ari_validate_endpoint(
8151 if (!prop_is_valid) {
8152 ast_log(LOG_ERROR, "ARI TextMessageReceived field endpoint failed validation\n");
8153 res = 0;
8154 }
8155 } else
8156 if (strcmp("message", ast_json_object_iter_key(iter)) == 0) {
8157 int prop_is_valid;
8158 has_message = 1;
8159 prop_is_valid = ast_ari_validate_text_message(
8161 if (!prop_is_valid) {
8162 ast_log(LOG_ERROR, "ARI TextMessageReceived field message failed validation\n");
8163 res = 0;
8164 }
8165 } else
8166 {
8168 "ARI TextMessageReceived has undocumented field %s\n",
8170 res = 0;
8171 }
8172 }
8173
8174 if (!has_type) {
8175 ast_log(LOG_ERROR, "ARI TextMessageReceived missing required field type\n");
8176 res = 0;
8177 }
8178
8179 if (!has_application) {
8180 ast_log(LOG_ERROR, "ARI TextMessageReceived missing required field application\n");
8181 res = 0;
8182 }
8183
8184 if (!has_timestamp) {
8185 ast_log(LOG_ERROR, "ARI TextMessageReceived missing required field timestamp\n");
8186 res = 0;
8187 }
8188
8189 if (!has_message) {
8190 ast_log(LOG_ERROR, "ARI TextMessageReceived missing required field message\n");
8191 res = 0;
8192 }
8193
8194 return res;
8195}
8196
8198{
8200}
8201
8203{
8204 int res = 1;
8205 struct ast_json_iter *iter;
8206 int has_bridge_ids = 0;
8207 int has_channel_ids = 0;
8208 int has_device_names = 0;
8209 int has_endpoint_ids = 0;
8210 int has_events_allowed = 0;
8211 int has_events_disallowed = 0;
8212 int has_name = 0;
8213
8214 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
8215 if (strcmp("bridge_ids", ast_json_object_iter_key(iter)) == 0) {
8216 int prop_is_valid;
8217 has_bridge_ids = 1;
8218 prop_is_valid = ast_ari_validate_list(
8221 if (!prop_is_valid) {
8222 ast_log(LOG_ERROR, "ARI Application field bridge_ids failed validation\n");
8223 res = 0;
8224 }
8225 } else
8226 if (strcmp("channel_ids", ast_json_object_iter_key(iter)) == 0) {
8227 int prop_is_valid;
8228 has_channel_ids = 1;
8229 prop_is_valid = ast_ari_validate_list(
8232 if (!prop_is_valid) {
8233 ast_log(LOG_ERROR, "ARI Application field channel_ids failed validation\n");
8234 res = 0;
8235 }
8236 } else
8237 if (strcmp("device_names", ast_json_object_iter_key(iter)) == 0) {
8238 int prop_is_valid;
8239 has_device_names = 1;
8240 prop_is_valid = ast_ari_validate_list(
8243 if (!prop_is_valid) {
8244 ast_log(LOG_ERROR, "ARI Application field device_names failed validation\n");
8245 res = 0;
8246 }
8247 } else
8248 if (strcmp("endpoint_ids", ast_json_object_iter_key(iter)) == 0) {
8249 int prop_is_valid;
8250 has_endpoint_ids = 1;
8251 prop_is_valid = ast_ari_validate_list(
8254 if (!prop_is_valid) {
8255 ast_log(LOG_ERROR, "ARI Application field endpoint_ids failed validation\n");
8256 res = 0;
8257 }
8258 } else
8259 if (strcmp("events_allowed", ast_json_object_iter_key(iter)) == 0) {
8260 int prop_is_valid;
8261 has_events_allowed = 1;
8262 prop_is_valid = ast_ari_validate_list(
8265 if (!prop_is_valid) {
8266 ast_log(LOG_ERROR, "ARI Application field events_allowed failed validation\n");
8267 res = 0;
8268 }
8269 } else
8270 if (strcmp("events_disallowed", ast_json_object_iter_key(iter)) == 0) {
8271 int prop_is_valid;
8272 has_events_disallowed = 1;
8273 prop_is_valid = ast_ari_validate_list(
8276 if (!prop_is_valid) {
8277 ast_log(LOG_ERROR, "ARI Application field events_disallowed failed validation\n");
8278 res = 0;
8279 }
8280 } else
8281 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
8282 int prop_is_valid;
8283 has_name = 1;
8284 prop_is_valid = ast_ari_validate_string(
8286 if (!prop_is_valid) {
8287 ast_log(LOG_ERROR, "ARI Application field name failed validation\n");
8288 res = 0;
8289 }
8290 } else
8291 {
8293 "ARI Application has undocumented field %s\n",
8295 res = 0;
8296 }
8297 }
8298
8299 if (!has_bridge_ids) {
8300 ast_log(LOG_ERROR, "ARI Application missing required field bridge_ids\n");
8301 res = 0;
8302 }
8303
8304 if (!has_channel_ids) {
8305 ast_log(LOG_ERROR, "ARI Application missing required field channel_ids\n");
8306 res = 0;
8307 }
8308
8309 if (!has_device_names) {
8310 ast_log(LOG_ERROR, "ARI Application missing required field device_names\n");
8311 res = 0;
8312 }
8313
8314 if (!has_endpoint_ids) {
8315 ast_log(LOG_ERROR, "ARI Application missing required field endpoint_ids\n");
8316 res = 0;
8317 }
8318
8319 if (!has_events_allowed) {
8320 ast_log(LOG_ERROR, "ARI Application missing required field events_allowed\n");
8321 res = 0;
8322 }
8323
8324 if (!has_events_disallowed) {
8325 ast_log(LOG_ERROR, "ARI Application missing required field events_disallowed\n");
8326 res = 0;
8327 }
8328
8329 if (!has_name) {
8330 ast_log(LOG_ERROR, "ARI Application missing required field name\n");
8331 res = 0;
8332 }
8333
8334 return res;
8335}
8336
8338{
8340}
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_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_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_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_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:1785
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, ...).