|
|
|
@ -119,9 +119,9 @@ STASIS_MESSAGE_TYPE_DEFN(ast_cluster_discovery_type);
|
|
|
|
|
|
|
|
|
|
void ast_system_publish_registry(const char *channeltype, const char *username, const char *domain, const char *status, const char *cause)
|
|
|
|
|
{
|
|
|
|
|
RAII_VAR(struct ast_json *, registry, NULL, ast_json_unref);
|
|
|
|
|
RAII_VAR(struct ast_json_payload *, payload, NULL, ao2_cleanup);
|
|
|
|
|
RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
|
|
|
|
|
struct ast_json *registry;
|
|
|
|
|
struct ast_json_payload *payload;
|
|
|
|
|
struct stasis_message *message;
|
|
|
|
|
|
|
|
|
|
if (!ast_system_registry_type()) {
|
|
|
|
|
return;
|
|
|
|
@ -135,15 +135,20 @@ void ast_system_publish_registry(const char *channeltype, const char *username,
|
|
|
|
|
"status", status,
|
|
|
|
|
"cause", S_OR(cause, ""));
|
|
|
|
|
|
|
|
|
|
if (!(payload = ast_json_payload_create(registry))) {
|
|
|
|
|
payload = ast_json_payload_create(registry);
|
|
|
|
|
ast_json_unref(registry);
|
|
|
|
|
if (!payload) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!(message = stasis_message_create(ast_system_registry_type(), payload))) {
|
|
|
|
|
message = stasis_message_create(ast_system_registry_type(), payload);
|
|
|
|
|
ao2_ref(payload, -1);
|
|
|
|
|
if (!message) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stasis_publish(ast_system_topic(), message);
|
|
|
|
|
ao2_ref(message, -1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static struct ast_manager_event_blob *system_registry_to_ami(struct stasis_message *message)
|
|
|
|
|