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" 182 channeltype, username, domain, status,
ast_str_buffer(cause_string));
200 core_id, callee, service);
208 unsigned int expires;
218 core_id, caller, expires);
236 core_id, caller, callee);
329 core_id, caller, reason);
struct stasis_message_type * ast_cc_callerstartmonitoring_type(void)
A stasis_message_type for CCSS Caller Start Monitoring messages.
Struct containing info for an AMI event to send out.
Asterisk main include file. File version handling, generic pbx functions.
struct stasis_topic * ast_system_topic(void)
A Stasis Message Bus API topic which publishes messages regarding system changes. ...
static struct stasis_topic * system_topic
The Stasis Message Bus API topic for system level changes.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
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.
static struct ast_manager_event_blob * cc_offertimerstart_to_ami(struct stasis_message *message)
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
static struct ast_manager_event_blob * cc_callerstopmonitoring_to_ami(struct stasis_message *message)
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
static struct ast_manager_event_blob * cc_requested_to_ami(struct stasis_message *message)
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
static struct ast_manager_event_blob * cc_requestacknowledged_to_ami(struct stasis_message *message)
struct stasis_message_type * ast_network_change_type(void)
A stasis_message_type for network changes.
#define STASIS_MESSAGE_TYPE_CLEANUP(name)
Boiler-plate messaging macro for cleaning up message types.
enum ast_cc_service_type service
struct stasis_message_type * ast_cc_callerrecalling_type(void)
A stasis_message_type for CCSS Caller Recalling messages.
static struct ast_manager_event_blob * system_registry_to_ami(struct stasis_message *message)
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.
struct stasis_message_type * ast_cc_failure_type(void)
A stasis_message_type for CCSS Failure messages.
#define ast_strlen_zero(foo)
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
#define EVENT_FLAG_SYSTEM
static struct ast_manager_event_blob * cc_available_to_ami(struct stasis_message *message)
static struct ast_manager_event_blob * cc_recallcomplete_to_ami(struct stasis_message *message)
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
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.
struct stasis_message_type * ast_cc_monitorfailed_type(void)
A stasis_message_type for CCSS Monitor Failed messages.
#define ao2_ref(o, delta)
struct stasis_message_type * ast_cc_offertimerstart_type(void)
A stasis_message_type for CCSS Offer Timer Start messages.
static struct ast_manager_event_blob * cc_callerrecalling_to_ami(struct stasis_message *message)
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
static void stasis_system_cleanup(void)
Cleanup the Stasis Message Bus API system level items.
struct stasis_topic * stasis_topic_create(const char *name)
Create a new topic.
struct stasis_message_type * ast_cc_callerstopmonitoring_type(void)
A stasis_message_type for CCSS Caller Stop Monitoring messages.
static struct ast_manager_event_blob * cc_failure_to_ami(struct stasis_message *message)
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
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.
STASIS_MESSAGE_TYPE_DEFN(ast_network_change_type)
struct stasis_message_type * ast_system_registry_type(void)
A stasis_message_type for outbound registration.
struct stasis_message_type * ast_cc_recallcomplete_type(void)
A stasis_message_type for CCSS Recall Complete messages.
static struct ast_manager_event_blob * cc_monitorfailed_to_ami(struct stasis_message *message)
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
static void to_ami(struct ast_sip_subscription *sub, struct ast_str **buf)
struct stasis_message_type * ast_cluster_discovery_type(void)
A stasis_message_type for Cluster discovery.
struct stasis_message_type * ast_cc_requested_type(void)
A stasis_message_type for CCSS Requested messages.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
struct stasis_message_type * ast_cc_requestacknowledged_type(void)
A stasis_message_type for CCSS Request Acknowledged messages.
int ast_stasis_system_init(void)
Initialize the system level items for Stasis Message Bus API.
struct stasis_message_type * ast_cc_available_type(void)
A stasis_message_type for CCSS Available messages.
static struct ast_manager_event_blob * cc_callerstartmonitoring_to_ami(struct stasis_message *message)
Abstract JSON element (object, array, string, int, ...).
intmax_t ast_json_integer_get(const struct ast_json *integer)
Get the value from a JSON integer.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.