mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-12 21:09:00 +00:00
ari: Provide the caller ID RDNIS for the channels
Provide the caller ID RDNIS when available. This will allow an
application to follow the redirect.
(cherry picked from commit 157389bc59)
This commit is contained in:
committed by
Asterisk Development Team
parent
089ddaaaed
commit
28f52d35f3
@@ -1323,6 +1323,10 @@ struct ast_json *ast_channel_snapshot_to_json(
|
|||||||
"creationtime", ast_json_timeval(snapshot->base->creationtime, NULL),
|
"creationtime", ast_json_timeval(snapshot->base->creationtime, NULL),
|
||||||
"language", snapshot->base->language);
|
"language", snapshot->base->language);
|
||||||
|
|
||||||
|
if (!ast_strlen_zero(snapshot->caller->rdnis)) {
|
||||||
|
ast_json_object_set(json_chan, "caller_rdnis", ast_json_string_create(snapshot->caller->rdnis));
|
||||||
|
}
|
||||||
|
|
||||||
if (snapshot->ari_vars && !AST_LIST_EMPTY(snapshot->ari_vars)) {
|
if (snapshot->ari_vars && !AST_LIST_EMPTY(snapshot->ari_vars)) {
|
||||||
ast_json_object_set(json_chan, "channelvars", ast_json_channel_vars(snapshot->ari_vars));
|
ast_json_object_set(json_chan, "channelvars", ast_json_channel_vars(snapshot->ari_vars));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1067,6 +1067,15 @@ int ast_ari_validate_channel(struct ast_json *json)
|
|||||||
res = 0;
|
res = 0;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
if (strcmp("caller_rdnis", 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 Channel field caller_rdnis failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("channelvars", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("channelvars", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
prop_is_valid = ast_ari_validate_object(
|
prop_is_valid = ast_ari_validate_object(
|
||||||
|
|||||||
@@ -1346,6 +1346,7 @@ ari_validator ast_ari_validate_application_fn(void);
|
|||||||
* Channel
|
* Channel
|
||||||
* - accountcode: string (required)
|
* - accountcode: string (required)
|
||||||
* - caller: CallerID (required)
|
* - caller: CallerID (required)
|
||||||
|
* - caller_rdnis: string
|
||||||
* - channelvars: object
|
* - channelvars: object
|
||||||
* - connected: CallerID (required)
|
* - connected: CallerID (required)
|
||||||
* - creationtime: Date (required)
|
* - creationtime: Date (required)
|
||||||
|
|||||||
@@ -2187,6 +2187,10 @@
|
|||||||
"required": false,
|
"required": false,
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "Channel variables"
|
"description": "Channel variables"
|
||||||
|
},
|
||||||
|
"caller_rdnis": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The Caller ID RDNIS"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user