23#ifndef AST_AEAP_MESSAGE_H
24#define AST_AEAP_MESSAGE_H
65 const char *
id,
const void *params);
209 const char *msg_type,
const char *
name,
const char *
id,
const void *params);
222 const char *
name,
const char *
id,
const void *params);
235 const char *
name,
const char *
id,
const void *params);
248 const char *
name,
const char *
id,
const char *error_msg);
260 const void *
buf, intmax_t size);
272 void **
buf, intmax_t *size);
366 const char *error_msg);
Asterisk External Application Protocol API.
AST_AEAP_DATA_TYPE
Supported Asterisk external application data types.
int ast_aeap_message_serialize(const struct ast_aeap_message *message, void **buf, intmax_t *size)
Serialize the given message object into a byte/char buffer.
struct ast_aeap_message * ast_aeap_message_create_error(const struct ast_aeap_message_type *type, const char *name, const char *id, const char *error_msg)
Create an Asterisk external application error response object.
int ast_aeap_message_is_request(const struct ast_aeap_message *message)
Retrieve whether or not this is a request message.
const char * ast_aeap_message_id(const struct ast_aeap_message *message)
Retrieve a message id.
int ast_aeap_message_is_response(const struct ast_aeap_message *message)
Retrieve whether or not this is a response message.
struct ast_aeap_message * ast_aeap_message_create_request(const struct ast_aeap_message_type *type, const char *name, const char *id, const void *params)
Create an Asterisk external application request object.
struct ast_aeap_message * ast_aeap_message_create2(const struct ast_aeap_message_type *type, const char *msg_type, const char *name, const char *id, const void *params)
Create an Asterisk external application message object.
const char * ast_aeap_message_id_generate(struct ast_aeap_message *message)
Generate an id, and set it for the message.
const char * ast_aeap_message_name(const struct ast_aeap_message *message)
Retrieve a message name.
int ast_aeap_message_error_msg_set(struct ast_aeap_message *message, const char *error_msg)
Set an error message.
const struct ast_aeap_message_type * ast_aeap_message_type_json
Asterisk external application JSON message type.
int ast_aeap_message_id_set(struct ast_aeap_message *message, const char *id)
Set a message id.
const char * ast_aeap_message_error_msg(const struct ast_aeap_message *message)
Retrieve the error message if it has one.
struct ast_aeap_message * ast_aeap_message_create_response(const struct ast_aeap_message_type *type, const char *name, const char *id, const void *params)
Create an Asterisk external application response object.
void * ast_aeap_message_data(struct ast_aeap_message *message)
Retrieve the core message data/body.
int ast_aeap_message_is_named(const struct ast_aeap_message *message, const char *name)
Check whether or not a message's name matches the given one.
struct ast_aeap_message * ast_aeap_message_deserialize(const struct ast_aeap_message_type *type, const void *buf, intmax_t size)
Deserialize the given buffer into an Asterisk external application message object.
struct ast_aeap_message * ast_aeap_message_create1(const struct ast_aeap_message_type *type, const void *params)
Create an Asterisk external application message object.
enum AST_AEAP_DATA_TYPE ast_aeap_message_serial_type(const struct ast_aeap_message_type *type)
Retrieve the serial type a message type.
Message type virtual method table.
int(* is_response)(const struct ast_aeap_message *self)
Retrieve whether or not this is a response message.
const char *(* name)(const struct ast_aeap_message *self)
Retrieve a message name.
int(* construct2)(struct ast_aeap_message *self, const char *msg_type, const char *name, const char *id, const void *params)
Construct/Initialize a message object.
int(* error_msg_set)(struct ast_aeap_message *self, const char *error_msg)
Set an error message.
int(* deserialize)(struct ast_aeap_message *self, const void *buf, intmax_t size)
Deserialize the given buffer into a message object.
enum AST_AEAP_DATA_TYPE serial_type
int(* serialize)(const struct ast_aeap_message *self, void **buf, intmax_t *size)
Serialize the message object into byte/char buffer.
void(* destruct)(struct ast_aeap_message *self)
Destruct/Cleanup object resources.
const char *(* id)(const struct ast_aeap_message *self)
Retrieve a message id.
int(* construct1)(struct ast_aeap_message *self, const void *params)
Construct/Initialize a message object.
int(* is_request)(const struct ast_aeap_message *self)
Retrieve whether or not this is a request message.
const char *(* error_msg)(const struct ast_aeap_message *self)
Retrieve the error message if it has one.
int(* id_set)(struct ast_aeap_message *self, const char *id)
Set a message id.
Asterisk external application base message.
const struct ast_aeap_message_type * type