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.

ASTERISK-28755 #close

Change-Id: Ia6051c01a53b30cf7edef84c27df4ed4479b8b6f
This commit is contained in:
Kevin Harwell
2020-02-28 12:55:31 -06:00
parent 8a8253e55b
commit a715cf5aaa
7 changed files with 65 additions and 108 deletions

View File

@@ -396,6 +396,19 @@ struct ast_msg_var_iterator *ast_msg_var_iterator_init(const struct ast_msg *msg
*/
int ast_msg_var_iterator_next(const struct ast_msg *msg, struct ast_msg_var_iterator *iter, const char **name, const char **value);
/*!
* \brief Get the next variable name and value that was set on a received message
* \param msg The message with the variables
* \param iter An iterator created with ast_msg_var_iterator_init
* \param name A pointer to the name result pointer
* \param value A pointer to the value result pointer
*
* \retval 0 No more entries
* \retval 1 Valid entry
*/
int ast_msg_var_iterator_next_received(const struct ast_msg *msg,
struct ast_msg_var_iterator *iter, const char **name, const char **value);
/*!
* \brief Destroy a message variable iterator
* \param iter Iterator to be destroyed