Asterisk - The Open Source Telephony Project GIT-master-8f1982c
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
Functions | Variables
stasis_system.c File Reference

Stasis Messages and Data Types for System events. More...

#include "asterisk.h"
#include "asterisk/astobj2.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_system.h"
Include dependency graph for stasis_system.c:

Go to the source code of this file.

Functions

int ast_stasis_system_init (void)
 Initialize the system level items for Stasis Message Bus API. More...
 
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. More...
 
struct stasis_topicast_system_topic (void)
 A Stasis Message Bus API topic which publishes messages regarding system changes. More...
 
static struct ast_manager_event_blobcc_available_to_ami (struct stasis_message *message)
 
static struct ast_manager_event_blobcc_callerrecalling_to_ami (struct stasis_message *message)
 
static struct ast_manager_event_blobcc_callerstartmonitoring_to_ami (struct stasis_message *message)
 
static struct ast_manager_event_blobcc_callerstopmonitoring_to_ami (struct stasis_message *message)
 
static struct ast_manager_event_blobcc_failure_to_ami (struct stasis_message *message)
 
static struct ast_manager_event_blobcc_monitorfailed_to_ami (struct stasis_message *message)
 
static struct ast_manager_event_blobcc_offertimerstart_to_ami (struct stasis_message *message)
 
static struct ast_manager_event_blobcc_recallcomplete_to_ami (struct stasis_message *message)
 
static struct ast_manager_event_blobcc_requestacknowledged_to_ami (struct stasis_message *message)
 
static struct ast_manager_event_blobcc_requested_to_ami (struct stasis_message *message)
 
 STASIS_MESSAGE_TYPE_DEFN (ast_cc_available_type,.to_ami=cc_available_to_ami,)
 
 STASIS_MESSAGE_TYPE_DEFN (ast_cc_callerrecalling_type,.to_ami=cc_callerrecalling_to_ami,)
 
 STASIS_MESSAGE_TYPE_DEFN (ast_cc_callerstartmonitoring_type,.to_ami=cc_callerstartmonitoring_to_ami,)
 
 STASIS_MESSAGE_TYPE_DEFN (ast_cc_callerstopmonitoring_type,.to_ami=cc_callerstopmonitoring_to_ami,)
 
 STASIS_MESSAGE_TYPE_DEFN (ast_cc_failure_type,.to_ami=cc_failure_to_ami,)
 
 STASIS_MESSAGE_TYPE_DEFN (ast_cc_monitorfailed_type,.to_ami=cc_monitorfailed_to_ami,)
 
 STASIS_MESSAGE_TYPE_DEFN (ast_cc_offertimerstart_type,.to_ami=cc_offertimerstart_to_ami,)
 
 STASIS_MESSAGE_TYPE_DEFN (ast_cc_recallcomplete_type,.to_ami=cc_recallcomplete_to_ami,)
 
 STASIS_MESSAGE_TYPE_DEFN (ast_cc_requestacknowledged_type,.to_ami=cc_requestacknowledged_to_ami,)
 
 STASIS_MESSAGE_TYPE_DEFN (ast_cc_requested_type,.to_ami=cc_requested_to_ami,)
 
 STASIS_MESSAGE_TYPE_DEFN (ast_cluster_discovery_type)
 
 STASIS_MESSAGE_TYPE_DEFN (ast_network_change_type)
 
 STASIS_MESSAGE_TYPE_DEFN (ast_system_registry_type,.to_ami=system_registry_to_ami,)
 
static void stasis_system_cleanup (void)
 Cleanup the Stasis Message Bus API system level items. More...
 
static struct ast_manager_event_blobsystem_registry_to_ami (struct stasis_message *message)
 

Variables

static struct stasis_topicsystem_topic
 The Stasis Message Bus API topic for system level changes. More...
 

Detailed Description

Stasis Messages and Data Types for System events.

Author
Jason Parker jpark.nosp@m.er@d.nosp@m.igium.nosp@m..com

