117 return type->available_formatters;
211#define INVOKE_VIRTUAL(fn, ...) \
216 ast_assert(msg->type != NULL); \
217 ast_assert(msg->type->vtable != NULL); \
218 if (!msg->type->vtable->fn) { \
221 msg->type->vtable->fn(__VA_ARGS__); \
241#define HAS_VIRTUAL(fn, msg) \
246 ast_assert(msg->type != NULL); \
247 ast_assert(msg->type->vtable != NULL); \
248 !!msg->type->vtable->fn; \
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdup(str)
A wrapper for strdup()
@ AO2_ALLOC_OPT_LOCK_NOLOCK
#define ao2_t_alloc_options(data_size, destructor_fn, options, debug_msg)
Allocate and initialize an object.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Generic (perhaps overly so) hashtable implementation Hash Table support in Asterisk.
unsigned int ast_hashtab_hash_string(const void *obj)
Hashes a string to a number.
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
static void to_ami(struct ast_sip_subscription *sub, struct ast_str **buf)
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
stasis_subscription_message_formatters
Stasis subscription formatter filters.
@ STASIS_SUBSCRIPTION_FORMATTER_EVENT
@ STASIS_SUBSCRIPTION_FORMATTER_AMI
@ STASIS_SUBSCRIPTION_FORMATTER_JSON
int stasis_message_type_declined(const char *name)
Check whether a message type is declined.
stasis_message_type_result
Return code for Stasis message type creation attempts.
@ STASIS_MESSAGE_TYPE_DECLINED
@ STASIS_MESSAGE_TYPE_ERROR
@ STASIS_MESSAGE_TYPE_SUCCESS
struct ast_manager_event_blob * stasis_message_to_ami(struct stasis_message *msg)
Build the AMI representation of the message.
#define HAS_VIRTUAL(fn, msg)
unsigned int stasis_message_type_hash(const struct stasis_message_type *type)
Gets the hash of a given message type.
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
enum stasis_subscription_message_formatters stasis_message_type_available_formatters(const struct stasis_message_type *type)
Get a bitmap of available formatters for a message type.
struct ast_json * stasis_message_to_json(struct stasis_message *msg, struct stasis_message_sanitizer *sanitize)
Build the JSON representation of the message.
static void message_type_dtor(void *obj)
static void stasis_message_dtor(void *obj)
const struct ast_eid * stasis_message_eid(const struct stasis_message *msg)
Get the entity id for a stasis_message.
struct ast_event * stasis_message_to_event(struct stasis_message *msg)
Build the Generic event system representation of the message.
static int message_type_id
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
enum stasis_message_type_result stasis_message_type_create(const char *name, struct stasis_message_vtable *vtable, struct stasis_message_type **result)
Create a new message type.
const char * stasis_message_type_name(const struct stasis_message_type *type)
Gets the name of a given message type.
struct stasis_message * stasis_message_create(struct stasis_message_type *type, void *data)
Create a new message.
int stasis_message_type_id(const struct stasis_message_type *type)
Gets the id of a given message type.
struct stasis_message * stasis_message_create_full(struct stasis_message_type *type, void *data, const struct ast_eid *eid)
Create a new message for an entity.
#define INVOKE_VIRTUAL(fn,...)
static struct stasis_message_vtable null_vtable
const struct timeval * stasis_message_timestamp(const struct stasis_message *msg)
Get the time when a message was created.
int stasis_message_can_be_ami(struct stasis_message *msg)
Determine if the given message can be converted to AMI.
An Entity ID is essentially a MAC address, brief and unique.
Abstract JSON element (object, array, string, int, ...).
Struct containing info for an AMI event to send out.
Structure containing callbacks for Stasis message sanitization.
struct stasis_message_vtable * vtable
enum stasis_subscription_message_formatters available_formatters
Virtual table providing methods for messages.
struct ast_manager_event_blob *(* to_ami)(struct stasis_message *message)
Build the AMI representation of the message.
struct ast_json *(* to_json)(struct stasis_message *message, const struct stasis_message_sanitizer *sanitize)
Build the JSON representation of the message.
struct ast_event *(* to_event)(struct stasis_message *message)
Build the ast_event representation of the message.
struct stasis_message_type * type
const struct ast_eid * eid_ptr
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
struct ast_eid ast_eid_default
Global EID.