Re: [asterisk-users] [External] [External] [External] Geo location 18.14.0-rc1 question

2022-08-10 Thread George Joseph
On Wed, Aug 10, 2022 at 11:25 AM Dan Cropp  wrote:

> Thank you George.
>
>
>
> Looking forward to working with the changes.  I will retrieve them when
> the next release candidate comes out.
>
>
>
>
>
> A quick question on using variables to pass custom Geo Location settings
> on via an AMI Originate.
>
>
>
>
>
> If my AMI originate request looks something like this…
>
> Action: Originate
>
> Channel: PJSIP/1234@192.168.x.x
>
> Exten: createcall
>
> Context: mycontext
>
> Priority: 1
>
> Timeout: 6
>
> CallerID: John Smith <8005551234>
>
> Variable:
> _MY_GEO_COUNTRY=US,_MY_GEO_NATSUB=Florida,_MY_GEO_CITY=Orlando,_MY_GEO_HNO=100,_MY_GEO_RD=Main,_MY_GEO_STS=Street
>
> Async: true
>
>
>
> Do I need to program the location_variables in the profile like this?
>
>
>
> [1]
>
> type = profile
>
> pidf_element = device
>
> profile_action = discard_incoming
>
> usage_rules = retransmission_allowed=yes
>
> location_variables = country=${_MY_GEO_COUNTRY}
>
> location_variables = A1=${_MY_GEO_NATIONAL_SUBDIVISION}
>
> location_variables = A2=${_MY_GEO_NATSUB}
>
> location_variables = A3=${_MY_GEO_CITY}
>
> location_variables = HNO=${_MY_GEO_HNO}
>
> location_variables = RD=${_MY_GEO_RD}
>
> location_variables = STS=${_MY_GEO_STS}
>
> location_variables = PC=${_MY_GEO_PC}
>
>
>
> Or would I need to program the location_info_refinements in the profile to
> use those variables?
>

location_info_refinement is what you want.  location_variables defines *new*
variables to use in addition to those on the channel.  You'd use these if
you had variables that for some reason you didn't want on the channel
itself.

However...   The profile you defined above doesn't have a location
reference to refine so you'd need at least a dummy location with a format
of civicAddress.

[mylog]
type = location
format = civicAddress

Then in your profile...
[1]

type = profile

pidf_element = device

profile_action = discard_incoming

usage_rules = retransmission_allowed=yes
location_reference = myloc

location_variables = country=${_MY_GEO_COUNTRY}

location_variables = A1=${_MY_GEO_NATIONAL_SUBDIVISION}
...

You can also do this which might actually be faster...
[mylog]
type = location
format = civicAddress
location_info = country=${_MY_GEO_COUNTRY},
A1=${_MY_GEO_NATIONAL_SUBDIVISION}
location_info = A2=${_MY_GEO_NATSUB}, ...

[1]

type = profile

pidf_element = device

profile_action = discard_incoming

usage_rules = retransmission_allowed=yes
location_reference = myloc

This way you don't need to use location_info_refinement at all.
IIRC this saves having to parse location_info_refinement and bounce it
against
the original location_info which could be empty.







>
>
> Dan
>
>
>
>
>
> *From:* asterisk-users  *On
> Behalf Of *George Joseph
> *Sent:* Wednesday, August 10, 2022 8:58 AM
> *To:* Asterisk Users Mailing List - Non-Commercial Discussion <
> asterisk-users@lists.digium.com>
> *Subject:* Re: [External] [asterisk-users] [External] [External] Geo
> location 18.14.0-rc1 question
>
>
>
> Sorry for the delay but this turned out to be a bit more complex than I
> anticipated.
>
> There are reviews up on Gerrit for the 16 and 18 branches that address the
> issues below as well as clean up the implementation, plug some memory
> leaks, etc.
>
> 16: https://gerrit.asterisk.org/c/asterisk/+/18896
>
> 18: https://gerrit.asterisk.org/c/asterisk/+/18897
>
>
>
> I anticipate these will make it into the next set of release candidates
> which are due to be cut tomorrow.
>
>
>
> Give them a try.
>
>
>
> On Wed, Aug 3, 2022 at 1:51 PM George Joseph  wrote:
>
> Looks like it'll be tomorrow before I can get the patch up.  I ran into
> some strange issues.
>
>
>
> On Tue, Aug 2, 2022 at 1:43 PM Dan Cropp  wrote:
>
> Thank you George
>
>
>
> *From:* asterisk-users  *On
> Behalf Of *George Joseph
> *Sent:* Tuesday, August 2, 2022 2:40 PM
> *To:* Asterisk Users Mailing List - Non-Commercial Discussion <
> asterisk-users@lists.digium.com>
> *Subject:* Re: [External] [asterisk-users] [External] Geo location
> 18.14.0-rc1 question
>
>
>
>
>
>
>
> On Tue, Aug 2, 2022 at 1:35 PM George Joseph  wrote:
>
>
>
>
>
> On Tue, Aug 2, 2022 at 1:13 PM Dan Cropp  wrote:
>
> Is the allow_routing setting on the geolocation Wiki Profile also not
> fully implemented?
>
>
>
> Well, 99% of the code is there.  The 1% is parsing the config option.  Not
> sure how I missed that.
>
> I'll have a patch up first thing in the morning UTC-6.
>
> I'll call it "allow_use_for_routing" in profile.
>
>
>
> Actually just "allow_routing_use"
>
>
>
>
>
>
>
> In the code, I see geolocation_routing used instead of allow_routing.
>
>
>
> Tried both and Asterisk indicates it cannot find suitable setting so it
> doesn’t create the profile object.
>
>
>
> Dan
>
>
>
> *From:* Dan Cropp
> *Sent:* Tuesday, August 2, 2022 10:04 AM
> *To:* Asterisk Users Mailing List - Non-Commercial Discussion <
> asterisk-users@lists.digium.com>
> *Subject:* RE: [External] [asterisk-users] Geo location 18.14.0-rc1
>