Definition in file stasis_system.c.

Function Documentation

◆ ast_stasis_system_init()

int ast_stasis_system_init ( void  )

Initialize the system level items for Stasis Message Bus API.

Initialize the stasis system topic and message types.

Definition at line 376 of file stasis_system.c.

377{
379
380 system_topic = stasis_topic_create("system:all");
381 if (!system_topic) {
382 return 1;
383 }
384
386 return -1;
387 }
388
390 return -1;
391 }
392
394 return -1;
395 }
396
398 return -1;
399 }
400
402 return -1;
403 }
404
406 return -1;
407 }
408
410 return -1;
411 }
412
414 return -1;
415 }
416
418 return -1;
419 }
420
422 return -1;
423 }
424
426 return -1;
427 }
428
430 return -1;
431 }
432
434 return -1;
435 }
436
437 return 0;
438}
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
Definition: clicompat.c:19
struct stasis_topic * stasis_topic_create(const char *name)
Create a new topic.
Definition: stasis.c:644
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
Definition: stasis.h:1493
static struct stasis_topic * system_topic
The Stasis Message Bus API topic for system level changes.
Definition: stasis_system.c:71
static void stasis_system_cleanup(void)
Cleanup the Stasis Message Bus API system level items.
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.

References ast_cc_available_type(), ast_cc_callerrecalling_type(), ast_cc_callerstartmonitoring_type(), ast_cc_callerstopmonitoring_type(), ast_cc_failure_type(), ast_cc_monitorfailed_type(), ast_cc_offertimerstart_type(), ast_cc_recallcomplete_type(), ast_cc_requestacknowledged_type(), ast_cc_requested_type(), ast_cluster_discovery_type(), ast_network_change_type(), ast_register_cleanup(), ast_system_registry_type(), STASIS_MESSAGE_TYPE_INIT, stasis_system_cleanup(), stasis_topic_create(), and system_topic.

Referenced by asterisk_daemon().

◆ ast_system_publish_registry()

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.

Since
12
Parameters
channeltypeThe channel driver that published the message
usernameThe username that was used to register
domainThe domain that was used to register
statusThe result of the registration
causeThe reason for the result

Definition at line 121 of file stasis_system.c.

122{
123 struct ast_json *registry;
124 struct ast_json_payload *payload;
125 struct stasis_message *message;
126
128 return;
129 }
130
131 registry = ast_json_pack("{s: s, s: s, s: s, s: s, s: s, s: s}",
132 "type", "registry",
133 "channeltype", channeltype,
134 "username", username,
135 "domain", domain,
136 "status", status,
137 "cause", S_OR(cause, ""));
138
139 payload = ast_json_payload_create(registry);
140 ast_json_unref(registry);
141 if (!payload) {
142 return;
143 }
144
146 ao2_ref(payload, -1);
147 if (!message) {
148 return;
149 }
150
152 ao2_ref(message, -1);
153}
jack_status_t status
Definition: app_jack.c:149
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:459
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
Definition: json.c:73
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.
Definition: json.c:756
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
Definition: json.c:612
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.
Definition: stasis.c:1538
struct stasis_topic * ast_system_topic(void)
A Stasis Message Bus API topic which publishes messages regarding system changes.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
Definition: strings.h:80
Abstract JSON element (object, array, string, int, ...).

References ao2_ref, ast_json_pack(), ast_json_payload_create(), ast_json_unref(), ast_system_registry_type(), ast_system_topic(), S_OR, stasis_message_create(), stasis_publish(), and status.

Referenced by handle_registration_response(), and iax2_publish_registry().

◆ ast_system_topic()

struct stasis_topic * ast_system_topic ( void  )

A Stasis Message Bus API topic which publishes messages regarding system changes.

Since
12
Returns
stasis_topic for system level changes
Return values
NULLon error

Definition at line 350 of file stasis_system.c.

351{
352 return system_topic;
353}

