Asterisk - The Open Source Telephony Project GIT-master-5782b03
|
#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/cli.h"
#include "geoloc_private.h"
Go to the source code of this file.
Macros | |
#define | AST_API_MODULE |
Variables | |
static const char * | format_names [] |
static struct ast_cli_entry | geoloc_location_cli_commands [] |
static struct ast_sorcery * | geoloc_sorcery |
static const char * | pidf_element_names [] |
static const char * | precedence_names [] |
#define AST_API_MODULE |
Definition at line 22 of file geoloc_config.c.
struct ast_geoloc_location *AST_OPTIONAL_API_NAME() ast_geoloc_get_location | ( | const char * | id | ) |
Retrieve a geolocation location object by id.
id | Location object id. |
Definition at line 580 of file geoloc_config.c.
References ast_sorcery_retrieve_by_id(), ast_strlen_zero(), geoloc_sorcery, and NULL.
Referenced by geoloc_profile_write().
struct ast_geoloc_profile *AST_OPTIONAL_API_NAME() ast_geoloc_get_profile | ( | const char * | id | ) |
Retrieve a geolocation profile by id.
id | profile id. |
Definition at line 589 of file geoloc_config.c.
References ast_sorcery_retrieve_by_id(), ast_strlen_zero(), geoloc_sorcery, and NULL.
Referenced by handle_incoming_request(), handle_outgoing_request(), and sip_endpoint_apply_handler().
int AST_OPTIONAL_API_NAME() ast_geoloc_is_loaded | ( | void | ) |
Check if res_geolocation is available.
Definition at line 763 of file geoloc_config.c.
Referenced by sip_endpoint_apply_handler().
|
static |
Definition at line 621 of file geoloc_config.c.
References ao2_ref, ast_alloca, ast_assert_return, AST_PIDF_ELEMENT_DEVICE, ast_sorcery_alloc(), ast_sorcery_create(), geoloc_sorcery, name, NULL, ast_geoloc_profile::pidf_element, and ast_geoloc_profile::precedence.
Referenced by geoloc_load_default_profiles().
|
static |
Definition at line 549 of file geoloc_config.c.
References a, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, geoloc_config_reload(), NULL, result, and ast_cli_entry::usage.
|
static |
Definition at line 250 of file geoloc_config.c.
References a, AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_container_alloc_rbtree, ao2_container_dup(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, AO2_ITERATOR_UNLINK, ao2_lock, ao2_ref, ao2_unlock, ast_cli(), ast_free, AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sorcery_object_get_id(), ast_sorcery_object_id_sort(), ast_sorcery_retrieve_by_fields(), ast_sorcery_retrieve_by_regex(), ast_str_buffer(), ast_variable_list_join(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_geoloc_location::format, format_names, geoloc_sorcery, ast_geoloc_location::location_info, NULL, result, str, and ast_cli_entry::usage.
|
static |
Definition at line 341 of file geoloc_config.c.
References a, AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_container_alloc_rbtree, ao2_container_dup(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, AO2_ITERATOR_UNLINK, ao2_lock, ao2_ref, ao2_unlock, ast_cli(), AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sorcery_object_get_id(), ast_sorcery_object_id_sort(), ast_sorcery_retrieve_by_fields(), ast_sorcery_retrieve_by_regex(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, geoloc_sorcery, ast_geoloc_profile::location_reference, NULL, ast_geoloc_profile::precedence, precedence_names, result, and ast_cli_entry::usage.
int geoloc_config_load | ( | void | ) |
Definition at line 659 of file geoloc_config.c.
References ast_geoloc_profile::allow_routing_use, ARRAY_LEN, ast_cli_register_multiple, AST_GEOLOC_FORMAT_NONE, ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_PIDF_ELEMENT_DEVICE, ast_sorcery_apply_config, ast_sorcery_apply_default, AST_SORCERY_APPLY_FAIL, AST_SORCERY_APPLY_SUCCESS, ast_sorcery_apply_wizard_mapping, ast_sorcery_load(), ast_sorcery_object_field_register, ast_sorcery_object_field_register_custom, ast_sorcery_object_register, ast_sorcery_open, FLDSET, geoloc_load_default_profiles(), geoloc_location_alloc(), geoloc_location_apply_handler(), geoloc_location_cli_commands, geoloc_profile_alloc(), geoloc_profile_apply_handler(), geoloc_sorcery, ast_geoloc_profile::location_reference, ast_geoloc_profile::location_source, LOG_ERROR, method, notes, NULL, OPT_BOOL_T, OPT_NOOP_T, OPT_STRINGFIELD_T, pidf_element_names, result, STRFLDSET, and ast_geoloc_profile::suppress_empty_ca_elements.
Referenced by load_module().
int geoloc_config_reload | ( | void | ) |
Definition at line 598 of file geoloc_config.c.
References AST_MODULE_LOAD_SUCCESS, ast_sorcery_reload(), and geoloc_sorcery.
Referenced by geoloc_config_cli_reload(), and reload_module().
|
static |
Definition at line 420 of file geoloc_config.c.
References a, ast_geoloc_eprofile::allow_routing_use, AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_container_alloc_rbtree, ao2_container_dup(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, AO2_ITERATOR_UNLINK, ao2_ref, ast_cli(), ast_free, ast_geoloc_eprofile_create_from_profile(), AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sorcery_object_id_sort(), ast_sorcery_retrieve_by_fields(), ast_sorcery_retrieve_by_regex(), ast_str_buffer(), ast_variable_list_join(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_geoloc_eprofile::confidence, ast_geoloc_eprofile::effective_location, ast_geoloc_eprofile::format, format_names, geoloc_sorcery, ast_geoloc_eprofile::id, ast_geoloc_eprofile::location_info, ast_geoloc_eprofile::location_reference, ast_geoloc_eprofile::location_refinement, ast_geoloc_eprofile::location_source, ast_geoloc_eprofile::location_variables, ast_geoloc_eprofile::method, ast_geoloc_eprofile::notes, NULL, ast_geoloc_eprofile::pidf_element, pidf_element_names, ast_geoloc_eprofile::precedence, precedence_names, result, S_COR, S_OR, ast_geoloc_eprofile::suppress_empty_ca_elements, ast_cli_entry::usage, and ast_geoloc_eprofile::usage_rules.
int geoloc_config_unload | ( | void | ) |
Definition at line 606 of file geoloc_config.c.
References ARRAY_LEN, ast_cli_unregister_multiple(), ast_sorcery_object_unregister(), ast_sorcery_unref, geoloc_location_cli_commands, geoloc_sorcery, and NULL.
Referenced by unload_module().
struct ast_sorcery * geoloc_get_sorcery | ( | void | ) |
Definition at line 244 of file geoloc_config.c.
References ast_sorcery_ref(), and geoloc_sorcery.
Referenced by geoloc_channel_load(), and geoloc_eprofile_load().
|
static |
Definition at line 644 of file geoloc_config.c.
References ast_assert_return, and default_profile_create().
Referenced by geoloc_config_load().
|
static |
Definition at line 60 of file geoloc_config.c.
References ast_sorcery_generic_alloc(), ast_string_field_init, and geoloc_location_destructor().
Referenced by geoloc_config_load().
|
static |
Definition at line 164 of file geoloc_config.c.
References AST_GEOLOC_VALIDATE_SUCCESS, ast_log, ast_sorcery_object_get_id(), ast_geoloc_location::format, ast_geoloc_location::location_info, ast_geoloc_location::location_source, LOG_ERROR, result, validate_location_info(), and validate_location_source().
Referenced by geoloc_config_load().
|
static |
Definition at line 52 of file geoloc_config.c.
References ast_string_field_free_memory, ast_variables_destroy(), ast_geoloc_location::confidence, and ast_geoloc_location::location_info.
Referenced by geoloc_location_alloc().
|
static |
Definition at line 92 of file geoloc_config.c.
References ast_sorcery_generic_alloc(), ast_string_field_init, and geoloc_profile_destructor().
Referenced by geoloc_config_load().
|
static |
Definition at line 190 of file geoloc_config.c.
References ao2_ref, AST_GEOLOC_FORMAT_NONE, AST_GEOLOC_VALIDATE_SUCCESS, ast_log, ast_sorcery_object_get_id(), ast_sorcery_retrieve_by_id(), ast_strlen_zero(), ast_geoloc_location::format, ast_geoloc_profile::format, geoloc_sorcery, ast_geoloc_profile::location_info, ast_geoloc_profile::location_reference, ast_geoloc_profile::location_refinement, ast_geoloc_profile::location_source, LOG_ERROR, result, validate_location_info(), and validate_location_source().
Referenced by geoloc_config_load().
|
static |
Definition at line 81 of file geoloc_config.c.
References ast_string_field_free_memory, ast_variables_destroy(), ast_geoloc_profile::confidence, ast_geoloc_profile::location_info, ast_geoloc_profile::location_refinement, ast_geoloc_profile::location_variables, and ast_geoloc_profile::usage_rules.
Referenced by geoloc_profile_alloc().
|
static |
Definition at line 103 of file geoloc_config.c.
References ast_free, ast_geoloc_civicaddr_validate_varlist(), AST_GEOLOC_FORMAT_CIVIC_ADDRESS, AST_GEOLOC_FORMAT_GML, AST_GEOLOC_FORMAT_LAST, AST_GEOLOC_FORMAT_NONE, AST_GEOLOC_FORMAT_URI, ast_geoloc_gml_validate_varlist(), AST_GEOLOC_VALIDATE_NOT_ENOUGH_VARNAMES, ast_geoloc_validate_result_to_str(), AST_GEOLOC_VALIDATE_SUCCESS, ast_log, ast_str_buffer(), ast_variable_find_in_list(), ast_variable_list_join(), ast_geoloc_profile::format, format_names, ast_geoloc_profile::location_info, LOG_ERROR, NULL, result, and str.
Referenced by geoloc_location_apply_handler(), and geoloc_profile_apply_handler().
|
static |
Definition at line 148 of file geoloc_config.c.
References ast_log, ast_sockaddr_parse(), ast_strlen_zero(), LOG_ERROR, and PARSE_PORT_FORBID.
Referenced by geoloc_location_apply_handler(), and geoloc_profile_apply_handler().
|
static |
Definition at line 34 of file geoloc_config.c.
Referenced by geoloc_config_list_locations(), geoloc_config_show_profiles(), and validate_location_info().
|
static |
Definition at line 573 of file geoloc_config.c.
Referenced by geoloc_config_load(), and geoloc_config_unload().
|
static |
Definition at line 25 of file geoloc_config.c.
Referenced by ast_geoloc_get_location(), ast_geoloc_get_profile(), default_profile_create(), geoloc_config_list_locations(), geoloc_config_list_profiles(), geoloc_config_load(), geoloc_config_reload(), geoloc_config_show_profiles(), geoloc_config_unload(), geoloc_get_sorcery(), and geoloc_profile_apply_handler().
|
static |
Definition at line 27 of file geoloc_config.c.
Referenced by geoloc_config_load(), and geoloc_config_show_profiles().
|
static |
Definition at line 41 of file geoloc_config.c.
Referenced by geoloc_config_list_profiles(), and geoloc_config_show_profiles().