[asterisk-commits] ari: Update model validator based on addition of asterisk id. (asterisk[14])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 18 12:16:03 CDT 2016


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/4144 )

Change subject: ari: Update model validator based on addition of asterisk_id.
......................................................................


ari: Update model validator based on addition of asterisk_id.

ASTERISK-26470

Change-Id: I9c386f7a1c7d969161b28f189eb6298bbc5b7541
---
M res/ari/ari_model_validators.c
M res/ari/ari_model_validators.h
2 files changed, 10 insertions(+), 0 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/res/ari/ari_model_validators.c b/res/ari/ari_model_validators.c
index 57c79c9..633a94c 100644
--- a/res/ari/ari_model_validators.c
+++ b/res/ari/ari_model_validators.c
@@ -5510,6 +5510,15 @@
 	int has_playback = 0;
 
 	for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
+		if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
+			int prop_is_valid;
+			prop_is_valid = ast_ari_validate_string(
+				ast_json_object_iter_value(iter));
+			if (!prop_is_valid) {
+				ast_log(LOG_ERROR, "ARI PlaybackContinuing field asterisk_id failed validation\n");
+				res = 0;
+			}
+		} else
 		if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
 			int prop_is_valid;
 			has_type = 1;
diff --git a/res/ari/ari_model_validators.h b/res/ari/ari_model_validators.h
index ffe82cc..0b08ce8 100644
--- a/res/ari/ari_model_validators.h
+++ b/res/ari/ari_model_validators.h
@@ -1720,6 +1720,7 @@
  * - endpoint: Endpoint (required)
  * - peer: Peer (required)
  * PlaybackContinuing
+ * - asterisk_id: string
  * - type: string (required)
  * - application: string (required)
  * - timestamp: Date

-- 
To view, visit https://gerrit.asterisk.org/4144
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9c386f7a1c7d969161b28f189eb6298bbc5b7541
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list