References system_topic.

Referenced by ast_system_publish_registry(), cc_publish(), load_module(), manager_system_init(), network_change_stasis_subscribe(), pjsip_outbound_registration_metrics_init(), publish_cluster_discovery_to_stasis_full(), publish_format_update(), and stun_monitor_request().

◆ cc_available_to_ami()

static struct ast_manager_event_blob * cc_available_to_ami ( struct stasis_message message)
static

Definition at line 188 of file stasis_system.c.

189{
191 int core_id;
192 const char *callee;
193 const char *service;
194
195 core_id = ast_json_integer_get(ast_json_object_get(payload->json, "core_id"));
196 callee = ast_json_string_get(ast_json_object_get(payload->json, "callee"));
197 service = ast_json_string_get(ast_json_object_get(payload->json, "service"));
198
199 return ast_manager_event_blob_create(EVENT_FLAG_CC, "CCAvailable",
200 "CoreID: %d\r\n"
201 "Callee: %s\r\n"
202 "Service: %s\r\n",
203 core_id, callee, service);
204}
enum ast_cc_service_type service
Definition: ccss.c:389
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
Definition: json.c:283
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Definition: json.c:407
intmax_t ast_json_integer_get(const struct ast_json *integer)
Get the value from a JSON integer.
Definition: json.c:332
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.
Definition: manager.c:10237
#define EVENT_FLAG_CC
Definition: manager.h:90
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
struct ast_json * json
Definition: json.h:1083

References ast_json_integer_get(), ast_json_object_get(), ast_json_string_get(), ast_manager_event_blob_create(), EVENT_FLAG_CC, ast_json_payload::json, service, and stasis_message_data().

◆ cc_callerrecalling_to_ami()

static struct ast_manager_event_blob * cc_callerrecalling_to_ami ( struct stasis_message message)
static

Definition at line 287 of file stasis_system.c.

288{
290 int core_id;
291 const char *caller;
292
293 core_id = ast_json_integer_get(ast_json_object_get(payload->json, "core_id"));
294 caller = ast_json_string_get(ast_json_object_get(payload->json, "caller"));
295
296 return ast_manager_event_blob_create(EVENT_FLAG_CC, "CCCallerRecalling",
297 "CoreID: %d\r\n"
298 "Caller: %s\r\n",
299 core_id, caller);
300}

References ast_json_integer_get(), ast_json_object_get(), ast_json_string_get(), ast_manager_event_blob_create(), EVENT_FLAG_CC, ast_json_payload::json, and stasis_message_data().

◆ cc_callerstartmonitoring_to_ami()

static struct ast_manager_event_blob * cc_callerstartmonitoring_to_ami ( struct stasis_message message)
static

Definition at line 272 of file stasis_system.c.

273{
275 int core_id;
276 const char *caller;
277
278 core_id = ast_json_integer_get(ast_json_object_get(payload->json, "core_id"));
279 caller = ast_json_string_get(ast_json_object_get(payload->json, "caller"));
280
281 return ast_manager_event_blob_create(EVENT_FLAG_CC, "CCCallerStartMonitoring",
282 "CoreID: %d\r\n"
283 "Caller: %s\r\n",
284 core_id, caller);
285}

References ast_json_integer_get(), ast_json_object_get(), ast_json_string_get(), ast_manager_event_blob_create(), EVENT_FLAG_CC, ast_json_payload::json, and stasis_message_data().

◆ cc_callerstopmonitoring_to_ami()

static struct ast_manager_event_blob * cc_callerstopmonitoring_to_ami ( struct stasis_message message)
static

Definition at line 257 of file stasis_system.c.

258{
260 int core_id;
261 const char *caller;
262
263 core_id = ast_json_integer_get(ast_json_object_get(payload->json, "core_id"));
264 caller = ast_json_string_get(ast_json_object_get(payload->json, "caller"));
265
266 return ast_manager_event_blob_create(EVENT_FLAG_CC, "CCCallerStopMonitoring",
267 "CoreID: %d\r\n"
268 "Caller: %s\r\n",
269 core_id, caller);
270}

