message & stasis/messaging: make text message variables work in ARI

When a text message was received any associated variable was not written to
the ARI TextMessageReceived event. This occurred because Asterisk only wrote
out "send" variables. However, even those "send" variables would fail ARI
validation due to a TextMessageVariable formatting bug.

Since it seems the TextMessageReceived event has never been able to include
actual variables it was decided to remove the TextMessageVariable object type
from ARI, and simply return a JSON object of key/value pairs for variables.
This aligns more with how the ARI sendMessage handles variables, and other
places in ARI.

That being the case, and since this is technically an API breaking change (no
one should really be affected since things never really worked) the ARI version
was updated to reflect that.

ASTERISK-28755 #close

Change-Id: Ia6051c01a53b30cf7edef84c27df4ed4479b8b6f
This commit is contained in:
Kevin Harwell
2020-02-24 17:16:33 -06:00
parent d86cd96c87
commit fc1d93cf97
8 changed files with 66 additions and 109 deletions

View File

@@ -387,24 +387,6 @@ int ast_ari_validate_text_message(struct ast_json *json);
*/
ari_validator ast_ari_validate_text_message_fn(void);
/*!
* \brief Validator for TextMessageVariable.
*
* A key/value pair variable in a text message.
*
* \param json JSON object to validate.
* \returns True (non-zero) if valid.
* \returns False (zero) if invalid.
*/
int ast_ari_validate_text_message_variable(struct ast_json *json);
/*!
* \brief Function pointer to ast_ari_validate_text_message_variable().
*
* See \ref ast_ari_model_validators.h for more details.
*/
ari_validator ast_ari_validate_text_message_variable_fn(void);
/*!
* \brief Validator for CallerID.
*
@@ -1497,10 +1479,7 @@ ari_validator ast_ari_validate_application_fn(void);
* - body: string (required)
* - from: string (required)
* - to: string (required)
* - variables: List[TextMessageVariable]
* TextMessageVariable
* - key: string (required)
* - value: string (required)
* - variables: object
* CallerID
* - name: string (required)
* - number: string (required)