diff options
Diffstat (limited to 'include/asterisk/message.h')
-rw-r--r-- | include/asterisk/message.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/include/asterisk/message.h b/include/asterisk/message.h index d989563e5..31ed0b28a 100644 --- a/include/asterisk/message.h +++ b/include/asterisk/message.h @@ -114,6 +114,11 @@ struct ast_msg *ast_msg_alloc(void); struct ast_msg *ast_msg_destroy(struct ast_msg *msg); /*! + * \brief Bump a msg's ref count + */ +struct ast_msg *ast_msg_ref(struct ast_msg *msg); + +/*! * \brief Set the 'to' URI of a message * * \retval 0 success @@ -159,7 +164,7 @@ int __attribute__((format(printf, 2, 3))) ast_msg_set_exten(struct ast_msg *msg, const char *fmt, ...); /*! - * \brief Set a variable on the message + * \brief Set a variable on the message going to the dialplan. * \note Setting a variable that already exists overwrites the existing variable value * * \param name Name of variable to set @@ -171,6 +176,18 @@ int __attribute__((format(printf, 2, 3))) int ast_msg_set_var(struct ast_msg *msg, const char *name, const char *value); /*! + * \brief Set a variable on the message being sent to a message tech directly. + * \note Setting a variable that already exists overwrites the existing variable value + * + * \param name Name of variable to set + * \param value Value of variable to set + * + * \retval 0 success + * \retval -1 failure + */ +int ast_msg_set_var_outbound(struct ast_msg *msg, const char *name, const char *value); + +/*! * \brief Get the specified variable on the message * \note The return value is valid only as long as the ast_message is valid. Hold a reference * to the message if you plan on storing the return value. Do re-set the same @@ -201,6 +218,17 @@ const char *ast_msg_get_body(const struct ast_msg *msg); int ast_msg_queue(struct ast_msg *msg); /*! + * \brief Send a msg directly to an endpoint. + * + * Regardless of the return value of this function, this funciton will take + * care of ensuring that the message object is properly destroyed when needed. + * + * \retval 0 message successfully queued to be sent out + * \retval non-zero failure, message not get sent out. + */ +int ast_msg_send(struct ast_msg *msg, const char *to, const char *from); + +/*! * \brief Opaque iterator for msg variables */ struct ast_msg_var_iterator; |