References ast_json_integer_get(), ast_json_object_get(), ast_json_string_get(), ast_manager_event_blob_create(), EVENT_FLAG_CC, ast_json_payload::json, and stasis_message_data().

◆ cc_failure_to_ami()

static struct ast_manager_event_blob * cc_failure_to_ami ( struct stasis_message message)
static

Definition at line 317 of file stasis_system.c.

318{
320 int core_id;
321 const char *caller;
322 const char *reason;
323
324 core_id = ast_json_integer_get(ast_json_object_get(payload->json, "core_id"));
325 caller = ast_json_string_get(ast_json_object_get(payload->json, "caller"));
326 reason = ast_json_string_get(ast_json_object_get(payload->json, "reason"));
327
329 "CoreID: %d\r\n"
330 "Caller: %s\r\n"
331 "Reason: %s\r\n",
332 core_id, caller, reason);
333}

References ast_json_integer_get(), ast_json_object_get(), ast_json_string_get(), ast_manager_event_blob_create(), EVENT_FLAG_CC, ast_json_payload::json, and stasis_message_data().

◆ cc_monitorfailed_to_ami()

static struct ast_manager_event_blob * cc_monitorfailed_to_ami ( struct stasis_message message)
static

Definition at line 335 of file stasis_system.c.

336{
338 int core_id;
339 const char *callee;
340
341 core_id = ast_json_integer_get(ast_json_object_get(payload->json, "core_id"));
342 callee = ast_json_string_get(ast_json_object_get(payload->json, "callee"));
343
344 return ast_manager_event_blob_create(EVENT_FLAG_CC, "CCMonitorFailed",
345 "CoreID: %d\r\n"
346 "Callee: %s\r\n",
347 core_id, callee);
348}

References ast_json_integer_get(), ast_json_object_get(), ast_json_string_get(), ast_manager_event_blob_create(), EVENT_FLAG_CC, ast_json_payload::json, and stasis_message_data().

◆ cc_offertimerstart_to_ami()

static struct ast_manager_event_blob * cc_offertimerstart_to_ami ( struct stasis_message message)
static

Definition at line 206 of file stasis_system.c.

207{
209 int core_id;
210 const char *caller;
211 unsigned int expires;
212
213 core_id = ast_json_integer_get(ast_json_object_get(payload->json, "core_id"));
214 caller = ast_json_string_get(ast_json_object_get(payload->json, "caller"));
215 expires = ast_json_integer_get(ast_json_object_get(payload->json, "expires"));
216
217 return ast_manager_event_blob_create(EVENT_FLAG_CC, "CCOfferTimerStart",
218 "CoreID: %d\r\n"
219 "Caller: %s\r\n"
220 "Expires: %u\r\n",
221 core_id, caller, expires);
222}

References ast_json_integer_get(), ast_json_object_get(), ast_json_string_get(), ast_manager_event_blob_create(), EVENT_FLAG_CC, ast_json_payload::json, and stasis_message_data().

◆ cc_recallcomplete_to_ami()

static struct ast_manager_event_blob * cc_recallcomplete_to_ami ( struct stasis_message message)
static

Definition at line 302 of file stasis_system.c.

303{
305 int core_id;
306 const char *caller;
307
308 core_id = ast_json_integer_get(ast_json_object_get(payload->json, "core_id"));
309 caller = ast_json_string_get(ast_json_object_get(payload->json, "caller"));
310
311 return ast_manager_event_blob_create(EVENT_FLAG_CC, "CCRecallComplete",
312 "CoreID: %d\r\n"
313 "Caller: %s\r\n",
314 core_id, caller);
315}

References ast_json_integer_get(), ast_json_object_get(), ast_json_string_get(), ast_manager_event_blob_create(), EVENT_FLAG_CC, ast_json_payload::json, and stasis_message_data().

