25#define JSON_MSG(lvalue, rvalue) struct message_json *lvalue = \
26 ((struct message_json *)rvalue)
44 return msg->json ? 0 : -1;
48 const char *
name,
const char *
id,
const void *params)
84 return msg->json ? 0 : -1;
Asterisk main include file. File version handling, generic pbx functions.
Asterisk JSON abstraction layer.
#define ast_json_object_string_get(object, key)
Get a string field from a JSON object.
struct ast_json * ast_json_object_iter_value(struct ast_json_iter *iter)
Get the value from an iterator.
struct ast_json * ast_json_string_create(const char *value)
Construct a JSON string from value.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
struct ast_json * ast_json_object_create(void)
Create a new JSON object.
#define ast_json_dump_string(root)
Encode a JSON value to a compact string.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
struct ast_json_iter * ast_json_object_iter_at(struct ast_json *object, const char *key)
Get an iterator pointing to a specified key in object.
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
int ast_json_object_set(struct ast_json *object, const char *key, struct ast_json *value)
Set a field in a JSON object.
struct ast_json * ast_json_load_buf(const char *buffer, size_t buflen, struct ast_json_error *error)
Parse buffer with known length into a JSON object or array.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
int ast_json_object_update(struct ast_json *object, struct ast_json *other)
Update object with all of the fields of other.
static void message_json_destruct(struct ast_aeap_message *self)
static int message_json_is_request(const struct ast_aeap_message *self)
static int message_json_serialize(const struct ast_aeap_message *self, void **buf, intmax_t *size)
static int message_json_error_msg_set(struct ast_aeap_message *self, const char *error_msg)
static int message_json_construct1(struct ast_aeap_message *self, const void *params)
const struct ast_aeap_message_type * ast_aeap_message_type_json
Asterisk external application JSON message type.
#define JSON_MSG(lvalue, rvalue)
static const char * message_json_id(const struct ast_aeap_message *self)
static const char * message_json_error_msg(const struct ast_aeap_message *self)
static const char * message_json_name(const struct ast_aeap_message *self)
static int message_json_id_set(struct ast_aeap_message *self, const char *id)
static int message_json_construct2(struct ast_aeap_message *self, const char *msg_type, const char *name, const char *id, const void *params)
static int message_json_deserialize(struct ast_aeap_message *self, const void *buf, intmax_t size)
static const struct ast_aeap_message_type message_type_json
static void * message_json_data(struct ast_aeap_message *self)
static int message_json_is_response(const struct ast_aeap_message *self)
@ AST_AEAP_DATA_TYPE_STRING
Asterisk External Application Protocol Message API.
Message type virtual method table.
Asterisk external application base message.
Iterator for JSON object key/values.
Abstract JSON element (object, array, string, int, ...).
Asterisk external application JSON message type.
struct ast_aeap_message base