Asterisk - The Open Source Telephony Project GIT-master-27fb039
Loading...
Searching...
No Matches
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
2612
2614{
2615 int res = 1;
2616 struct ast_json_iter *iter;
2617 int has_type = 0;
2618 int has_application = 0;
2619 int has_timestamp = 0;
2620
2621 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2622 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2623 int prop_is_valid;
2624 prop_is_valid = ast_ari_validate_string(
2626 if (!prop_is_valid) {
2627 ast_log(LOG_ERROR, "ARI ApplicationRegistered field asterisk_id failed validation\n");
2628 res = 0;
2629 }
2630 } else
2631 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2632 int prop_is_valid;
2633 has_type = 1;
2634 prop_is_valid = ast_ari_validate_string(
2636 if (!prop_is_valid) {
2637 ast_log(LOG_ERROR, "ARI ApplicationRegistered field type failed validation\n");
2638 res = 0;
2639 }
2640 } else
2641 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2642 int prop_is_valid;
2643 has_application = 1;
2644 prop_is_valid = ast_ari_validate_string(
2646 if (!prop_is_valid) {
2647 ast_log(LOG_ERROR, "ARI ApplicationRegistered field application failed validation\n");
2648 res = 0;
2649 }
2650 } else
2651 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2652 int prop_is_valid;
2653 has_timestamp = 1;
2654 prop_is_valid = ast_ari_validate_date(
2656 if (!prop_is_valid) {
2657 ast_log(LOG_ERROR, "ARI ApplicationRegistered field timestamp failed validation\n");
2658 res = 0;
2659 }
2660 } else
2661 {
2663 "ARI ApplicationRegistered has undocumented field %s\n",
2665 res = 0;
2666 }
2667 }
2668
2669 if (!has_type) {
2670 ast_log(LOG_ERROR, "ARI ApplicationRegistered missing required field type\n");
2671 res = 0;
2672 }
2673
2674 if (!has_application) {
2675 ast_log(LOG_ERROR, "ARI ApplicationRegistered missing required field application\n");
2676 res = 0;
2677 }
2678
2679 if (!has_timestamp) {
2680 ast_log(LOG_ERROR, "ARI ApplicationRegistered missing required field timestamp\n");
2681 res = 0;
2682 }
2683
2684 return res;
2685}
2686
2691
2693{
2694 int res = 1;
2695 struct ast_json_iter *iter;
2696 int has_type = 0;
2697 int has_application = 0;
2698 int has_timestamp = 0;
2699
2700 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2701 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2702 int prop_is_valid;
2703 prop_is_valid = ast_ari_validate_string(
2705 if (!prop_is_valid) {
2706 ast_log(LOG_ERROR, "ARI ApplicationReplaced field asterisk_id failed validation\n");
2707 res = 0;
2708 }
2709 } else
2710 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2711 int prop_is_valid;
2712 has_type = 1;
2713 prop_is_valid = ast_ari_validate_string(
2715 if (!prop_is_valid) {
2716 ast_log(LOG_ERROR, "ARI ApplicationReplaced field type failed validation\n");
2717 res = 0;
2718 }
2719 } else
2720 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2721 int prop_is_valid;
2722 has_application = 1;
2723 prop_is_valid = ast_ari_validate_string(
2725 if (!prop_is_valid) {
2726 ast_log(LOG_ERROR, "ARI ApplicationReplaced field application failed validation\n");
2727 res = 0;
2728 }
2729 } else
2730 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2731 int prop_is_valid;
2732 has_timestamp = 1;
2733 prop_is_valid = ast_ari_validate_date(
2735 if (!prop_is_valid) {
2736 ast_log(LOG_ERROR, "ARI ApplicationReplaced field timestamp failed validation\n");
2737 res = 0;
2738 }
2739 } else
2740 {
2742 "ARI ApplicationReplaced has undocumented field %s\n",
2744 res = 0;
2745 }
2746 }
2747
2748 if (!has_type) {
2749 ast_log(LOG_ERROR, "ARI ApplicationReplaced missing required field type\n");
2750 res = 0;
2751 }
2752
2753 if (!has_application) {
2754 ast_log(LOG_ERROR, "ARI ApplicationReplaced missing required field application\n");
2755 res = 0;
2756 }
2757
2758 if (!has_timestamp) {
2759 ast_log(LOG_ERROR, "ARI ApplicationReplaced missing required field timestamp\n");
2760 res = 0;
2761 }
2762
2763 return res;
2764}
2765
2770
2772{
2773 int res = 1;
2774 struct ast_json_iter *iter;
2775 int has_type = 0;
2776 int has_application = 0;
2777 int has_timestamp = 0;
2778
2779 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2780 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2781 int prop_is_valid;
2782 prop_is_valid = ast_ari_validate_string(
2784 if (!prop_is_valid) {
2785 ast_log(LOG_ERROR, "ARI ApplicationUnregistered field asterisk_id failed validation\n");
2786 res = 0;
2787 }
2788 } else
2789 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2790 int prop_is_valid;
2791 has_type = 1;
2792 prop_is_valid = ast_ari_validate_string(
2794 if (!prop_is_valid) {
2795 ast_log(LOG_ERROR, "ARI ApplicationUnregistered field type failed validation\n");
2796 res = 0;
2797 }
2798 } else
2799 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2800 int prop_is_valid;
2801 has_application = 1;
2802 prop_is_valid = ast_ari_validate_string(
2804 if (!prop_is_valid) {
2805 ast_log(LOG_ERROR, "ARI ApplicationUnregistered field application failed validation\n");
2806 res = 0;
2807 }
2808 } else
2809 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2810 int prop_is_valid;
2811 has_timestamp = 1;
2812 prop_is_valid = ast_ari_validate_date(
2814 if (!prop_is_valid) {
2815 ast_log(LOG_ERROR, "ARI ApplicationUnregistered field timestamp failed validation\n");
2816 res = 0;
2817 }
2818 } else
2819 {
2821 "ARI ApplicationUnregistered has undocumented field %s\n",
2823 res = 0;
2824 }
2825 }
2826
2827 if (!has_type) {
2828 ast_log(LOG_ERROR, "ARI ApplicationUnregistered missing required field type\n");
2829 res = 0;
2830 }
2831
2832 if (!has_application) {
2833 ast_log(LOG_ERROR, "ARI ApplicationUnregistered missing required field application\n");
2834 res = 0;
2835 }
2836
2837 if (!has_timestamp) {
2838 ast_log(LOG_ERROR, "ARI ApplicationUnregistered missing required field timestamp\n");
2839 res = 0;
2840 }
2841
2842 return res;
2843}
2844
2849
2851{
2852 int res = 1;
2853 struct ast_json_iter *iter;
2854 int has_type = 0;
2855 int has_application = 0;
2856 int has_timestamp = 0;
2857 int has_destination_type = 0;
2858 int has_is_external = 0;
2859 int has_result = 0;
2860 int has_transferer_first_leg = 0;
2861 int has_transferer_second_leg = 0;
2862
2863 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2864 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2865 int prop_is_valid;
2866 prop_is_valid = ast_ari_validate_string(
2868 if (!prop_is_valid) {
2869 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field asterisk_id failed validation\n");
2870 res = 0;
2871 }
2872 } else
2873 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2874 int prop_is_valid;
2875 has_type = 1;
2876 prop_is_valid = ast_ari_validate_string(
2878 if (!prop_is_valid) {
2879 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field type failed validation\n");
2880 res = 0;
2881 }
2882 } else
2883 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2884 int prop_is_valid;
2885 has_application = 1;
2886 prop_is_valid = ast_ari_validate_string(
2888 if (!prop_is_valid) {
2889 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field application failed validation\n");
2890 res = 0;
2891 }
2892 } else
2893 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2894 int prop_is_valid;
2895 has_timestamp = 1;
2896 prop_is_valid = ast_ari_validate_date(
2898 if (!prop_is_valid) {
2899 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field timestamp failed validation\n");
2900 res = 0;
2901 }
2902 } else
2903 if (strcmp("destination_application", ast_json_object_iter_key(iter)) == 0) {
2904 int prop_is_valid;
2905 prop_is_valid = ast_ari_validate_string(
2907 if (!prop_is_valid) {
2908 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_application failed validation\n");
2909 res = 0;
2910 }
2911 } else
2912 if (strcmp("destination_bridge", ast_json_object_iter_key(iter)) == 0) {
2913 int prop_is_valid;
2914 prop_is_valid = ast_ari_validate_string(
2916 if (!prop_is_valid) {
2917 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_bridge failed validation\n");
2918 res = 0;
2919 }
2920 } else
2921 if (strcmp("destination_link_first_leg", ast_json_object_iter_key(iter)) == 0) {
2922 int prop_is_valid;
2923 prop_is_valid = ast_ari_validate_channel(
2925 if (!prop_is_valid) {
2926 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_link_first_leg failed validation\n");
2927 res = 0;
2928 }
2929 } else
2930 if (strcmp("destination_link_second_leg", ast_json_object_iter_key(iter)) == 0) {
2931 int prop_is_valid;
2932 prop_is_valid = ast_ari_validate_channel(
2934 if (!prop_is_valid) {
2935 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_link_second_leg failed validation\n");
2936 res = 0;
2937 }
2938 } else
2939 if (strcmp("destination_threeway_bridge", ast_json_object_iter_key(iter)) == 0) {
2940 int prop_is_valid;
2941 prop_is_valid = ast_ari_validate_bridge(
2943 if (!prop_is_valid) {
2944 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_threeway_bridge failed validation\n");
2945 res = 0;
2946 }
2947 } else
2948 if (strcmp("destination_threeway_channel", ast_json_object_iter_key(iter)) == 0) {
2949 int prop_is_valid;
2950 prop_is_valid = ast_ari_validate_channel(
2952 if (!prop_is_valid) {
2953 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_threeway_channel failed validation\n");
2954 res = 0;
2955 }
2956 } else
2957 if (strcmp("destination_type", ast_json_object_iter_key(iter)) == 0) {
2958 int prop_is_valid;
2959 has_destination_type = 1;
2960 prop_is_valid = ast_ari_validate_string(
2962 if (!prop_is_valid) {
2963 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_type failed validation\n");
2964 res = 0;
2965 }
2966 } else
2967 if (strcmp("is_external", ast_json_object_iter_key(iter)) == 0) {
2968 int prop_is_valid;
2969 has_is_external = 1;
2970 prop_is_valid = ast_ari_validate_boolean(
2972 if (!prop_is_valid) {
2973 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field is_external failed validation\n");
2974 res = 0;
2975 }
2976 } else
2977 if (strcmp("replace_channel", ast_json_object_iter_key(iter)) == 0) {
2978 int prop_is_valid;
2979 prop_is_valid = ast_ari_validate_channel(
2981 if (!prop_is_valid) {
2982 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field replace_channel failed validation\n");
2983 res = 0;
2984 }
2985 } else
2986 if (strcmp("result", ast_json_object_iter_key(iter)) == 0) {
2987 int prop_is_valid;
2988 has_result = 1;
2989 prop_is_valid = ast_ari_validate_string(
2991 if (!prop_is_valid) {
2992 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field result failed validation\n");
2993 res = 0;
2994 }
2995 } else
2996 if (strcmp("transfer_target", ast_json_object_iter_key(iter)) == 0) {
2997 int prop_is_valid;
2998 prop_is_valid = ast_ari_validate_channel(
3000 if (!prop_is_valid) {
3001 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transfer_target failed validation\n");
3002 res = 0;
3003 }
3004 } else
3005 if (strcmp("transferee", ast_json_object_iter_key(iter)) == 0) {
3006 int prop_is_valid;
3007 prop_is_valid = ast_ari_validate_channel(
3009 if (!prop_is_valid) {
3010 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferee failed validation\n");
3011 res = 0;
3012 }
3013 } else
3014 if (strcmp("transferer_first_leg", ast_json_object_iter_key(iter)) == 0) {
3015 int prop_is_valid;
3016 has_transferer_first_leg = 1;
3017 prop_is_valid = ast_ari_validate_channel(
3019 if (!prop_is_valid) {
3020 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_first_leg failed validation\n");
3021 res = 0;
3022 }
3023 } else
3024 if (strcmp("transferer_first_leg_bridge", ast_json_object_iter_key(iter)) == 0) {
3025 int prop_is_valid;
3026 prop_is_valid = ast_ari_validate_bridge(
3028 if (!prop_is_valid) {
3029 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_first_leg_bridge failed validation\n");
3030 res = 0;
3031 }
3032 } else
3033 if (strcmp("transferer_second_leg", ast_json_object_iter_key(iter)) == 0) {
3034 int prop_is_valid;
3035 has_transferer_second_leg = 1;
3036 prop_is_valid = ast_ari_validate_channel(
3038 if (!prop_is_valid) {
3039 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_second_leg failed validation\n");
3040 res = 0;
3041 }
3042 } else
3043 if (strcmp("transferer_second_leg_bridge", ast_json_object_iter_key(iter)) == 0) {
3044 int prop_is_valid;
3045 prop_is_valid = ast_ari_validate_bridge(
3047 if (!prop_is_valid) {
3048 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_second_leg_bridge failed validation\n");
3049 res = 0;
3050 }
3051 } else
3052 {
3054 "ARI BridgeAttendedTransfer has undocumented field %s\n",
3056 res = 0;
3057 }
3058 }
3059
3060 if (!has_type) {
3061 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field type\n");
3062 res = 0;
3063 }
3064
3065 if (!has_application) {
3066 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field application\n");
3067 res = 0;
3068 }
3069
3070 if (!has_timestamp) {
3071 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field timestamp\n");
3072 res = 0;
3073 }
3074
3075 if (!has_destination_type) {
3076 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field destination_type\n");
3077 res = 0;
3078 }
3079
3080 if (!has_is_external) {
3081 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field is_external\n");
3082 res = 0;
3083 }
3084
3085 if (!has_result) {
3086 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field result\n");
3087 res = 0;
3088 }
3089
3090 if (!has_transferer_first_leg) {
3091 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field transferer_first_leg\n");
3092 res = 0;
3093 }
3094
3095 if (!has_transferer_second_leg) {
3096 ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field transferer_second_leg\n");
3097 res = 0;
3098 }
3099
3100 return res;
3101}
3102
3107
3109{
3110 int res = 1;
3111 struct ast_json_iter *iter;
3112 int has_type = 0;
3113 int has_application = 0;
3114 int has_timestamp = 0;
3115 int has_channel = 0;
3116 int has_context = 0;
3117 int has_exten = 0;
3118 int has_is_external = 0;
3119 int has_result = 0;
3120
3121 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3122 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3123 int prop_is_valid;
3124 prop_is_valid = ast_ari_validate_string(
3126 if (!prop_is_valid) {
3127 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field asterisk_id failed validation\n");
3128 res = 0;
3129 }
3130 } else
3131 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3132 int prop_is_valid;
3133 has_type = 1;
3134 prop_is_valid = ast_ari_validate_string(
3136 if (!prop_is_valid) {
3137 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field type failed validation\n");
3138 res = 0;
3139 }
3140 } else
3141 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3142 int prop_is_valid;
3143 has_application = 1;
3144 prop_is_valid = ast_ari_validate_string(
3146 if (!prop_is_valid) {
3147 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field application failed validation\n");
3148 res = 0;
3149 }
3150 } else
3151 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3152 int prop_is_valid;
3153 has_timestamp = 1;
3154 prop_is_valid = ast_ari_validate_date(
3156 if (!prop_is_valid) {
3157 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field timestamp failed validation\n");
3158 res = 0;
3159 }
3160 } else
3161 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3162 int prop_is_valid;
3163 prop_is_valid = ast_ari_validate_bridge(
3165 if (!prop_is_valid) {
3166 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field bridge failed validation\n");
3167 res = 0;
3168 }
3169 } else
3170 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3171 int prop_is_valid;
3172 has_channel = 1;
3173 prop_is_valid = ast_ari_validate_channel(
3175 if (!prop_is_valid) {
3176 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field channel failed validation\n");
3177 res = 0;
3178 }
3179 } else
3180 if (strcmp("context", ast_json_object_iter_key(iter)) == 0) {
3181 int prop_is_valid;
3182 has_context = 1;
3183 prop_is_valid = ast_ari_validate_string(
3185 if (!prop_is_valid) {
3186 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field context failed validation\n");
3187 res = 0;
3188 }
3189 } else
3190 if (strcmp("exten", ast_json_object_iter_key(iter)) == 0) {
3191 int prop_is_valid;
3192 has_exten = 1;
3193 prop_is_valid = ast_ari_validate_string(
3195 if (!prop_is_valid) {
3196 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field exten failed validation\n");
3197 res = 0;
3198 }
3199 } else
3200 if (strcmp("is_external", ast_json_object_iter_key(iter)) == 0) {
3201 int prop_is_valid;
3202 has_is_external = 1;
3203 prop_is_valid = ast_ari_validate_boolean(
3205 if (!prop_is_valid) {
3206 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field is_external failed validation\n");
3207 res = 0;
3208 }
3209 } else
3210 if (strcmp("replace_channel", ast_json_object_iter_key(iter)) == 0) {
3211 int prop_is_valid;
3212 prop_is_valid = ast_ari_validate_channel(
3214 if (!prop_is_valid) {
3215 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field replace_channel failed validation\n");
3216 res = 0;
3217 }
3218 } else
3219 if (strcmp("result", ast_json_object_iter_key(iter)) == 0) {
3220 int prop_is_valid;
3221 has_result = 1;
3222 prop_is_valid = ast_ari_validate_string(
3224 if (!prop_is_valid) {
3225 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field result failed validation\n");
3226 res = 0;
3227 }
3228 } else
3229 if (strcmp("transferee", ast_json_object_iter_key(iter)) == 0) {
3230 int prop_is_valid;
3231 prop_is_valid = ast_ari_validate_channel(
3233 if (!prop_is_valid) {
3234 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field transferee failed validation\n");
3235 res = 0;
3236 }
3237 } else
3238 {
3240 "ARI BridgeBlindTransfer has undocumented field %s\n",
3242 res = 0;
3243 }
3244 }
3245
3246 if (!has_type) {
3247 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field type\n");
3248 res = 0;
3249 }
3250
3251 if (!has_application) {
3252 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field application\n");
3253 res = 0;
3254 }
3255
3256 if (!has_timestamp) {
3257 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field timestamp\n");
3258 res = 0;
3259 }
3260
3261 if (!has_channel) {
3262 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field channel\n");
3263 res = 0;
3264 }
3265
3266 if (!has_context) {
3267 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field context\n");
3268 res = 0;
3269 }
3270
3271 if (!has_exten) {
3272 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field exten\n");
3273 res = 0;
3274 }
3275
3276 if (!has_is_external) {
3277 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field is_external\n");
3278 res = 0;
3279 }
3280
3281 if (!has_result) {
3282 ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field result\n");
3283 res = 0;
3284 }
3285
3286 return res;
3287}
3288
3293
3295{
3296 int res = 1;
3297 struct ast_json_iter *iter;
3298 int has_type = 0;
3299 int has_application = 0;
3300 int has_timestamp = 0;
3301 int has_bridge = 0;
3302
3303 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3304 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3305 int prop_is_valid;
3306 prop_is_valid = ast_ari_validate_string(
3308 if (!prop_is_valid) {
3309 ast_log(LOG_ERROR, "ARI BridgeCreated field asterisk_id failed validation\n");
3310 res = 0;
3311 }
3312 } else
3313 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3314 int prop_is_valid;
3315 has_type = 1;
3316 prop_is_valid = ast_ari_validate_string(
3318 if (!prop_is_valid) {
3319 ast_log(LOG_ERROR, "ARI BridgeCreated field type failed validation\n");
3320 res = 0;
3321 }
3322 } else
3323 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3324 int prop_is_valid;
3325 has_application = 1;
3326 prop_is_valid = ast_ari_validate_string(
3328 if (!prop_is_valid) {
3329 ast_log(LOG_ERROR, "ARI BridgeCreated field application failed validation\n");
3330 res = 0;
3331 }
3332 } else
3333 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3334 int prop_is_valid;
3335 has_timestamp = 1;
3336 prop_is_valid = ast_ari_validate_date(
3338 if (!prop_is_valid) {
3339 ast_log(LOG_ERROR, "ARI BridgeCreated field timestamp failed validation\n");
3340 res = 0;
3341 }
3342 } else
3343 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3344 int prop_is_valid;
3345 has_bridge = 1;
3346 prop_is_valid = ast_ari_validate_bridge(
3348 if (!prop_is_valid) {
3349 ast_log(LOG_ERROR, "ARI BridgeCreated field bridge failed validation\n");
3350 res = 0;
3351 }
3352 } else
3353 {
3355 "ARI BridgeCreated has undocumented field %s\n",
3357 res = 0;
3358 }
3359 }
3360
3361 if (!has_type) {
3362 ast_log(LOG_ERROR, "ARI BridgeCreated missing required field type\n");
3363 res = 0;
3364 }
3365
3366 if (!has_application) {
3367 ast_log(LOG_ERROR, "ARI BridgeCreated missing required field application\n");
3368 res = 0;
3369 }
3370
3371 if (!has_timestamp) {
3372 ast_log(LOG_ERROR, "ARI BridgeCreated missing required field timestamp\n");
3373 res = 0;
3374 }
3375
3376 if (!has_bridge) {
3377 ast_log(LOG_ERROR, "ARI BridgeCreated missing required field bridge\n");
3378 res = 0;
3379 }
3380
3381 return res;
3382}
3383
3388
3390{
3391 int res = 1;
3392 struct ast_json_iter *iter;
3393 int has_type = 0;
3394 int has_application = 0;
3395 int has_timestamp = 0;
3396 int has_bridge = 0;
3397
3398 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3399 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3400 int prop_is_valid;
3401 prop_is_valid = ast_ari_validate_string(
3403 if (!prop_is_valid) {
3404 ast_log(LOG_ERROR, "ARI BridgeDestroyed field asterisk_id failed validation\n");
3405 res = 0;
3406 }
3407 } else
3408 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3409 int prop_is_valid;
3410 has_type = 1;
3411 prop_is_valid = ast_ari_validate_string(
3413 if (!prop_is_valid) {
3414 ast_log(LOG_ERROR, "ARI BridgeDestroyed field type failed validation\n");
3415 res = 0;
3416 }
3417 } else
3418 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3419 int prop_is_valid;
3420 has_application = 1;
3421 prop_is_valid = ast_ari_validate_string(
3423 if (!prop_is_valid) {
3424 ast_log(LOG_ERROR, "ARI BridgeDestroyed field application failed validation\n");
3425 res = 0;
3426 }
3427 } else
3428 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3429 int prop_is_valid;
3430 has_timestamp = 1;
3431 prop_is_valid = ast_ari_validate_date(
3433 if (!prop_is_valid) {
3434 ast_log(LOG_ERROR, "ARI BridgeDestroyed field timestamp failed validation\n");
3435 res = 0;
3436 }
3437 } else
3438 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3439 int prop_is_valid;
3440 has_bridge = 1;
3441 prop_is_valid = ast_ari_validate_bridge(
3443 if (!prop_is_valid) {
3444 ast_log(LOG_ERROR, "ARI BridgeDestroyed field bridge failed validation\n");
3445 res = 0;
3446 }
3447 } else
3448 {
3450 "ARI BridgeDestroyed has undocumented field %s\n",
3452 res = 0;
3453 }
3454 }
3455
3456 if (!has_type) {
3457 ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field type\n");
3458 res = 0;
3459 }
3460
3461 if (!has_application) {
3462 ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field application\n");
3463 res = 0;
3464 }
3465
3466 if (!has_timestamp) {
3467 ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field timestamp\n");
3468 res = 0;
3469 }
3470
3471 if (!has_bridge) {
3472 ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field bridge\n");
3473 res = 0;
3474 }
3475
3476 return res;
3477}
3478
3483
3485{
3486 int res = 1;
3487 struct ast_json_iter *iter;
3488 int has_type = 0;
3489 int has_application = 0;
3490 int has_timestamp = 0;
3491 int has_bridge = 0;
3492 int has_bridge_from = 0;
3493
3494 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3495 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3496 int prop_is_valid;
3497 prop_is_valid = ast_ari_validate_string(
3499 if (!prop_is_valid) {
3500 ast_log(LOG_ERROR, "ARI BridgeMerged field asterisk_id failed validation\n");
3501 res = 0;
3502 }
3503 } else
3504 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3505 int prop_is_valid;
3506 has_type = 1;
3507 prop_is_valid = ast_ari_validate_string(
3509 if (!prop_is_valid) {
3510 ast_log(LOG_ERROR, "ARI BridgeMerged field type failed validation\n");
3511 res = 0;
3512 }
3513 } else
3514 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3515 int prop_is_valid;
3516 has_application = 1;
3517 prop_is_valid = ast_ari_validate_string(
3519 if (!prop_is_valid) {
3520 ast_log(LOG_ERROR, "ARI BridgeMerged field application failed validation\n");
3521 res = 0;
3522 }
3523 } else
3524 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3525 int prop_is_valid;
3526 has_timestamp = 1;
3527 prop_is_valid = ast_ari_validate_date(
3529 if (!prop_is_valid) {
3530 ast_log(LOG_ERROR, "ARI BridgeMerged field timestamp failed validation\n");
3531 res = 0;
3532 }
3533 } else
3534 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3535 int prop_is_valid;
3536 has_bridge = 1;
3537 prop_is_valid = ast_ari_validate_bridge(
3539 if (!prop_is_valid) {
3540 ast_log(LOG_ERROR, "ARI BridgeMerged field bridge failed validation\n");
3541 res = 0;
3542 }
3543 } else
3544 if (strcmp("bridge_from", ast_json_object_iter_key(iter)) == 0) {
3545 int prop_is_valid;
3546 has_bridge_from = 1;
3547 prop_is_valid = ast_ari_validate_bridge(
3549 if (!prop_is_valid) {
3550 ast_log(LOG_ERROR, "ARI BridgeMerged field bridge_from failed validation\n");
3551 res = 0;
3552 }
3553 } else
3554 {
3556 "ARI BridgeMerged has undocumented field %s\n",
3558 res = 0;
3559 }
3560 }
3561
3562 if (!has_type) {
3563 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field type\n");
3564 res = 0;
3565 }
3566
3567 if (!has_application) {
3568 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field application\n");
3569 res = 0;
3570 }
3571
3572 if (!has_timestamp) {
3573 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field timestamp\n");
3574 res = 0;
3575 }
3576
3577 if (!has_bridge) {
3578 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field bridge\n");
3579 res = 0;
3580 }
3581
3582 if (!has_bridge_from) {
3583 ast_log(LOG_ERROR, "ARI BridgeMerged missing required field bridge_from\n");
3584 res = 0;
3585 }
3586
3587 return res;
3588}
3589
3594
3596{
3597 int res = 1;
3598 struct ast_json_iter *iter;
3599 int has_type = 0;
3600 int has_application = 0;
3601 int has_timestamp = 0;
3602 int has_bridge = 0;
3603
3604 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3605 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3606 int prop_is_valid;
3607 prop_is_valid = ast_ari_validate_string(
3609 if (!prop_is_valid) {
3610 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field asterisk_id failed validation\n");
3611 res = 0;
3612 }
3613 } else
3614 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3615 int prop_is_valid;
3616 has_type = 1;
3617 prop_is_valid = ast_ari_validate_string(
3619 if (!prop_is_valid) {
3620 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field type failed validation\n");
3621 res = 0;
3622 }
3623 } else
3624 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3625 int prop_is_valid;
3626 has_application = 1;
3627 prop_is_valid = ast_ari_validate_string(
3629 if (!prop_is_valid) {
3630 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field application failed validation\n");
3631 res = 0;
3632 }
3633 } else
3634 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3635 int prop_is_valid;
3636 has_timestamp = 1;
3637 prop_is_valid = ast_ari_validate_date(
3639 if (!prop_is_valid) {
3640 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field timestamp failed validation\n");
3641 res = 0;
3642 }
3643 } else
3644 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3645 int prop_is_valid;
3646 has_bridge = 1;
3647 prop_is_valid = ast_ari_validate_bridge(
3649 if (!prop_is_valid) {
3650 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field bridge failed validation\n");
3651 res = 0;
3652 }
3653 } else
3654 if (strcmp("old_video_source_id", ast_json_object_iter_key(iter)) == 0) {
3655 int prop_is_valid;
3656 prop_is_valid = ast_ari_validate_string(
3658 if (!prop_is_valid) {
3659 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field old_video_source_id failed validation\n");
3660 res = 0;
3661 }
3662 } else
3663 {
3665 "ARI BridgeVideoSourceChanged has undocumented field %s\n",
3667 res = 0;
3668 }
3669 }
3670
3671 if (!has_type) {
3672 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field type\n");
3673 res = 0;
3674 }
3675
3676 if (!has_application) {
3677 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field application\n");
3678 res = 0;
3679 }
3680
3681 if (!has_timestamp) {
3682 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field timestamp\n");
3683 res = 0;
3684 }
3685
3686 if (!has_bridge) {
3687 ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field bridge\n");
3688 res = 0;
3689 }
3690
3691 return res;
3692}
3693
3698
3700{
3701 int res = 1;
3702 struct ast_json_iter *iter;
3703 int has_type = 0;
3704 int has_application = 0;
3705 int has_timestamp = 0;
3706 int has_caller_presentation = 0;
3707 int has_caller_presentation_txt = 0;
3708 int has_channel = 0;
3709
3710 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3711 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3712 int prop_is_valid;
3713 prop_is_valid = ast_ari_validate_string(
3715 if (!prop_is_valid) {
3716 ast_log(LOG_ERROR, "ARI ChannelCallerId field asterisk_id failed validation\n");
3717 res = 0;
3718 }
3719 } else
3720 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3721 int prop_is_valid;
3722 has_type = 1;
3723 prop_is_valid = ast_ari_validate_string(
3725 if (!prop_is_valid) {
3726 ast_log(LOG_ERROR, "ARI ChannelCallerId field type failed validation\n");
3727 res = 0;
3728 }
3729 } else
3730 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3731 int prop_is_valid;
3732 has_application = 1;
3733 prop_is_valid = ast_ari_validate_string(
3735 if (!prop_is_valid) {
3736 ast_log(LOG_ERROR, "ARI ChannelCallerId field application failed validation\n");
3737 res = 0;
3738 }
3739 } else
3740 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3741 int prop_is_valid;
3742 has_timestamp = 1;
3743 prop_is_valid = ast_ari_validate_date(
3745 if (!prop_is_valid) {
3746 ast_log(LOG_ERROR, "ARI ChannelCallerId field timestamp failed validation\n");
3747 res = 0;
3748 }
3749 } else
3750 if (strcmp("caller_presentation", ast_json_object_iter_key(iter)) == 0) {
3751 int prop_is_valid;
3752 has_caller_presentation = 1;
3753 prop_is_valid = ast_ari_validate_int(
3755 if (!prop_is_valid) {
3756 ast_log(LOG_ERROR, "ARI ChannelCallerId field caller_presentation failed validation\n");
3757 res = 0;
3758 }
3759 } else
3760 if (strcmp("caller_presentation_txt", ast_json_object_iter_key(iter)) == 0) {
3761 int prop_is_valid;
3762 has_caller_presentation_txt = 1;
3763 prop_is_valid = ast_ari_validate_string(
3765 if (!prop_is_valid) {
3766 ast_log(LOG_ERROR, "ARI ChannelCallerId field caller_presentation_txt failed validation\n");
3767 res = 0;
3768 }
3769 } else
3770 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3771 int prop_is_valid;
3772 has_channel = 1;
3773 prop_is_valid = ast_ari_validate_channel(
3775 if (!prop_is_valid) {
3776 ast_log(LOG_ERROR, "ARI ChannelCallerId field channel failed validation\n");
3777 res = 0;
3778 }
3779 } else
3780 {
3782 "ARI ChannelCallerId has undocumented field %s\n",
3784 res = 0;
3785 }
3786 }
3787
3788 if (!has_type) {
3789 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field type\n");
3790 res = 0;
3791 }
3792
3793 if (!has_application) {
3794 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field application\n");
3795 res = 0;
3796 }
3797
3798 if (!has_timestamp) {
3799 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field timestamp\n");
3800 res = 0;
3801 }
3802
3803 if (!has_caller_presentation) {
3804 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field caller_presentation\n");
3805 res = 0;
3806 }
3807
3808 if (!has_caller_presentation_txt) {
3809 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field caller_presentation_txt\n");
3810 res = 0;
3811 }
3812
3813 if (!has_channel) {
3814 ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field channel\n");
3815 res = 0;
3816 }
3817
3818 return res;
3819}
3820
3825
3827{
3828 int res = 1;
3829 struct ast_json_iter *iter;
3830 int has_type = 0;
3831 int has_application = 0;
3832 int has_timestamp = 0;
3833 int has_channel = 0;
3834
3835 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3836 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3837 int prop_is_valid;
3838 prop_is_valid = ast_ari_validate_string(
3840 if (!prop_is_valid) {
3841 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field asterisk_id failed validation\n");
3842 res = 0;
3843 }
3844 } else
3845 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3846 int prop_is_valid;
3847 has_type = 1;
3848 prop_is_valid = ast_ari_validate_string(
3850 if (!prop_is_valid) {
3851 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field type failed validation\n");
3852 res = 0;
3853 }
3854 } else
3855 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3856 int prop_is_valid;
3857 has_application = 1;
3858 prop_is_valid = ast_ari_validate_string(
3860 if (!prop_is_valid) {
3861 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field application failed validation\n");
3862 res = 0;
3863 }
3864 } else
3865 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3866 int prop_is_valid;
3867 has_timestamp = 1;
3868 prop_is_valid = ast_ari_validate_date(
3870 if (!prop_is_valid) {
3871 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field timestamp failed validation\n");
3872 res = 0;
3873 }
3874 } else
3875 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3876 int prop_is_valid;
3877 has_channel = 1;
3878 prop_is_valid = ast_ari_validate_channel(
3880 if (!prop_is_valid) {
3881 ast_log(LOG_ERROR, "ARI ChannelConnectedLine field channel failed validation\n");
3882 res = 0;
3883 }
3884 } else
3885 {
3887 "ARI ChannelConnectedLine has undocumented field %s\n",
3889 res = 0;
3890 }
3891 }
3892
3893 if (!has_type) {
3894 ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field type\n");
3895 res = 0;
3896 }
3897
3898 if (!has_application) {
3899 ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field application\n");
3900 res = 0;
3901 }
3902
3903 if (!has_timestamp) {
3904 ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field timestamp\n");
3905 res = 0;
3906 }
3907
3908 if (!has_channel) {
3909 ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field channel\n");
3910 res = 0;
3911 }
3912
3913 return res;
3914}
3915
3920
3922{
3923 int res = 1;
3924 struct ast_json_iter *iter;
3925 int has_type = 0;
3926 int has_application = 0;
3927 int has_timestamp = 0;
3928 int has_channel = 0;
3929
3930 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3931 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3932 int prop_is_valid;
3933 prop_is_valid = ast_ari_validate_string(
3935 if (!prop_is_valid) {
3936 ast_log(LOG_ERROR, "ARI ChannelCreated field asterisk_id failed validation\n");
3937 res = 0;
3938 }
3939 } else
3940 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3941 int prop_is_valid;
3942 has_type = 1;
3943 prop_is_valid = ast_ari_validate_string(
3945 if (!prop_is_valid) {
3946 ast_log(LOG_ERROR, "ARI ChannelCreated field type failed validation\n");
3947 res = 0;
3948 }
3949 } else
3950 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3951 int prop_is_valid;
3952 has_application = 1;
3953 prop_is_valid = ast_ari_validate_string(
3955 if (!prop_is_valid) {
3956 ast_log(LOG_ERROR, "ARI ChannelCreated field application failed validation\n");
3957 res = 0;
3958 }
3959 } else
3960 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3961 int prop_is_valid;
3962 has_timestamp = 1;
3963 prop_is_valid = ast_ari_validate_date(
3965 if (!prop_is_valid) {
3966 ast_log(LOG_ERROR, "ARI ChannelCreated field timestamp failed validation\n");
3967 res = 0;
3968 }
3969 } else
3970 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3971 int prop_is_valid;
3972 has_channel = 1;
3973 prop_is_valid = ast_ari_validate_channel(
3975 if (!prop_is_valid) {
3976 ast_log(LOG_ERROR, "ARI ChannelCreated field channel failed validation\n");
3977 res = 0;
3978 }
3979 } else
3980 {
3982 "ARI ChannelCreated has undocumented field %s\n",
3984 res = 0;
3985 }
3986 }
3987
3988 if (!has_type) {
3989 ast_log(LOG_ERROR, "ARI ChannelCreated missing required field type\n");
3990 res = 0;
3991 }
3992
3993 if (!has_application) {
3994 ast_log(LOG_ERROR, "ARI ChannelCreated missing required field application\n");
3995 res = 0;
3996 }
3997
3998 if (!has_timestamp) {
3999 ast_log(LOG_ERROR, "ARI ChannelCreated missing required field timestamp\n");
4000 res = 0;
4001 }
4002
4003 if (!has_channel) {
4004 ast_log(LOG_ERROR, "ARI ChannelCreated missing required field channel\n");
4005 res = 0;
4006 }
4007
4008 return res;
4009}
4010
4015
4017{
4018 int res = 1;
4019 struct ast_json_iter *iter;
4020 int has_type = 0;
4021 int has_application = 0;
4022 int has_timestamp = 0;
4023 int has_cause = 0;
4024 int has_cause_txt = 0;
4025 int has_channel = 0;
4026
4027 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4028 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4029 int prop_is_valid;
4030 prop_is_valid = ast_ari_validate_string(
4032 if (!prop_is_valid) {
4033 ast_log(LOG_ERROR, "ARI ChannelDestroyed field asterisk_id failed validation\n");
4034 res = 0;
4035 }
4036 } else
4037 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4038 int prop_is_valid;
4039 has_type = 1;
4040 prop_is_valid = ast_ari_validate_string(
4042 if (!prop_is_valid) {
4043 ast_log(LOG_ERROR, "ARI ChannelDestroyed field type failed validation\n");
4044 res = 0;
4045 }
4046 } else
4047 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4048 int prop_is_valid;
4049 has_application = 1;
4050 prop_is_valid = ast_ari_validate_string(
4052 if (!prop_is_valid) {
4053 ast_log(LOG_ERROR, "ARI ChannelDestroyed field application failed validation\n");
4054 res = 0;
4055 }
4056 } else
4057 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4058 int prop_is_valid;
4059 has_timestamp = 1;
4060 prop_is_valid = ast_ari_validate_date(
4062 if (!prop_is_valid) {
4063 ast_log(LOG_ERROR, "ARI ChannelDestroyed field timestamp failed validation\n");
4064 res = 0;
4065 }
4066 } else
4067 if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
4068 int prop_is_valid;
4069 has_cause = 1;
4070 prop_is_valid = ast_ari_validate_int(
4072 if (!prop_is_valid) {
4073 ast_log(LOG_ERROR, "ARI ChannelDestroyed field cause failed validation\n");
4074 res = 0;
4075 }
4076 } else
4077 if (strcmp("cause_txt", ast_json_object_iter_key(iter)) == 0) {
4078 int prop_is_valid;
4079 has_cause_txt = 1;
4080 prop_is_valid = ast_ari_validate_string(
4082 if (!prop_is_valid) {
4083 ast_log(LOG_ERROR, "ARI ChannelDestroyed field cause_txt failed validation\n");
4084 res = 0;
4085 }
4086 } else
4087 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4088 int prop_is_valid;
4089 has_channel = 1;
4090 prop_is_valid = ast_ari_validate_channel(
4092 if (!prop_is_valid) {
4093 ast_log(LOG_ERROR, "ARI ChannelDestroyed field channel failed validation\n");
4094 res = 0;
4095 }
4096 } else
4097 if (strcmp("tech_cause", ast_json_object_iter_key(iter)) == 0) {
4098 int prop_is_valid;
4099 prop_is_valid = ast_ari_validate_int(
4101 if (!prop_is_valid) {
4102 ast_log(LOG_ERROR, "ARI ChannelDestroyed field tech_cause failed validation\n");
4103 res = 0;
4104 }
4105 } else
4106 {
4108 "ARI ChannelDestroyed has undocumented field %s\n",
4110 res = 0;
4111 }
4112 }
4113
4114 if (!has_type) {
4115 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field type\n");
4116 res = 0;
4117 }
4118
4119 if (!has_application) {
4120 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field application\n");
4121 res = 0;
4122 }
4123
4124 if (!has_timestamp) {
4125 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field timestamp\n");
4126 res = 0;
4127 }
4128
4129 if (!has_cause) {
4130 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field cause\n");
4131 res = 0;
4132 }
4133
4134 if (!has_cause_txt) {
4135 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field cause_txt\n");
4136 res = 0;
4137 }
4138
4139 if (!has_channel) {
4140 ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field channel\n");
4141 res = 0;
4142 }
4143
4144 return res;
4145}
4146
4151
4153{
4154 int res = 1;
4155 struct ast_json_iter *iter;
4156 int has_type = 0;
4157 int has_application = 0;
4158 int has_timestamp = 0;
4159 int has_channel = 0;
4160 int has_dialplan_app = 0;
4161 int has_dialplan_app_data = 0;
4162
4163 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4164 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4165 int prop_is_valid;
4166 prop_is_valid = ast_ari_validate_string(
4168 if (!prop_is_valid) {
4169 ast_log(LOG_ERROR, "ARI ChannelDialplan field asterisk_id failed validation\n");
4170 res = 0;
4171 }
4172 } else
4173 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4174 int prop_is_valid;
4175 has_type = 1;
4176 prop_is_valid = ast_ari_validate_string(
4178 if (!prop_is_valid) {
4179 ast_log(LOG_ERROR, "ARI ChannelDialplan field type failed validation\n");
4180 res = 0;
4181 }
4182 } else
4183 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4184 int prop_is_valid;
4185 has_application = 1;
4186 prop_is_valid = ast_ari_validate_string(
4188 if (!prop_is_valid) {
4189 ast_log(LOG_ERROR, "ARI ChannelDialplan field application failed validation\n");
4190 res = 0;
4191 }
4192 } else
4193 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4194 int prop_is_valid;
4195 has_timestamp = 1;
4196 prop_is_valid = ast_ari_validate_date(
4198 if (!prop_is_valid) {
4199 ast_log(LOG_ERROR, "ARI ChannelDialplan field timestamp failed validation\n");
4200 res = 0;
4201 }
4202 } else
4203 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4204 int prop_is_valid;
4205 has_channel = 1;
4206 prop_is_valid = ast_ari_validate_channel(
4208 if (!prop_is_valid) {
4209 ast_log(LOG_ERROR, "ARI ChannelDialplan field channel failed validation\n");
4210 res = 0;
4211 }
4212 } else
4213 if (strcmp("dialplan_app", ast_json_object_iter_key(iter)) == 0) {
4214 int prop_is_valid;
4215 has_dialplan_app = 1;
4216 prop_is_valid = ast_ari_validate_string(
4218 if (!prop_is_valid) {
4219 ast_log(LOG_ERROR, "ARI ChannelDialplan field dialplan_app failed validation\n");
4220 res = 0;
4221 }
4222 } else
4223 if (strcmp("dialplan_app_data", ast_json_object_iter_key(iter)) == 0) {
4224 int prop_is_valid;
4225 has_dialplan_app_data = 1;
4226 prop_is_valid = ast_ari_validate_string(
4228 if (!prop_is_valid) {
4229 ast_log(LOG_ERROR, "ARI ChannelDialplan field dialplan_app_data failed validation\n");
4230 res = 0;
4231 }
4232 } else
4233 {
4235 "ARI ChannelDialplan has undocumented field %s\n",
4237 res = 0;
4238 }
4239 }
4240
4241 if (!has_type) {
4242 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field type\n");
4243 res = 0;
4244 }
4245
4246 if (!has_application) {
4247 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field application\n");
4248 res = 0;
4249 }
4250
4251 if (!has_timestamp) {
4252 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field timestamp\n");
4253 res = 0;
4254 }
4255
4256 if (!has_channel) {
4257 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field channel\n");
4258 res = 0;
4259 }
4260
4261 if (!has_dialplan_app) {
4262 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field dialplan_app\n");
4263 res = 0;
4264 }
4265
4266 if (!has_dialplan_app_data) {
4267 ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field dialplan_app_data\n");
4268 res = 0;
4269 }
4270
4271 return res;
4272}
4273
4278
4280{
4281 int res = 1;
4282 struct ast_json_iter *iter;
4283 int has_type = 0;
4284 int has_application = 0;
4285 int has_timestamp = 0;
4286 int has_channel = 0;
4287 int has_digit = 0;
4288 int has_duration_ms = 0;
4289
4290 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4291 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4292 int prop_is_valid;
4293 prop_is_valid = ast_ari_validate_string(
4295 if (!prop_is_valid) {
4296 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field asterisk_id failed validation\n");
4297 res = 0;
4298 }
4299 } else
4300 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4301 int prop_is_valid;
4302 has_type = 1;
4303 prop_is_valid = ast_ari_validate_string(
4305 if (!prop_is_valid) {
4306 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field type failed validation\n");
4307 res = 0;
4308 }
4309 } else
4310 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4311 int prop_is_valid;
4312 has_application = 1;
4313 prop_is_valid = ast_ari_validate_string(
4315 if (!prop_is_valid) {
4316 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field application failed validation\n");
4317 res = 0;
4318 }
4319 } else
4320 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4321 int prop_is_valid;
4322 has_timestamp = 1;
4323 prop_is_valid = ast_ari_validate_date(
4325 if (!prop_is_valid) {
4326 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field timestamp failed validation\n");
4327 res = 0;
4328 }
4329 } else
4330 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4331 int prop_is_valid;
4332 has_channel = 1;
4333 prop_is_valid = ast_ari_validate_channel(
4335 if (!prop_is_valid) {
4336 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field channel failed validation\n");
4337 res = 0;
4338 }
4339 } else
4340 if (strcmp("digit", ast_json_object_iter_key(iter)) == 0) {
4341 int prop_is_valid;
4342 has_digit = 1;
4343 prop_is_valid = ast_ari_validate_string(
4345 if (!prop_is_valid) {
4346 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field digit failed validation\n");
4347 res = 0;
4348 }
4349 } else
4350 if (strcmp("duration_ms", ast_json_object_iter_key(iter)) == 0) {
4351 int prop_is_valid;
4352 has_duration_ms = 1;
4353 prop_is_valid = ast_ari_validate_int(
4355 if (!prop_is_valid) {
4356 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field duration_ms failed validation\n");
4357 res = 0;
4358 }
4359 } else
4360 {
4362 "ARI ChannelDtmfReceived has undocumented field %s\n",
4364 res = 0;
4365 }
4366 }
4367
4368 if (!has_type) {
4369 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field type\n");
4370 res = 0;
4371 }
4372
4373 if (!has_application) {
4374 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field application\n");
4375 res = 0;
4376 }
4377
4378 if (!has_timestamp) {
4379 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field timestamp\n");
4380 res = 0;
4381 }
4382
4383 if (!has_channel) {
4384 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field channel\n");
4385 res = 0;
4386 }
4387
4388 if (!has_digit) {
4389 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field digit\n");
4390 res = 0;
4391 }
4392
4393 if (!has_duration_ms) {
4394 ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field duration_ms\n");
4395 res = 0;
4396 }
4397
4398 return res;
4399}
4400
4405
4407{
4408 int res = 1;
4409 struct ast_json_iter *iter;
4410 int has_type = 0;
4411 int has_application = 0;
4412 int has_timestamp = 0;
4413 int has_bridge = 0;
4414
4415 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4416 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4417 int prop_is_valid;
4418 prop_is_valid = ast_ari_validate_string(
4420 if (!prop_is_valid) {
4421 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field asterisk_id failed validation\n");
4422 res = 0;
4423 }
4424 } else
4425 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4426 int prop_is_valid;
4427 has_type = 1;
4428 prop_is_valid = ast_ari_validate_string(
4430 if (!prop_is_valid) {
4431 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field type failed validation\n");
4432 res = 0;
4433 }
4434 } else
4435 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4436 int prop_is_valid;
4437 has_application = 1;
4438 prop_is_valid = ast_ari_validate_string(
4440 if (!prop_is_valid) {
4441 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field application failed validation\n");
4442 res = 0;
4443 }
4444 } else
4445 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4446 int prop_is_valid;
4447 has_timestamp = 1;
4448 prop_is_valid = ast_ari_validate_date(
4450 if (!prop_is_valid) {
4451 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field timestamp failed validation\n");
4452 res = 0;
4453 }
4454 } else
4455 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
4456 int prop_is_valid;
4457 has_bridge = 1;
4458 prop_is_valid = ast_ari_validate_bridge(
4460 if (!prop_is_valid) {
4461 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field bridge failed validation\n");
4462 res = 0;
4463 }
4464 } else
4465 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4466 int prop_is_valid;
4467 prop_is_valid = ast_ari_validate_channel(
4469 if (!prop_is_valid) {
4470 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field channel failed validation\n");
4471 res = 0;
4472 }
4473 } else
4474 {
4476 "ARI ChannelEnteredBridge has undocumented field %s\n",
4478 res = 0;
4479 }
4480 }
4481
4482 if (!has_type) {
4483 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field type\n");
4484 res = 0;
4485 }
4486
4487 if (!has_application) {
4488 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field application\n");
4489 res = 0;
4490 }
4491
4492 if (!has_timestamp) {
4493 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field timestamp\n");
4494 res = 0;
4495 }
4496
4497 if (!has_bridge) {
4498 ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field bridge\n");
4499 res = 0;
4500 }
4501
4502 return res;
4503}
4504
4509
4511{
4512 int res = 1;
4513 struct ast_json_iter *iter;
4514 int has_type = 0;
4515 int has_application = 0;
4516 int has_timestamp = 0;
4517 int has_channel = 0;
4518
4519 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4520 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4521 int prop_is_valid;
4522 prop_is_valid = ast_ari_validate_string(
4524 if (!prop_is_valid) {
4525 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field asterisk_id failed validation\n");
4526 res = 0;
4527 }
4528 } else
4529 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4530 int prop_is_valid;
4531 has_type = 1;
4532 prop_is_valid = ast_ari_validate_string(
4534 if (!prop_is_valid) {
4535 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field type failed validation\n");
4536 res = 0;
4537 }
4538 } else
4539 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4540 int prop_is_valid;
4541 has_application = 1;
4542 prop_is_valid = ast_ari_validate_string(
4544 if (!prop_is_valid) {
4545 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field application failed validation\n");
4546 res = 0;
4547 }
4548 } else
4549 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4550 int prop_is_valid;
4551 has_timestamp = 1;
4552 prop_is_valid = ast_ari_validate_date(
4554 if (!prop_is_valid) {
4555 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field timestamp failed validation\n");
4556 res = 0;
4557 }
4558 } else
4559 if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
4560 int prop_is_valid;
4561 prop_is_valid = ast_ari_validate_int(
4563 if (!prop_is_valid) {
4564 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field cause failed validation\n");
4565 res = 0;
4566 }
4567 } else
4568 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4569 int prop_is_valid;
4570 has_channel = 1;
4571 prop_is_valid = ast_ari_validate_channel(
4573 if (!prop_is_valid) {
4574 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field channel failed validation\n");
4575 res = 0;
4576 }
4577 } else
4578 if (strcmp("soft", ast_json_object_iter_key(iter)) == 0) {
4579 int prop_is_valid;
4580 prop_is_valid = ast_ari_validate_boolean(
4582 if (!prop_is_valid) {
4583 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field soft failed validation\n");
4584 res = 0;
4585 }
4586 } else
4587 if (strcmp("tech_cause", ast_json_object_iter_key(iter)) == 0) {
4588 int prop_is_valid;
4589 prop_is_valid = ast_ari_validate_int(
4591 if (!prop_is_valid) {
4592 ast_log(LOG_ERROR, "ARI ChannelHangupRequest field tech_cause failed validation\n");
4593 res = 0;
4594 }
4595 } else
4596 {
4598 "ARI ChannelHangupRequest has undocumented field %s\n",
4600 res = 0;
4601 }
4602 }
4603
4604 if (!has_type) {
4605 ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field type\n");
4606 res = 0;
4607 }
4608
4609 if (!has_application) {
4610 ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field application\n");
4611 res = 0;
4612 }
4613
4614 if (!has_timestamp) {
4615 ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field timestamp\n");
4616 res = 0;
4617 }
4618
4619 if (!has_channel) {
4620 ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field channel\n");
4621 res = 0;
4622 }
4623
4624 return res;
4625}
4626
4631
4633{
4634 int res = 1;
4635 struct ast_json_iter *iter;
4636 int has_type = 0;
4637 int has_application = 0;
4638 int has_timestamp = 0;
4639 int has_channel = 0;
4640
4641 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4642 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4643 int prop_is_valid;
4644 prop_is_valid = ast_ari_validate_string(
4646 if (!prop_is_valid) {
4647 ast_log(LOG_ERROR, "ARI ChannelHold field asterisk_id failed validation\n");
4648 res = 0;
4649 }
4650 } else
4651 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4652 int prop_is_valid;
4653 has_type = 1;
4654 prop_is_valid = ast_ari_validate_string(
4656 if (!prop_is_valid) {
4657 ast_log(LOG_ERROR, "ARI ChannelHold field type failed validation\n");
4658 res = 0;
4659 }
4660 } else
4661 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4662 int prop_is_valid;
4663 has_application = 1;
4664 prop_is_valid = ast_ari_validate_string(
4666 if (!prop_is_valid) {
4667 ast_log(LOG_ERROR, "ARI ChannelHold field application failed validation\n");
4668 res = 0;
4669 }
4670 } else
4671 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4672 int prop_is_valid;
4673 has_timestamp = 1;
4674 prop_is_valid = ast_ari_validate_date(
4676 if (!prop_is_valid) {
4677 ast_log(LOG_ERROR, "ARI ChannelHold field timestamp failed validation\n");
4678 res = 0;
4679 }
4680 } else
4681 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4682 int prop_is_valid;
4683 has_channel = 1;
4684 prop_is_valid = ast_ari_validate_channel(
4686 if (!prop_is_valid) {
4687 ast_log(LOG_ERROR, "ARI ChannelHold field channel failed validation\n");
4688 res = 0;
4689 }
4690 } else
4691 if (strcmp("musicclass", ast_json_object_iter_key(iter)) == 0) {
4692 int prop_is_valid;
4693 prop_is_valid = ast_ari_validate_string(
4695 if (!prop_is_valid) {
4696 ast_log(LOG_ERROR, "ARI ChannelHold field musicclass failed validation\n");
4697 res = 0;
4698 }
4699 } else
4700 {
4702 "ARI ChannelHold has undocumented field %s\n",
4704 res = 0;
4705 }
4706 }
4707
4708 if (!has_type) {
4709 ast_log(LOG_ERROR, "ARI ChannelHold missing required field type\n");
4710 res = 0;
4711 }
4712
4713 if (!has_application) {
4714 ast_log(LOG_ERROR, "ARI ChannelHold missing required field application\n");
4715 res = 0;
4716 }
4717
4718 if (!has_timestamp) {
4719 ast_log(LOG_ERROR, "ARI ChannelHold missing required field timestamp\n");
4720 res = 0;
4721 }
4722
4723 if (!has_channel) {
4724 ast_log(LOG_ERROR, "ARI ChannelHold missing required field channel\n");
4725 res = 0;
4726 }
4727
4728 return res;
4729}
4730
4735
4737{
4738 int res = 1;
4739 struct ast_json_iter *iter;
4740 int has_type = 0;
4741 int has_application = 0;
4742 int has_timestamp = 0;
4743 int has_bridge = 0;
4744 int has_channel = 0;
4745
4746 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4747 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4748 int prop_is_valid;
4749 prop_is_valid = ast_ari_validate_string(
4751 if (!prop_is_valid) {
4752 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field asterisk_id failed validation\n");
4753 res = 0;
4754 }
4755 } else
4756 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4757 int prop_is_valid;
4758 has_type = 1;
4759 prop_is_valid = ast_ari_validate_string(
4761 if (!prop_is_valid) {
4762 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field type failed validation\n");
4763 res = 0;
4764 }
4765 } else
4766 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4767 int prop_is_valid;
4768 has_application = 1;
4769 prop_is_valid = ast_ari_validate_string(
4771 if (!prop_is_valid) {
4772 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field application failed validation\n");
4773 res = 0;
4774 }
4775 } else
4776 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4777 int prop_is_valid;
4778 has_timestamp = 1;
4779 prop_is_valid = ast_ari_validate_date(
4781 if (!prop_is_valid) {
4782 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field timestamp failed validation\n");
4783 res = 0;
4784 }
4785 } else
4786 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
4787 int prop_is_valid;
4788 has_bridge = 1;
4789 prop_is_valid = ast_ari_validate_bridge(
4791 if (!prop_is_valid) {
4792 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field bridge failed validation\n");
4793 res = 0;
4794 }
4795 } else
4796 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4797 int prop_is_valid;
4798 has_channel = 1;
4799 prop_is_valid = ast_ari_validate_channel(
4801 if (!prop_is_valid) {
4802 ast_log(LOG_ERROR, "ARI ChannelLeftBridge field channel failed validation\n");
4803 res = 0;
4804 }
4805 } else
4806 {
4808 "ARI ChannelLeftBridge has undocumented field %s\n",
4810 res = 0;
4811 }
4812 }
4813
4814 if (!has_type) {
4815 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field type\n");
4816 res = 0;
4817 }
4818
4819 if (!has_application) {
4820 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field application\n");
4821 res = 0;
4822 }
4823
4824 if (!has_timestamp) {
4825 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field timestamp\n");
4826 res = 0;
4827 }
4828
4829 if (!has_bridge) {
4830 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field bridge\n");
4831 res = 0;
4832 }
4833
4834 if (!has_channel) {
4835 ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field channel\n");
4836 res = 0;
4837 }
4838
4839 return res;
4840}
4841
4846
4848{
4849 int res = 1;
4850 struct ast_json_iter *iter;
4851 int has_type = 0;
4852 int has_application = 0;
4853 int has_timestamp = 0;
4854 int has_channel = 0;
4855
4856 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4857 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4858 int prop_is_valid;
4859 prop_is_valid = ast_ari_validate_string(
4861 if (!prop_is_valid) {
4862 ast_log(LOG_ERROR, "ARI ChannelStateChange field asterisk_id failed validation\n");
4863 res = 0;
4864 }
4865 } else
4866 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4867 int prop_is_valid;
4868 has_type = 1;
4869 prop_is_valid = ast_ari_validate_string(
4871 if (!prop_is_valid) {
4872 ast_log(LOG_ERROR, "ARI ChannelStateChange field type failed validation\n");
4873 res = 0;
4874 }
4875 } else
4876 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4877 int prop_is_valid;
4878 has_application = 1;
4879 prop_is_valid = ast_ari_validate_string(
4881 if (!prop_is_valid) {
4882 ast_log(LOG_ERROR, "ARI ChannelStateChange field application failed validation\n");
4883 res = 0;
4884 }
4885 } else
4886 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4887 int prop_is_valid;
4888 has_timestamp = 1;
4889 prop_is_valid = ast_ari_validate_date(
4891 if (!prop_is_valid) {
4892 ast_log(LOG_ERROR, "ARI ChannelStateChange field timestamp failed validation\n");
4893 res = 0;
4894 }
4895 } else
4896 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4897 int prop_is_valid;
4898 has_channel = 1;
4899 prop_is_valid = ast_ari_validate_channel(
4901 if (!prop_is_valid) {
4902 ast_log(LOG_ERROR, "ARI ChannelStateChange field channel failed validation\n");
4903 res = 0;
4904 }
4905 } else
4906 {
4908 "ARI ChannelStateChange has undocumented field %s\n",
4910 res = 0;
4911 }
4912 }
4913
4914 if (!has_type) {
4915 ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field type\n");
4916 res = 0;
4917 }
4918
4919 if (!has_application) {
4920 ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field application\n");
4921 res = 0;
4922 }
4923
4924 if (!has_timestamp) {
4925 ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field timestamp\n");
4926 res = 0;
4927 }
4928
4929 if (!has_channel) {
4930 ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field channel\n");
4931 res = 0;
4932 }
4933
4934 return res;
4935}
4936
4941
4943{
4944 int res = 1;
4945 struct ast_json_iter *iter;
4946 int has_type = 0;
4947 int has_application = 0;
4948 int has_timestamp = 0;
4949 int has_channel = 0;
4950 int has_duration = 0;
4951
4952 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4953 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4954 int prop_is_valid;
4955 prop_is_valid = ast_ari_validate_string(
4957 if (!prop_is_valid) {
4958 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field asterisk_id failed validation\n");
4959 res = 0;
4960 }
4961 } else
4962 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4963 int prop_is_valid;
4964 has_type = 1;
4965 prop_is_valid = ast_ari_validate_string(
4967 if (!prop_is_valid) {
4968 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field type failed validation\n");
4969 res = 0;
4970 }
4971 } else
4972 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4973 int prop_is_valid;
4974 has_application = 1;
4975 prop_is_valid = ast_ari_validate_string(
4977 if (!prop_is_valid) {
4978 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field application failed validation\n");
4979 res = 0;
4980 }
4981 } else
4982 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4983 int prop_is_valid;
4984 has_timestamp = 1;
4985 prop_is_valid = ast_ari_validate_date(
4987 if (!prop_is_valid) {
4988 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field timestamp failed validation\n");
4989 res = 0;
4990 }
4991 } else
4992 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4993 int prop_is_valid;
4994 has_channel = 1;
4995 prop_is_valid = ast_ari_validate_channel(
4997 if (!prop_is_valid) {
4998 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field channel failed validation\n");
4999 res = 0;
5000 }
5001 } else
5002 if (strcmp("duration", ast_json_object_iter_key(iter)) == 0) {
5003 int prop_is_valid;
5004 has_duration = 1;
5005 prop_is_valid = ast_ari_validate_int(
5007 if (!prop_is_valid) {
5008 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field duration failed validation\n");
5009 res = 0;
5010 }
5011 } else
5012 {
5014 "ARI ChannelTalkingFinished has undocumented field %s\n",
5016 res = 0;
5017 }
5018 }
5019
5020 if (!has_type) {
5021 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field type\n");
5022 res = 0;
5023 }
5024
5025 if (!has_application) {
5026 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field application\n");
5027 res = 0;
5028 }
5029
5030 if (!has_timestamp) {
5031 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field timestamp\n");
5032 res = 0;
5033 }
5034
5035 if (!has_channel) {
5036 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field channel\n");
5037 res = 0;
5038 }
5039
5040 if (!has_duration) {
5041 ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field duration\n");
5042 res = 0;
5043 }
5044
5045 return res;
5046}
5047
5052
5054{
5055 int res = 1;
5056 struct ast_json_iter *iter;
5057 int has_type = 0;
5058 int has_application = 0;
5059 int has_timestamp = 0;
5060 int has_channel = 0;
5061
5062 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5063 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5064 int prop_is_valid;
5065 prop_is_valid = ast_ari_validate_string(
5067 if (!prop_is_valid) {
5068 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field asterisk_id failed validation\n");
5069 res = 0;
5070 }
5071 } else
5072 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5073 int prop_is_valid;
5074 has_type = 1;
5075 prop_is_valid = ast_ari_validate_string(
5077 if (!prop_is_valid) {
5078 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field type failed validation\n");
5079 res = 0;
5080 }
5081 } else
5082 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5083 int prop_is_valid;
5084 has_application = 1;
5085 prop_is_valid = ast_ari_validate_string(
5087 if (!prop_is_valid) {
5088 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field application failed validation\n");
5089 res = 0;
5090 }
5091 } else
5092 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5093 int prop_is_valid;
5094 has_timestamp = 1;
5095 prop_is_valid = ast_ari_validate_date(
5097 if (!prop_is_valid) {
5098 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field timestamp failed validation\n");
5099 res = 0;
5100 }
5101 } else
5102 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5103 int prop_is_valid;
5104 has_channel = 1;
5105 prop_is_valid = ast_ari_validate_channel(
5107 if (!prop_is_valid) {
5108 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field channel failed validation\n");
5109 res = 0;
5110 }
5111 } else
5112 {
5114 "ARI ChannelTalkingStarted has undocumented field %s\n",
5116 res = 0;
5117 }
5118 }
5119
5120 if (!has_type) {
5121 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field type\n");
5122 res = 0;
5123 }
5124
5125 if (!has_application) {
5126 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field application\n");
5127 res = 0;
5128 }
5129
5130 if (!has_timestamp) {
5131 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field timestamp\n");
5132 res = 0;
5133 }
5134
5135 if (!has_channel) {
5136 ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field channel\n");
5137 res = 0;
5138 }
5139
5140 return res;
5141}
5142
5147
5149{
5150 int res = 1;
5151 struct ast_json_iter *iter;
5152 int has_type = 0;
5153 int has_application = 0;
5154 int has_timestamp = 0;
5155 int has_channel = 0;
5156
5157 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5158 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5159 int prop_is_valid;
5160 prop_is_valid = ast_ari_validate_string(
5162 if (!prop_is_valid) {
5163 ast_log(LOG_ERROR, "ARI ChannelToneDetected field asterisk_id failed validation\n");
5164 res = 0;
5165 }
5166 } else
5167 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5168 int prop_is_valid;
5169 has_type = 1;
5170 prop_is_valid = ast_ari_validate_string(
5172 if (!prop_is_valid) {
5173 ast_log(LOG_ERROR, "ARI ChannelToneDetected field type failed validation\n");
5174 res = 0;
5175 }
5176 } else
5177 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5178 int prop_is_valid;
5179 has_application = 1;
5180 prop_is_valid = ast_ari_validate_string(
5182 if (!prop_is_valid) {
5183 ast_log(LOG_ERROR, "ARI ChannelToneDetected field application failed validation\n");
5184 res = 0;
5185 }
5186 } else
5187 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5188 int prop_is_valid;
5189 has_timestamp = 1;
5190 prop_is_valid = ast_ari_validate_date(
5192 if (!prop_is_valid) {
5193 ast_log(LOG_ERROR, "ARI ChannelToneDetected field timestamp failed validation\n");
5194 res = 0;
5195 }
5196 } else
5197 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5198 int prop_is_valid;
5199 has_channel = 1;
5200 prop_is_valid = ast_ari_validate_channel(
5202 if (!prop_is_valid) {
5203 ast_log(LOG_ERROR, "ARI ChannelToneDetected field channel failed validation\n");
5204 res = 0;
5205 }
5206 } else
5207 {
5209 "ARI ChannelToneDetected has undocumented field %s\n",
5211 res = 0;
5212 }
5213 }
5214
5215 if (!has_type) {
5216 ast_log(LOG_ERROR, "ARI ChannelToneDetected missing required field type\n");
5217 res = 0;
5218 }
5219
5220 if (!has_application) {
5221 ast_log(LOG_ERROR, "ARI ChannelToneDetected missing required field application\n");
5222 res = 0;
5223 }
5224
5225 if (!has_timestamp) {
5226 ast_log(LOG_ERROR, "ARI ChannelToneDetected missing required field timestamp\n");
5227 res = 0;
5228 }
5229
5230 if (!has_channel) {
5231 ast_log(LOG_ERROR, "ARI ChannelToneDetected missing required field channel\n");
5232 res = 0;
5233 }
5234
5235 return res;
5236}
5237
5242
5244{
5245 int res = 1;
5246 struct ast_json_iter *iter;
5247 int has_type = 0;
5248 int has_application = 0;
5249 int has_timestamp = 0;
5250 int has_refer_to = 0;
5251 int has_referred_by = 0;
5252
5253 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5254 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5255 int prop_is_valid;
5256 prop_is_valid = ast_ari_validate_string(
5258 if (!prop_is_valid) {
5259 ast_log(LOG_ERROR, "ARI ChannelTransfer field asterisk_id failed validation\n");
5260 res = 0;
5261 }
5262 } else
5263 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5264 int prop_is_valid;
5265 has_type = 1;
5266 prop_is_valid = ast_ari_validate_string(
5268 if (!prop_is_valid) {
5269 ast_log(LOG_ERROR, "ARI ChannelTransfer field type failed validation\n");
5270 res = 0;
5271 }
5272 } else
5273 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5274 int prop_is_valid;
5275 has_application = 1;
5276 prop_is_valid = ast_ari_validate_string(
5278 if (!prop_is_valid) {
5279 ast_log(LOG_ERROR, "ARI ChannelTransfer field application failed validation\n");
5280 res = 0;
5281 }
5282 } else
5283 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5284 int prop_is_valid;
5285 has_timestamp = 1;
5286 prop_is_valid = ast_ari_validate_date(
5288 if (!prop_is_valid) {
5289 ast_log(LOG_ERROR, "ARI ChannelTransfer field timestamp failed validation\n");
5290 res = 0;
5291 }
5292 } else
5293 if (strcmp("refer_to", ast_json_object_iter_key(iter)) == 0) {
5294 int prop_is_valid;
5295 has_refer_to = 1;
5296 prop_is_valid = ast_ari_validate_refer_to(
5298 if (!prop_is_valid) {
5299 ast_log(LOG_ERROR, "ARI ChannelTransfer field refer_to failed validation\n");
5300 res = 0;
5301 }
5302 } else
5303 if (strcmp("referred_by", ast_json_object_iter_key(iter)) == 0) {
5304 int prop_is_valid;
5305 has_referred_by = 1;
5306 prop_is_valid = ast_ari_validate_referred_by(
5308 if (!prop_is_valid) {
5309 ast_log(LOG_ERROR, "ARI ChannelTransfer field referred_by failed validation\n");
5310 res = 0;
5311 }
5312 } else
5313 if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
5314 int prop_is_valid;
5315 prop_is_valid = ast_ari_validate_string(
5317 if (!prop_is_valid) {
5318 ast_log(LOG_ERROR, "ARI ChannelTransfer field state failed validation\n");
5319 res = 0;
5320 }
5321 } else
5322 {
5324 "ARI ChannelTransfer has undocumented field %s\n",
5326 res = 0;
5327 }
5328 }
5329
5330 if (!has_type) {
5331 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field type\n");
5332 res = 0;
5333 }
5334
5335 if (!has_application) {
5336 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field application\n");
5337 res = 0;
5338 }
5339
5340 if (!has_timestamp) {
5341 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field timestamp\n");
5342 res = 0;
5343 }
5344
5345 if (!has_refer_to) {
5346 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field refer_to\n");
5347 res = 0;
5348 }
5349
5350 if (!has_referred_by) {
5351 ast_log(LOG_ERROR, "ARI ChannelTransfer missing required field referred_by\n");
5352 res = 0;
5353 }
5354
5355 return res;
5356}
5357
5362
5364{
5365 int res = 1;
5366 struct ast_json_iter *iter;
5367 int has_type = 0;
5368 int has_application = 0;
5369 int has_timestamp = 0;
5370 int has_channel = 0;
5371
5372 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5373 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5374 int prop_is_valid;
5375 prop_is_valid = ast_ari_validate_string(
5377 if (!prop_is_valid) {
5378 ast_log(LOG_ERROR, "ARI ChannelUnhold field asterisk_id failed validation\n");
5379 res = 0;
5380 }
5381 } else
5382 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5383 int prop_is_valid;
5384 has_type = 1;
5385 prop_is_valid = ast_ari_validate_string(
5387 if (!prop_is_valid) {
5388 ast_log(LOG_ERROR, "ARI ChannelUnhold field type failed validation\n");
5389 res = 0;
5390 }
5391 } else
5392 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5393 int prop_is_valid;
5394 has_application = 1;
5395 prop_is_valid = ast_ari_validate_string(
5397 if (!prop_is_valid) {
5398 ast_log(LOG_ERROR, "ARI ChannelUnhold field application failed validation\n");
5399 res = 0;
5400 }
5401 } else
5402 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5403 int prop_is_valid;
5404 has_timestamp = 1;
5405 prop_is_valid = ast_ari_validate_date(
5407 if (!prop_is_valid) {
5408 ast_log(LOG_ERROR, "ARI ChannelUnhold field timestamp failed validation\n");
5409 res = 0;
5410 }
5411 } else
5412 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5413 int prop_is_valid;
5414 has_channel = 1;
5415 prop_is_valid = ast_ari_validate_channel(
5417 if (!prop_is_valid) {
5418 ast_log(LOG_ERROR, "ARI ChannelUnhold field channel failed validation\n");
5419 res = 0;
5420 }
5421 } else
5422 {
5424 "ARI ChannelUnhold has undocumented field %s\n",
5426 res = 0;
5427 }
5428 }
5429
5430 if (!has_type) {
5431 ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field type\n");
5432 res = 0;
5433 }
5434
5435 if (!has_application) {
5436 ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field application\n");
5437 res = 0;
5438 }
5439
5440 if (!has_timestamp) {
5441 ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field timestamp\n");
5442 res = 0;
5443 }
5444
5445 if (!has_channel) {
5446 ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field channel\n");
5447 res = 0;
5448 }
5449
5450 return res;
5451}
5452
5457
5459{
5460 int res = 1;
5461 struct ast_json_iter *iter;
5462 int has_type = 0;
5463 int has_application = 0;
5464 int has_timestamp = 0;
5465 int has_eventname = 0;
5466 int has_userevent = 0;
5467
5468 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5469 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5470 int prop_is_valid;
5471 prop_is_valid = ast_ari_validate_string(
5473 if (!prop_is_valid) {
5474 ast_log(LOG_ERROR, "ARI ChannelUserevent field asterisk_id failed validation\n");
5475 res = 0;
5476 }
5477 } else
5478 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5479 int prop_is_valid;
5480 has_type = 1;
5481 prop_is_valid = ast_ari_validate_string(
5483 if (!prop_is_valid) {
5484 ast_log(LOG_ERROR, "ARI ChannelUserevent field type failed validation\n");
5485 res = 0;
5486 }
5487 } else
5488 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5489 int prop_is_valid;
5490 has_application = 1;
5491 prop_is_valid = ast_ari_validate_string(
5493 if (!prop_is_valid) {
5494 ast_log(LOG_ERROR, "ARI ChannelUserevent field application failed validation\n");
5495 res = 0;
5496 }
5497 } else
5498 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5499 int prop_is_valid;
5500 has_timestamp = 1;
5501 prop_is_valid = ast_ari_validate_date(
5503 if (!prop_is_valid) {
5504 ast_log(LOG_ERROR, "ARI ChannelUserevent field timestamp failed validation\n");
5505 res = 0;
5506 }
5507 } else
5508 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
5509 int prop_is_valid;
5510 prop_is_valid = ast_ari_validate_bridge(
5512 if (!prop_is_valid) {
5513 ast_log(LOG_ERROR, "ARI ChannelUserevent field bridge failed validation\n");
5514 res = 0;
5515 }
5516 } else
5517 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5518 int prop_is_valid;
5519 prop_is_valid = ast_ari_validate_channel(
5521 if (!prop_is_valid) {
5522 ast_log(LOG_ERROR, "ARI ChannelUserevent field channel failed validation\n");
5523 res = 0;
5524 }
5525 } else
5526 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
5527 int prop_is_valid;
5528 prop_is_valid = ast_ari_validate_endpoint(
5530 if (!prop_is_valid) {
5531 ast_log(LOG_ERROR, "ARI ChannelUserevent field endpoint failed validation\n");
5532 res = 0;
5533 }
5534 } else
5535 if (strcmp("eventname", ast_json_object_iter_key(iter)) == 0) {
5536 int prop_is_valid;
5537 has_eventname = 1;
5538 prop_is_valid = ast_ari_validate_string(
5540 if (!prop_is_valid) {
5541 ast_log(LOG_ERROR, "ARI ChannelUserevent field eventname failed validation\n");
5542 res = 0;
5543 }
5544 } else
5545 if (strcmp("userevent", ast_json_object_iter_key(iter)) == 0) {
5546 int prop_is_valid;
5547 has_userevent = 1;
5548 prop_is_valid = ast_ari_validate_object(
5550 if (!prop_is_valid) {
5551 ast_log(LOG_ERROR, "ARI ChannelUserevent field userevent failed validation\n");
5552 res = 0;
5553 }
5554 } else
5555 {
5557 "ARI ChannelUserevent has undocumented field %s\n",
5559 res = 0;
5560 }
5561 }
5562
5563 if (!has_type) {
5564 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field type\n");
5565 res = 0;
5566 }
5567
5568 if (!has_application) {
5569 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field application\n");
5570 res = 0;
5571 }
5572
5573 if (!has_timestamp) {
5574 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field timestamp\n");
5575 res = 0;
5576 }
5577
5578 if (!has_eventname) {
5579 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field eventname\n");
5580 res = 0;
5581 }
5582
5583 if (!has_userevent) {
5584 ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field userevent\n");
5585 res = 0;
5586 }
5587
5588 return res;
5589}
5590
5595
5597{
5598 int res = 1;
5599 struct ast_json_iter *iter;
5600 int has_type = 0;
5601 int has_application = 0;
5602 int has_timestamp = 0;
5603 int has_value = 0;
5604 int has_variable = 0;
5605
5606 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5607 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5608 int prop_is_valid;
5609 prop_is_valid = ast_ari_validate_string(
5611 if (!prop_is_valid) {
5612 ast_log(LOG_ERROR, "ARI ChannelVarset field asterisk_id failed validation\n");
5613 res = 0;
5614 }
5615 } else
5616 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5617 int prop_is_valid;
5618 has_type = 1;
5619 prop_is_valid = ast_ari_validate_string(
5621 if (!prop_is_valid) {
5622 ast_log(LOG_ERROR, "ARI ChannelVarset field type failed validation\n");
5623 res = 0;
5624 }
5625 } else
5626 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5627 int prop_is_valid;
5628 has_application = 1;
5629 prop_is_valid = ast_ari_validate_string(
5631 if (!prop_is_valid) {
5632 ast_log(LOG_ERROR, "ARI ChannelVarset field application failed validation\n");
5633 res = 0;
5634 }
5635 } else
5636 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5637 int prop_is_valid;
5638 has_timestamp = 1;
5639 prop_is_valid = ast_ari_validate_date(
5641 if (!prop_is_valid) {
5642 ast_log(LOG_ERROR, "ARI ChannelVarset field timestamp failed validation\n");
5643 res = 0;
5644 }
5645 } else
5646 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5647 int prop_is_valid;
5648 prop_is_valid = ast_ari_validate_channel(
5650 if (!prop_is_valid) {
5651 ast_log(LOG_ERROR, "ARI ChannelVarset field channel failed validation\n");
5652 res = 0;
5653 }
5654 } else
5655 if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
5656 int prop_is_valid;
5657 has_value = 1;
5658 prop_is_valid = ast_ari_validate_string(
5660 if (!prop_is_valid) {
5661 ast_log(LOG_ERROR, "ARI ChannelVarset field value failed validation\n");
5662 res = 0;
5663 }
5664 } else
5665 if (strcmp("variable", ast_json_object_iter_key(iter)) == 0) {
5666 int prop_is_valid;
5667 has_variable = 1;
5668 prop_is_valid = ast_ari_validate_string(
5670 if (!prop_is_valid) {
5671 ast_log(LOG_ERROR, "ARI ChannelVarset field variable failed validation\n");
5672 res = 0;
5673 }
5674 } else
5675 {
5677 "ARI ChannelVarset has undocumented field %s\n",
5679 res = 0;
5680 }
5681 }
5682
5683 if (!has_type) {
5684 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field type\n");
5685 res = 0;
5686 }
5687
5688 if (!has_application) {
5689 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field application\n");
5690 res = 0;
5691 }
5692
5693 if (!has_timestamp) {
5694 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field timestamp\n");
5695 res = 0;
5696 }
5697
5698 if (!has_value) {
5699 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field value\n");
5700 res = 0;
5701 }
5702
5703 if (!has_variable) {
5704 ast_log(LOG_ERROR, "ARI ChannelVarset missing required field variable\n");
5705 res = 0;
5706 }
5707
5708 return res;
5709}
5710
5715
5717{
5718 int res = 1;
5719 struct ast_json_iter *iter;
5720 int has_aor = 0;
5721 int has_contact_status = 0;
5722 int has_uri = 0;
5723
5724 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5725 if (strcmp("aor", ast_json_object_iter_key(iter)) == 0) {
5726 int prop_is_valid;
5727 has_aor = 1;
5728 prop_is_valid = ast_ari_validate_string(
5730 if (!prop_is_valid) {
5731 ast_log(LOG_ERROR, "ARI ContactInfo field aor failed validation\n");
5732 res = 0;
5733 }
5734 } else
5735 if (strcmp("contact_status", ast_json_object_iter_key(iter)) == 0) {
5736 int prop_is_valid;
5737 has_contact_status = 1;
5738 prop_is_valid = ast_ari_validate_string(
5740 if (!prop_is_valid) {
5741 ast_log(LOG_ERROR, "ARI ContactInfo field contact_status failed validation\n");
5742 res = 0;
5743 }
5744 } else
5745 if (strcmp("roundtrip_usec", ast_json_object_iter_key(iter)) == 0) {
5746 int prop_is_valid;
5747 prop_is_valid = ast_ari_validate_string(
5749 if (!prop_is_valid) {
5750 ast_log(LOG_ERROR, "ARI ContactInfo field roundtrip_usec failed validation\n");
5751 res = 0;
5752 }
5753 } else
5754 if (strcmp("uri", ast_json_object_iter_key(iter)) == 0) {
5755 int prop_is_valid;
5756 has_uri = 1;
5757 prop_is_valid = ast_ari_validate_string(
5759 if (!prop_is_valid) {
5760 ast_log(LOG_ERROR, "ARI ContactInfo field uri failed validation\n");
5761 res = 0;
5762 }
5763 } else
5764 {
5766 "ARI ContactInfo has undocumented field %s\n",
5768 res = 0;
5769 }
5770 }
5771
5772 if (!has_aor) {
5773 ast_log(LOG_ERROR, "ARI ContactInfo missing required field aor\n");
5774 res = 0;
5775 }
5776
5777 if (!has_contact_status) {
5778 ast_log(LOG_ERROR, "ARI ContactInfo missing required field contact_status\n");
5779 res = 0;
5780 }
5781
5782 if (!has_uri) {
5783 ast_log(LOG_ERROR, "ARI ContactInfo missing required field uri\n");
5784 res = 0;
5785 }
5786
5787 return res;
5788}
5789
5794
5796{
5797 int res = 1;
5798 struct ast_json_iter *iter;
5799 int has_type = 0;
5800 int has_application = 0;
5801 int has_timestamp = 0;
5802 int has_contact_info = 0;
5803 int has_endpoint = 0;
5804
5805 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5806 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5807 int prop_is_valid;
5808 prop_is_valid = ast_ari_validate_string(
5810 if (!prop_is_valid) {
5811 ast_log(LOG_ERROR, "ARI ContactStatusChange field asterisk_id failed validation\n");
5812 res = 0;
5813 }
5814 } else
5815 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5816 int prop_is_valid;
5817 has_type = 1;
5818 prop_is_valid = ast_ari_validate_string(
5820 if (!prop_is_valid) {
5821 ast_log(LOG_ERROR, "ARI ContactStatusChange field type failed validation\n");
5822 res = 0;
5823 }
5824 } else
5825 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5826 int prop_is_valid;
5827 has_application = 1;
5828 prop_is_valid = ast_ari_validate_string(
5830 if (!prop_is_valid) {
5831 ast_log(LOG_ERROR, "ARI ContactStatusChange field application failed validation\n");
5832 res = 0;
5833 }
5834 } else
5835 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5836 int prop_is_valid;
5837 has_timestamp = 1;
5838 prop_is_valid = ast_ari_validate_date(
5840 if (!prop_is_valid) {
5841 ast_log(LOG_ERROR, "ARI ContactStatusChange field timestamp failed validation\n");
5842 res = 0;
5843 }
5844 } else
5845 if (strcmp("contact_info", ast_json_object_iter_key(iter)) == 0) {
5846 int prop_is_valid;
5847 has_contact_info = 1;
5848 prop_is_valid = ast_ari_validate_contact_info(
5850 if (!prop_is_valid) {
5851 ast_log(LOG_ERROR, "ARI ContactStatusChange field contact_info failed validation\n");
5852 res = 0;
5853 }
5854 } else
5855 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
5856 int prop_is_valid;
5857 has_endpoint = 1;
5858 prop_is_valid = ast_ari_validate_endpoint(
5860 if (!prop_is_valid) {
5861 ast_log(LOG_ERROR, "ARI ContactStatusChange field endpoint failed validation\n");
5862 res = 0;
5863 }
5864 } else
5865 {
5867 "ARI ContactStatusChange has undocumented field %s\n",
5869 res = 0;
5870 }
5871 }
5872
5873 if (!has_type) {
5874 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field type\n");
5875 res = 0;
5876 }
5877
5878 if (!has_application) {
5879 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field application\n");
5880 res = 0;
5881 }
5882
5883 if (!has_timestamp) {
5884 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field timestamp\n");
5885 res = 0;
5886 }
5887
5888 if (!has_contact_info) {
5889 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field contact_info\n");
5890 res = 0;
5891 }
5892
5893 if (!has_endpoint) {
5894 ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field endpoint\n");
5895 res = 0;
5896 }
5897
5898 return res;
5899}
5900
5905
5907{
5908 int res = 1;
5909 struct ast_json_iter *iter;
5910 int has_type = 0;
5911 int has_application = 0;
5912 int has_timestamp = 0;
5913 int has_device_state = 0;
5914
5915 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5916 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5917 int prop_is_valid;
5918 prop_is_valid = ast_ari_validate_string(
5920 if (!prop_is_valid) {
5921 ast_log(LOG_ERROR, "ARI DeviceStateChanged field asterisk_id failed validation\n");
5922 res = 0;
5923 }
5924 } else
5925 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5926 int prop_is_valid;
5927 has_type = 1;
5928 prop_is_valid = ast_ari_validate_string(
5930 if (!prop_is_valid) {
5931 ast_log(LOG_ERROR, "ARI DeviceStateChanged field type failed validation\n");
5932 res = 0;
5933 }
5934 } else
5935 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5936 int prop_is_valid;
5937 has_application = 1;
5938 prop_is_valid = ast_ari_validate_string(
5940 if (!prop_is_valid) {
5941 ast_log(LOG_ERROR, "ARI DeviceStateChanged field application failed validation\n");
5942 res = 0;
5943 }
5944 } else
5945 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5946 int prop_is_valid;
5947 has_timestamp = 1;
5948 prop_is_valid = ast_ari_validate_date(
5950 if (!prop_is_valid) {
5951 ast_log(LOG_ERROR, "ARI DeviceStateChanged field timestamp failed validation\n");
5952 res = 0;
5953 }
5954 } else
5955 if (strcmp("device_state", ast_json_object_iter_key(iter)) == 0) {
5956 int prop_is_valid;
5957 has_device_state = 1;
5958 prop_is_valid = ast_ari_validate_device_state(
5960 if (!prop_is_valid) {
5961 ast_log(LOG_ERROR, "ARI DeviceStateChanged field device_state failed validation\n");
5962 res = 0;
5963 }
5964 } else
5965 {
5967 "ARI DeviceStateChanged has undocumented field %s\n",
5969 res = 0;
5970 }
5971 }
5972
5973 if (!has_type) {
5974 ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field type\n");
5975 res = 0;
5976 }
5977
5978 if (!has_application) {
5979 ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field application\n");
5980 res = 0;
5981 }
5982
5983 if (!has_timestamp) {
5984 ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field timestamp\n");
5985 res = 0;
5986 }
5987
5988 if (!has_device_state) {
5989 ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field device_state\n");
5990 res = 0;
5991 }
5992
5993 return res;
5994}
5995
6000
6002{
6003 int res = 1;
6004 struct ast_json_iter *iter;
6005 int has_type = 0;
6006 int has_application = 0;
6007 int has_timestamp = 0;
6008 int has_dialstatus = 0;
6009 int has_peer = 0;
6010
6011 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6012 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6013 int prop_is_valid;
6014 prop_is_valid = ast_ari_validate_string(
6016 if (!prop_is_valid) {
6017 ast_log(LOG_ERROR, "ARI Dial field asterisk_id failed validation\n");
6018 res = 0;
6019 }
6020 } else
6021 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6022 int prop_is_valid;
6023 has_type = 1;
6024 prop_is_valid = ast_ari_validate_string(
6026 if (!prop_is_valid) {
6027 ast_log(LOG_ERROR, "ARI Dial field type failed validation\n");
6028 res = 0;
6029 }
6030 } else
6031 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6032 int prop_is_valid;
6033 has_application = 1;
6034 prop_is_valid = ast_ari_validate_string(
6036 if (!prop_is_valid) {
6037 ast_log(LOG_ERROR, "ARI Dial field application failed validation\n");
6038 res = 0;
6039 }
6040 } else
6041 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6042 int prop_is_valid;
6043 has_timestamp = 1;
6044 prop_is_valid = ast_ari_validate_date(
6046 if (!prop_is_valid) {
6047 ast_log(LOG_ERROR, "ARI Dial field timestamp failed validation\n");
6048 res = 0;
6049 }
6050 } else
6051 if (strcmp("caller", ast_json_object_iter_key(iter)) == 0) {
6052 int prop_is_valid;
6053 prop_is_valid = ast_ari_validate_channel(
6055 if (!prop_is_valid) {
6056 ast_log(LOG_ERROR, "ARI Dial field caller failed validation\n");
6057 res = 0;
6058 }
6059 } else
6060 if (strcmp("dialstatus", ast_json_object_iter_key(iter)) == 0) {
6061 int prop_is_valid;
6062 has_dialstatus = 1;
6063 prop_is_valid = ast_ari_validate_string(
6065 if (!prop_is_valid) {
6066 ast_log(LOG_ERROR, "ARI Dial field dialstatus failed validation\n");
6067 res = 0;
6068 }
6069 } else
6070 if (strcmp("dialstring", ast_json_object_iter_key(iter)) == 0) {
6071 int prop_is_valid;
6072 prop_is_valid = ast_ari_validate_string(
6074 if (!prop_is_valid) {
6075 ast_log(LOG_ERROR, "ARI Dial field dialstring failed validation\n");
6076 res = 0;
6077 }
6078 } else
6079 if (strcmp("forward", ast_json_object_iter_key(iter)) == 0) {
6080 int prop_is_valid;
6081 prop_is_valid = ast_ari_validate_string(
6083 if (!prop_is_valid) {
6084 ast_log(LOG_ERROR, "ARI Dial field forward failed validation\n");
6085 res = 0;
6086 }
6087 } else
6088 if (strcmp("forwarded", ast_json_object_iter_key(iter)) == 0) {
6089 int prop_is_valid;
6090 prop_is_valid = ast_ari_validate_channel(
6092 if (!prop_is_valid) {
6093 ast_log(LOG_ERROR, "ARI Dial field forwarded failed validation\n");
6094 res = 0;
6095 }
6096 } else
6097 if (strcmp("peer", ast_json_object_iter_key(iter)) == 0) {
6098 int prop_is_valid;
6099 has_peer = 1;
6100 prop_is_valid = ast_ari_validate_channel(
6102 if (!prop_is_valid) {
6103 ast_log(LOG_ERROR, "ARI Dial field peer failed validation\n");
6104 res = 0;
6105 }
6106 } else
6107 {
6109 "ARI Dial has undocumented field %s\n",
6111 res = 0;
6112 }
6113 }
6114
6115 if (!has_type) {
6116 ast_log(LOG_ERROR, "ARI Dial missing required field type\n");
6117 res = 0;
6118 }
6119
6120 if (!has_application) {
6121 ast_log(LOG_ERROR, "ARI Dial missing required field application\n");
6122 res = 0;
6123 }
6124
6125 if (!has_timestamp) {
6126 ast_log(LOG_ERROR, "ARI Dial missing required field timestamp\n");
6127 res = 0;
6128 }
6129
6130 if (!has_dialstatus) {
6131 ast_log(LOG_ERROR, "ARI Dial missing required field dialstatus\n");
6132 res = 0;
6133 }
6134
6135 if (!has_peer) {
6136 ast_log(LOG_ERROR, "ARI Dial missing required field peer\n");
6137 res = 0;
6138 }
6139
6140 return res;
6141}
6142
6147
6149{
6150 int res = 1;
6151 struct ast_json_iter *iter;
6152 int has_type = 0;
6153 int has_application = 0;
6154 int has_timestamp = 0;
6155 int has_endpoint = 0;
6156
6157 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6158 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6159 int prop_is_valid;
6160 prop_is_valid = ast_ari_validate_string(
6162 if (!prop_is_valid) {
6163 ast_log(LOG_ERROR, "ARI EndpointStateChange field asterisk_id failed validation\n");
6164 res = 0;
6165 }
6166 } else
6167 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6168 int prop_is_valid;
6169 has_type = 1;
6170 prop_is_valid = ast_ari_validate_string(
6172 if (!prop_is_valid) {
6173 ast_log(LOG_ERROR, "ARI EndpointStateChange field type failed validation\n");
6174 res = 0;
6175 }
6176 } else
6177 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6178 int prop_is_valid;
6179 has_application = 1;
6180 prop_is_valid = ast_ari_validate_string(
6182 if (!prop_is_valid) {
6183 ast_log(LOG_ERROR, "ARI EndpointStateChange field application failed validation\n");
6184 res = 0;
6185 }
6186 } else
6187 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6188 int prop_is_valid;
6189 has_timestamp = 1;
6190 prop_is_valid = ast_ari_validate_date(
6192 if (!prop_is_valid) {
6193 ast_log(LOG_ERROR, "ARI EndpointStateChange field timestamp failed validation\n");
6194 res = 0;
6195 }
6196 } else
6197 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
6198 int prop_is_valid;
6199 has_endpoint = 1;
6200 prop_is_valid = ast_ari_validate_endpoint(
6202 if (!prop_is_valid) {
6203 ast_log(LOG_ERROR, "ARI EndpointStateChange field endpoint failed validation\n");
6204 res = 0;
6205 }
6206 } else
6207 {
6209 "ARI EndpointStateChange has undocumented field %s\n",
6211 res = 0;
6212 }
6213 }
6214
6215 if (!has_type) {
6216 ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field type\n");
6217 res = 0;
6218 }
6219
6220 if (!has_application) {
6221 ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field application\n");
6222 res = 0;
6223 }
6224
6225 if (!has_timestamp) {
6226 ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field timestamp\n");
6227 res = 0;
6228 }
6229
6230 if (!has_endpoint) {
6231 ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field endpoint\n");
6232 res = 0;
6233 }
6234
6235 return res;
6236}
6237
6242
6244{
6245 int res = 1;
6246 struct ast_json_iter *iter;
6247 int has_type = 0;
6248 int has_application = 0;
6249 int has_timestamp = 0;
6250 const char *discriminator;
6251
6252 discriminator = ast_json_string_get(ast_json_object_get(json, "type"));
6253 if (!discriminator) {
6254 ast_log(LOG_ERROR, "ARI Event missing required field type\n");
6255 return 0;
6256 }
6257
6258 if (strcmp("Event", discriminator) == 0) {
6259 /* Self type; fall through */
6260 } else
6261 if (strcmp("ApplicationMoveFailed", discriminator) == 0) {
6263 } else
6264 if (strcmp("ApplicationRegistered", discriminator) == 0) {
6266 } else
6267 if (strcmp("ApplicationReplaced", discriminator) == 0) {
6269 } else
6270 if (strcmp("ApplicationUnregistered", discriminator) == 0) {
6272 } else
6273 if (strcmp("BridgeAttendedTransfer", discriminator) == 0) {
6275 } else
6276 if (strcmp("BridgeBlindTransfer", discriminator) == 0) {
6278 } else
6279 if (strcmp("BridgeCreated", discriminator) == 0) {
6281 } else
6282 if (strcmp("BridgeDestroyed", discriminator) == 0) {
6284 } else
6285 if (strcmp("BridgeMerged", discriminator) == 0) {
6286 return ast_ari_validate_bridge_merged(json);
6287 } else
6288 if (strcmp("BridgeVideoSourceChanged", discriminator) == 0) {
6290 } else
6291 if (strcmp("ChannelCallerId", discriminator) == 0) {
6293 } else
6294 if (strcmp("ChannelConnectedLine", discriminator) == 0) {
6296 } else
6297 if (strcmp("ChannelCreated", discriminator) == 0) {
6299 } else
6300 if (strcmp("ChannelDestroyed", discriminator) == 0) {
6302 } else
6303 if (strcmp("ChannelDialplan", discriminator) == 0) {
6305 } else
6306 if (strcmp("ChannelDtmfReceived", discriminator) == 0) {
6308 } else
6309 if (strcmp("ChannelEnteredBridge", discriminator) == 0) {
6311 } else
6312 if (strcmp("ChannelHangupRequest", discriminator) == 0) {
6314 } else
6315 if (strcmp("ChannelHold", discriminator) == 0) {
6316 return ast_ari_validate_channel_hold(json);
6317 } else
6318 if (strcmp("ChannelLeftBridge", discriminator) == 0) {
6320 } else
6321 if (strcmp("ChannelStateChange", discriminator) == 0) {
6323 } else
6324 if (strcmp("ChannelTalkingFinished", discriminator) == 0) {
6326 } else
6327 if (strcmp("ChannelTalkingStarted", discriminator) == 0) {
6329 } else
6330 if (strcmp("ChannelToneDetected", discriminator) == 0) {
6332 } else
6333 if (strcmp("ChannelTransfer", discriminator) == 0) {
6335 } else
6336 if (strcmp("ChannelUnhold", discriminator) == 0) {
6338 } else
6339 if (strcmp("ChannelUserevent", discriminator) == 0) {
6341 } else
6342 if (strcmp("ChannelVarset", discriminator) == 0) {
6344 } else
6345 if (strcmp("ContactStatusChange", discriminator) == 0) {
6347 } else
6348 if (strcmp("DeviceStateChanged", discriminator) == 0) {
6350 } else
6351 if (strcmp("Dial", discriminator) == 0) {
6352 return ast_ari_validate_dial(json);
6353 } else
6354 if (strcmp("EndpointStateChange", discriminator) == 0) {
6356 } else
6357 if (strcmp("PeerStatusChange", discriminator) == 0) {
6359 } else
6360 if (strcmp("PlaybackContinuing", discriminator) == 0) {
6362 } else
6363 if (strcmp("PlaybackFinished", discriminator) == 0) {
6365 } else
6366 if (strcmp("PlaybackStarted", discriminator) == 0) {
6368 } else
6369 if (strcmp("RESTResponse", discriminator) == 0) {
6370 return ast_ari_validate_restresponse(json);
6371 } else
6372 if (strcmp("RecordingFailed", discriminator) == 0) {
6374 } else
6375 if (strcmp("RecordingFinished", discriminator) == 0) {
6377 } else
6378 if (strcmp("RecordingStarted", discriminator) == 0) {
6380 } else
6381 if (strcmp("StasisEnd", discriminator) == 0) {
6382 return ast_ari_validate_stasis_end(json);
6383 } else
6384 if (strcmp("StasisStart", discriminator) == 0) {
6385 return ast_ari_validate_stasis_start(json);
6386 } else
6387 if (strcmp("TextMessageReceived", discriminator) == 0) {
6389 } else
6390 {
6391 ast_log(LOG_ERROR, "ARI Event has undocumented subtype %s\n",
6392 discriminator);
6393 res = 0;
6394 }
6395
6396 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6397 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6398 int prop_is_valid;
6399 prop_is_valid = ast_ari_validate_string(
6401 if (!prop_is_valid) {
6402 ast_log(LOG_ERROR, "ARI Event field asterisk_id failed validation\n");
6403 res = 0;
6404 }
6405 } else
6406 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6407 int prop_is_valid;
6408 has_type = 1;
6409 prop_is_valid = ast_ari_validate_string(
6411 if (!prop_is_valid) {
6412 ast_log(LOG_ERROR, "ARI Event field type failed validation\n");
6413 res = 0;
6414 }
6415 } else
6416 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6417 int prop_is_valid;
6418 has_application = 1;
6419 prop_is_valid = ast_ari_validate_string(
6421 if (!prop_is_valid) {
6422 ast_log(LOG_ERROR, "ARI Event field application failed validation\n");
6423 res = 0;
6424 }
6425 } else
6426 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6427 int prop_is_valid;
6428 has_timestamp = 1;
6429 prop_is_valid = ast_ari_validate_date(
6431 if (!prop_is_valid) {
6432 ast_log(LOG_ERROR, "ARI Event field timestamp failed validation\n");
6433 res = 0;
6434 }
6435 } else
6436 {
6438 "ARI Event has undocumented field %s\n",
6440 res = 0;
6441 }
6442 }
6443
6444 if (!has_type) {
6445 ast_log(LOG_ERROR, "ARI Event missing required field type\n");
6446 res = 0;
6447 }
6448
6449 if (!has_application) {
6450 ast_log(LOG_ERROR, "ARI Event missing required field application\n");
6451 res = 0;
6452 }
6453
6454 if (!has_timestamp) {
6455 ast_log(LOG_ERROR, "ARI Event missing required field timestamp\n");
6456 res = 0;
6457 }
6458
6459 return res;
6460}
6461
6466
6468{
6469 int res = 1;
6470 struct ast_json_iter *iter;
6471 int has_type = 0;
6472 const char *discriminator;
6473
6474 discriminator = ast_json_string_get(ast_json_object_get(json, "type"));
6475 if (!discriminator) {
6476 ast_log(LOG_ERROR, "ARI Message missing required field type\n");
6477 return 0;
6478 }
6479
6480 if (strcmp("Message", discriminator) == 0) {
6481 /* Self type; fall through */
6482 } else
6483 if (strcmp("ApplicationMoveFailed", discriminator) == 0) {
6485 } else
6486 if (strcmp("ApplicationRegistered", discriminator) == 0) {
6488 } else
6489 if (strcmp("ApplicationReplaced", discriminator) == 0) {
6491 } else
6492 if (strcmp("ApplicationUnregistered", discriminator) == 0) {
6494 } else
6495 if (strcmp("BridgeAttendedTransfer", discriminator) == 0) {
6497 } else
6498 if (strcmp("BridgeBlindTransfer", discriminator) == 0) {
6500 } else
6501 if (strcmp("BridgeCreated", discriminator) == 0) {
6503 } else
6504 if (strcmp("BridgeDestroyed", discriminator) == 0) {
6506 } else
6507 if (strcmp("BridgeMerged", discriminator) == 0) {
6508 return ast_ari_validate_bridge_merged(json);
6509 } else
6510 if (strcmp("BridgeVideoSourceChanged", discriminator) == 0) {
6512 } else
6513 if (strcmp("ChannelCallerId", discriminator) == 0) {
6515 } else
6516 if (strcmp("ChannelConnectedLine", discriminator) == 0) {
6518 } else
6519 if (strcmp("ChannelCreated", discriminator) == 0) {
6521 } else
6522 if (strcmp("ChannelDestroyed", discriminator) == 0) {
6524 } else
6525 if (strcmp("ChannelDialplan", discriminator) == 0) {
6527 } else
6528 if (strcmp("ChannelDtmfReceived", discriminator) == 0) {
6530 } else
6531 if (strcmp("ChannelEnteredBridge", discriminator) == 0) {
6533 } else
6534 if (strcmp("ChannelHangupRequest", discriminator) == 0) {
6536 } else
6537 if (strcmp("ChannelHold", discriminator) == 0) {
6538 return ast_ari_validate_channel_hold(json);
6539 } else
6540 if (strcmp("ChannelLeftBridge", discriminator) == 0) {
6542 } else
6543 if (strcmp("ChannelStateChange", discriminator) == 0) {
6545 } else
6546 if (strcmp("ChannelTalkingFinished", discriminator) == 0) {
6548 } else
6549 if (strcmp("ChannelTalkingStarted", discriminator) == 0) {
6551 } else
6552 if (strcmp("ChannelToneDetected", discriminator) == 0) {
6554 } else
6555 if (strcmp("ChannelTransfer", discriminator) == 0) {
6557 } else
6558 if (strcmp("ChannelUnhold", discriminator) == 0) {
6560 } else
6561 if (strcmp("ChannelUserevent", discriminator) == 0) {
6563 } else
6564 if (strcmp("ChannelVarset", discriminator) == 0) {
6566 } else
6567 if (strcmp("ContactStatusChange", discriminator) == 0) {
6569 } else
6570 if (strcmp("DeviceStateChanged", discriminator) == 0) {
6572 } else
6573 if (strcmp("Dial", discriminator) == 0) {
6574 return ast_ari_validate_dial(json);
6575 } else
6576 if (strcmp("EndpointStateChange", discriminator) == 0) {
6578 } else
6579 if (strcmp("Event", discriminator) == 0) {
6580 return ast_ari_validate_event(json);
6581 } else
6582 if (strcmp("MissingParams", discriminator) == 0) {
6584 } else
6585 if (strcmp("PeerStatusChange", discriminator) == 0) {
6587 } else
6588 if (strcmp("PlaybackContinuing", discriminator) == 0) {
6590 } else
6591 if (strcmp("PlaybackFinished", discriminator) == 0) {
6593 } else
6594 if (strcmp("PlaybackStarted", discriminator) == 0) {
6596 } else
6597 if (strcmp("RESTResponse", discriminator) == 0) {
6598 return ast_ari_validate_restresponse(json);
6599 } else
6600 if (strcmp("RecordingFailed", discriminator) == 0) {
6602 } else
6603 if (strcmp("RecordingFinished", discriminator) == 0) {
6605 } else
6606 if (strcmp("RecordingStarted", discriminator) == 0) {
6608 } else
6609 if (strcmp("StasisEnd", discriminator) == 0) {
6610 return ast_ari_validate_stasis_end(json);
6611 } else
6612 if (strcmp("StasisStart", discriminator) == 0) {
6613 return ast_ari_validate_stasis_start(json);
6614 } else
6615 if (strcmp("TextMessageReceived", discriminator) == 0) {
6617 } else
6618 {
6619 ast_log(LOG_ERROR, "ARI Message has undocumented subtype %s\n",
6620 discriminator);
6621 res = 0;
6622 }
6623
6624 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6625 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6626 int prop_is_valid;
6627 prop_is_valid = ast_ari_validate_string(
6629 if (!prop_is_valid) {
6630 ast_log(LOG_ERROR, "ARI Message field asterisk_id failed validation\n");
6631 res = 0;
6632 }
6633 } else
6634 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6635 int prop_is_valid;
6636 has_type = 1;
6637 prop_is_valid = ast_ari_validate_string(
6639 if (!prop_is_valid) {
6640 ast_log(LOG_ERROR, "ARI Message field type failed validation\n");
6641 res = 0;
6642 }
6643 } else
6644 {
6646 "ARI Message has undocumented field %s\n",
6648 res = 0;
6649 }
6650 }
6651
6652 if (!has_type) {
6653 ast_log(LOG_ERROR, "ARI Message missing required field type\n");
6654 res = 0;
6655 }
6656
6657 return res;
6658}
6659
6664
6666{
6667 int res = 1;
6668 struct ast_json_iter *iter;
6669 int has_type = 0;
6670 int has_params = 0;
6671
6672 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6673 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6674 int prop_is_valid;
6675 prop_is_valid = ast_ari_validate_string(
6677 if (!prop_is_valid) {
6678 ast_log(LOG_ERROR, "ARI MissingParams field asterisk_id failed validation\n");
6679 res = 0;
6680 }
6681 } else
6682 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6683 int prop_is_valid;
6684 has_type = 1;
6685 prop_is_valid = ast_ari_validate_string(
6687 if (!prop_is_valid) {
6688 ast_log(LOG_ERROR, "ARI MissingParams field type failed validation\n");
6689 res = 0;
6690 }
6691 } else
6692 if (strcmp("params", ast_json_object_iter_key(iter)) == 0) {
6693 int prop_is_valid;
6694 has_params = 1;
6695 prop_is_valid = ast_ari_validate_list(
6698 if (!prop_is_valid) {
6699 ast_log(LOG_ERROR, "ARI MissingParams field params failed validation\n");
6700 res = 0;
6701 }
6702 } else
6703 {
6705 "ARI MissingParams has undocumented field %s\n",
6707 res = 0;
6708 }
6709 }
6710
6711 if (!has_type) {
6712 ast_log(LOG_ERROR, "ARI MissingParams missing required field type\n");
6713 res = 0;
6714 }
6715
6716 if (!has_params) {
6717 ast_log(LOG_ERROR, "ARI MissingParams missing required field params\n");
6718 res = 0;
6719 }
6720
6721 return res;
6722}
6723
6728
6730{
6731 int res = 1;
6732 struct ast_json_iter *iter;
6733 int has_peer_status = 0;
6734
6735 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6736 if (strcmp("address", 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 Peer field address failed validation\n");
6742 res = 0;
6743 }
6744 } else
6745 if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
6746 int prop_is_valid;
6747 prop_is_valid = ast_ari_validate_string(
6749 if (!prop_is_valid) {
6750 ast_log(LOG_ERROR, "ARI Peer field cause failed validation\n");
6751 res = 0;
6752 }
6753 } else
6754 if (strcmp("peer_status", ast_json_object_iter_key(iter)) == 0) {
6755 int prop_is_valid;
6756 has_peer_status = 1;
6757 prop_is_valid = ast_ari_validate_string(
6759 if (!prop_is_valid) {
6760 ast_log(LOG_ERROR, "ARI Peer field peer_status failed validation\n");
6761 res = 0;
6762 }
6763 } else
6764 if (strcmp("port", ast_json_object_iter_key(iter)) == 0) {
6765 int prop_is_valid;
6766 prop_is_valid = ast_ari_validate_string(
6768 if (!prop_is_valid) {
6769 ast_log(LOG_ERROR, "ARI Peer field port failed validation\n");
6770 res = 0;
6771 }
6772 } else
6773 if (strcmp("time", ast_json_object_iter_key(iter)) == 0) {
6774 int prop_is_valid;
6775 prop_is_valid = ast_ari_validate_string(
6777 if (!prop_is_valid) {
6778 ast_log(LOG_ERROR, "ARI Peer field time failed validation\n");
6779 res = 0;
6780 }
6781 } else
6782 {
6784 "ARI Peer has undocumented field %s\n",
6786 res = 0;
6787 }
6788 }
6789
6790 if (!has_peer_status) {
6791 ast_log(LOG_ERROR, "ARI Peer missing required field peer_status\n");
6792 res = 0;
6793 }
6794
6795 return res;
6796}
6797
6802
6804{
6805 int res = 1;
6806 struct ast_json_iter *iter;
6807 int has_type = 0;
6808 int has_application = 0;
6809 int has_timestamp = 0;
6810 int has_endpoint = 0;
6811 int has_peer = 0;
6812
6813 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6814 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6815 int prop_is_valid;
6816 prop_is_valid = ast_ari_validate_string(
6818 if (!prop_is_valid) {
6819 ast_log(LOG_ERROR, "ARI PeerStatusChange field asterisk_id failed validation\n");
6820 res = 0;
6821 }
6822 } else
6823 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6824 int prop_is_valid;
6825 has_type = 1;
6826 prop_is_valid = ast_ari_validate_string(
6828 if (!prop_is_valid) {
6829 ast_log(LOG_ERROR, "ARI PeerStatusChange field type failed validation\n");
6830 res = 0;
6831 }
6832 } else
6833 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6834 int prop_is_valid;
6835 has_application = 1;
6836 prop_is_valid = ast_ari_validate_string(
6838 if (!prop_is_valid) {
6839 ast_log(LOG_ERROR, "ARI PeerStatusChange field application failed validation\n");
6840 res = 0;
6841 }
6842 } else
6843 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6844 int prop_is_valid;
6845 has_timestamp = 1;
6846 prop_is_valid = ast_ari_validate_date(
6848 if (!prop_is_valid) {
6849 ast_log(LOG_ERROR, "ARI PeerStatusChange field timestamp failed validation\n");
6850 res = 0;
6851 }
6852 } else
6853 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
6854 int prop_is_valid;
6855 has_endpoint = 1;
6856 prop_is_valid = ast_ari_validate_endpoint(
6858 if (!prop_is_valid) {
6859 ast_log(LOG_ERROR, "ARI PeerStatusChange field endpoint failed validation\n");
6860 res = 0;
6861 }
6862 } else
6863 if (strcmp("peer", ast_json_object_iter_key(iter)) == 0) {
6864 int prop_is_valid;
6865 has_peer = 1;
6866 prop_is_valid = ast_ari_validate_peer(
6868 if (!prop_is_valid) {
6869 ast_log(LOG_ERROR, "ARI PeerStatusChange field peer failed validation\n");
6870 res = 0;
6871 }
6872 } else
6873 {
6875 "ARI PeerStatusChange has undocumented field %s\n",
6877 res = 0;
6878 }
6879 }
6880
6881 if (!has_type) {
6882 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field type\n");
6883 res = 0;
6884 }
6885
6886 if (!has_application) {
6887 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field application\n");
6888 res = 0;
6889 }
6890
6891 if (!has_timestamp) {
6892 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field timestamp\n");
6893 res = 0;
6894 }
6895
6896 if (!has_endpoint) {
6897 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field endpoint\n");
6898 res = 0;
6899 }
6900
6901 if (!has_peer) {
6902 ast_log(LOG_ERROR, "ARI PeerStatusChange missing required field peer\n");
6903 res = 0;
6904 }
6905
6906 return res;
6907}
6908
6913
6915{
6916 int res = 1;
6917 struct ast_json_iter *iter;
6918 int has_type = 0;
6919 int has_application = 0;
6920 int has_timestamp = 0;
6921 int has_playback = 0;
6922
6923 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
6924 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
6925 int prop_is_valid;
6926 prop_is_valid = ast_ari_validate_string(
6928 if (!prop_is_valid) {
6929 ast_log(LOG_ERROR, "ARI PlaybackContinuing field asterisk_id failed validation\n");
6930 res = 0;
6931 }
6932 } else
6933 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
6934 int prop_is_valid;
6935 has_type = 1;
6936 prop_is_valid = ast_ari_validate_string(
6938 if (!prop_is_valid) {
6939 ast_log(LOG_ERROR, "ARI PlaybackContinuing field type failed validation\n");
6940 res = 0;
6941 }
6942 } else
6943 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
6944 int prop_is_valid;
6945 has_application = 1;
6946 prop_is_valid = ast_ari_validate_string(
6948 if (!prop_is_valid) {
6949 ast_log(LOG_ERROR, "ARI PlaybackContinuing field application failed validation\n");
6950 res = 0;
6951 }
6952 } else
6953 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
6954 int prop_is_valid;
6955 has_timestamp = 1;
6956 prop_is_valid = ast_ari_validate_date(
6958 if (!prop_is_valid) {
6959 ast_log(LOG_ERROR, "ARI PlaybackContinuing field timestamp failed validation\n");
6960 res = 0;
6961 }
6962 } else
6963 if (strcmp("playback", ast_json_object_iter_key(iter)) == 0) {
6964 int prop_is_valid;
6965 has_playback = 1;
6966 prop_is_valid = ast_ari_validate_playback(
6968 if (!prop_is_valid) {
6969 ast_log(LOG_ERROR, "ARI PlaybackContinuing field playback failed validation\n");
6970 res = 0;
6971 }
6972 } else
6973 {
6975 "ARI PlaybackContinuing has undocumented field %s\n",
6977 res = 0;
6978 }
6979 }
6980
6981 if (!has_type) {
6982 ast_log(LOG_ERROR, "ARI PlaybackContinuing missing required field type\n");
6983 res = 0;
6984 }
6985
6986 if (!has_application) {
6987 ast_log(LOG_ERROR, "ARI PlaybackContinuing missing required field application\n");
6988 res = 0;
6989 }
6990
6991 if (!has_timestamp) {
6992 ast_log(LOG_ERROR, "ARI PlaybackContinuing missing required field timestamp\n");
6993 res = 0;
6994 }
6995
6996 if (!has_playback) {
6997 ast_log(LOG_ERROR, "ARI PlaybackContinuing missing required field playback\n");
6998 res = 0;
6999 }
7000
7001 return res;
7002}
7003
7008
7010{
7011 int res = 1;
7012 struct ast_json_iter *iter;
7013 int has_type = 0;
7014 int has_application = 0;
7015 int has_timestamp = 0;
7016 int has_playback = 0;
7017
7018 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7019 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7020 int prop_is_valid;
7021 prop_is_valid = ast_ari_validate_string(
7023 if (!prop_is_valid) {
7024 ast_log(LOG_ERROR, "ARI PlaybackFinished field asterisk_id failed validation\n");
7025 res = 0;
7026 }
7027 } else
7028 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7029 int prop_is_valid;
7030 has_type = 1;
7031 prop_is_valid = ast_ari_validate_string(
7033 if (!prop_is_valid) {
7034 ast_log(LOG_ERROR, "ARI PlaybackFinished field type failed validation\n");
7035 res = 0;
7036 }
7037 } else
7038 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7039 int prop_is_valid;
7040 has_application = 1;
7041 prop_is_valid = ast_ari_validate_string(
7043 if (!prop_is_valid) {
7044 ast_log(LOG_ERROR, "ARI PlaybackFinished field application failed validation\n");
7045 res = 0;
7046 }
7047 } else
7048 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7049 int prop_is_valid;
7050 has_timestamp = 1;
7051 prop_is_valid = ast_ari_validate_date(
7053 if (!prop_is_valid) {
7054 ast_log(LOG_ERROR, "ARI PlaybackFinished field timestamp failed validation\n");
7055 res = 0;
7056 }
7057 } else
7058 if (strcmp("playback", ast_json_object_iter_key(iter)) == 0) {
7059 int prop_is_valid;
7060 has_playback = 1;
7061 prop_is_valid = ast_ari_validate_playback(
7063 if (!prop_is_valid) {
7064 ast_log(LOG_ERROR, "ARI PlaybackFinished field playback failed validation\n");
7065 res = 0;
7066 }
7067 } else
7068 {
7070 "ARI PlaybackFinished has undocumented field %s\n",
7072 res = 0;
7073 }
7074 }
7075
7076 if (!has_type) {
7077 ast_log(LOG_ERROR, "ARI PlaybackFinished missing required field type\n");
7078 res = 0;
7079 }
7080
7081 if (!has_application) {
7082 ast_log(LOG_ERROR, "ARI PlaybackFinished missing required field application\n");
7083 res = 0;
7084 }
7085
7086 if (!has_timestamp) {
7087 ast_log(LOG_ERROR, "ARI PlaybackFinished missing required field timestamp\n");
7088 res = 0;
7089 }
7090
7091 if (!has_playback) {
7092 ast_log(LOG_ERROR, "ARI PlaybackFinished missing required field playback\n");
7093 res = 0;
7094 }
7095
7096 return res;
7097}
7098
7103
7105{
7106 int res = 1;
7107 struct ast_json_iter *iter;
7108 int has_type = 0;
7109 int has_application = 0;
7110 int has_timestamp = 0;
7111 int has_playback = 0;
7112
7113 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7114 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7115 int prop_is_valid;
7116 prop_is_valid = ast_ari_validate_string(
7118 if (!prop_is_valid) {
7119 ast_log(LOG_ERROR, "ARI PlaybackStarted field asterisk_id failed validation\n");
7120 res = 0;
7121 }
7122 } else
7123 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7124 int prop_is_valid;
7125 has_type = 1;
7126 prop_is_valid = ast_ari_validate_string(
7128 if (!prop_is_valid) {
7129 ast_log(LOG_ERROR, "ARI PlaybackStarted field type failed validation\n");
7130 res = 0;
7131 }
7132 } else
7133 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7134 int prop_is_valid;
7135 has_application = 1;
7136 prop_is_valid = ast_ari_validate_string(
7138 if (!prop_is_valid) {
7139 ast_log(LOG_ERROR, "ARI PlaybackStarted field application failed validation\n");
7140 res = 0;
7141 }
7142 } else
7143 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7144 int prop_is_valid;
7145 has_timestamp = 1;
7146 prop_is_valid = ast_ari_validate_date(
7148 if (!prop_is_valid) {
7149 ast_log(LOG_ERROR, "ARI PlaybackStarted field timestamp failed validation\n");
7150 res = 0;
7151 }
7152 } else
7153 if (strcmp("playback", ast_json_object_iter_key(iter)) == 0) {
7154 int prop_is_valid;
7155 has_playback = 1;
7156 prop_is_valid = ast_ari_validate_playback(
7158 if (!prop_is_valid) {
7159 ast_log(LOG_ERROR, "ARI PlaybackStarted field playback failed validation\n");
7160 res = 0;
7161 }
7162 } else
7163 {
7165 "ARI PlaybackStarted has undocumented field %s\n",
7167 res = 0;
7168 }
7169 }
7170
7171 if (!has_type) {
7172 ast_log(LOG_ERROR, "ARI PlaybackStarted missing required field type\n");
7173 res = 0;
7174 }
7175
7176 if (!has_application) {
7177 ast_log(LOG_ERROR, "ARI PlaybackStarted missing required field application\n");
7178 res = 0;
7179 }
7180
7181 if (!has_timestamp) {
7182 ast_log(LOG_ERROR, "ARI PlaybackStarted missing required field timestamp\n");
7183 res = 0;
7184 }
7185
7186 if (!has_playback) {
7187 ast_log(LOG_ERROR, "ARI PlaybackStarted missing required field playback\n");
7188 res = 0;
7189 }
7190
7191 return res;
7192}
7193
7198
7200{
7201 int res = 1;
7202 struct ast_json_iter *iter;
7203 int has_name = 0;
7204 int has_value = 0;
7205
7206 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7207 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
7208 int prop_is_valid;
7209 has_name = 1;
7210 prop_is_valid = ast_ari_validate_string(
7212 if (!prop_is_valid) {
7213 ast_log(LOG_ERROR, "ARI RESTHeader field name failed validation\n");
7214 res = 0;
7215 }
7216 } else
7217 if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
7218 int prop_is_valid;
7219 has_value = 1;
7220 prop_is_valid = ast_ari_validate_string(
7222 if (!prop_is_valid) {
7223 ast_log(LOG_ERROR, "ARI RESTHeader field value failed validation\n");
7224 res = 0;
7225 }
7226 } else
7227 {
7229 "ARI RESTHeader has undocumented field %s\n",
7231 res = 0;
7232 }
7233 }
7234
7235 if (!has_name) {
7236 ast_log(LOG_ERROR, "ARI RESTHeader missing required field name\n");
7237 res = 0;
7238 }
7239
7240 if (!has_value) {
7241 ast_log(LOG_ERROR, "ARI RESTHeader missing required field value\n");
7242 res = 0;
7243 }
7244
7245 return res;
7246}
7247
7252
7254{
7255 int res = 1;
7256 struct ast_json_iter *iter;
7257 int has_name = 0;
7258 int has_value = 0;
7259
7260 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7261 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
7262 int prop_is_valid;
7263 has_name = 1;
7264 prop_is_valid = ast_ari_validate_string(
7266 if (!prop_is_valid) {
7267 ast_log(LOG_ERROR, "ARI RESTQueryStringParameter field name failed validation\n");
7268 res = 0;
7269 }
7270 } else
7271 if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
7272 int prop_is_valid;
7273 has_value = 1;
7274 prop_is_valid = ast_ari_validate_string(
7276 if (!prop_is_valid) {
7277 ast_log(LOG_ERROR, "ARI RESTQueryStringParameter field value failed validation\n");
7278 res = 0;
7279 }
7280 } else
7281 {
7283 "ARI RESTQueryStringParameter has undocumented field %s\n",
7285 res = 0;
7286 }
7287 }
7288
7289 if (!has_name) {
7290 ast_log(LOG_ERROR, "ARI RESTQueryStringParameter missing required field name\n");
7291 res = 0;
7292 }
7293
7294 if (!has_value) {
7295 ast_log(LOG_ERROR, "ARI RESTQueryStringParameter missing required field value\n");
7296 res = 0;
7297 }
7298
7299 return res;
7300}
7301
7306
7308{
7309 int res = 1;
7310 struct ast_json_iter *iter;
7311 int has_method = 0;
7312 int has_request_id = 0;
7313 int has_transaction_id = 0;
7314 int has_type = 0;
7315 int has_uri = 0;
7316
7317 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7318 if (strcmp("content_type", ast_json_object_iter_key(iter)) == 0) {
7319 int prop_is_valid;
7320 prop_is_valid = ast_ari_validate_string(
7322 if (!prop_is_valid) {
7323 ast_log(LOG_ERROR, "ARI RESTRequest field content_type failed validation\n");
7324 res = 0;
7325 }
7326 } else
7327 if (strcmp("message_body", ast_json_object_iter_key(iter)) == 0) {
7328 int prop_is_valid;
7329 prop_is_valid = ast_ari_validate_string(
7331 if (!prop_is_valid) {
7332 ast_log(LOG_ERROR, "ARI RESTRequest field message_body failed validation\n");
7333 res = 0;
7334 }
7335 } else
7336 if (strcmp("method", ast_json_object_iter_key(iter)) == 0) {
7337 int prop_is_valid;
7338 has_method = 1;
7339 prop_is_valid = ast_ari_validate_string(
7341 if (!prop_is_valid) {
7342 ast_log(LOG_ERROR, "ARI RESTRequest field method failed validation\n");
7343 res = 0;
7344 }
7345 } else
7346 if (strcmp("query_strings", ast_json_object_iter_key(iter)) == 0) {
7347 int prop_is_valid;
7348 prop_is_valid = ast_ari_validate_list(
7351 if (!prop_is_valid) {
7352 ast_log(LOG_ERROR, "ARI RESTRequest field query_strings failed validation\n");
7353 res = 0;
7354 }
7355 } else
7356 if (strcmp("request_id", ast_json_object_iter_key(iter)) == 0) {
7357 int prop_is_valid;
7358 has_request_id = 1;
7359 prop_is_valid = ast_ari_validate_string(
7361 if (!prop_is_valid) {
7362 ast_log(LOG_ERROR, "ARI RESTRequest field request_id failed validation\n");
7363 res = 0;
7364 }
7365 } else
7366 if (strcmp("transaction_id", ast_json_object_iter_key(iter)) == 0) {
7367 int prop_is_valid;
7368 has_transaction_id = 1;
7369 prop_is_valid = ast_ari_validate_string(
7371 if (!prop_is_valid) {
7372 ast_log(LOG_ERROR, "ARI RESTRequest field transaction_id failed validation\n");
7373 res = 0;
7374 }
7375 } else
7376 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7377 int prop_is_valid;
7378 has_type = 1;
7379 prop_is_valid = ast_ari_validate_string(
7381 if (!prop_is_valid) {
7382 ast_log(LOG_ERROR, "ARI RESTRequest field type failed validation\n");
7383 res = 0;
7384 }
7385 } else
7386 if (strcmp("uri", ast_json_object_iter_key(iter)) == 0) {
7387 int prop_is_valid;
7388 has_uri = 1;
7389 prop_is_valid = ast_ari_validate_string(
7391 if (!prop_is_valid) {
7392 ast_log(LOG_ERROR, "ARI RESTRequest field uri failed validation\n");
7393 res = 0;
7394 }
7395 } else
7396 {
7398 "ARI RESTRequest has undocumented field %s\n",
7400 res = 0;
7401 }
7402 }
7403
7404 if (!has_method) {
7405 ast_log(LOG_ERROR, "ARI RESTRequest missing required field method\n");
7406 res = 0;
7407 }
7408
7409 if (!has_request_id) {
7410 ast_log(LOG_ERROR, "ARI RESTRequest missing required field request_id\n");
7411 res = 0;
7412 }
7413
7414 if (!has_transaction_id) {
7415 ast_log(LOG_ERROR, "ARI RESTRequest missing required field transaction_id\n");
7416 res = 0;
7417 }
7418
7419 if (!has_type) {
7420 ast_log(LOG_ERROR, "ARI RESTRequest missing required field type\n");
7421 res = 0;
7422 }
7423
7424 if (!has_uri) {
7425 ast_log(LOG_ERROR, "ARI RESTRequest missing required field uri\n");
7426 res = 0;
7427 }
7428
7429 return res;
7430}
7431
7436
7438{
7439 int res = 1;
7440 struct ast_json_iter *iter;
7441 int has_type = 0;
7442 int has_application = 0;
7443 int has_timestamp = 0;
7444 int has_reason_phrase = 0;
7445 int has_request_id = 0;
7446 int has_status_code = 0;
7447 int has_transaction_id = 0;
7448 int has_uri = 0;
7449
7450 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7451 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7452 int prop_is_valid;
7453 prop_is_valid = ast_ari_validate_string(
7455 if (!prop_is_valid) {
7456 ast_log(LOG_ERROR, "ARI RESTResponse field asterisk_id failed validation\n");
7457 res = 0;
7458 }
7459 } else
7460 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7461 int prop_is_valid;
7462 has_type = 1;
7463 prop_is_valid = ast_ari_validate_string(
7465 if (!prop_is_valid) {
7466 ast_log(LOG_ERROR, "ARI RESTResponse field type failed validation\n");
7467 res = 0;
7468 }
7469 } else
7470 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7471 int prop_is_valid;
7472 has_application = 1;
7473 prop_is_valid = ast_ari_validate_string(
7475 if (!prop_is_valid) {
7476 ast_log(LOG_ERROR, "ARI RESTResponse field application failed validation\n");
7477 res = 0;
7478 }
7479 } else
7480 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7481 int prop_is_valid;
7482 has_timestamp = 1;
7483 prop_is_valid = ast_ari_validate_date(
7485 if (!prop_is_valid) {
7486 ast_log(LOG_ERROR, "ARI RESTResponse field timestamp failed validation\n");
7487 res = 0;
7488 }
7489 } else
7490 if (strcmp("content_type", ast_json_object_iter_key(iter)) == 0) {
7491 int prop_is_valid;
7492 prop_is_valid = ast_ari_validate_string(
7494 if (!prop_is_valid) {
7495 ast_log(LOG_ERROR, "ARI RESTResponse field content_type failed validation\n");
7496 res = 0;
7497 }
7498 } else
7499 if (strcmp("message_body", ast_json_object_iter_key(iter)) == 0) {
7500 int prop_is_valid;
7501 prop_is_valid = ast_ari_validate_string(
7503 if (!prop_is_valid) {
7504 ast_log(LOG_ERROR, "ARI RESTResponse field message_body failed validation\n");
7505 res = 0;
7506 }
7507 } else
7508 if (strcmp("reason_phrase", ast_json_object_iter_key(iter)) == 0) {
7509 int prop_is_valid;
7510 has_reason_phrase = 1;
7511 prop_is_valid = ast_ari_validate_string(
7513 if (!prop_is_valid) {
7514 ast_log(LOG_ERROR, "ARI RESTResponse field reason_phrase failed validation\n");
7515 res = 0;
7516 }
7517 } else
7518 if (strcmp("request_id", ast_json_object_iter_key(iter)) == 0) {
7519 int prop_is_valid;
7520 has_request_id = 1;
7521 prop_is_valid = ast_ari_validate_string(
7523 if (!prop_is_valid) {
7524 ast_log(LOG_ERROR, "ARI RESTResponse field request_id failed validation\n");
7525 res = 0;
7526 }
7527 } else
7528 if (strcmp("status_code", ast_json_object_iter_key(iter)) == 0) {
7529 int prop_is_valid;
7530 has_status_code = 1;
7531 prop_is_valid = ast_ari_validate_int(
7533 if (!prop_is_valid) {
7534 ast_log(LOG_ERROR, "ARI RESTResponse field status_code failed validation\n");
7535 res = 0;
7536 }
7537 } else
7538 if (strcmp("transaction_id", ast_json_object_iter_key(iter)) == 0) {
7539 int prop_is_valid;
7540 has_transaction_id = 1;
7541 prop_is_valid = ast_ari_validate_string(
7543 if (!prop_is_valid) {
7544 ast_log(LOG_ERROR, "ARI RESTResponse field transaction_id failed validation\n");
7545 res = 0;
7546 }
7547 } else
7548 if (strcmp("uri", ast_json_object_iter_key(iter)) == 0) {
7549 int prop_is_valid;
7550 has_uri = 1;
7551 prop_is_valid = ast_ari_validate_string(
7553 if (!prop_is_valid) {
7554 ast_log(LOG_ERROR, "ARI RESTResponse field uri failed validation\n");
7555 res = 0;
7556 }
7557 } else
7558 {
7560 "ARI RESTResponse has undocumented field %s\n",
7562 res = 0;
7563 }
7564 }
7565
7566 if (!has_type) {
7567 ast_log(LOG_ERROR, "ARI RESTResponse missing required field type\n");
7568 res = 0;
7569 }
7570
7571 if (!has_application) {
7572 ast_log(LOG_ERROR, "ARI RESTResponse missing required field application\n");
7573 res = 0;
7574 }
7575
7576 if (!has_timestamp) {
7577 ast_log(LOG_ERROR, "ARI RESTResponse missing required field timestamp\n");
7578 res = 0;
7579 }
7580
7581 if (!has_reason_phrase) {
7582 ast_log(LOG_ERROR, "ARI RESTResponse missing required field reason_phrase\n");
7583 res = 0;
7584 }
7585
7586 if (!has_request_id) {
7587 ast_log(LOG_ERROR, "ARI RESTResponse missing required field request_id\n");
7588 res = 0;
7589 }
7590
7591 if (!has_status_code) {
7592 ast_log(LOG_ERROR, "ARI RESTResponse missing required field status_code\n");
7593 res = 0;
7594 }
7595
7596 if (!has_transaction_id) {
7597 ast_log(LOG_ERROR, "ARI RESTResponse missing required field transaction_id\n");
7598 res = 0;
7599 }
7600
7601 if (!has_uri) {
7602 ast_log(LOG_ERROR, "ARI RESTResponse missing required field uri\n");
7603 res = 0;
7604 }
7605
7606 return res;
7607}
7608
7613
7615{
7616 int res = 1;
7617 struct ast_json_iter *iter;
7618 int has_type = 0;
7619 int has_application = 0;
7620 int has_timestamp = 0;
7621 int has_recording = 0;
7622
7623 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7624 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7625 int prop_is_valid;
7626 prop_is_valid = ast_ari_validate_string(
7628 if (!prop_is_valid) {
7629 ast_log(LOG_ERROR, "ARI RecordingFailed field asterisk_id failed validation\n");
7630 res = 0;
7631 }
7632 } else
7633 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7634 int prop_is_valid;
7635 has_type = 1;
7636 prop_is_valid = ast_ari_validate_string(
7638 if (!prop_is_valid) {
7639 ast_log(LOG_ERROR, "ARI RecordingFailed field type failed validation\n");
7640 res = 0;
7641 }
7642 } else
7643 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7644 int prop_is_valid;
7645 has_application = 1;
7646 prop_is_valid = ast_ari_validate_string(
7648 if (!prop_is_valid) {
7649 ast_log(LOG_ERROR, "ARI RecordingFailed field application failed validation\n");
7650 res = 0;
7651 }
7652 } else
7653 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7654 int prop_is_valid;
7655 has_timestamp = 1;
7656 prop_is_valid = ast_ari_validate_date(
7658 if (!prop_is_valid) {
7659 ast_log(LOG_ERROR, "ARI RecordingFailed field timestamp failed validation\n");
7660 res = 0;
7661 }
7662 } else
7663 if (strcmp("recording", ast_json_object_iter_key(iter)) == 0) {
7664 int prop_is_valid;
7665 has_recording = 1;
7666 prop_is_valid = ast_ari_validate_live_recording(
7668 if (!prop_is_valid) {
7669 ast_log(LOG_ERROR, "ARI RecordingFailed field recording failed validation\n");
7670 res = 0;
7671 }
7672 } else
7673 {
7675 "ARI RecordingFailed has undocumented field %s\n",
7677 res = 0;
7678 }
7679 }
7680
7681 if (!has_type) {
7682 ast_log(LOG_ERROR, "ARI RecordingFailed missing required field type\n");
7683 res = 0;
7684 }
7685
7686 if (!has_application) {
7687 ast_log(LOG_ERROR, "ARI RecordingFailed missing required field application\n");
7688 res = 0;
7689 }
7690
7691 if (!has_timestamp) {
7692 ast_log(LOG_ERROR, "ARI RecordingFailed missing required field timestamp\n");
7693 res = 0;
7694 }
7695
7696 if (!has_recording) {
7697 ast_log(LOG_ERROR, "ARI RecordingFailed missing required field recording\n");
7698 res = 0;
7699 }
7700
7701 return res;
7702}
7703
7708
7710{
7711 int res = 1;
7712 struct ast_json_iter *iter;
7713 int has_type = 0;
7714 int has_application = 0;
7715 int has_timestamp = 0;
7716 int has_recording = 0;
7717
7718 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7719 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7720 int prop_is_valid;
7721 prop_is_valid = ast_ari_validate_string(
7723 if (!prop_is_valid) {
7724 ast_log(LOG_ERROR, "ARI RecordingFinished field asterisk_id failed validation\n");
7725 res = 0;
7726 }
7727 } else
7728 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7729 int prop_is_valid;
7730 has_type = 1;
7731 prop_is_valid = ast_ari_validate_string(
7733 if (!prop_is_valid) {
7734 ast_log(LOG_ERROR, "ARI RecordingFinished field type failed validation\n");
7735 res = 0;
7736 }
7737 } else
7738 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7739 int prop_is_valid;
7740 has_application = 1;
7741 prop_is_valid = ast_ari_validate_string(
7743 if (!prop_is_valid) {
7744 ast_log(LOG_ERROR, "ARI RecordingFinished field application failed validation\n");
7745 res = 0;
7746 }
7747 } else
7748 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7749 int prop_is_valid;
7750 has_timestamp = 1;
7751 prop_is_valid = ast_ari_validate_date(
7753 if (!prop_is_valid) {
7754 ast_log(LOG_ERROR, "ARI RecordingFinished field timestamp failed validation\n");
7755 res = 0;
7756 }
7757 } else
7758 if (strcmp("recording", ast_json_object_iter_key(iter)) == 0) {
7759 int prop_is_valid;
7760 has_recording = 1;
7761 prop_is_valid = ast_ari_validate_live_recording(
7763 if (!prop_is_valid) {
7764 ast_log(LOG_ERROR, "ARI RecordingFinished field recording failed validation\n");
7765 res = 0;
7766 }
7767 } else
7768 {
7770 "ARI RecordingFinished has undocumented field %s\n",
7772 res = 0;
7773 }
7774 }
7775
7776 if (!has_type) {
7777 ast_log(LOG_ERROR, "ARI RecordingFinished missing required field type\n");
7778 res = 0;
7779 }
7780
7781 if (!has_application) {
7782 ast_log(LOG_ERROR, "ARI RecordingFinished missing required field application\n");
7783 res = 0;
7784 }
7785
7786 if (!has_timestamp) {
7787 ast_log(LOG_ERROR, "ARI RecordingFinished missing required field timestamp\n");
7788 res = 0;
7789 }
7790
7791 if (!has_recording) {
7792 ast_log(LOG_ERROR, "ARI RecordingFinished missing required field recording\n");
7793 res = 0;
7794 }
7795
7796 return res;
7797}
7798
7803
7805{
7806 int res = 1;
7807 struct ast_json_iter *iter;
7808 int has_type = 0;
7809 int has_application = 0;
7810 int has_timestamp = 0;
7811 int has_recording = 0;
7812
7813 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7814 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
7815 int prop_is_valid;
7816 prop_is_valid = ast_ari_validate_string(
7818 if (!prop_is_valid) {
7819 ast_log(LOG_ERROR, "ARI RecordingStarted field asterisk_id failed validation\n");
7820 res = 0;
7821 }
7822 } else
7823 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
7824 int prop_is_valid;
7825 has_type = 1;
7826 prop_is_valid = ast_ari_validate_string(
7828 if (!prop_is_valid) {
7829 ast_log(LOG_ERROR, "ARI RecordingStarted field type failed validation\n");
7830 res = 0;
7831 }
7832 } else
7833 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
7834 int prop_is_valid;
7835 has_application = 1;
7836 prop_is_valid = ast_ari_validate_string(
7838 if (!prop_is_valid) {
7839 ast_log(LOG_ERROR, "ARI RecordingStarted field application failed validation\n");
7840 res = 0;
7841 }
7842 } else
7843 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
7844 int prop_is_valid;
7845 has_timestamp = 1;
7846 prop_is_valid = ast_ari_validate_date(
7848 if (!prop_is_valid) {
7849 ast_log(LOG_ERROR, "ARI RecordingStarted field timestamp failed validation\n");
7850 res = 0;
7851 }
7852 } else
7853 if (strcmp("recording", ast_json_object_iter_key(iter)) == 0) {
7854 int prop_is_valid;
7855 has_recording = 1;
7856 prop_is_valid = ast_ari_validate_live_recording(
7858 if (!prop_is_valid) {
7859 ast_log(LOG_ERROR, "ARI RecordingStarted field recording failed validation\n");
7860 res = 0;
7861 }
7862 } else
7863 {
7865 "ARI RecordingStarted has undocumented field %s\n",
7867 res = 0;
7868 }
7869 }
7870
7871 if (!has_type) {
7872 ast_log(LOG_ERROR, "ARI RecordingStarted missing required field type\n");
7873 res = 0;
7874 }
7875
7876 if (!has_application) {
7877 ast_log(LOG_ERROR, "ARI RecordingStarted missing required field application\n");
7878 res = 0;
7879 }
7880
7881 if (!has_timestamp) {
7882 ast_log(LOG_ERROR, "ARI RecordingStarted missing required field timestamp\n");
7883 res = 0;
7884 }
7885
7886 if (!has_recording) {
7887 ast_log(LOG_ERROR, "ARI RecordingStarted missing required field recording\n");
7888 res = 0;
7889 }
7890
7891 return res;
7892}
7893
7898
7900{
7901 int res = 1;
7902 struct ast_json_iter *iter;
7903 int has_requested_destination = 0;
7904
7905 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7906 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
7907 int prop_is_valid;
7908 prop_is_valid = ast_ari_validate_bridge(
7910 if (!prop_is_valid) {
7911 ast_log(LOG_ERROR, "ARI ReferTo field bridge failed validation\n");
7912 res = 0;
7913 }
7914 } else
7915 if (strcmp("connected_channel", ast_json_object_iter_key(iter)) == 0) {
7916 int prop_is_valid;
7917 prop_is_valid = ast_ari_validate_channel(
7919 if (!prop_is_valid) {
7920 ast_log(LOG_ERROR, "ARI ReferTo field connected_channel failed validation\n");
7921 res = 0;
7922 }
7923 } else
7924 if (strcmp("destination_channel", ast_json_object_iter_key(iter)) == 0) {
7925 int prop_is_valid;
7926 prop_is_valid = ast_ari_validate_channel(
7928 if (!prop_is_valid) {
7929 ast_log(LOG_ERROR, "ARI ReferTo field destination_channel failed validation\n");
7930 res = 0;
7931 }
7932 } else
7933 if (strcmp("requested_destination", ast_json_object_iter_key(iter)) == 0) {
7934 int prop_is_valid;
7935 has_requested_destination = 1;
7938 if (!prop_is_valid) {
7939 ast_log(LOG_ERROR, "ARI ReferTo field requested_destination failed validation\n");
7940 res = 0;
7941 }
7942 } else
7943 {
7945 "ARI ReferTo has undocumented field %s\n",
7947 res = 0;
7948 }
7949 }
7950
7951 if (!has_requested_destination) {
7952 ast_log(LOG_ERROR, "ARI ReferTo missing required field requested_destination\n");
7953 res = 0;
7954 }
7955
7956 return res;
7957}
7958
7963
7965{
7966 int res = 1;
7967 struct ast_json_iter *iter;
7968 int has_source_channel = 0;
7969
7970 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
7971 if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
7972 int prop_is_valid;
7973 prop_is_valid = ast_ari_validate_bridge(
7975 if (!prop_is_valid) {
7976 ast_log(LOG_ERROR, "ARI ReferredBy field bridge failed validation\n");
7977 res = 0;
7978 }
7979 } else
7980 if (strcmp("connected_channel", ast_json_object_iter_key(iter)) == 0) {
7981 int prop_is_valid;
7982 prop_is_valid = ast_ari_validate_channel(
7984 if (!prop_is_valid) {
7985 ast_log(LOG_ERROR, "ARI ReferredBy field connected_channel failed validation\n");
7986 res = 0;
7987 }
7988 } else
7989 if (strcmp("source_channel", ast_json_object_iter_key(iter)) == 0) {
7990 int prop_is_valid;
7991 has_source_channel = 1;
7992 prop_is_valid = ast_ari_validate_channel(
7994 if (!prop_is_valid) {
7995 ast_log(LOG_ERROR, "ARI ReferredBy field source_channel failed validation\n");
7996 res = 0;
7997 }
7998 } else
7999 {
8001 "ARI ReferredBy has undocumented field %s\n",
8003 res = 0;
8004 }
8005 }
8006
8007 if (!has_source_channel) {
8008 ast_log(LOG_ERROR, "ARI ReferredBy missing required field source_channel\n");
8009 res = 0;
8010 }
8011
8012 return res;
8013}
8014
8019
8021{
8022 int res = 1;
8023 struct ast_json_iter *iter;
8024
8025 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
8026 if (strcmp("additional_protocol_params", ast_json_object_iter_key(iter)) == 0) {
8027 int prop_is_valid;
8028 prop_is_valid = ast_ari_validate_list(
8031 if (!prop_is_valid) {
8032 ast_log(LOG_ERROR, "ARI RequiredDestination field additional_protocol_params failed validation\n");
8033 res = 0;
8034 }
8035 } else
8036 if (strcmp("destination", ast_json_object_iter_key(iter)) == 0) {
8037 int prop_is_valid;
8038 prop_is_valid = ast_ari_validate_string(
8040 if (!prop_is_valid) {
8041 ast_log(LOG_ERROR, "ARI RequiredDestination field destination failed validation\n");
8042 res = 0;
8043 }
8044 } else
8045 if (strcmp("protocol_id", ast_json_object_iter_key(iter)) == 0) {
8046 int prop_is_valid;
8047 prop_is_valid = ast_ari_validate_string(
8049 if (!prop_is_valid) {
8050 ast_log(LOG_ERROR, "ARI RequiredDestination field protocol_id failed validation\n");
8051 res = 0;
8052 }
8053 } else
8054 {
8056 "ARI RequiredDestination has undocumented field %s\n",
8058 res = 0;
8059 }
8060 }
8061
8062 return res;
8063}
8064
8069
8071{
8072 int res = 1;
8073 struct ast_json_iter *iter;
8074 int has_type = 0;
8075 int has_application = 0;
8076 int has_timestamp = 0;
8077 int has_channel = 0;
8078
8079 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
8080 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
8081 int prop_is_valid;
8082 prop_is_valid = ast_ari_validate_string(
8084 if (!prop_is_valid) {
8085 ast_log(LOG_ERROR, "ARI StasisEnd field asterisk_id failed validation\n");
8086 res = 0;
8087 }
8088 } else
8089 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
8090 int prop_is_valid;
8091 has_type = 1;
8092 prop_is_valid = ast_ari_validate_string(
8094 if (!prop_is_valid) {
8095 ast_log(LOG_ERROR, "ARI StasisEnd field type failed validation\n");
8096 res = 0;
8097 }
8098 } else
8099 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
8100 int prop_is_valid;
8101 has_application = 1;
8102 prop_is_valid = ast_ari_validate_string(
8104 if (!prop_is_valid) {
8105 ast_log(LOG_ERROR, "ARI StasisEnd field application failed validation\n");
8106 res = 0;
8107 }
8108 } else
8109 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
8110 int prop_is_valid;
8111 has_timestamp = 1;
8112 prop_is_valid = ast_ari_validate_date(
8114 if (!prop_is_valid) {
8115 ast_log(LOG_ERROR, "ARI StasisEnd field timestamp failed validation\n");
8116 res = 0;
8117 }
8118 } else
8119 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
8120 int prop_is_valid;
8121 has_channel = 1;
8122 prop_is_valid = ast_ari_validate_channel(
8124 if (!prop_is_valid) {
8125 ast_log(LOG_ERROR, "ARI StasisEnd field channel failed validation\n");
8126 res = 0;
8127 }
8128 } else
8129 {
8131 "ARI StasisEnd has undocumented field %s\n",
8133 res = 0;
8134 }
8135 }
8136
8137 if (!has_type) {
8138 ast_log(LOG_ERROR, "ARI StasisEnd missing required field type\n");
8139 res = 0;
8140 }
8141
8142 if (!has_application) {
8143 ast_log(LOG_ERROR, "ARI StasisEnd missing required field application\n");
8144 res = 0;
8145 }
8146
8147 if (!has_timestamp) {
8148 ast_log(LOG_ERROR, "ARI StasisEnd missing required field timestamp\n");
8149 res = 0;
8150 }
8151
8152 if (!has_channel) {
8153 ast_log(LOG_ERROR, "ARI StasisEnd missing required field channel\n");
8154 res = 0;
8155 }
8156
8157 return res;
8158}
8159
8164
8166{
8167 int res = 1;
8168 struct ast_json_iter *iter;
8169 int has_type = 0;
8170 int has_application = 0;
8171 int has_timestamp = 0;
8172 int has_args = 0;
8173 int has_channel = 0;
8174
8175 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
8176 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
8177 int prop_is_valid;
8178 prop_is_valid = ast_ari_validate_string(
8180 if (!prop_is_valid) {
8181 ast_log(LOG_ERROR, "ARI StasisStart field asterisk_id failed validation\n");
8182 res = 0;
8183 }
8184 } else
8185 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
8186 int prop_is_valid;
8187 has_type = 1;
8188 prop_is_valid = ast_ari_validate_string(
8190 if (!prop_is_valid) {
8191 ast_log(LOG_ERROR, "ARI StasisStart field type failed validation\n");
8192 res = 0;
8193 }
8194 } else
8195 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
8196 int prop_is_valid;
8197 has_application = 1;
8198 prop_is_valid = ast_ari_validate_string(
8200 if (!prop_is_valid) {
8201 ast_log(LOG_ERROR, "ARI StasisStart field application failed validation\n");
8202 res = 0;
8203 }
8204 } else
8205 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
8206 int prop_is_valid;
8207 has_timestamp = 1;
8208 prop_is_valid = ast_ari_validate_date(
8210 if (!prop_is_valid) {
8211 ast_log(LOG_ERROR, "ARI StasisStart field timestamp failed validation\n");
8212 res = 0;
8213 }
8214 } else
8215 if (strcmp("args", ast_json_object_iter_key(iter)) == 0) {
8216 int prop_is_valid;
8217 has_args = 1;
8218 prop_is_valid = ast_ari_validate_list(
8221 if (!prop_is_valid) {
8222 ast_log(LOG_ERROR, "ARI StasisStart field args failed validation\n");
8223 res = 0;
8224 }
8225 } else
8226 if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
8227 int prop_is_valid;
8228 has_channel = 1;
8229 prop_is_valid = ast_ari_validate_channel(
8231 if (!prop_is_valid) {
8232 ast_log(LOG_ERROR, "ARI StasisStart field channel failed validation\n");
8233 res = 0;
8234 }
8235 } else
8236 if (strcmp("replace_channel", ast_json_object_iter_key(iter)) == 0) {
8237 int prop_is_valid;
8238 prop_is_valid = ast_ari_validate_channel(
8240 if (!prop_is_valid) {
8241 ast_log(LOG_ERROR, "ARI StasisStart field replace_channel failed validation\n");
8242 res = 0;
8243 }
8244 } else
8245 {
8247 "ARI StasisStart has undocumented field %s\n",
8249 res = 0;
8250 }
8251 }
8252
8253 if (!has_type) {
8254 ast_log(LOG_ERROR, "ARI StasisStart missing required field type\n");
8255 res = 0;
8256 }
8257
8258 if (!has_application) {
8259 ast_log(LOG_ERROR, "ARI StasisStart missing required field application\n");
8260 res = 0;
8261 }
8262
8263 if (!has_timestamp) {
8264 ast_log(LOG_ERROR, "ARI StasisStart missing required field timestamp\n");
8265 res = 0;
8266 }
8267
8268 if (!has_args) {
8269 ast_log(LOG_ERROR, "ARI StasisStart missing required field args\n");
8270 res = 0;
8271 }
8272
8273 if (!has_channel) {
8274 ast_log(LOG_ERROR, "ARI StasisStart missing required field channel\n");
8275 res = 0;
8276 }
8277
8278 return res;
8279}
8280
8285
8287{
8288 int res = 1;
8289 struct ast_json_iter *iter;
8290 int has_type = 0;
8291 int has_application = 0;
8292 int has_timestamp = 0;
8293 int has_message = 0;
8294
8295 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
8296 if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
8297 int prop_is_valid;
8298 prop_is_valid = ast_ari_validate_string(
8300 if (!prop_is_valid) {
8301 ast_log(LOG_ERROR, "ARI TextMessageReceived field asterisk_id failed validation\n");
8302 res = 0;
8303 }
8304 } else
8305 if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
8306 int prop_is_valid;
8307 has_type = 1;
8308 prop_is_valid = ast_ari_validate_string(
8310 if (!prop_is_valid) {
8311 ast_log(LOG_ERROR, "ARI TextMessageReceived field type failed validation\n");
8312 res = 0;
8313 }
8314 } else
8315 if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
8316 int prop_is_valid;
8317 has_application = 1;
8318 prop_is_valid = ast_ari_validate_string(
8320 if (!prop_is_valid) {
8321 ast_log(LOG_ERROR, "ARI TextMessageReceived field application failed validation\n");
8322 res = 0;
8323 }
8324 } else
8325 if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
8326 int prop_is_valid;
8327 has_timestamp = 1;
8328 prop_is_valid = ast_ari_validate_date(
8330 if (!prop_is_valid) {
8331 ast_log(LOG_ERROR, "ARI TextMessageReceived field timestamp failed validation\n");
8332 res = 0;
8333 }
8334 } else
8335 if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
8336 int prop_is_valid;
8337 prop_is_valid = ast_ari_validate_endpoint(
8339 if (!prop_is_valid) {
8340 ast_log(LOG_ERROR, "ARI TextMessageReceived field endpoint failed validation\n");
8341 res = 0;
8342 }
8343 } else
8344 if (strcmp("message", ast_json_object_iter_key(iter)) == 0) {
8345 int prop_is_valid;
8346 has_message = 1;
8347 prop_is_valid = ast_ari_validate_text_message(
8349 if (!prop_is_valid) {
8350 ast_log(LOG_ERROR, "ARI TextMessageReceived field message failed validation\n");
8351 res = 0;
8352 }
8353 } else
8354 {
8356 "ARI TextMessageReceived has undocumented field %s\n",
8358 res = 0;
8359 }
8360 }
8361
8362 if (!has_type) {
8363 ast_log(LOG_ERROR, "ARI TextMessageReceived missing required field type\n");
8364 res = 0;
8365 }
8366
8367 if (!has_application) {
8368 ast_log(LOG_ERROR, "ARI TextMessageReceived missing required field application\n");
8369 res = 0;
8370 }
8371
8372 if (!has_timestamp) {
8373 ast_log(LOG_ERROR, "ARI TextMessageReceived missing required field timestamp\n");
8374 res = 0;
8375 }
8376
8377 if (!has_message) {
8378 ast_log(LOG_ERROR, "ARI TextMessageReceived missing required field message\n");
8379 res = 0;
8380 }
8381
8382 return res;
8383}
8384
8389
8391{
8392 int res = 1;
8393 struct ast_json_iter *iter;
8394 int has_bridge_ids = 0;
8395 int has_channel_ids = 0;
8396 int has_device_names = 0;
8397 int has_endpoint_ids = 0;
8398 int has_events_allowed = 0;
8399 int has_events_disallowed = 0;
8400 int has_name = 0;
8401
8402 for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
8403 if (strcmp("bridge_ids", ast_json_object_iter_key(iter)) == 0) {
8404 int prop_is_valid;
8405 has_bridge_ids = 1;
8406 prop_is_valid = ast_ari_validate_list(
8409 if (!prop_is_valid) {
8410 ast_log(LOG_ERROR, "ARI Application field bridge_ids failed validation\n");
8411 res = 0;
8412 }
8413 } else
8414 if (strcmp("channel_ids", ast_json_object_iter_key(iter)) == 0) {
8415 int prop_is_valid;
8416 has_channel_ids = 1;
8417 prop_is_valid = ast_ari_validate_list(
8420 if (!prop_is_valid) {
8421 ast_log(LOG_ERROR, "ARI Application field channel_ids failed validation\n");
8422 res = 0;
8423 }
8424 } else
8425 if (strcmp("device_names", ast_json_object_iter_key(iter)) == 0) {
8426 int prop_is_valid;
8427 has_device_names = 1;
8428 prop_is_valid = ast_ari_validate_list(
8431 if (!prop_is_valid) {
8432 ast_log(LOG_ERROR, "ARI Application field device_names failed validation\n");
8433 res = 0;
8434 }
8435 } else
8436 if (strcmp("endpoint_ids", ast_json_object_iter_key(iter)) == 0) {
8437 int prop_is_valid;
8438 has_endpoint_ids = 1;
8439 prop_is_valid = ast_ari_validate_list(
8442 if (!prop_is_valid) {
8443 ast_log(LOG_ERROR, "ARI Application field endpoint_ids failed validation\n");
8444 res = 0;
8445 }
8446 } else
8447 if (strcmp("events_allowed", ast_json_object_iter_key(iter)) == 0) {
8448 int prop_is_valid;
8449 has_events_allowed = 1;
8450 prop_is_valid = ast_ari_validate_list(
8453 if (!prop_is_valid) {
8454 ast_log(LOG_ERROR, "ARI Application field events_allowed failed validation\n");
8455 res = 0;
8456 }
8457 } else
8458 if (strcmp("events_disallowed", ast_json_object_iter_key(iter)) == 0) {
8459 int prop_is_valid;
8460 has_events_disallowed = 1;
8461 prop_is_valid = ast_ari_validate_list(
8464 if (!prop_is_valid) {
8465 ast_log(LOG_ERROR, "ARI Application field events_disallowed failed validation\n");
8466 res = 0;
8467 }
8468 } else
8469 if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
8470 int prop_is_valid;
8471 has_name = 1;
8472 prop_is_valid = ast_ari_validate_string(
8474 if (!prop_is_valid) {
8475 ast_log(LOG_ERROR, "ARI Application field name failed validation\n");
8476 res = 0;
8477 }
8478 } else
8479 {
8481 "ARI Application has undocumented field %s\n",
8483 res = 0;
8484 }
8485 }
8486
8487 if (!has_bridge_ids) {
8488 ast_log(LOG_ERROR, "ARI Application missing required field bridge_ids\n");
8489 res = 0;
8490 }
8491
8492 if (!has_channel_ids) {
8493 ast_log(LOG_ERROR, "ARI Application missing required field channel_ids\n");
8494 res = 0;
8495 }
8496
8497 if (!has_device_names) {
8498 ast_log(LOG_ERROR, "ARI Application missing required field device_names\n");
8499 res = 0;
8500 }
8501
8502 if (!has_endpoint_ids) {
8503 ast_log(LOG_ERROR, "ARI Application missing required field endpoint_ids\n");
8504 res = 0;
8505 }
8506
8507 if (!has_events_allowed) {
8508 ast_log(LOG_ERROR, "ARI Application missing required field events_allowed\n");
8509 res = 0;
8510 }
8511
8512 if (!has_events_disallowed) {
8513 ast_log(LOG_ERROR, "ARI Application missing required field events_disallowed\n");
8514 res = 0;
8515 }
8516
8517 if (!has_name) {
8518 ast_log(LOG_ERROR, "ARI Application missing required field name\n");
8519 res = 0;
8520 }
8521
8522 return res;
8523}
8524
ari_validator ast_ari_validate_restheader_fn(void)
Function pointer to ast_ari_validate_restheader().
ari_validator ast_ari_validate_set_id_fn(void)
Function pointer to ast_ari_validate_set_id().
ari_validator ast_ari_validate_config_info_fn(void)
Function pointer to ast_ari_validate_config_info().
ari_validator ast_ari_validate_sound_fn(void)
Function pointer to ast_ari_validate_sound().
int ast_ari_validate_missing_params(struct ast_json *json)
Validator for MissingParams.
int ast_ari_validate_variable(struct ast_json *json)
Validator for Variable.
ari_validator ast_ari_validate_live_recording_fn(void)
Function pointer to ast_ari_validate_live_recording().
int ast_ari_validate_application_replaced(struct ast_json *json)
Validator for ApplicationReplaced.
int ast_ari_validate_log_channel(struct ast_json *json)
Validator for LogChannel.
ari_validator ast_ari_validate_peer_fn(void)
Function pointer to ast_ari_validate_peer().
ari_validator ast_ari_validate_channel_talking_started_fn(void)
Function pointer to ast_ari_validate_channel_talking_started().
ari_validator ast_ari_validate_asterisk_ping_fn(void)
Function pointer to ast_ari_validate_asterisk_ping().
ari_validator ast_ari_validate_application_fn(void)
Function pointer to ast_ari_validate_application().
ari_validator ast_ari_validate_application_replaced_fn(void)
Function pointer to ast_ari_validate_application_replaced().
int ast_ari_validate_text_message_received(struct ast_json *json)
Validator for TextMessageReceived.
ari_validator ast_ari_validate_channel_dtmf_received_fn(void)
Function pointer to ast_ari_validate_channel_dtmf_received().
ari_validator ast_ari_validate_contact_status_change_fn(void)
Function pointer to ast_ari_validate_contact_status_change().
ari_validator ast_ari_validate_bridge_destroyed_fn(void)
Function pointer to ast_ari_validate_bridge_destroyed().
int ast_ari_validate_playback_finished(struct ast_json *json)
Validator for PlaybackFinished.
ari_validator ast_ari_validate_build_info_fn(void)
Function pointer to ast_ari_validate_build_info().
ari_validator ast_ari_validate_recording_started_fn(void)
Function pointer to ast_ari_validate_recording_started().
ari_validator ast_ari_validate_contact_info_fn(void)
Function pointer to ast_ari_validate_contact_info().
int ast_ari_validate_text_message(struct ast_json *json)
Validator for TextMessage.
int ast_ari_validate_bridge_blind_transfer(struct ast_json *json)
Validator for BridgeBlindTransfer.
int ast_ari_validate_channel_destroyed(struct ast_json *json)
Validator for ChannelDestroyed.
ari_validator ast_ari_validate_playback_started_fn(void)
Function pointer to ast_ari_validate_playback_started().
int ast_ari_validate_endpoint_state_change(struct ast_json *json)
Validator for EndpointStateChange.
int ast_ari_validate_restrequest(struct ast_json *json)
Validator for RESTRequest.
int ast_ari_validate_playback(struct ast_json *json)
Validator for Playback.
ari_validator ast_ari_validate_playback_continuing_fn(void)
Function pointer to ast_ari_validate_playback_continuing().
int ast_ari_validate_channel_tone_detected(struct ast_json *json)
Validator for ChannelToneDetected.
ari_validator ast_ari_validate_application_registered_fn(void)
Function pointer to ast_ari_validate_application_registered().
ari_validator ast_ari_validate_stasis_end_fn(void)
Function pointer to ast_ari_validate_stasis_end().
ari_validator ast_ari_validate_variable_fn(void)
Function pointer to ast_ari_validate_variable().
ari_validator ast_ari_validate_application_unregistered_fn(void)
Function pointer to ast_ari_validate_application_unregistered().
ari_validator ast_ari_validate_channel_left_bridge_fn(void)
Function pointer to ast_ari_validate_channel_left_bridge().
int ast_ari_validate_application(struct ast_json *json)
Validator for Application.
int ast_ari_validate_dialed(struct ast_json *json)
Validator for Dialed.
int ast_ari_validate_live_recording(struct ast_json *json)
Validator for LiveRecording.
ari_validator ast_ari_validate_stored_recording_fn(void)
Function pointer to ast_ari_validate_stored_recording().
ari_validator ast_ari_validate_channel_userevent_fn(void)
Function pointer to ast_ari_validate_channel_userevent().
ari_validator ast_ari_validate_channel_created_fn(void)
Function pointer to ast_ari_validate_channel_created().
ari_validator ast_ari_validate_refer_to_fn(void)
Function pointer to ast_ari_validate_refer_to().
int ast_ari_validate_module(struct ast_json *json)
Validator for Module.
int ast_ari_validate_additional_param(struct ast_json *json)
Validator for AdditionalParam.
int ast_ari_validate_stasis_start(struct ast_json *json)
Validator for StasisStart.
ari_validator ast_ari_validate_required_destination_fn(void)
Function pointer to ast_ari_validate_required_destination().
ari_validator ast_ari_validate_channel_talking_finished_fn(void)
Function pointer to ast_ari_validate_channel_talking_finished().
int ast_ari_validate_mailbox(struct ast_json *json)
Validator for Mailbox.
ari_validator ast_ari_validate_playback_finished_fn(void)
Function pointer to ast_ari_validate_playback_finished().
ari_validator ast_ari_validate_channel_tone_detected_fn(void)
Function pointer to ast_ari_validate_channel_tone_detected().
int ast_ari_validate_channel_hangup_request(struct ast_json *json)
Validator for ChannelHangupRequest.
int ast_ari_validate_bridge(struct ast_json *json)
Validator for Bridge.
int ast_ari_validate_message(struct ast_json *json)
Validator for Message.
ari_validator ast_ari_validate_dialed_fn(void)
Function pointer to ast_ari_validate_dialed().
int ast_ari_validate_contact_info(struct ast_json *json)
Validator for ContactInfo.
int ast_ari_validate_refer_to(struct ast_json *json)
Validator for ReferTo.
int ast_ari_validate_dialplan_cep(struct ast_json *json)
Validator for DialplanCEP.
int ast_ari_validate_set_id(struct ast_json *json)
Validator for SetId.
ari_validator ast_ari_validate_channel_varset_fn(void)
Function pointer to ast_ari_validate_channel_varset().
ari_validator ast_ari_validate_playback_fn(void)
Function pointer to ast_ari_validate_playback().
ari_validator ast_ari_validate_system_info_fn(void)
Function pointer to ast_ari_validate_system_info().
ari_validator ast_ari_validate_caller_id_fn(void)
Function pointer to ast_ari_validate_caller_id().
int ast_ari_validate_stasis_end(struct ast_json *json)
Validator for StasisEnd.
ari_validator ast_ari_validate_dialplan_cep_fn(void)
Function pointer to ast_ari_validate_dialplan_cep().
int ast_ari_validate_playback_started(struct ast_json *json)
Validator for PlaybackStarted.
ari_validator ast_ari_validate_bridge_blind_transfer_fn(void)
Function pointer to ast_ari_validate_bridge_blind_transfer().
int ast_ari_validate_bridge_attended_transfer(struct ast_json *json)
Validator for BridgeAttendedTransfer.
ari_validator ast_ari_validate_additional_param_fn(void)
Function pointer to ast_ari_validate_additional_param().
int ast_ari_validate_channel_dialplan(struct ast_json *json)
Validator for ChannelDialplan.
int ast_ari_validate_channel_state_change(struct ast_json *json)
Validator for ChannelStateChange.
ari_validator ast_ari_validate_bridge_attended_transfer_fn(void)
Function pointer to ast_ari_validate_bridge_attended_transfer().
int ast_ari_validate_channel_talking_finished(struct ast_json *json)
Validator for ChannelTalkingFinished.
ari_validator ast_ari_validate_missing_params_fn(void)
Function pointer to ast_ari_validate_missing_params().
int ast_ari_validate_channel_dtmf_received(struct ast_json *json)
Validator for ChannelDtmfReceived.
ari_validator ast_ari_validate_restquery_string_parameter_fn(void)
Function pointer to ast_ari_validate_restquery_string_parameter().
ari_validator ast_ari_validate_config_tuple_fn(void)
Function pointer to ast_ari_validate_config_tuple().
int ast_ari_validate_peer_status_change(struct ast_json *json)
Validator for PeerStatusChange.
int ast_ari_validate_restquery_string_parameter(struct ast_json *json)
Validator for RESTQueryStringParameter.
int ast_ari_validate_bridge_created(struct ast_json *json)
Validator for BridgeCreated.
ari_validator ast_ari_validate_dial_fn(void)
Function pointer to ast_ari_validate_dial().
ari_validator ast_ari_validate_bridge_fn(void)
Function pointer to ast_ari_validate_bridge().
ari_validator ast_ari_validate_event_fn(void)
Function pointer to ast_ari_validate_event().
int ast_ari_validate_application_move_failed(struct ast_json *json)
Validator for ApplicationMoveFailed.
ari_validator ast_ari_validate_message_fn(void)
Function pointer to ast_ari_validate_message().
int ast_ari_validate_asterisk_info(struct ast_json *json)
Validator for AsteriskInfo.
int ast_ari_validate_channel_varset(struct ast_json *json)
Validator for ChannelVarset.
int ast_ari_validate_referred_by(struct ast_json *json)
Validator for ReferredBy.
int ast_ari_validate_asterisk_ping(struct ast_json *json)
Validator for AsteriskPing.
ari_validator ast_ari_validate_recording_finished_fn(void)
Function pointer to ast_ari_validate_recording_finished().
int ast_ari_validate_stored_recording(struct ast_json *json)
Validator for StoredRecording.
int ast_ari_validate_bridge_destroyed(struct ast_json *json)
Validator for BridgeDestroyed.
ari_validator ast_ari_validate_mailbox_fn(void)
Function pointer to ast_ari_validate_mailbox().
ari_validator ast_ari_validate_status_info_fn(void)
Function pointer to ast_ari_validate_status_info().
int ast_ari_validate_format_lang_pair(struct ast_json *json)
Validator for FormatLangPair.
int ast_ari_validate_application_registered(struct ast_json *json)
Validator for ApplicationRegistered.
int ast_ari_validate_caller_id(struct ast_json *json)
Validator for CallerID.
int ast_ari_validate_endpoint(struct ast_json *json)
Validator for Endpoint.
int ast_ari_validate_status_info(struct ast_json *json)
Validator for StatusInfo.
ari_validator ast_ari_validate_log_channel_fn(void)
Function pointer to ast_ari_validate_log_channel().
ari_validator ast_ari_validate_rtpstat_fn(void)
Function pointer to ast_ari_validate_rtpstat().
int ast_ari_validate_playback_continuing(struct ast_json *json)
Validator for PlaybackContinuing.
int ast_ari_validate_channel_caller_id(struct ast_json *json)
Validator for ChannelCallerId.
ari_validator ast_ari_validate_peer_status_change_fn(void)
Function pointer to ast_ari_validate_peer_status_change().
ari_validator ast_ari_validate_text_message_fn(void)
Function pointer to ast_ari_validate_text_message().
ari_validator ast_ari_validate_restrequest_fn(void)
Function pointer to ast_ari_validate_restrequest().
int ast_ari_validate_required_destination(struct ast_json *json)
Validator for RequiredDestination.
ari_validator ast_ari_validate_stasis_start_fn(void)
Function pointer to ast_ari_validate_stasis_start().
int ast_ari_validate_recording_finished(struct ast_json *json)
Validator for RecordingFinished.
ari_validator ast_ari_validate_channel_connected_line_fn(void)
Function pointer to ast_ari_validate_channel_connected_line().
ari_validator ast_ari_validate_channel_dialplan_fn(void)
Function pointer to ast_ari_validate_channel_dialplan().
ari_validator ast_ari_validate_text_message_received_fn(void)
Function pointer to ast_ari_validate_text_message_received().
int ast_ari_validate_device_state(struct ast_json *json)
Validator for DeviceState.
int ast_ari_validate_channel_left_bridge(struct ast_json *json)
Validator for ChannelLeftBridge.
int ast_ari_validate_device_state_changed(struct ast_json *json)
Validator for DeviceStateChanged.
int ast_ari_validate_channel_entered_bridge(struct ast_json *json)
Validator for ChannelEnteredBridge.
ari_validator ast_ari_validate_recording_failed_fn(void)
Function pointer to ast_ari_validate_recording_failed().
int ast_ari_validate_restresponse(struct ast_json *json)
Validator for RESTResponse.
int ast_ari_validate_channel_unhold(struct ast_json *json)
Validator for ChannelUnhold.
ari_validator ast_ari_validate_device_state_fn(void)
Function pointer to ast_ari_validate_device_state().
ari_validator ast_ari_validate_bridge_video_source_changed_fn(void)
Function pointer to ast_ari_validate_bridge_video_source_changed().
int ast_ari_validate_event(struct ast_json *json)
Validator for Event.
int ast_ari_validate_bridge_video_source_changed(struct ast_json *json)
Validator for BridgeVideoSourceChanged.
int ast_ari_validate_system_info(struct ast_json *json)
Validator for SystemInfo.
ari_validator ast_ari_validate_channel_hold_fn(void)
Function pointer to ast_ari_validate_channel_hold().
int ast_ari_validate_recording_started(struct ast_json *json)
Validator for RecordingStarted.
int ast_ari_validate_channel(struct ast_json *json)
Validator for Channel.
ari_validator ast_ari_validate_module_fn(void)
Function pointer to ast_ari_validate_module().
int ast_ari_validate_build_info(struct ast_json *json)
Validator for BuildInfo.
int ast_ari_validate_rtpstat(struct ast_json *json)
Validator for RTPstat.
int ast_ari_validate_recording_failed(struct ast_json *json)
Validator for RecordingFailed.
int ast_ari_validate_contact_status_change(struct ast_json *json)
Validator for ContactStatusChange.
ari_validator ast_ari_validate_restresponse_fn(void)
Function pointer to ast_ari_validate_restresponse().
ari_validator ast_ari_validate_channel_caller_id_fn(void)
Function pointer to ast_ari_validate_channel_caller_id().
ari_validator ast_ari_validate_channel_state_change_fn(void)
Function pointer to ast_ari_validate_channel_state_change().
ari_validator ast_ari_validate_referred_by_fn(void)
Function pointer to ast_ari_validate_referred_by().
ari_validator ast_ari_validate_format_lang_pair_fn(void)
Function pointer to ast_ari_validate_format_lang_pair().
ari_validator ast_ari_validate_application_move_failed_fn(void)
Function pointer to ast_ari_validate_application_move_failed().
int ast_ari_validate_config_info(struct ast_json *json)
Validator for ConfigInfo.
ari_validator ast_ari_validate_channel_entered_bridge_fn(void)
Function pointer to ast_ari_validate_channel_entered_bridge().
ari_validator ast_ari_validate_channel_destroyed_fn(void)
Function pointer to ast_ari_validate_channel_destroyed().
ari_validator ast_ari_validate_endpoint_state_change_fn(void)
Function pointer to ast_ari_validate_endpoint_state_change().
int ast_ari_validate_restheader(struct ast_json *json)
Validator for RESTHeader.
ari_validator ast_ari_validate_channel_hangup_request_fn(void)
Function pointer to ast_ari_validate_channel_hangup_request().
int ast_ari_validate_config_tuple(struct ast_json *json)
Validator for ConfigTuple.
int ast_ari_validate_sound(struct ast_json *json)
Validator for Sound.
int ast_ari_validate_dial(struct ast_json *json)
Validator for Dial.
int ast_ari_validate_channel_created(struct ast_json *json)
Validator for ChannelCreated.
ari_validator ast_ari_validate_device_state_changed_fn(void)
Function pointer to ast_ari_validate_device_state_changed().
int ast_ari_validate_channel_userevent(struct ast_json *json)
Validator for ChannelUserevent.
int ast_ari_validate_application_unregistered(struct ast_json *json)
Validator for ApplicationUnregistered.
int ast_ari_validate_bridge_merged(struct ast_json *json)
Validator for BridgeMerged.
int ast_ari_validate_channel_talking_started(struct ast_json *json)
Validator for ChannelTalkingStarted.
ari_validator ast_ari_validate_channel_unhold_fn(void)
Function pointer to ast_ari_validate_channel_unhold().
int ast_ari_validate_peer(struct ast_json *json)
Validator for Peer.
int ast_ari_validate_channel_transfer(struct ast_json *json)
Validator for ChannelTransfer.
int ast_ari_validate_channel_connected_line(struct ast_json *json)
Validator for ChannelConnectedLine.
ari_validator ast_ari_validate_channel_transfer_fn(void)
Function pointer to ast_ari_validate_channel_transfer().
ari_validator ast_ari_validate_bridge_merged_fn(void)
Function pointer to ast_ari_validate_bridge_merged().
ari_validator ast_ari_validate_channel_fn(void)
Function pointer to ast_ari_validate_channel().
ari_validator ast_ari_validate_endpoint_fn(void)
Function pointer to ast_ari_validate_endpoint().
ari_validator ast_ari_validate_bridge_created_fn(void)
Function pointer to ast_ari_validate_bridge_created().
ari_validator ast_ari_validate_asterisk_info_fn(void)
Function pointer to ast_ari_validate_asterisk_info().
int ast_ari_validate_channel_hold(struct ast_json *json)
Validator for ChannelHold.
Generated file - Build validators for ARI model objects.
int ast_ari_validate_object(struct ast_json *json)
Validator for native Swagger object.
int ast_ari_validate_int(struct ast_json *json)
Validator for native Swagger int.
int ast_ari_validate_long(struct ast_json *json)
Validator for native Swagger long.
int ast_ari_validate_string(struct ast_json *json)
Validator for native Swagger string.
int ast_ari_validate_boolean(struct ast_json *json)
Validator for native Swagger boolean.
int ast_ari_validate_double(struct ast_json *json)
Validator for native Swagger double.
int ast_ari_validate_date(struct ast_json *json)
Validator for native Swagger date.
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.
int(* ari_validator)(struct ast_json *json)
Function type for validator functions. Allows for.
static int has_priority(void)
Check whether we were set to high(er) priority.
Definition asterisk.c:1790
Asterisk main include file. File version handling, generic pbx functions.
#define ast_log
Definition astobj2.c:42
Support for logging to various files, console and syslog Configuration in file logger....
#define LOG_ERROR
struct ast_json * ast_json_object_iter_value(struct ast_json_iter *iter)
Get the value from an iterator.
Definition json.c:455
struct ast_json_iter * ast_json_object_iter_next(struct ast_json *object, struct ast_json_iter *iter)
Get the next iterator.
Definition json.c:447
struct ast_json_iter * ast_json_object_iter(struct ast_json *object)
Get an iterator pointing to the first field in a JSON object.
Definition json.c:439
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
Definition json.c:283
const char * ast_json_object_iter_key(struct ast_json_iter *iter)
Get the key from an iterator.
Definition json.c:451
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Definition json.c:407
Asterisk module definitions.
Iterator for JSON object key/values.
Abstract JSON element (object, array, string, int, ...).