◆ cc_requestacknowledged_to_ami()

static struct ast_manager_event_blob * cc_requestacknowledged_to_ami ( struct stasis_message message)
static

Definition at line 242 of file stasis_system.c.

243{
245 int core_id;
246 const char *caller;
247
248 core_id = ast_json_integer_get(ast_json_object_get(payload->json, "core_id"));
249 caller = ast_json_string_get(ast_json_object_get(payload->json, "caller"));
250
251 return ast_manager_event_blob_create(EVENT_FLAG_CC, "CCRequestAcknowledged",
252 "CoreID: %d\r\n"
253 "Caller: %s\r\n",
254 core_id, caller);
255}

References ast_json_integer_get(), ast_json_object_get(), ast_json_string_get(), ast_manager_event_blob_create(), EVENT_FLAG_CC, ast_json_payload::json, and stasis_message_data().

◆ cc_requested_to_ami()

static struct ast_manager_event_blob * cc_requested_to_ami ( struct stasis_message message)
static

Definition at line 224 of file stasis_system.c.

225{
227 int core_id;
228 const char *caller;
229 const char *callee;
230
231 core_id = ast_json_integer_get(ast_json_object_get(payload->json, "core_id"));
232 caller = ast_json_string_get(ast_json_object_get(payload->json, "caller"));
233 callee = ast_json_string_get(ast_json_object_get(payload->json, "callee"));
234
235 return ast_manager_event_blob_create(EVENT_FLAG_CC, "CCRequested",
236 "CoreID: %d\r\n"
237 "Caller: %s\r\n"
238 "Callee: %s\r\n",
239 core_id, caller, callee);
240}

References ast_json_integer_get(), ast_json_object_get(), ast_json_string_get(), ast_manager_event_blob_create(), EVENT_FLAG_CC, ast_json_payload::json, and stasis_message_data().

◆ STASIS_MESSAGE_TYPE_DEFN() [1/13]

STASIS_MESSAGE_TYPE_DEFN ( ast_cc_available_type  ,
to_ami = cc_available_to_ami 
)

◆ STASIS_MESSAGE_TYPE_DEFN() [2/13]

STASIS_MESSAGE_TYPE_DEFN ( ast_cc_callerrecalling_type  ,
to_ami = cc_callerrecalling_to_ami 
)

◆ STASIS_MESSAGE_TYPE_DEFN() [3/13]

STASIS_MESSAGE_TYPE_DEFN ( ast_cc_callerstartmonitoring_type  ,
to_ami = cc_callerstartmonitoring_to_ami 
)

◆ STASIS_MESSAGE_TYPE_DEFN() [4/13]

STASIS_MESSAGE_TYPE_DEFN ( ast_cc_callerstopmonitoring_type  ,
to_ami = cc_callerstopmonitoring_to_ami 
)

◆ STASIS_MESSAGE_TYPE_DEFN() [5/13]

STASIS_MESSAGE_TYPE_DEFN ( ast_cc_failure_type  ,
to_ami = cc_failure_to_ami 
)

◆ STASIS_MESSAGE_TYPE_DEFN() [6/13]

STASIS_MESSAGE_TYPE_DEFN ( ast_cc_monitorfailed_type  ,
to_ami = cc_monitorfailed_to_ami 
)

◆ STASIS_MESSAGE_TYPE_DEFN() [7/13]

STASIS_MESSAGE_TYPE_DEFN ( ast_cc_offertimerstart_type  ,
to_ami = cc_offertimerstart_to_ami 
)

◆ STASIS_MESSAGE_TYPE_DEFN() [8/13]

STASIS_MESSAGE_TYPE_DEFN ( ast_cc_recallcomplete_type  ,
to_ami = cc_recallcomplete_to_ami 
)

◆ STASIS_MESSAGE_TYPE_DEFN() [9/13]

