mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 11:58:40 +00:00
manager - Add Content-Type parameter to the SendText action
This patch allows a user of AMI to now specify the type of message content contained within by setting the 'Content-Type' parameter. Note, the AMI version has been bumped for this change. ASTERISK-28945 #close Change-Id: Ibb5315702532c6b954e1498beddc8855fabdf4bb
This commit is contained in:
committed by
Friendly Automation
parent
8d1064eaaf
commit
cfed0ea033
@@ -1429,6 +1429,32 @@ struct ast_msg_data *ast_msg_data_alloc(enum ast_msg_data_source_type source,
|
||||
return msg;
|
||||
}
|
||||
|
||||
struct ast_msg_data *ast_msg_data_alloc2(enum ast_msg_data_source_type source_type,
|
||||
const char *to, const char *from, const char *content_type, const char *body)
|
||||
{
|
||||
struct ast_msg_data_attribute attrs[] =
|
||||
{
|
||||
{
|
||||
.type = AST_MSG_DATA_ATTR_TO,
|
||||
.value = (char *)S_OR(to, ""),
|
||||
},
|
||||
{
|
||||
.type = AST_MSG_DATA_ATTR_FROM,
|
||||
.value = (char *)S_OR(from, ""),
|
||||
},
|
||||
{
|
||||
.type = AST_MSG_DATA_ATTR_CONTENT_TYPE,
|
||||
.value = (char *)S_OR(content_type, ""),
|
||||
},
|
||||
{
|
||||
.type = AST_MSG_DATA_ATTR_BODY,
|
||||
.value = (char *)S_OR(body, ""),
|
||||
},
|
||||
};
|
||||
|
||||
return ast_msg_data_alloc(source_type, attrs, ARRAY_LEN(attrs));
|
||||
}
|
||||
|
||||
struct ast_msg_data *ast_msg_data_dup(struct ast_msg_data *msg)
|
||||
{
|
||||
struct ast_msg_data *dest;
|
||||
|
||||
Reference in New Issue
Block a user