128 registry =
ast_json_pack(
"{s: s, s: s, s: s, s: s, s: s, s: s}",
130 "channeltype", channeltype,
131 "username", username,
134 "cause",
S_OR(cause,
""));
155 const char *channeltype;
156 const char *username;
173 ast_str_set(&cause_string, 0,
"Cause: %s\r\n", cause);
177 "ChannelType: %s\r\n"
208 unsigned int expires;
218 core_id, caller, expires);
236 core_id, caller, callee);
329 core_id, caller, reason);
Asterisk main include file. File version handling, generic pbx functions.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
enum ast_cc_service_type service
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
struct ast_json_payload * ast_json_payload_create(struct ast_json *json)
Create an ao2 object to pass json blobs as data payloads for stasis.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
intmax_t ast_json_integer_get(const struct ast_json *integer)
Get the value from a JSON integer.
#define EVENT_FLAG_SYSTEM
struct ast_manager_event_blob * ast_manager_event_blob_create(int event_flags, const char *manager_event, const char *extra_fields_fmt,...)
Construct a ast_manager_event_blob.
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.
#define STASIS_MESSAGE_TYPE_CLEANUP(name)
Boiler-plate messaging macro for cleaning up message types.
struct stasis_topic * stasis_topic_create(const char *name)
Create a new topic.
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
struct stasis_message * stasis_message_create(struct stasis_message_type *type, void *data)
Create a new message.
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
void ast_system_publish_registry(const char *channeltype, const char *username, const char *domain, const char *status, const char *cause)
Publish a channel driver outgoing registration message.
static struct ast_manager_event_blob * system_registry_to_ami(struct stasis_message *message)
struct stasis_topic * ast_system_topic(void)
A Stasis Message Bus API topic which publishes messages regarding system changes.
static struct ast_manager_event_blob * cc_offertimerstart_to_ami(struct stasis_message *message)
static struct ast_manager_event_blob * cc_callerrecalling_to_ami(struct stasis_message *message)
static struct ast_manager_event_blob * cc_requested_to_ami(struct stasis_message *message)
static struct stasis_topic * system_topic
The Stasis Message Bus API topic for system level changes.
static struct ast_manager_event_blob * cc_callerstopmonitoring_to_ami(struct stasis_message *message)
static struct ast_manager_event_blob * cc_monitorfailed_to_ami(struct stasis_message *message)
static struct ast_manager_event_blob * cc_callerstartmonitoring_to_ami(struct stasis_message *message)
static struct ast_manager_event_blob * cc_available_to_ami(struct stasis_message *message)
STASIS_MESSAGE_TYPE_DEFN(ast_network_change_type)
static struct ast_manager_event_blob * cc_failure_to_ami(struct stasis_message *message)
int ast_stasis_system_init(void)
Initialize the system level items for Stasis Message Bus API.
static struct ast_manager_event_blob * cc_requestacknowledged_to_ami(struct stasis_message *message)
static void stasis_system_cleanup(void)
Cleanup the Stasis Message Bus API system level items.
static struct ast_manager_event_blob * cc_recallcomplete_to_ami(struct stasis_message *message)
struct stasis_message_type * ast_cc_monitorfailed_type(void)
A stasis_message_type for CCSS Monitor Failed messages.
struct stasis_message_type * ast_cc_recallcomplete_type(void)
A stasis_message_type for CCSS Recall Complete messages.
struct stasis_message_type * ast_system_registry_type(void)
A stasis_message_type for outbound registration.
struct stasis_message_type * ast_cc_callerrecalling_type(void)
A stasis_message_type for CCSS Caller Recalling messages.
struct stasis_message_type * ast_cluster_discovery_type(void)
A stasis_message_type for Cluster discovery.
struct stasis_message_type * ast_cc_failure_type(void)
A stasis_message_type for CCSS Failure messages.
struct stasis_message_type * ast_cc_callerstopmonitoring_type(void)
A stasis_message_type for CCSS Caller Stop Monitoring messages.
struct stasis_message_type * ast_cc_available_type(void)
A stasis_message_type for CCSS Available messages.
struct stasis_message_type * ast_cc_requestacknowledged_type(void)
A stasis_message_type for CCSS Request Acknowledged messages.
struct stasis_message_type * ast_network_change_type(void)
A stasis_message_type for network changes.
struct stasis_message_type * ast_cc_callerstartmonitoring_type(void)
A stasis_message_type for CCSS Caller Start Monitoring messages.
struct stasis_message_type * ast_cc_offertimerstart_type(void)
A stasis_message_type for CCSS Offer Timer Start messages.
struct stasis_message_type * ast_cc_requested_type(void)
A stasis_message_type for CCSS Requested messages.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
Abstract JSON element (object, array, string, int, ...).
Struct containing info for an AMI event to send out.
Support for dynamic strings.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.