mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
Document MissingParams error message for /ari/events
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -64,7 +64,7 @@ static void stasis_http_event_websocket_ws_cb(struct ast_websocket *ws_session,
|
||||
}
|
||||
#if defined(AST_DEVMODE)
|
||||
session = ari_websocket_session_create(ws_session,
|
||||
ari_validate_event_fn());
|
||||
ari_validate_message_fn());
|
||||
#else
|
||||
session = ari_websocket_session_create(ws_session, NULL);
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -655,6 +655,42 @@ int ari_validate_event(struct ast_json *json);
|
||||
*/
|
||||
ari_validator ari_validate_event_fn(void);
|
||||
|
||||
/*!
|
||||
* \brief Validator for Message.
|
||||
*
|
||||
* Base type for errors and events
|
||||
*
|
||||
* \param json JSON object to validate.
|
||||
* \returns True (non-zero) if valid.
|
||||
* \returns False (zero) if invalid.
|
||||
*/
|
||||
int ari_validate_message(struct ast_json *json);
|
||||
|
||||
/*!
|
||||
* \brief Function pointer to ari_validate_message().
|
||||
*
|
||||
* See \ref ari_model_validators.h for more details.
|
||||
*/
|
||||
ari_validator ari_validate_message_fn(void);
|
||||
|
||||
/*!
|
||||
* \brief Validator for MissingParams.
|
||||
*
|
||||
* Error event sent when required params are missing.
|
||||
*
|
||||
* \param json JSON object to validate.
|
||||
* \returns True (non-zero) if valid.
|
||||
* \returns False (zero) if invalid.
|
||||
*/
|
||||
int ari_validate_missing_params(struct ast_json *json);
|
||||
|
||||
/*!
|
||||
* \brief Function pointer to ari_validate_missing_params().
|
||||
*
|
||||
* See \ref ari_model_validators.h for more details.
|
||||
*/
|
||||
ari_validator ari_validate_missing_params_fn(void);
|
||||
|
||||
/*!
|
||||
* \brief Validator for PlaybackFinished.
|
||||
*
|
||||
@@ -780,118 +816,123 @@ ari_validator ari_validate_stasis_start_fn(void);
|
||||
* - state: string (required)
|
||||
* - target_uri: string (required)
|
||||
* ApplicationReplaced
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* BridgeCreated
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - bridge: Bridge (required)
|
||||
* BridgeDestroyed
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - bridge: Bridge (required)
|
||||
* BridgeMerged
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - bridge: Bridge (required)
|
||||
* - bridge_from: Bridge (required)
|
||||
* ChannelCallerId
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - caller_presentation: int (required)
|
||||
* - caller_presentation_txt: string (required)
|
||||
* - channel: Channel (required)
|
||||
* ChannelCreated
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - channel: Channel (required)
|
||||
* ChannelDestroyed
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - cause: int (required)
|
||||
* - cause_txt: string (required)
|
||||
* - channel: Channel (required)
|
||||
* ChannelDialplan
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - channel: Channel (required)
|
||||
* - dialplan_app: string (required)
|
||||
* - dialplan_app_data: string (required)
|
||||
* ChannelDtmfReceived
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - channel: Channel (required)
|
||||
* - digit: string (required)
|
||||
* - duration_ms: int (required)
|
||||
* ChannelEnteredBridge
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - bridge: Bridge (required)
|
||||
* - channel: Channel
|
||||
* ChannelHangupRequest
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - cause: int
|
||||
* - channel: Channel (required)
|
||||
* - soft: boolean
|
||||
* ChannelLeftBridge
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - bridge: Bridge (required)
|
||||
* - channel: Channel (required)
|
||||
* ChannelStateChange
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - channel: Channel (required)
|
||||
* ChannelUserevent
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - channel: Channel (required)
|
||||
* - eventname: string (required)
|
||||
* ChannelVarset
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - channel: Channel
|
||||
* - value: string (required)
|
||||
* - variable: string (required)
|
||||
* Event
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* Message
|
||||
* - type: string (required)
|
||||
* MissingParams
|
||||
* - type: string (required)
|
||||
* - params: List[string] (required)
|
||||
* PlaybackFinished
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - playback: Playback (required)
|
||||
* PlaybackStarted
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - playback: Playback (required)
|
||||
* StasisEnd
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - channel: Channel (required)
|
||||
* StasisStart
|
||||
* - type: string (required)
|
||||
* - application: string (required)
|
||||
* - timestamp: Date
|
||||
* - type: string (required)
|
||||
* - args: List[string] (required)
|
||||
* - channel: Channel (required)
|
||||
*/
|
||||
|
@@ -182,8 +182,8 @@ void ari_websocket_event_websocket(struct ari_websocket_session *ws_session,
|
||||
RAII_VAR(struct ast_json *, msg, NULL, ast_json_unref);
|
||||
|
||||
msg = ast_json_pack("{s: s, s: [s]}",
|
||||
"error", "MissingParams",
|
||||
"params", "app");
|
||||
"type", "MissingParams",
|
||||
"params", "app");
|
||||
if (!msg) {
|
||||
msg = ast_json_ref(ari_oom_json());
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
"websocketProtocol": "ari",
|
||||
"summary": "WebSocket connection for events.",
|
||||
"nickname": "eventWebsocket",
|
||||
"responseClass": "Event",
|
||||
"responseClass": "Message",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "app",
|
||||
@@ -33,16 +33,35 @@
|
||||
}
|
||||
],
|
||||
"models": {
|
||||
"Event": {
|
||||
"id": "Event",
|
||||
"description": "Base type for asynchronous events from Asterisk.",
|
||||
"Message": {
|
||||
"id": "Message",
|
||||
"description": "Base type for errors and events",
|
||||
"discriminator": "type",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Indicates the type of this event."
|
||||
},
|
||||
"description": "Indicates the type of this message."
|
||||
}
|
||||
}
|
||||
},
|
||||
"MissingParams": {
|
||||
"id": "MissingParams",
|
||||
"extends": "Message",
|
||||
"description": "Error event sent when required params are missing.",
|
||||
"properties": {
|
||||
"params": {
|
||||
"required": true,
|
||||
"type": "List[string]",
|
||||
"description": "A list of the missing parameters"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Event": {
|
||||
"id": "Event",
|
||||
"extends": "Message",
|
||||
"description": "Base type for asynchronous events from Asterisk.",
|
||||
"properties": {
|
||||
"application": {
|
||||
"type": "string",
|
||||
"description": "Name of the application receiving the event.",
|
||||
|
Reference in New Issue
Block a user