mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
ARI/AMI: Include language in standard channel snapshot output
The channel "language" was already part of a channel snapshot, however is was not sent out over AMI or ARI. This patch makes it so the channel "language" is included in the appropriate AMI or ARI events. ASTERISK-24553 #close Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/4245/ ........ Merged revisions 429204 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -786,6 +786,7 @@ int ast_ari_validate_channel(struct ast_json *json)
|
||||
int has_creationtime = 0;
|
||||
int has_dialplan = 0;
|
||||
int has_id = 0;
|
||||
int has_language = 0;
|
||||
int has_name = 0;
|
||||
int has_state = 0;
|
||||
|
||||
@@ -850,6 +851,16 @@ int ast_ari_validate_channel(struct ast_json *json)
|
||||
res = 0;
|
||||
}
|
||||
} else
|
||||
if (strcmp("language", ast_json_object_iter_key(iter)) == 0) {
|
||||
int prop_is_valid;
|
||||
has_language = 1;
|
||||
prop_is_valid = ast_ari_validate_string(
|
||||
ast_json_object_iter_value(iter));
|
||||
if (!prop_is_valid) {
|
||||
ast_log(LOG_ERROR, "ARI Channel field language failed validation\n");
|
||||
res = 0;
|
||||
}
|
||||
} else
|
||||
if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
|
||||
int prop_is_valid;
|
||||
has_name = 1;
|
||||
@@ -908,6 +919,11 @@ int ast_ari_validate_channel(struct ast_json *json)
|
||||
res = 0;
|
||||
}
|
||||
|
||||
if (!has_language) {
|
||||
ast_log(LOG_ERROR, "ARI Channel missing required field language\n");
|
||||
res = 0;
|
||||
}
|
||||
|
||||
if (!has_name) {
|
||||
ast_log(LOG_ERROR, "ARI Channel missing required field name\n");
|
||||
res = 0;
|
||||
|
Reference in New Issue
Block a user