Re: [asterisk-users] [External] [External] [External] Geo location 18.14.0-rc1 question

2022-08-10 Thread Dan Cropp
Thank you George.

Looking forward to working with the changes.  I will retrieve them when the 
next release candidate comes out.


A quick question on using variables to pass custom Geo Location settings on via 
an AMI Originate.


If my AMI originate request looks something like this…
Action: Originate
Channel: PJSIP/1234@192.168.x.x
Exten: createcall
Context: mycontext
Priority: 1
Timeout: 6
CallerID: John Smith <8005551234>
Variable: 
_MY_GEO_COUNTRY=US,_MY_GEO_NATSUB=Florida,_MY_GEO_CITY=Orlando,_MY_GEO_HNO=100,_MY_GEO_RD=Main,_MY_GEO_STS=Street
Async: true

Do I need to program the location_variables in the profile like this?

[1]
type = profile
pidf_element = device
profile_action = discard_incoming
usage_rules = retransmission_allowed=yes
location_variables = country=${_MY_GEO_COUNTRY}
location_variables = A1=${_MY_GEO_NATIONAL_SUBDIVISION}
location_variables = A2=${_MY_GEO_NATSUB}
location_variables = A3=${_MY_GEO_CITY}
location_variables = HNO=${_MY_GEO_HNO}
location_variables = RD=${_MY_GEO_RD}
location_variables = STS=${_MY_GEO_STS}
location_variables = PC=${_MY_GEO_PC}

Or would I need to program the location_info_refinements in the profile to use 
those variables?

Dan


From: asterisk-users  On Behalf Of 
George Joseph
Sent: Wednesday, August 10, 2022 8:58 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion 

Subject: Re: [External] [asterisk-users] [External] [External] Geo location 
18.14.0-rc1 question

Sorry for the delay but this turned out to be a bit more complex than I 
anticipated.
There are reviews up on Gerrit for the 16 and 18 branches that address the 
issues below as well as clean up the implementation, plug some memory leaks, 
etc.
16: https://gerrit.asterisk.org/c/asterisk/+/18896
18: https://gerrit.asterisk.org/c/asterisk/+/18897

I anticipate these will make it into the next set of release candidates which 
are due to be cut tomorrow.

Give them a try.

On Wed, Aug 3, 2022 at 1:51 PM George Joseph 
mailto:gjos...@sangoma.com>> wrote:
Looks like it'll be tomorrow before I can get the patch up.  I ran into some 
strange issues.

On Tue, Aug 2, 2022 at 1:43 PM Dan Cropp 
mailto:d...@amtelco.com>> wrote:
Thank you George

From: asterisk-users 
mailto:asterisk-users-boun...@lists.digium.com>>
 On Behalf Of George Joseph
Sent: Tuesday, August 2, 2022 2:40 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion 
mailto:asterisk-users@lists.digium.com>>
Subject: Re: [External] [asterisk-users] [External] Geo location 18.14.0-rc1 
question



On Tue, Aug 2, 2022 at 1:35 PM George Joseph 
mailto:gjos...@sangoma.com>> wrote:


On Tue, Aug 2, 2022 at 1:13 PM Dan Cropp 
mailto:d...@amtelco.com>> wrote:
Is the allow_routing setting on the geolocation Wiki Profile also not fully 
implemented?

Well, 99% of the code is there.  The 1% is parsing the config option.  Not sure 
how I missed that.
I'll have a patch up first thing in the morning UTC-6.
I'll call it "allow_use_for_routing" in profile.

Actually just "allow_routing_use"



In the code, I see geolocation_routing used instead of allow_routing.

Tried both and Asterisk indicates it cannot find suitable setting so it doesn’t 
create the profile object.

Dan

From: Dan Cropp
Sent: Tuesday, August 2, 2022 10:04 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion 
mailto:asterisk-users@lists.digium.com>>
Subject: RE: [External] [asterisk-users] Geo location 18.14.0-rc1 question

Thank you George.

From: asterisk-users 
mailto:asterisk-users-boun...@lists.digium.com>>
 On Behalf Of George Joseph
Sent: Tuesday, August 2, 2022 9:57 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion 
mailto:asterisk-users@lists.digium.com>>
Subject: Re: [External] [asterisk-users] Geo location 18.14.0-rc1 question



On Tue, Aug 2, 2022 at 8:46 AM Dan Cropp 
mailto:d...@amtelco.com>> wrote:
I believe I have everything configured correctly, but Asterisk is complaining 
about my configuration

It is complaining about confidence settings.

From the Asterisk Geolocation Implementation Wiki, I believe I have this set 
correctly.


Sub-parameters:

  *   value: A percentage indicating the confidence or "unknown".
  *   pdf: "unknown", "normal" or "rectangular"
Example: confidence = value=80, pdf=unknown
If no confidence parameter is specified, the default is 95%.
See 
RFC7459
 for the exact definition of this parameter.


[08/02 09:30:03.724] ERROR[682944] config_options.c: Could not find option 
suitable for category 'IS_loc_1' named 'confidence' at line 12 of
[08/02 09:30:03.724] ERROR[682944] res_sorcery_config.c: Could not create an 
object of type 'location' with id 'IS_loc_1' from configuration file 
'geolocation.conf'

[IS_loc_1]
type = location
format = civicAddress
confidence = value=95, pdf=unknown
location_info = country=US,A1=Wisconsin,A3=Madison
location_info = HNO=4800,RD=Main,STS=Drive,PC=