19#ifndef INCLUDE_ASTERISK_RES_GEOLOCATION_H_
20#define INCLUDE_ASTERISK_RES_GEOLOCATION_H_
28#define AST_GEOLOC_INVALID_VALUE -1
53#define CONFIG_STR_TO_ENUM_DECL(_stem) int ast_geoloc_ ## _stem ## _str_to_enum(const char *str);
57#define GEOLOC_ENUM_TO_NAME_DECL(_stem) const char * ast_geoloc_ ## _stem ## _to_name(int ix);
348 struct ast_xml_doc *pidf_xmldoc,
const char *geoloc_uri,
const char *reference_string);
359 const char *reference_string);
General Asterisk PBX channel definitions.
Configuration File Parser.
Optional API function macros.
#define AST_OPTIONAL_API(result, name, proto, stub)
Declare an optional API function.
@ AST_GEOLOC_PRECED_DISCARD_CONFIG
@ AST_GEOLOC_PRECED_PREFER_CONFIG
@ AST_GEOLOC_PRECED_DISCARD_INCOMING
@ AST_GEOLOC_PRECED_PREFER_INCOMING
struct ast_datastore * ast_geoloc_datastore_create_from_profile_name(const char *profile_name)
Geolocation datastore Functions.
int ast_geoloc_eprofile_refresh_location(struct ast_geoloc_eprofile *eprofile)
Refresh the effective profile with any changed info.
struct ast_geoloc_eprofile * ast_geoloc_eprofile_dup(struct ast_geoloc_eprofile *src)
Duplicate an effective profile.
const char * ast_geoloc_validate_result_to_str(enum ast_geoloc_validate_result result)
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.
#define CONFIG_STR_TO_ENUM_DECL(_stem)
ast_geoloc_validate_result
@ AST_GEOLOC_VALIDATE_TOO_MANY_VARNAMES
@ AST_GEOLOC_VALIDATE_MISSING_SHAPE
@ AST_GEOLOC_VALIDATE_INVALID_VALUE
@ AST_GEOLOC_VALIDATE_SUCCESS
@ AST_GEOLOC_VALIDATE_NOT_ENOUGH_VARNAMES
@ AST_GEOLOC_VALIDATE_INVALID_SHAPE
@ AST_GEOLOC_VALIDATE_INVALID_VARNAME
const char * ast_geoloc_eprofiles_to_pidf(struct ast_datastore *ds, struct ast_channel *chan, struct ast_str **buf, const char *ref_string)
Convert a datastore containing eprofiles to a PIDF-LO document.
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.
enum ast_geoloc_validate_result ast_geoloc_civicaddr_validate_varlist(const struct ast_variable *varlist, const char **result)
Validate that the names of the variables in the list are valid codes or synonyms.
const char * ast_geoloc_eprofile_to_uri(struct ast_geoloc_eprofile *eprofile, struct ast_channel *chan, struct ast_str **buf, const char *ref_string)
Convert a URI eprofile to a URI string.
struct ast_geoloc_eprofile * ast_geoloc_eprofile_create_from_pidf(struct ast_xml_doc *pidf_xmldoc, const char *geoloc_uri, const char *reference_string)
Allocate a new effective profile from an XML PIDF-LO document.
struct ast_geoloc_eprofile * ast_geoloc_eprofile_create_from_uri(const char *uri, const char *reference_string)
Allocate a new effective profile from a URI.
struct ast_geoloc_profile * ast_geoloc_get_profile(const char *id)
Retrieve a geolocation profile by id.
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.
@ AST_PIDF_ELEMENT_PERSON
@ AST_PIDF_ELEMENT_DEVICE
int ast_geoloc_is_loaded(void)
Check if res_geolocation is available.
@ AST_GEOLOC_FORMAT_CIVIC_ADDRESS
struct ast_geoloc_eprofile * ast_geoloc_eprofile_alloc(const char *name)
Geolocation Effective Profile Functions.
struct ast_geoloc_location * ast_geoloc_get_location(const char *id)
Retrieve a geolocation location object by id.
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.
const char * ast_geoloc_eprofile_to_pidf(struct ast_geoloc_eprofile *eprofile, struct ast_channel *chan, struct ast_str **buf, const char *ref_string)
Convert a single eprofile to a PIDF-LO document.
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.
struct ast_geoloc_eprofile * ast_geoloc_eprofile_create_from_profile(struct ast_geoloc_profile *profile)
Allocate a new effective profile from an existing profile.
enum ast_geoloc_validate_result ast_geoloc_gml_validate_varlist(const struct ast_variable *varlist, const char **result)
Validate that the variables in the list represent a valid GML shape.
int ast_geoloc_civicaddr_is_code_valid(const char *code)
Given a civicAddress code, check whether it's valid.
int ast_geoloc_datastore_delete_eprofile(struct ast_datastore *ds, int ix)
Delete a specific eprofile from a datastore by index.
#define GEOLOC_ENUM_TO_NAME_DECL(_stem)
Sorcery Data Access Layer API.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
#define AST_STRING_FIELD(name)
Declare a string field.
Main Channel structure associated with a channel.
Structure for a data store object.
struct ast_variable * effective_location
const ast_string_field location_reference
enum ast_geoloc_format format
enum ast_geoloc_pidf_element pidf_element
const ast_string_field method
struct ast_variable * location_refinement
enum ast_geoloc_precedence precedence
const ast_string_field notes
int suppress_empty_ca_elements
struct ast_variable * location_variables
struct ast_variable * confidence
struct ast_variable * usage_rules
const ast_string_field location_source
struct ast_variable * location_info
enum ast_geoloc_format format
struct ast_variable * confidence
struct ast_variable * location_info
const ast_string_field location_reference
enum ast_geoloc_format format
enum ast_geoloc_pidf_element pidf_element
const ast_string_field method
struct ast_variable * location_refinement
enum ast_geoloc_precedence precedence
const ast_string_field notes
int suppress_empty_ca_elements
struct ast_variable * location_variables
struct ast_variable * confidence
struct ast_variable * usage_rules
const ast_string_field location_source
struct ast_variable * location_info
Support for dynamic strings.
Structure for variables, used for configurations and for channel variables.
Asterisk XML abstraction layer.