mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
bridging: Add creation timestamps
This small feature will help to checking the bridge's status to figure out which bridge is in old/zombie or not. Also added detail items for the 'bridge show *' cli to provide more detail info. And added creation item to the ARI as well. ASTERISK-28279 Change-Id: I460238c488eca4d216b9176576211cb03286e040
This commit is contained in:
@@ -1360,6 +1360,7 @@ int ast_ari_validate_bridge(struct ast_json *json)
|
||||
int has_bridge_class = 0;
|
||||
int has_bridge_type = 0;
|
||||
int has_channels = 0;
|
||||
int has_creationtime = 0;
|
||||
int has_creator = 0;
|
||||
int has_id = 0;
|
||||
int has_name = 0;
|
||||
@@ -1397,6 +1398,16 @@ int ast_ari_validate_bridge(struct ast_json *json)
|
||||
res = 0;
|
||||
}
|
||||
} else
|
||||
if (strcmp("creationtime", ast_json_object_iter_key(iter)) == 0) {
|
||||
int prop_is_valid;
|
||||
has_creationtime = 1;
|
||||
prop_is_valid = ast_ari_validate_date(
|
||||
ast_json_object_iter_value(iter));
|
||||
if (!prop_is_valid) {
|
||||
ast_log(LOG_ERROR, "ARI Bridge field creationtime failed validation\n");
|
||||
res = 0;
|
||||
}
|
||||
} else
|
||||
if (strcmp("creator", ast_json_object_iter_key(iter)) == 0) {
|
||||
int prop_is_valid;
|
||||
has_creator = 1;
|
||||
@@ -1478,6 +1489,11 @@ int ast_ari_validate_bridge(struct ast_json *json)
|
||||
res = 0;
|
||||
}
|
||||
|
||||
if (!has_creationtime) {
|
||||
ast_log(LOG_ERROR, "ARI Bridge missing required field creationtime\n");
|
||||
res = 0;
|
||||
}
|
||||
|
||||
if (!has_creator) {
|
||||
ast_log(LOG_ERROR, "ARI Bridge missing required field creator\n");
|
||||
res = 0;
|
||||
|
@@ -1488,6 +1488,7 @@ ari_validator ast_ari_validate_application_fn(void);
|
||||
* - bridge_class: string (required)
|
||||
* - bridge_type: string (required)
|
||||
* - channels: List[string] (required)
|
||||
* - creationtime: Date (required)
|
||||
* - creator: string (required)
|
||||
* - id: string (required)
|
||||
* - name: string (required)
|
||||
|
Reference in New Issue
Block a user