Oh, for now, you can also use something like this to conditionally set an element: ${IF(${EXISTS(${MyA3})}?A3=${MyA3})} On Mon, Aug 15, 2022 at 9:57 AM George Joseph <gjoseph at sangoma.com> wrote:> The email was getting too long for the mailing list so I've truncated it. > Anyway... > > Dan, Have you tried using the GEOLOC_PROFILE dialplan function to create a > profile on the fly? I'm not sure how this would fit into your use of > Originate but... > > Create a dummy geoloc profile. > [<passthrough>] > type=profile > profile_precedence=discard_config > > In pjsip.conf, set > geoloc_outgoing_call_profile = <passthrough> > on the outgoing channel. > > Either in the dialplan or via the Originate (I forget how) call > GEOLOC_PROFILE. Here's what it'd look like in the dialplan... > > [geoloc_callee] > exten = s,1,NoOp(); CID: ${CALLERID(all)} CL: ${CONNECTEDLINE(all)}) > same = n,Set(GEOLOC_PROFILE(format)=civicAddress) > same = n,Set(GEOLOC_PROFILE(location_info)=country=US,A1=Colorado) > same = n,Set(GEOLOC_PROFILE(pidf_element)=device) > same = n,Return() > > [default] > exten = 911,Dial(PJSIP/upstream-carrier,20,b(geoloc_callee^s^1)) > > Not sure if this helps. I am working on the other suggestions though. > > > On Mon, Aug 15, 2022 at 3:46 AM George Joseph <gjoseph at sangoma.com> wrote: > >> >> >> On Sat, Aug 13, 2022 at 3:55 PM Dan Cropp <dan at amtelco.com> wrote: >> >>> Thank you George. >>> >>> >>> >>> rc2 did fix the issue. >>> >> >> Whew. >> >> >>> >>> >>> I am now able to program the variables in the location_info and pass >>> values via the AMI Originate variables. >>> >>> >>> >>> Is there a way to make the location_info optional? >>> >> >> I _believe_ I can allow you to specify "location" parameters directly on >> a profile which would be mutually exclusive with the location_reference >> parameter. Let me look at it. >> >> >>> >>> >>> On the same PJSIP Endpoint, we may need to originate calls with >>> different requirements for the fields passed. >>> >>> For example >>> >>> Dialing a number for customer A, need to pass country, A1, A3, HNO, RD, >>> STS, PC, FLR and ROOM. >>> >>> Dialing a number for customer B, need to pass country, A1, A2, and A3. >>> >>> >>> >>> Is it possible to program the Profile/Location to support values for all >>> the settings, but have Asterisk ignore any settings where the value is >>> blank? >>> >> >> A good idea. I can't think of any element that would need to be sent >> empty but I'm wondering if I'll need to add a config option like >> "suppress_empty_elements". Let me investigate. >> >> >>> >>> >>> Right now, if I have HNO=${MYGEO_FLR} but the variable MYGEO_FLR is not >>> set, it still passes the FLR in the sip as <ca:FLR/> >>> >>> >>> >>> I believe it’s perfectly fine to send the <ca:FLR/> >>> >>> My fear is some system may interpret a blank FLR differently than the >>> FLR not being present at all. >>> >>> >>> >>> Dan >>> >>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20220815/d38ecc6c/attachment.html>
Dan Cropp
2022-Aug-15 18:59 UTC
[asterisk-users] [External] Geo location 18.14.0-rc1 question
Thank you George. Good idea on the passthrough profile. Is there a way to set the GEOLOC_PROFILE values from the AMI Originate command? I tried the following, but it doesn’t like the GEOLOC_PROFILE values in the variable parameter. If there is a way to do this, the passthrough would solve the problem of Geo Location information settings needing to be provided by a third-party application. Action: Originate Channel: PJSIP/1234 at 192.168.33.31 Exten: createcall Context: mycontext Priority: 1 Timeout: 60000 CallerID: John Smith <8005551234> Variable: GEOLOC_PROFILE(format)=civicAddress,GEOLOC_PROFILE(method)=Manual,GEOLOC_PROFILE(location_info)=="country=US,A1=Florida,A3=Orlando,HNO=100,RD=Main,STS=Street",CALLERID(num-pres)=allowed_passed_screen Async: true I believe this portion believe indicates Asterisk treats the GEOLOC_PROFILE(xxx) as GEOLOCPROFILESTATUS variable name. [08/15 13:41:41.609] DEBUG[42424] manager.c: Examining AMI event: Event: VarSet^M Privilege: dialplan,all^M Channel: PJSIP/192.168.33.31-00000000^M ChannelState: 0^M ChannelStateDesc: Down^M CallerIDNum: <unknown>^M CallerIDName: <unknown>^M ConnectedLineNum: <unknown>^M ConnectedLineName: <unknown>^M Language: en^M AccountCode: 20^M Context: IS^M Exten: s^M Priority: 1^M Uniqueid: 1660588901.0^M Linkedid: 1660588901.0^M Variable: GEOLOCPROFILESTATUS^M Value: 0^M ^M Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20220815/6e56d2c9/attachment.html>