Exemple #1
0
static int contacts_to_var_list(const void *obj, struct ast_variable **fields)
{
	const struct ast_sip_aor *aor = obj;

	ast_sip_for_each_contact(aor, contact_to_var_list, fields);

	return 0;
}
Exemple #2
0
static int contacts_to_str(const void *obj, const intptr_t *args, char **buf)
{
	const struct ast_sip_aor *aor = obj;
	RAII_VAR(struct ast_str *, str, ast_str_create(MAX_OBJECT_FIELD), ast_free);

	ast_sip_for_each_contact(aor, ast_sip_contact_to_str, &str);
	ast_str_truncate(str, -1);

	*buf = ast_strdup(ast_str_buffer(str));
	if (!*buf) {
		return -1;
	}

	return 0;
}
Exemple #3
0
static int contacts_to_str(const void *obj, const intptr_t *args, char **buf)
{
	const struct ast_sip_aor *aor = obj;
	struct ast_str *str;

	str = ast_str_create(MAX_OBJECT_FIELD);
	if (!str) {
		*buf = NULL;
		return -1;
	}

	ast_sip_for_each_contact(aor, ast_sip_contact_to_str, &str);
	ast_str_truncate(str, -1);

	*buf = ast_strdup(ast_str_buffer(str));
	ast_free(str);

	return *buf ? 0 : -1;
}
static int ami_registrations_aor(void *obj, void *arg, int flags)
{
	struct ast_sip_aor *aor = obj;
	struct ast_sip_ami *ami = arg;
	int *count = ami->arg;
	RAII_VAR(struct ast_str *, buf,
		 ast_sip_create_ami_event("InboundRegistrationDetail", ami), ast_free);

	if (!buf) {
		return -1;
	}

	ast_sip_sorcery_object_to_ami(aor, &buf);
	ast_str_append(&buf, 0, "Contacts: ");
	ast_sip_for_each_contact(aor, sip_contact_to_str, &buf);
	ast_str_append(&buf, 0, "\r\n");

	astman_append(ami->s, "%s\r\n", ast_str_buffer(buf));
	(*count)++;
	return 0;
}
Exemple #5
0
static int cli_contact_iterate(void *container, ao2_callback_fn callback, void *args)
{
	return ast_sip_for_each_contact(container, callback, args);
}
Exemple #6
0
static int cli_aor_gather_contacts(void *obj, void *arg, int flags)
{
	struct ast_sip_aor *aor = obj;

	return ast_sip_for_each_contact(aor, cli_contact_populate_container, arg);
}
static int format_contact_status_for_aor(void *obj, void *arg, int flags)
{
	struct ast_sip_aor *aor = obj;

	return ast_sip_for_each_contact(aor, format_contact_status, arg);
}