res_geolocation: Address user issues, remove complexity, plug leaks

* Added processing for the 'confidence' element.
* Added documentation to some APIs.
* removed a lot of complex code related to the very-off-nominal
  case of needing to process multiple location info sources.
* Create a new 'ast_geoloc_eprofile_to_pidf' API that just takes
  one eprofile instead of a datastore of multiples.
* Plugged a huge leak in XML processing that arose from
  insufficient documentation by the libxml/libxslt authors.
* Refactored stylesheets to be more efficient.
* Renamed 'profile_action' to 'profile_precedence' to better
  reflect it's purpose.
* Added the config option for 'allow_routing_use' which
  sets the value of the 'Geolocation-Routing' header.
* Removed the GeolocProfileCreate and GeolocProfileDelete
  dialplan apps.
* Changed the GEOLOC_PROFILE dialplan function as follows:
  * Removed the 'profile' argument.
  * Automatically create a profile if it doesn't exist.
  * Delete a profile if 'inheritable' is set to no.
* Fixed various bugs and leaks
* Updated Asterisk WiKi documentation.

ASTERISK-30167

Change-Id: If38c23f26228e96165be161c2f5e849cb8e16fa0
This commit is contained in:
George Joseph
2022-08-05 07:50:49 -06:00
parent 79e1447dc2
commit 9f4db77bbe
16 changed files with 1119 additions and 1258 deletions

View File

@@ -25,18 +25,8 @@
#include "asterisk/lock.h"
#include "asterisk/res_geolocation.h"
#define CONFIG_STR_TO_ENUM_DECL(_stem) int geoloc_ ## _stem ## _str_to_enum(const char *str);
CONFIG_STR_TO_ENUM_DECL(pidf_element)
CONFIG_STR_TO_ENUM_DECL(format);
CONFIG_STR_TO_ENUM_DECL(action);
#define GEOLOC_ENUM_TO_NAME_DECL(_stem) const char * geoloc_ ## _stem ## _to_name(int ix);
GEOLOC_ENUM_TO_NAME_DECL(pidf_element)
GEOLOC_ENUM_TO_NAME_DECL(format);
GEOLOC_ENUM_TO_NAME_DECL(action);
#define CONFIG_STR_TO_ENUM(_stem) \
int geoloc_ ## _stem ## _str_to_enum(const char *str) \
int ast_geoloc_ ## _stem ## _str_to_enum(const char *str) \
{ \
int i; \
for (i = 0; i < ARRAY_LEN(_stem ## _names); i++) { \
@@ -51,7 +41,7 @@ int geoloc_ ## _stem ## _str_to_enum(const char *str) \
static int _stem ## _handler(const struct aco_option *opt, struct ast_variable *var, void *obj) \
{ \
struct ast_geoloc_ ## _object *_thisobject = obj; \
int enumval = geoloc_ ## _stem ## _str_to_enum(var->value); \
int enumval = ast_geoloc_ ## _stem ## _str_to_enum(var->value); \
if (enumval == -1) { \
return -1; \
} \
@@ -61,7 +51,7 @@ static int _stem ## _handler(const struct aco_option *opt, struct ast_variable *
#define GEOLOC_ENUM_TO_NAME(_stem) \
const char * geoloc_ ## _stem ## _to_name(int ix) \
const char * ast_geoloc_ ## _stem ## _to_name(int ix) \
{ \
if (!ARRAY_IN_BOUNDS(ix, _stem ## _names)) { \
return "none"; \