19 #ifndef INCLUDE_ASTERISK_RES_GEOLOCATION_H_
20 #define INCLUDE_ASTERISK_RES_GEOLOCATION_H_
28 #define AST_GEOLOC_INVALID_VALUE -1
30 enum ast_geoloc_pidf_element {
31 AST_PIDF_ELEMENT_NONE = 0,
32 AST_PIDF_ELEMENT_DEVICE,
33 AST_PIDF_ELEMENT_TUPLE,
34 AST_PIDF_ELEMENT_PERSON,
35 AST_PIDF_ELEMENT_LAST,
38 enum ast_geoloc_format {
39 AST_GEOLOC_FORMAT_NONE = 0,
40 AST_GEOLOC_FORMAT_CIVIC_ADDRESS,
41 AST_GEOLOC_FORMAT_GML,
42 AST_GEOLOC_FORMAT_URI,
43 AST_GEOLOC_FORMAT_LAST,
46 enum ast_geoloc_precedence {
47 AST_GEOLOC_PRECED_PREFER_INCOMING = 0,
48 AST_GEOLOC_PRECED_PREFER_CONFIG,
49 AST_GEOLOC_PRECED_DISCARD_INCOMING,
50 AST_GEOLOC_PRECED_DISCARD_CONFIG,
53 #define CONFIG_STR_TO_ENUM_DECL(_stem) int ast_geoloc_ ## _stem ## _str_to_enum(const char *str);
54 CONFIG_STR_TO_ENUM_DECL(pidf_element)
55 CONFIG_STR_TO_ENUM_DECL(format);
56 CONFIG_STR_TO_ENUM_DECL(precedence);
57 #define GEOLOC_ENUM_TO_NAME_DECL(_stem) const char * ast_geoloc_ ## _stem ## _to_name(int ix);
58 GEOLOC_ENUM_TO_NAME_DECL(pidf_element)
59 GEOLOC_ENUM_TO_NAME_DECL(format);
60 GEOLOC_ENUM_TO_NAME_DECL(precedence);
68 enum ast_geoloc_format format;
74 SORCERY_OBJECT(details);
81 enum ast_geoloc_pidf_element pidf_element;
82 enum ast_geoloc_precedence precedence;
83 int allow_routing_use;
87 int suppress_empty_ca_elements;
88 enum ast_geoloc_format format;
101 enum ast_geoloc_pidf_element pidf_element;
102 enum ast_geoloc_precedence precedence;
103 int allow_routing_use;
104 enum ast_geoloc_format format;
111 int suppress_empty_ca_elements;
150 int ast_geoloc_civicaddr_is_code_valid(
const char *code);
152 enum ast_geoloc_validate_result {
153 AST_GEOLOC_VALIDATE_INVALID_VALUE = -1,
154 AST_GEOLOC_VALIDATE_SUCCESS = 0,
155 AST_GEOLOC_VALIDATE_MISSING_SHAPE,
156 AST_GEOLOC_VALIDATE_INVALID_SHAPE,
157 AST_GEOLOC_VALIDATE_INVALID_VARNAME,
158 AST_GEOLOC_VALIDATE_NOT_ENOUGH_VARNAMES,
159 AST_GEOLOC_VALIDATE_TOO_MANY_VARNAMES,
162 const char *ast_geoloc_validate_result_to_str(
enum ast_geoloc_validate_result result);
172 enum ast_geoloc_validate_result ast_geoloc_civicaddr_validate_varlist(
173 const struct ast_variable *varlist,
const char **result);
183 enum ast_geoloc_validate_result ast_geoloc_gml_validate_varlist(
const struct ast_variable *varlist,
184 const char **result);
199 struct ast_datastore *ast_geoloc_datastore_create_from_profile_name(
const char *profile_name);
208 struct ast_datastore *ast_geoloc_datastore_create_from_eprofile(
218 struct ast_datastore *ast_geoloc_datastore_create(
const char *
id);
227 const char *ast_geoloc_datastore_get_id(
struct ast_datastore *ds);
237 int ast_geoloc_datastore_add_eprofile(
struct ast_datastore *ds,
250 int ast_geoloc_datastore_insert_eprofile(
struct ast_datastore *ds,
271 int ast_geoloc_datastore_set_inheritance(
struct ast_datastore *ds,
int inherit);
291 int ast_geoloc_datastore_delete_eprofile(
struct ast_datastore *ds,
int ix);
348 struct ast_xml_doc *pidf_xmldoc,
const char *geoloc_uri,
const char *reference_string);
359 const char *reference_string);
384 const char *ast_geoloc_eprofiles_to_pidf(
struct ast_datastore *ds,
Main Channel structure associated with a channel.
Optional API function macros.
Structure for variables, used for configurations and for channel variables.
#define SORCERY_OBJECT(details)
Macro which must be used at the beginning of each sorcery capable object.
#define AST_OPTIONAL_API(result, name, proto, stub)
Declare an optional API function.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
Structure for a data store object.
Configuration File Parser.
General Asterisk PBX channel definitions.
#define AST_STRING_FIELD(name)
Declare a string field.
Asterisk XML abstraction layer.
Support for dynamic strings.
Sorcery Data Access Layer API.