SIP requests may be forwarded based on a location provided by the request or retrieved from a specific location server using an identity (HELD). This module implements the basic functionality to get or parse location information (civic and geodetic) and to query a mapping service (LOST) to get the next hop based on location and service urn either specified or provided with the request. This module implements protocol functions that use the http_client API to fetch data from external LOST and HELD servers. The module is using the http_client concept of "connections" to define properties of HTTP sessions. A connection has one or multiple servers and a set of settings that apply to the specific connection. The function lost_held_query allows Kamailio to assemble a HELD locationRequest as defined in RFC6155 (https://tools.ietf.org/html/rfc6155) to query location information represented as PIDF-LO for a given identity (in most cases a SIP URI). The identity may be a specific parameter or taken from the P-Asserted-Identity or From header. The locationRequest response is parsed and represented as PIDF-LO and location URI to dereference location via HTTP(S). The function lost_held_dereference allows Kamailio to assemble a HELD dereference request as defined in RFC6155 (https://tools.ietf.org/html/rfc6753) to dereference location information represented as PIDF-LO for a given URL. Required parameters are an URL, responseTime, and responseType. The response is represented as PIDF-LO. T
| Parámetro | Tipo | Descripción |
|---|---|---|
| exact_type | int | 3.2. response_time (int) 3.3. location_type (string) 3.4. post_request (int) 3.5. location_profile (int) 3.6. location_3d (int) 3.7. geoheader_type (int) 3.8. geoheader_order (int) 3.9. recursion (int |
| response_time | int | 3.3. location_type (string) 3.4. post_request (int) 3.5. location_profile (int) 3.6. location_3d (int) 3.7. geoheader_type (int) 3.8. geoheader_order (int) 3.9. recursion (int) 3.10. verbose (int) |
| location_type | string | 3.4. post_request (int) 3.5. location_profile (int) 3.6. location_3d (int) 3.7. geoheader_type (int) 3.8. geoheader_order (int) 3.9. recursion (int) 3.10. verbose (int) |
| post_request | int | 3.5. location_profile (int) 3.6. location_3d (int) 3.7. geoheader_type (int) 3.8. geoheader_order (int) 3.9. recursion (int) 3.10. verbose (int) |
| location_profile | int | 3.6. location_3d (int) 3.7. geoheader_type (int) 3.8. geoheader_order (int) 3.9. recursion (int) 3.10. verbose (int) |
| location_3d | int | 3.7. geoheader_type (int) 3.8. geoheader_order (int) 3.9. recursion (int) 3.10. verbose (int) |
| geoheader_type | int | 3.8. geoheader_order (int) 3.9. recursion (int) 3.10. verbose (int) |
| geoheader_order | int | 3.9. recursion (int) 3.10. verbose (int) |
| recursion | int | 3.10. verbose (int) |
| verbose | int | Besides parameters listed, this module uses http_client therefore appropriate module parameters may apply. |
| exact_type | int | Indicates to the location server that the contents of the "location_type" parameter must be strictly followed. Values are 0 (false) or 1 (true). |
| response_time | int | A time value informs the location server how long the client is prepared to wait for a response. |
| location_type | string | The "locationType" element contains a list of types that are requested. Values are "any", "geodetic", "civic" or "locationURI" and combinations. * any - returns location information in all forms avail |
| post_request | int | Dereferencing the location can be done using either the HTTP GET or POST method. This parameter globally defines whether only HTTP POST method should be used. Values are 0 (GET) or 1 (POST). |
| location_profile | int | A Presence Information Data Format Location Object (PIDF-LO) may contain geodetic or civic location profile or combinations. A LoST findService contains only one location, which is selected via this p |
| location_3d | int | A Presence Information Data Format Location Object (PIDF-LO) may contain one of the shape types as listed in RFC5491 (https://tools.ietf.org/html/rfc5491). A LoST findService request currently contain |
| geoheader_type | int | A Geolocation header may include a list of locationValues pointing to either a Presence Information Data Format Location Object (PIDF-LO) in the SIP body using a content-indirection (cid:) URI per RFC |
| geoheader_order | int | A Geolocation header may include a list of locationValues. This parameter sets the order of the URI used to retrieve the location information, either the first element of a certain type or the last. V |
| recursion | int | A Geolocation header may include a list of locationValues. This parameter sets the order of the URI used to retrieve the location information, either the first element of a certain type or the last. V |
| verbose | int | Detailed output of LoST findService, redirect or error response as shown below. Values are 0 (disabled) or 1 (enabled). ### LOST expires: [2031-01-27T14:54:21+00:00] ### LOST lastUpdated: [2021-01-29T |
4.2. lost_held_dereference(url, rtime, rtype, pidf-lo, error) 4.3. lost_query(con, [pidf-lo, urn,] uri, name, error)
4.3. lost_query(con, [pidf-lo, urn,] uri, name, error)
4.1. lost_held_query(con, [id,] pidf-lo, url, error)
Sends a HELD locationRequest to a given connection. The device identity is either specified, or the P-A-I header value, or the From header value. * con - the name of an existing HTTP connection, defined by a httpcon modparam * id - the device id used
usage ... modparam("http_client", "httpcon", "heldsrv=>http://service.org/api/held"); ... # HELD location request $var(id) = "sip:alice@atlanta"; $var(res) = lost_held_query("heldsrv", "$var(id)" , "$var(pidf)", "$var(url)", " $var(err)"); xlog("L_IN
Sends a HELD POST locationRequest to a given URL. Attributes are responseTime and responseType. The locationType property "exact" is set to "false". * url - a URL received via Geolocation header to dereference location * rtime - the response time as
usage ... # HELD location dereference if ($hdr(Geolocation)=~"^<http.*$") { $var(url) = $(hdr(Geolocation){s.select,0,;}); $var(res) = lost_held_dereference("$(var(url){s.unbracket})", "emergencyDisp atch", "civic geodetic", "$var(pidf)", "$var(err)"
Sends a LOST findService request to a given connection. PIDF-LO and URN are either specified, or, if omitted, parsed from the message body (PIDF-LO) and request line (URN). Either "pidf-lo" or "urn" can be set to an empty string to be ignored. * con
usage ... modparam("http_client", "httpcon", "heldsrv=>http://service.org/api/held"); modparam("http_client", "httpcon", "lostsrv=>http://service.org/api/lost"); ... # HELD location request $var(id) = "sip:alice@atlanta"; $var(res) = lost_held_query(
Copyright © 2018-2021 Wolfgang Kampichler