mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
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:
@@ -8,6 +8,7 @@
|
||||
xmlns:gp="urn:ietf:params:xml:ns:pidf:geopriv10"
|
||||
xmlns:gs="http://www.opengis.net/pidflo/1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:con="urn:ietf:params:xml:ns:geopriv:conf"
|
||||
xmlns:date="http://exslt.org/dates-and-times">
|
||||
|
||||
<xsl:output method="xml" indent="yes"/>
|
||||
@@ -20,12 +21,16 @@
|
||||
<!-- xslt will take care of adding all of the namespace declarations
|
||||
from the list above -->
|
||||
<presence xmlns="urn:ietf:params:xml:ns:pidf" entity="{@entity}">
|
||||
<xsl:apply-templates select="./device|tuple|person"/>
|
||||
<xsl:apply-templates/>
|
||||
</presence>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="device">
|
||||
<dm:device>
|
||||
<xsl:template match="person|device">
|
||||
<xsl:element name="dm:{local-name(.)}">
|
||||
<xsl:if test="@id">
|
||||
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<gp:geopriv>
|
||||
<xsl:apply-templates select="./location-info"/>
|
||||
<xsl:apply-templates select="./usage-rules"/>
|
||||
@@ -42,7 +47,7 @@
|
||||
<xsl:value-of select="./deviceID"/>
|
||||
</dm:deviceID>
|
||||
</xsl:if>
|
||||
</dm:device>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="tuple">
|
||||
@@ -63,21 +68,6 @@
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="person">
|
||||
<dm:person>
|
||||
<gp:geopriv>
|
||||
<xsl:apply-templates select="./location-info"/>
|
||||
<xsl:apply-templates select="./usage-rules"/>
|
||||
<xsl:apply-templates select="./method"/>
|
||||
<xsl:apply-templates select="./note-well"/>
|
||||
</gp:geopriv>
|
||||
<xsl:if test="./timestamp">
|
||||
<dm:timestamp>
|
||||
<xsl:value-of select="./timestamp"/>
|
||||
</dm:timestamp>
|
||||
</xsl:if>
|
||||
</dm:person>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="location-info">
|
||||
<gp:location-info>
|
||||
@@ -233,5 +223,10 @@
|
||||
<xsl:template match="pos"><xsl:call-template name="name-value" /></xsl:template>
|
||||
<xsl:template match="posList"><xsl:call-template name="name-value" /></xsl:template>
|
||||
|
||||
<xsl:template match="confidence">
|
||||
<con:confidence pdf="{@pdf}">
|
||||
<xsl:value-of select="."/>
|
||||
</con:confidence>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
Reference in New Issue
Block a user