mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-11 12:28:27 +00:00
Merge "res/ari: Add the Asterisk EID field to outgoing events" into 13
This commit is contained in:
7
CHANGES
7
CHANGES
@@ -89,6 +89,13 @@ app_dial
|
|||||||
when another channel answers the call. The default of ANSWERED_ELSEWHERE
|
when another channel answers the call. The default of ANSWERED_ELSEWHERE
|
||||||
is unchanged.
|
is unchanged.
|
||||||
|
|
||||||
|
res_ari
|
||||||
|
------------------
|
||||||
|
* ARI events will all now include a new field in the root of the JSON message,
|
||||||
|
'asterisk_id'. This will be the unique ID for the Asterisk system
|
||||||
|
transmitting the event. The value can be overridden using the 'entityid'
|
||||||
|
setting in asterisk.conf.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
--- Functionality changes from Asterisk 13.10.0 to Asterisk 13.11.0 ----------
|
--- Functionality changes from Asterisk 13.10.0 to Asterisk 13.11.0 ----------
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -1932,6 +1932,15 @@ int ast_ari_validate_application_replaced(struct ast_json *json)
|
|||||||
int has_application = 0;
|
int has_application = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ApplicationReplaced field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -2000,6 +2009,15 @@ int ast_ari_validate_bridge_attended_transfer(struct ast_json *json)
|
|||||||
int has_transferer_second_leg = 0;
|
int has_transferer_second_leg = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 BridgeAttendedTransfer field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -2242,6 +2260,15 @@ int ast_ari_validate_bridge_blind_transfer(struct ast_json *json)
|
|||||||
int has_result = 0;
|
int has_result = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 BridgeBlindTransfer field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -2408,6 +2435,15 @@ int ast_ari_validate_bridge_created(struct ast_json *json)
|
|||||||
int has_bridge = 0;
|
int has_bridge = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 BridgeCreated field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -2487,6 +2523,15 @@ int ast_ari_validate_bridge_destroyed(struct ast_json *json)
|
|||||||
int has_bridge = 0;
|
int has_bridge = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 BridgeDestroyed field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -2567,6 +2612,15 @@ int ast_ari_validate_bridge_merged(struct ast_json *json)
|
|||||||
int has_bridge_from = 0;
|
int has_bridge_from = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 BridgeMerged field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -2663,6 +2717,15 @@ int ast_ari_validate_channel_caller_id(struct ast_json *json)
|
|||||||
int has_channel = 0;
|
int has_channel = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelCallerId field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -2772,6 +2835,15 @@ int ast_ari_validate_channel_connected_line(struct ast_json *json)
|
|||||||
int has_channel = 0;
|
int has_channel = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelConnectedLine field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -2851,6 +2923,15 @@ int ast_ari_validate_channel_created(struct ast_json *json)
|
|||||||
int has_channel = 0;
|
int has_channel = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelCreated field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -2932,6 +3013,15 @@ int ast_ari_validate_channel_destroyed(struct ast_json *json)
|
|||||||
int has_channel = 0;
|
int has_channel = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelDestroyed field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -3043,6 +3133,15 @@ int ast_ari_validate_channel_dialplan(struct ast_json *json)
|
|||||||
int has_dialplan_app_data = 0;
|
int has_dialplan_app_data = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelDialplan field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -3154,6 +3253,15 @@ int ast_ari_validate_channel_dtmf_received(struct ast_json *json)
|
|||||||
int has_duration_ms = 0;
|
int has_duration_ms = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelDtmfReceived field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -3263,6 +3371,15 @@ int ast_ari_validate_channel_entered_bridge(struct ast_json *json)
|
|||||||
int has_bridge = 0;
|
int has_bridge = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelEnteredBridge field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -3351,6 +3468,15 @@ int ast_ari_validate_channel_hangup_request(struct ast_json *json)
|
|||||||
int has_channel = 0;
|
int has_channel = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelHangupRequest field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -3448,6 +3574,15 @@ int ast_ari_validate_channel_hold(struct ast_json *json)
|
|||||||
int has_channel = 0;
|
int has_channel = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelHold field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -3537,6 +3672,15 @@ int ast_ari_validate_channel_left_bridge(struct ast_json *json)
|
|||||||
int has_channel = 0;
|
int has_channel = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelLeftBridge field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -3631,6 +3775,15 @@ int ast_ari_validate_channel_state_change(struct ast_json *json)
|
|||||||
int has_channel = 0;
|
int has_channel = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelStateChange field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -3711,6 +3864,15 @@ int ast_ari_validate_channel_talking_finished(struct ast_json *json)
|
|||||||
int has_duration = 0;
|
int has_duration = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelTalkingFinished field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -3805,6 +3967,15 @@ int ast_ari_validate_channel_talking_started(struct ast_json *json)
|
|||||||
int has_channel = 0;
|
int has_channel = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelTalkingStarted field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -3884,6 +4055,15 @@ int ast_ari_validate_channel_unhold(struct ast_json *json)
|
|||||||
int has_channel = 0;
|
int has_channel = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelUnhold field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -3964,6 +4144,15 @@ int ast_ari_validate_channel_userevent(struct ast_json *json)
|
|||||||
int has_userevent = 0;
|
int has_userevent = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelUserevent field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -4086,6 +4275,15 @@ int ast_ari_validate_channel_varset(struct ast_json *json)
|
|||||||
int has_variable = 0;
|
int has_variable = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ChannelVarset field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -4269,6 +4467,15 @@ int ast_ari_validate_contact_status_change(struct ast_json *json)
|
|||||||
int has_endpoint = 0;
|
int has_endpoint = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 ContactStatusChange field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -4363,6 +4570,15 @@ int ast_ari_validate_device_state_changed(struct ast_json *json)
|
|||||||
int has_device_state = 0;
|
int has_device_state = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 DeviceStateChanged field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -4443,6 +4659,15 @@ int ast_ari_validate_dial(struct ast_json *json)
|
|||||||
int has_peer = 0;
|
int has_peer = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 Dial field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -4573,6 +4798,15 @@ int ast_ari_validate_endpoint_state_change(struct ast_json *json)
|
|||||||
int has_endpoint = 0;
|
int has_endpoint = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 EndpointStateChange field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -4772,6 +5006,15 @@ int ast_ari_validate_event(struct ast_json *json)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 Event field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -4961,6 +5204,15 @@ int ast_ari_validate_message(struct ast_json *json)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 Message field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -5000,6 +5252,15 @@ int ast_ari_validate_missing_params(struct ast_json *json)
|
|||||||
int has_params = 0;
|
int has_params = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 MissingParams field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -5131,6 +5392,15 @@ int ast_ari_validate_peer_status_change(struct ast_json *json)
|
|||||||
int has_peer = 0;
|
int has_peer = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 PeerStatusChange field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -5225,6 +5495,15 @@ int ast_ari_validate_playback_finished(struct ast_json *json)
|
|||||||
int has_playback = 0;
|
int has_playback = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 PlaybackFinished field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -5304,6 +5583,15 @@ int ast_ari_validate_playback_started(struct ast_json *json)
|
|||||||
int has_playback = 0;
|
int has_playback = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 PlaybackStarted field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -5383,6 +5671,15 @@ int ast_ari_validate_recording_failed(struct ast_json *json)
|
|||||||
int has_recording = 0;
|
int has_recording = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 RecordingFailed field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -5462,6 +5759,15 @@ int ast_ari_validate_recording_finished(struct ast_json *json)
|
|||||||
int has_recording = 0;
|
int has_recording = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 RecordingFinished field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -5541,6 +5847,15 @@ int ast_ari_validate_recording_started(struct ast_json *json)
|
|||||||
int has_recording = 0;
|
int has_recording = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 RecordingStarted field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -5620,6 +5935,15 @@ int ast_ari_validate_stasis_end(struct ast_json *json)
|
|||||||
int has_channel = 0;
|
int has_channel = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 StasisEnd field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -5700,6 +6024,15 @@ int ast_ari_validate_stasis_start(struct ast_json *json)
|
|||||||
int has_channel = 0;
|
int has_channel = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 StasisStart field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
@@ -5804,6 +6137,15 @@ int ast_ari_validate_text_message_received(struct ast_json *json)
|
|||||||
int has_message = 0;
|
int has_message = 0;
|
||||||
|
|
||||||
for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
|
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 TextMessageReceived field asterisk_id failed validation\n");
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
} else
|
||||||
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
|
||||||
int prop_is_valid;
|
int prop_is_valid;
|
||||||
has_type = 1;
|
has_type = 1;
|
||||||
|
|||||||
@@ -1467,10 +1467,12 @@ ari_validator ast_ari_validate_application_fn(void);
|
|||||||
* - new_messages: int (required)
|
* - new_messages: int (required)
|
||||||
* - old_messages: int (required)
|
* - old_messages: int (required)
|
||||||
* ApplicationReplaced
|
* ApplicationReplaced
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* BridgeAttendedTransfer
|
* BridgeAttendedTransfer
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
@@ -1491,6 +1493,7 @@ ari_validator ast_ari_validate_application_fn(void);
|
|||||||
* - transferer_second_leg: Channel (required)
|
* - transferer_second_leg: Channel (required)
|
||||||
* - transferer_second_leg_bridge: Bridge
|
* - transferer_second_leg_bridge: Bridge
|
||||||
* BridgeBlindTransfer
|
* BridgeBlindTransfer
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
@@ -1503,22 +1506,26 @@ ari_validator ast_ari_validate_application_fn(void);
|
|||||||
* - result: string (required)
|
* - result: string (required)
|
||||||
* - transferee: Channel
|
* - transferee: Channel
|
||||||
* BridgeCreated
|
* BridgeCreated
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - bridge: Bridge (required)
|
* - bridge: Bridge (required)
|
||||||
* BridgeDestroyed
|
* BridgeDestroyed
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - bridge: Bridge (required)
|
* - bridge: Bridge (required)
|
||||||
* BridgeMerged
|
* BridgeMerged
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - bridge: Bridge (required)
|
* - bridge: Bridge (required)
|
||||||
* - bridge_from: Bridge (required)
|
* - bridge_from: Bridge (required)
|
||||||
* ChannelCallerId
|
* ChannelCallerId
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
@@ -1526,16 +1533,19 @@ ari_validator ast_ari_validate_application_fn(void);
|
|||||||
* - caller_presentation_txt: string (required)
|
* - caller_presentation_txt: string (required)
|
||||||
* - channel: Channel (required)
|
* - channel: Channel (required)
|
||||||
* ChannelConnectedLine
|
* ChannelConnectedLine
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - channel: Channel (required)
|
* - channel: Channel (required)
|
||||||
* ChannelCreated
|
* ChannelCreated
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - channel: Channel (required)
|
* - channel: Channel (required)
|
||||||
* ChannelDestroyed
|
* ChannelDestroyed
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
@@ -1543,6 +1553,7 @@ ari_validator ast_ari_validate_application_fn(void);
|
|||||||
* - cause_txt: string (required)
|
* - cause_txt: string (required)
|
||||||
* - channel: Channel (required)
|
* - channel: Channel (required)
|
||||||
* ChannelDialplan
|
* ChannelDialplan
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
@@ -1550,6 +1561,7 @@ ari_validator ast_ari_validate_application_fn(void);
|
|||||||
* - dialplan_app: string (required)
|
* - dialplan_app: string (required)
|
||||||
* - dialplan_app_data: string (required)
|
* - dialplan_app_data: string (required)
|
||||||
* ChannelDtmfReceived
|
* ChannelDtmfReceived
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
@@ -1557,12 +1569,14 @@ ari_validator ast_ari_validate_application_fn(void);
|
|||||||
* - digit: string (required)
|
* - digit: string (required)
|
||||||
* - duration_ms: int (required)
|
* - duration_ms: int (required)
|
||||||
* ChannelEnteredBridge
|
* ChannelEnteredBridge
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - bridge: Bridge (required)
|
* - bridge: Bridge (required)
|
||||||
* - channel: Channel
|
* - channel: Channel
|
||||||
* ChannelHangupRequest
|
* ChannelHangupRequest
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
@@ -1570,39 +1584,46 @@ ari_validator ast_ari_validate_application_fn(void);
|
|||||||
* - channel: Channel (required)
|
* - channel: Channel (required)
|
||||||
* - soft: boolean
|
* - soft: boolean
|
||||||
* ChannelHold
|
* ChannelHold
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - channel: Channel (required)
|
* - channel: Channel (required)
|
||||||
* - musicclass: string
|
* - musicclass: string
|
||||||
* ChannelLeftBridge
|
* ChannelLeftBridge
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - bridge: Bridge (required)
|
* - bridge: Bridge (required)
|
||||||
* - channel: Channel (required)
|
* - channel: Channel (required)
|
||||||
* ChannelStateChange
|
* ChannelStateChange
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - channel: Channel (required)
|
* - channel: Channel (required)
|
||||||
* ChannelTalkingFinished
|
* ChannelTalkingFinished
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - channel: Channel (required)
|
* - channel: Channel (required)
|
||||||
* - duration: int (required)
|
* - duration: int (required)
|
||||||
* ChannelTalkingStarted
|
* ChannelTalkingStarted
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - channel: Channel (required)
|
* - channel: Channel (required)
|
||||||
* ChannelUnhold
|
* ChannelUnhold
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - channel: Channel (required)
|
* - channel: Channel (required)
|
||||||
* ChannelUserevent
|
* ChannelUserevent
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
@@ -1612,6 +1633,7 @@ ari_validator ast_ari_validate_application_fn(void);
|
|||||||
* - eventname: string (required)
|
* - eventname: string (required)
|
||||||
* - userevent: object (required)
|
* - userevent: object (required)
|
||||||
* ChannelVarset
|
* ChannelVarset
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
@@ -1624,17 +1646,20 @@ ari_validator ast_ari_validate_application_fn(void);
|
|||||||
* - roundtrip_usec: string
|
* - roundtrip_usec: string
|
||||||
* - uri: string (required)
|
* - uri: string (required)
|
||||||
* ContactStatusChange
|
* ContactStatusChange
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - contact_info: ContactInfo (required)
|
* - contact_info: ContactInfo (required)
|
||||||
* - endpoint: Endpoint (required)
|
* - endpoint: Endpoint (required)
|
||||||
* DeviceStateChanged
|
* DeviceStateChanged
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - device_state: DeviceState (required)
|
* - device_state: DeviceState (required)
|
||||||
* Dial
|
* Dial
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
@@ -1645,17 +1670,21 @@ ari_validator ast_ari_validate_application_fn(void);
|
|||||||
* - forwarded: Channel
|
* - forwarded: Channel
|
||||||
* - peer: Channel (required)
|
* - peer: Channel (required)
|
||||||
* EndpointStateChange
|
* EndpointStateChange
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - endpoint: Endpoint (required)
|
* - endpoint: Endpoint (required)
|
||||||
* Event
|
* Event
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* Message
|
* Message
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* MissingParams
|
* MissingParams
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - params: List[string] (required)
|
* - params: List[string] (required)
|
||||||
* Peer
|
* Peer
|
||||||
@@ -1665,42 +1694,50 @@ ari_validator ast_ari_validate_application_fn(void);
|
|||||||
* - port: string
|
* - port: string
|
||||||
* - time: string
|
* - time: string
|
||||||
* PeerStatusChange
|
* PeerStatusChange
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - endpoint: Endpoint (required)
|
* - endpoint: Endpoint (required)
|
||||||
* - peer: Peer (required)
|
* - peer: Peer (required)
|
||||||
* PlaybackFinished
|
* PlaybackFinished
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - playback: Playback (required)
|
* - playback: Playback (required)
|
||||||
* PlaybackStarted
|
* PlaybackStarted
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - playback: Playback (required)
|
* - playback: Playback (required)
|
||||||
* RecordingFailed
|
* RecordingFailed
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - recording: LiveRecording (required)
|
* - recording: LiveRecording (required)
|
||||||
* RecordingFinished
|
* RecordingFinished
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - recording: LiveRecording (required)
|
* - recording: LiveRecording (required)
|
||||||
* RecordingStarted
|
* RecordingStarted
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - recording: LiveRecording (required)
|
* - recording: LiveRecording (required)
|
||||||
* StasisEnd
|
* StasisEnd
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
* - channel: Channel (required)
|
* - channel: Channel (required)
|
||||||
* StasisStart
|
* StasisStart
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
@@ -1708,6 +1745,7 @@ ari_validator ast_ari_validate_application_fn(void);
|
|||||||
* - channel: Channel (required)
|
* - channel: Channel (required)
|
||||||
* - replace_channel: Channel
|
* - replace_channel: Channel
|
||||||
* TextMessageReceived
|
* TextMessageReceived
|
||||||
|
* - asterisk_id: string
|
||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - application: string (required)
|
* - application: string (required)
|
||||||
* - timestamp: Date
|
* - timestamp: Date
|
||||||
|
|||||||
@@ -930,8 +930,15 @@ struct stasis_topic *ast_app_get_topic(struct stasis_app *app)
|
|||||||
void app_send(struct stasis_app *app, struct ast_json *message)
|
void app_send(struct stasis_app *app, struct ast_json *message)
|
||||||
{
|
{
|
||||||
stasis_app_cb handler;
|
stasis_app_cb handler;
|
||||||
|
char eid[20];
|
||||||
RAII_VAR(void *, data, NULL, ao2_cleanup);
|
RAII_VAR(void *, data, NULL, ao2_cleanup);
|
||||||
|
|
||||||
|
if (ast_json_object_set(message, "asterisk_id", ast_json_string_create(
|
||||||
|
ast_eid_to_str(eid, sizeof(eid), &ast_eid_default)))) {
|
||||||
|
ast_log(AST_LOG_WARNING, "Failed to append EID to outgoing event %s\n",
|
||||||
|
ast_json_string_get(ast_json_object_get(message, "type")));
|
||||||
|
}
|
||||||
|
|
||||||
/* Copy off mutable state with lock held */
|
/* Copy off mutable state with lock held */
|
||||||
{
|
{
|
||||||
SCOPED_AO2LOCK(lock, app);
|
SCOPED_AO2LOCK(lock, app);
|
||||||
|
|||||||
@@ -110,6 +110,11 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"required": true,
|
"required": true,
|
||||||
"description": "Indicates the type of this message."
|
"description": "Indicates the type of this message."
|
||||||
|
},
|
||||||
|
"asterisk_id": {
|
||||||
|
"type": "string",
|
||||||
|
"required": false,
|
||||||
|
"description": "The unique ID for the Asterisk instance that raised this event."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"subTypes": [
|
"subTypes": [
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ AST_TEST_DEFINE(app_replaced)
|
|||||||
RAII_VAR(struct ast_json *, expected_message1, NULL, ast_json_unref);
|
RAII_VAR(struct ast_json *, expected_message1, NULL, ast_json_unref);
|
||||||
RAII_VAR(struct ast_json *, message, NULL, ast_json_unref);
|
RAII_VAR(struct ast_json *, message, NULL, ast_json_unref);
|
||||||
RAII_VAR(struct ast_json *, expected_message2, NULL, ast_json_unref);
|
RAII_VAR(struct ast_json *, expected_message2, NULL, ast_json_unref);
|
||||||
|
char eid[20];
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
@@ -157,9 +158,10 @@ AST_TEST_DEFINE(app_replaced)
|
|||||||
|
|
||||||
stasis_app_register(app_name, test_handler, app_data1);
|
stasis_app_register(app_name, test_handler, app_data1);
|
||||||
stasis_app_register(app_name, test_handler, app_data2);
|
stasis_app_register(app_name, test_handler, app_data2);
|
||||||
expected_message1 = ast_json_pack("[{s: s, s: s}]",
|
expected_message1 = ast_json_pack("[{s: s, s: s, s: s}]",
|
||||||
"type", "ApplicationReplaced",
|
"type", "ApplicationReplaced",
|
||||||
"application", app_name);
|
"application", app_name,
|
||||||
|
"asterisk_id", ast_eid_to_str(eid, sizeof(eid), &ast_eid_default));
|
||||||
message = ast_json_pack("{ s: o }", "test-message", ast_json_null());
|
message = ast_json_pack("{ s: o }", "test-message", ast_json_null());
|
||||||
expected_message2 = ast_json_pack("[o]", ast_json_ref(message));
|
expected_message2 = ast_json_pack("[o]", ast_json_ref(message));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user