Go to the source code of this file.
|
static int | message_json_construct1 (struct ast_aeap_message *self, const void *params) |
|
static int | message_json_construct2 (struct ast_aeap_message *self, const char *msg_type, const char *name, const char *id, const void *params) |
|
static void * | message_json_data (struct ast_aeap_message *self) |
|
static int | message_json_deserialize (struct ast_aeap_message *self, const void *buf, intmax_t size) |
|
static void | message_json_destruct (struct ast_aeap_message *self) |
|
static const char * | message_json_error_msg (const struct ast_aeap_message *self) |
|
static int | message_json_error_msg_set (struct ast_aeap_message *self, const char *error_msg) |
|
static const char * | message_json_id (const struct ast_aeap_message *self) |
|
static int | message_json_id_set (struct ast_aeap_message *self, const char *id) |
|
static int | message_json_is_request (const struct ast_aeap_message *self) |
|
static int | message_json_is_response (const struct ast_aeap_message *self) |
|
static const char * | message_json_name (const struct ast_aeap_message *self) |
|
static int | message_json_serialize (const struct ast_aeap_message *self, void **buf, intmax_t *size) |
|
◆ JSON_MSG
#define JSON_MSG |
( |
|
lvalue, |
|
|
|
rvalue |
|
) |
| |
Value:
Asterisk external application JSON message type.
Definition at line 25 of file message_json.c.
◆ message_json_construct1()
static int message_json_construct1 |
( |
struct ast_aeap_message * |
self, |
|
|
const void * |
params |
|
) |
| |
|
static |
Definition at line 38 of file message_json.c.
39{
41
43
44 return msg->json ? 0 : -1;
45}
struct ast_json * ast_json_object_create(void)
Create a new JSON object.
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
#define JSON_MSG(lvalue, rvalue)
Abstract JSON element (object, array, string, int, ...).
References ast_json_object_create(), ast_json_ref(), and JSON_MSG.
Referenced by message_json_construct2().
◆ message_json_construct2()
static int message_json_construct2 |
( |
struct ast_aeap_message * |
self, |
|
|
const char * |
msg_type, |
|
|
const char * |
name, |
|
|
const char * |
id, |
|
|
const void * |
params |
|
) |
| |
|
static |
Definition at line 47 of file message_json.c.
49{
51 int res;
52
54
57 return -1;
58 }
59
63 return -1;
64 }
65
68 return res;
69}
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
int ast_json_object_update(struct ast_json *object, struct ast_json *other)
Update object with all of the fields of other.
static int message_json_construct1(struct ast_aeap_message *self, const void *params)
References ast_json_object_update(), ast_json_pack(), ast_json_unref(), ast_log, LOG_ERROR, message_json_construct1(), and name.
◆ message_json_data()
◆ message_json_deserialize()
static int message_json_deserialize |
( |
struct ast_aeap_message * |
self, |
|
|
const void * |
buf, |
|
|
intmax_t |
size |
|
) |
| |
|
static |
Definition at line 78 of file message_json.c.
79{
81
83
84 return msg->json ? 0 : -1;
85}
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.
References ast_json_load_buf(), buf, JSON_MSG, and NULL.
◆ message_json_destruct()
◆ message_json_error_msg()
static const char * message_json_error_msg |
( |
const struct ast_aeap_message * |
self | ) |
|
|
static |
◆ message_json_error_msg_set()
static int message_json_error_msg_set |
( |
struct ast_aeap_message * |
self, |
|
|
const char * |
error_msg |
|
) |
| |
|
static |
Definition at line 161 of file message_json.c.
162{
164
166 return -1;
167 }
168
169 return 0;
170}
struct ast_json * ast_json_string_create(const char *value)
Construct a JSON string from value.
int ast_json_object_set(struct ast_json *object, const char *key, struct ast_json *value)
Set a field in a JSON object.
References ast_json_object_set(), ast_json_string_create(), and JSON_MSG.
◆ message_json_id()
◆ message_json_id_set()
static int message_json_id_set |
( |
struct ast_aeap_message * |
self, |
|
|
const char * |
id |
|
) |
| |
|
static |
◆ message_json_is_request()
◆ message_json_is_response()
◆ message_json_name()
◆ message_json_serialize()
static int message_json_serialize |
( |
const struct ast_aeap_message * |
self, |
|
|
void ** |
buf, |
|
|
intmax_t * |
size |
|
) |
| |
|
static |
Definition at line 87 of file message_json.c.
88{
90
93 *size = 0;
94 return -1;
95 }
96
98
99 return 0;
100}
#define ast_json_dump_string(root)
Encode a JSON value to a compact string.
References ast_json_dump_string, buf, and JSON_MSG.
◆ ast_aeap_message_type_json
◆ message_type_json