27#define GEOLOC_DS_TYPE "geoloc_eprofiles"
51 int eprofile_count = 0;
65 for (i = 0; i < eprofile_count; i++) {
84#define IS_GEOLOC_DS(_ds) (_ds && _ds->data && ast_strings_equal(_ds->info->type, GEOLOC_DS_TYPE))
106 ast_log(
LOG_ERROR,
"A geoloc datastore can't be allocated with a NULL or empty id\n");
119 ast_log(
LOG_ERROR,
"Private structure for geoloc datastore '%s' couldn't be allocated\n",
id);
128 ast_log(
LOG_ERROR,
"Vector for geoloc datastore '%s' couldn't be initialized\n",
id);
149 ast_log(
LOG_ERROR,
"Couldn't add eprofile '%s' to geoloc datastore '%s'\n", eprofile->
id, eds->
id);
170 ast_log(
LOG_ERROR,
"Couldn't add eprofile '%s' to geoloc datastore '%s' in position '%d'\n",
171 eprofile->
id, eds->
id, index);
279 ast_log(
LOG_ERROR,
"A profile with the name '%s' was not found\n", profile_name);
285 ast_log(
LOG_ERROR,
"A datastore couldn't be allocated for profile '%s'\n", profile_name);
294 ast_log(
LOG_ERROR,
"An effective profile with the name '%s' couldn't be allocated\n", profile_name);
Asterisk main include file. File version handling, generic pbx functions.
#define ast_calloc(num, len)
A wrapper for calloc()
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
General Asterisk PBX channel definitions.
#define DATASTORE_INHERIT_FOREVER
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
Asterisk datastore objects.
#define ast_datastore_alloc(info, uid)
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
struct ast_sorcery * geoloc_get_sorcery(void)
struct ast_datastore * ast_geoloc_datastore_create_from_profile_name(const char *profile_name)
Geolocation datastore Functions.
int geoloc_channel_reload(void)
struct ast_geoloc_eprofile * ast_geoloc_datastore_get_eprofile(struct ast_datastore *ds, int ix)
Retrieve a specific eprofile from a datastore by index.
struct ast_datastore * ast_geoloc_datastore_create_from_eprofile(struct ast_geoloc_eprofile *eprofile)
Create a geoloc datastore from an effective profile.
static void geoloc_datastore_free(void *obj)
static void * geoloc_datastore_duplicate(void *obj)
struct ast_sorcery * geoloc_sorcery
int ast_geoloc_datastore_insert_eprofile(struct ast_datastore *ds, struct ast_geoloc_eprofile *eprofile, int index)
Insert an eprofile to a datastore at the specified position.
int geoloc_channel_load(void)
const char * ast_geoloc_datastore_get_id(struct ast_datastore *ds)
Retrieve a geoloc datastore's id.
struct ast_datastore * ast_geoloc_datastore_create(const char *id)
Create an empty geoloc datastore.
#define IS_GEOLOC_DS(_ds)
static const struct ast_datastore_info geoloc_datastore_info
int ast_geoloc_datastore_set_inheritance(struct ast_datastore *ds, int inherit)
Sets the inheritance flag on the datastore.
int ast_geoloc_datastore_add_eprofile(struct ast_datastore *ds, struct ast_geoloc_eprofile *eprofile)
Add an eprofile to a datastore.
int ast_geoloc_datastore_size(struct ast_datastore *ds)
Retrieves the number of eprofiles in the datastore.
struct ast_datastore * ast_geoloc_datastore_find(struct ast_channel *chan)
Retrieves the geoloc datastore from a channel, if any.
int geoloc_channel_unload(void)
int ast_geoloc_datastore_delete_eprofile(struct ast_datastore *ds, int ix)
Delete a specific eprofile from a datastore by index.
@ AST_MODULE_LOAD_SUCCESS
struct ast_geoloc_eprofile * ast_geoloc_eprofile_create_from_profile(struct ast_geoloc_profile *profile)
Allocate a new effective profile from an existing profile.
#define ast_sorcery_unref(sorcery)
Decrease the reference count of a sorcery structure.
void * ast_sorcery_retrieve_by_id(const struct ast_sorcery *sorcery, const char *type, const char *id)
Retrieve an object using its unique identifier.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Main Channel structure associated with a channel.
Structure for a data store type.
Structure for a data store object.
const ast_string_field id
Full structure for sorcery.
struct eprofiles_datastore::geoloc_eprofiles eprofiles
Vector container support.
#define AST_VECTOR_RESET(vec, cleanup)
Reset vector.
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
#define AST_VECTOR_INSERT_AT(vec, idx, elem)
Insert an element at a specific position in a vector, growing the vector if needed.
#define AST_VECTOR_FREE(vec)
Deallocates this vector.
#define AST_VECTOR_REMOVE(vec, idx, preserve_ordered)
Remove an element from a vector by index.
#define AST_VECTOR_INIT(vec, size)
Initialize a vector.
#define AST_VECTOR_APPEND(vec, elem)
Append an element to a vector, growing the vector if needed.
#define AST_VECTOR(name, type)
Define a vector structure.
#define AST_VECTOR_GET(vec, idx)
Get an element from a vector.