STASIS_MESSAGE_TYPE_DEFN ( ast_cc_requestacknowledged_type  ,
to_ami = cc_requestacknowledged_to_ami 
)

◆ STASIS_MESSAGE_TYPE_DEFN() [10/13]

STASIS_MESSAGE_TYPE_DEFN ( ast_cc_requested_type  ,
to_ami = cc_requested_to_ami 
)

◆ STASIS_MESSAGE_TYPE_DEFN() [11/13]

STASIS_MESSAGE_TYPE_DEFN ( ast_cluster_discovery_type  )

◆ STASIS_MESSAGE_TYPE_DEFN() [12/13]

STASIS_MESSAGE_TYPE_DEFN ( ast_network_change_type  )

◆ STASIS_MESSAGE_TYPE_DEFN() [13/13]

STASIS_MESSAGE_TYPE_DEFN ( ast_system_registry_type  ,
to_ami = system_registry_to_ami 
)

◆ stasis_system_cleanup()

static void stasis_system_cleanup ( void  )
static

Cleanup the Stasis Message Bus API system level items.

Definition at line 356 of file stasis_system.c.

References ao2_cleanup, ast_cc_available_type(), ast_cc_callerrecalling_type(), ast_cc_callerstartmonitoring_type(), ast_cc_callerstopmonitoring_type(), ast_cc_failure_type(), ast_cc_monitorfailed_type(), ast_cc_offertimerstart_type(), ast_cc_recallcomplete_type(), ast_cc_requestacknowledged_type(), ast_cc_requested_type(), ast_cluster_discovery_type(), ast_network_change_type(), ast_system_registry_type(), NULL, STASIS_MESSAGE_TYPE_CLEANUP, and system_topic.

Referenced by ast_stasis_system_init().

◆ system_registry_to_ami()

static struct ast_manager_event_blob * system_registry_to_ami ( struct stasis_message message)
static

Definition at line 155 of file stasis_system.c.

156{
158 const char *channeltype;
159 const char *username;
160 const char *domain;
161 const char *status;
162 const char *cause;
163 RAII_VAR(struct ast_str *, cause_string, ast_str_create(32), ast_free);
164
165 if (!cause_string) {
166 return NULL;
167 }
168
169 channeltype = ast_json_string_get(ast_json_object_get(payload->json, "channeltype"));
170 username = ast_json_string_get(ast_json_object_get(payload->json, "username"));
171 domain = ast_json_string_get(ast_json_object_get(payload->json, "domain"));
172 status = ast_json_string_get(ast_json_object_get(payload->json, "status"));
173 cause = ast_json_string_get(ast_json_object_get(payload->json, "cause"));
174
175 if (!ast_strlen_zero(cause)) {
176 ast_str_set(&cause_string, 0, "Cause: %s\r\n", cause);
177 }
178
180 "ChannelType: %s\r\n"
181 "Username: %s\r\n"
182 "Domain: %s\r\n"
183 "Status: %s\r\n"
184 "%s",
185 channeltype, username, domain, status, ast_str_buffer(cause_string));
186}
#define ast_free(a)
Definition: astmm.h:180
#define EVENT_FLAG_SYSTEM
Definition: manager.h:75
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
Definition: strings.h:761
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Definition: strings.h:65
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
Definition: strings.h:659
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
Definition: strings.h:1113
Support for dynamic strings.
Definition: strings.h:623
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:941

References ast_free, ast_json_object_get(), ast_json_string_get(), ast_manager_event_blob_create(), ast_str_buffer(), ast_str_create, ast_str_set(), ast_strlen_zero(), EVENT_FLAG_SYSTEM, ast_json_payload::json, NULL, RAII_VAR, stasis_message_data(), and status.

Variable Documentation

◆ system_topic

struct stasis_topic* system_topic
static

The Stasis Message Bus API topic for system level changes.

Definition at line 71 of file stasis_system.c.

Referenced by ast_stasis_system_init(), ast_system_topic(), manager_system_init(), and stasis_system_cleanup().