| 1 |
;-- |
| 2 |
Geolocation Profile Sample Configuration |
| 3 |
|
| 4 |
Please see https://docs.asterisk.org/Deployment/Geolocation/ |
| 5 |
for the most current information. |
| 6 |
--; |
| 7 |
|
| 8 |
;-- |
| 9 |
======================================================================= |
| 10 |
Overview |
| 11 |
======================================================================= |
| 12 |
|
| 13 |
Geolocation information is actually comprised of two objects, a |
| 14 |
Location object, and a Profile object. |
| 15 |
|
| 16 |
Location objects must contain one of the following: |
| 17 |
|
| 18 |
- Location information specified in Geographic Markup Language |
| 19 |
(GML) or civicAddress formats. |
| 20 |
|
| 21 |
- A URI that points to externally hosted location information. |
| 22 |
|
| 23 |
Profile objects contain instructions for the disposition of location |
| 24 |
information, an optional reference to a Location object, and updates or |
| 25 |
overrides to that Location object if specified. |
| 26 |
|
| 27 |
Channel drivers and the dialplan functions are responsible for |
| 28 |
associating Profiles to endpoints/devices and calls. Normally, two |
| 29 |
profiles would be assigned to an endpoint to control behavior in each |
| 30 |
direction and to optionally specify location information. One for |
| 31 |
incoming calls (Asterisk is the UAS) and and one for outgoing calls |
| 32 |
(Asterisk is the UAC). |
| 33 |
|
| 34 |
NOTE: |
| 35 |
|
| 36 |
See https://docs.asterisk.org/Deployment/Geolocation/ for the most |
| 37 |
complete and up-to-date information on valid values for the object |
| 38 |
parameters and a full list of references. |
| 39 |
|
| 40 |
GENERAL CAUTION: You must coordinate with your partners with regards |
| 41 |
to what location information is expected by each party and how it should |
| 42 |
be formatted. An outgoing configuration mismatch for instance, could |
| 43 |
result in misinformation or no information being sent to an emergency |
| 44 |
response center or even call failure for which you are solely responsible. |
| 45 |
--; |
| 46 |
|
| 47 |
|
| 48 |
;-- |
| 49 |
======================================================================= |
| 50 |
Location Object Description |
| 51 |
======================================================================= |
| 52 |
[<location_id>] |
| 53 |
|
| 54 |
-- type (required) ---------------------------------------------------- |
| 55 |
Defines the object type. |
| 56 |
type = location |
| 57 |
|
| 58 |
Must be "location" to identify this configuration section as a |
| 59 |
Geolocation Location object. |
| 60 |
|
| 61 |
-- format (required) -------------------------------------------------- |
| 62 |
Sets the format used to express the location. |
| 63 |
format = < civicAddress | GML | URI > |
| 64 |
|
| 65 |
Values: |
| 66 |
civicAddress: [RFC4119] [RFC5139] [RFC5491] |
| 67 |
The location information will be placed in an XML document |
| 68 |
conforming to the PIDF-LO standard. |
| 69 |
For chan_pjsip, this will be placed in the body of |
| 70 |
outgoing INVITE messages in addition to any SDP. |
| 71 |
|
| 72 |
GML: [RFC4119] [RFC4479] [RFC5491] [GeoShape] |
| 73 |
The location information will be placed in an XML document |
| 74 |
conforming to the PIDF-LO standard. |
| 75 |
For chan_pjsip, this will be placed in the body of |
| 76 |
outgoing INVITE messages in addition to any SDP. |
| 77 |
|
| 78 |
URI: [RFC6442] |
| 79 |
The external URI at which the the location information |
| 80 |
can be found. For chan_pjsip, this URI will be placed |
| 81 |
in a "Geolocation" header in outgoing INVITE messages. |
| 82 |
|
| 83 |
There is no default. |
| 84 |
|
| 85 |
Example: |
| 86 |
format = civicAddress |
| 87 |
|
| 88 |
-- location_info (required) ------------------------------------------- |
| 89 |
The location-format-specific information describing the location. |
| 90 |
location_info = <location_format_specific_description> |
| 91 |
|
| 92 |
For readability, multiple "location" parameters can be specified and |
| 93 |
they will be concatenated into one specification. The description may |
| 94 |
contain replacement variables which may be the names of common channel |
| 95 |
variables like ${EXTEN}, channel variables you may have added in the |
| 96 |
dialplan, or variables you may have specified in the profile that |
| 97 |
references this location object. |
| 98 |
|
| 99 |
NOTE: See https://docs.asterisk.org/Deployment/Geolocation/ for the |
| 100 |
most complete and up-to-date information on valid values for the object |
| 101 |
parameters and a full list of references. |
| 102 |
|
| 103 |
WARNING: Asterisk can only validate that a particular sub-parameter |
| 104 |
name is valid for a particular format. It can't validate the actual |
| 105 |
value of the sub-parameter. |
| 106 |
|
| 107 |
Example for civicAddress: |
| 108 |
|
| 109 |
location_info = country=US |
| 110 |
location_info = A1="New York", A3="New York", A4=Manhattan, |
| 111 |
location_info = HNO=1633, PRD=W, RD=46th, STS=Street |
| 112 |
location_info = PC=10222 |
| 113 |
|
| 114 |
Example for GML with replacement variables: |
| 115 |
|
| 116 |
location_info = type=Point, crs=2d, pos="${mylat} ${mylon}" |
| 117 |
|
| 118 |
Example for URI with replacement variables: |
| 119 |
location_info = URI=https://some.company.com?number=${phone_number} |
| 120 |
|
| 121 |
-- method (optional) -------------------------------------------------- |
| 122 |
The method used to determine the location_info |
| 123 |
method = <"GPS" | "A-GPS" | "Manual" | "DHCP" |
| 124 |
| "Triangulation" | "Cell" | "802.11"> |
| 125 |
|
| 126 |
Example: |
| 127 |
method = Manual |
| 128 |
|
| 129 |
-- location_source (optional) ----------------------------------------- |
| 130 |
Original source of the location-info. |
| 131 |
location_source = < FQDN > |
| 132 |
|
| 133 |
The value MUST be a FQDN. IP addresses are specifically not |
| 134 |
allowed. See RFC8787. |
| 135 |
|
| 136 |
Example: |
| 137 |
location_source = sip1.myserver.net |
| 138 |
|
| 139 |
-- confidence (optional) ----------------------------------------- |
| 140 |
The confidence in the location specified. |
| 141 |
confidence = pdf=[ unknown | normal | rectangular ], value=<percent_confident> |
| 142 |
|
| 143 |
Please see RFC7459 for the exact description of this parameter. |
| 144 |
|
| 145 |
Example: |
| 146 |
confidence = pdf=normal, value=75 |
| 147 |
|
| 148 |
|
| 149 |
-- Location Example --------------------------------------------------- |
| 150 |
|
| 151 |
[mylocation] |
| 152 |
type = location |
| 153 |
format = civicAddress |
| 154 |
location_info = country=US |
| 155 |
location_info = A1="New York", A3="New York", A4=Manhattan |
| 156 |
location_info = HNO=1633, PRD=W, RD=46th, STS=Street |
| 157 |
location_info = PC=10222 |
| 158 |
method = Manual |
| 159 |
location_source = sip1.myserver.net |
| 160 |
|
| 161 |
======================================================================= |
| 162 |
--; |
| 163 |
|
| 164 |
|
| 165 |
;-- |
| 166 |
======================================================================= |
| 167 |
Profile Object Descriptions |
| 168 |
======================================================================= |
| 169 |
[<profile_id>] |
| 170 |
|
| 171 |
-- type (required) ---------------------------------------------------- |
| 172 |
Defines the object type. |
| 173 |
type = profile |
| 174 |
|
| 175 |
-- profile_precedence (optional) -------------------------------------- |
| 176 |
Sets how to reconcile incoming and configured profiles. |
| 177 |
|
| 178 |
profile_precedence = < prefer_incoming | prefer_config | discard_incoming |
| 179 |
| discard_config > |
| 180 |
|
| 181 |
On an incoming call leg, "incoming" is the location description |
| 182 |
received in the SIP INVITE (if any) and "config" is this profile. |
| 183 |
|
| 184 |
On an outgoing call leg, "incoming" is the location description |
| 185 |
passed through the dialplan to this channel (if any) and "config" |
| 186 |
is this profile. |
| 187 |
|
| 188 |
Values: |
| 189 |
|
| 190 |
prefer_incoming: If there's an incoming location description, use it |
| 191 |
even if there's also a configured one. |
| 192 |
prefer_config: If there's a configured location description, use it |
| 193 |
even if there's also an incoming one. |
| 194 |
discard_incoming: Discard any incoming location description. If there's |
| 195 |
a configured one, use it. If not, no location |
| 196 |
information is propagated. |
| 197 |
discard_config: Discard any configured location description. If |
| 198 |
there's an incoming one, use it. If not, no location |
| 199 |
information is propagated. |
| 200 |
|
| 201 |
discard_incoming is the default. |
| 202 |
|
| 203 |
Example: |
| 204 |
profile_precedence = prefer_config |
| 205 |
|
| 206 |
-- pidf_element (optional) -------------------------------------------- |
| 207 |
PIDF-LO element in which to place the location description. |
| 208 |
|
| 209 |
pidf_element = < tuple | device | person > |
| 210 |
Default: device |
| 211 |
|
| 212 |
If the format is civicAddress or GML, this sets the PIDF element into |
| 213 |
which the location information will be placed. |
| 214 |
|
| 215 |
Values: |
| 216 |
tuple: Places the information in a "tuple" element. |
| 217 |
device: Places the information in a "device" element. |
| 218 |
person: Places the information in a "person" element. |
| 219 |
|
| 220 |
Per [RFC5491], "device" is preferred and therefore the default. |
| 221 |
|
| 222 |
Example: |
| 223 |
pidf_element = tuple |
| 224 |
|
| 225 |
-- pidf_element id(optional) ------------------------------------------ |
| 226 |
Sets the value of the 'id' attribute for the top-level PIDF-LO element. |
| 227 |
You can reference channel variables in this parameter. |
| 228 |
|
| 229 |
pidf_element_id = <any valid attribute string> |
| 230 |
|
| 231 |
Example: |
| 232 |
pidf_element_id = ${CHANNEL(name)} |
| 233 |
|
| 234 |
-- device_id (optional) ----------------------------------------------- |
| 235 |
Sets the contents of the <dm:deviceID> element in the top-level |
| 236 |
PIDF-LO element. RFC4479 defined this only as a 'URN' with the only |
| 237 |
examples being a mac address in the format 'mac:XXXXXXXXXXXX'. |
| 238 |
You can reference channel variables in this parameter. |
| 239 |
|
| 240 |
device_id = <urn> |
| 241 |
|
| 242 |
Example: |
| 243 |
device_id = mac:40000b0c0d12 |
| 244 |
device_id = mac:${MAC_ADDRESS} |
| 245 |
|
| 246 |
|
| 247 |
-- allow_routing_use (optional) --------------------------------------- |
| 248 |
Sets whether the "Geolocation-Routing" header is added to outgoing |
| 249 |
requests. |
| 250 |
|
| 251 |
allow_routing_use = < yes | no > |
| 252 |
Default: no |
| 253 |
|
| 254 |
Set to "yes" to indicate that servers later in the path |
| 255 |
can use the location information for routing purposes. Set to "no" |
| 256 |
if they should not. If this value isn't specified, no |
| 257 |
"Geolocation-Routing" header will be added. |
| 258 |
|
| 259 |
Example: |
| 260 |
allow_routing_use = yes |
| 261 |
|
| 262 |
-- location_reference (optional) -------------------------------------- |
| 263 |
The name of an existing Location object. |
| 264 |
location_reference = <location_id> |
| 265 |
|
| 266 |
The location_info_refinement and location_variables parameters below can |
| 267 |
be used to refine the location object for this specific profile. |
| 268 |
|
| 269 |
Example: |
| 270 |
location_reference = "my_building" |
| 271 |
|
| 272 |
-- location_info_refinement (optional) -------------------------------- |
| 273 |
Location info to add to that already retrieved from the location object. |
| 274 |
|
| 275 |
location_info_refinement = <location_format_specific_description> |
| 276 |
|
| 277 |
The information in the referenced Location object can be refined on a |
| 278 |
per-profile basis. For example, if the referenced Location object has a |
| 279 |
civicAddress for a building, you could set location_refinement to add a |
| 280 |
floor and room just for this profile |
| 281 |
|
| 282 |
Example: |
| 283 |
location_info_refinement = floor=20, room=20a2 |
| 284 |
|
| 285 |
-- location_variables (optional) -------------------------------------- |
| 286 |
|
| 287 |
If the referenced Location object uses any replacement variables, they |
| 288 |
can be assigned here. There is no need to define variables that come |
| 289 |
from the channel using this profile. They get assigned automatically. |
| 290 |
|
| 291 |
location_variables = myfloor=20, myroom=222 |
| 292 |
|
| 293 |
-- suppress_empty_ca_elements (optional) ------------------------------ |
| 294 |
Sets whether empty values for Civic Address elements should be |
| 295 |
suppressed from the outgoing PIDF-LO document. |
| 296 |
|
| 297 |
suppress_empty_ca_elements = < yes | no > |
| 298 |
Default: no |
| 299 |
|
| 300 |
Setting to "yes" allows you to define a location info template |
| 301 |
with channel variables that may or may not exist. |
| 302 |
|
| 303 |
For example, with: |
| 304 |
location_info_refinement = FLR=${MyFlr} |
| 305 |
suppress_empty_ca_elements = no ; the default |
| 306 |
|
| 307 |
If the MyFlr channel variable weren't set, the outgoing PIDF-LO document |
| 308 |
would have an empty <FLR/> element in it. If suppress_empty_ca_elements |
| 309 |
were set to "yes", the FLR element would be dropped from the PIDF-LO |
| 310 |
document altogether. |
| 311 |
|
| 312 |
-- format, location_info, location_source, method, confidence --------- |
| 313 |
You can specify the location object's format, location_info, |
| 314 |
method, location_source and confidence parameters directly on |
| 315 |
a profile object for simple scenarios where the location |
| 316 |
information isn't common with any other profiles. This is |
| 317 |
mutually exclusive with setting location_reference on the |
| 318 |
profile. |
| 319 |
|
| 320 |
-- Profile Example ---------------------------------------------------- |
| 321 |
|
| 322 |
[myprofile] |
| 323 |
type = profile |
| 324 |
location_reference = mylocation |
| 325 |
location_info_refinement = floor=20, room=20a2 |
| 326 |
pidf_element = tuple |
| 327 |
profile_action = discard_incoming |
| 328 |
|
| 329 |
======================================================================= |
| 330 |
|
| 331 |
-- NOTE --------------------------------------------------------------- |
| 332 |
There are 4 built-in profiles that can be assigned to endpoints: |
| 333 |
"<prefer_config>" |
| 334 |
"<discard_config>" |
| 335 |
"<prefer_incoming>" |
| 336 |
"<discard_incoming>" |
| 337 |
The profiles are empty except for having their precedence |
| 338 |
set. |
| 339 |
|
| 340 |
--; |