Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lost: dynamic HELD url resolving #2574

Closed
sergey-safarov opened this issue Dec 3, 2020 · 4 comments
Closed

lost: dynamic HELD url resolving #2574

sergey-safarov opened this issue Dec 3, 2020 · 4 comments

Comments

@sergey-safarov
Copy link
Member

sergey-safarov commented Dec 3, 2020

Description

According to design logic HELD request need to send a carrier LIS server. Now lost module sends this request to the preconfigured server via http_client/httpcon param.
I prefer to use dynamic LIS server discovery according to rfc7216#section-4 and rfc5986#section-4.
So dynamic LIS discovery works as:

  1. Kamailio send reverse .in-addr.arpa. or .ip6.arpa. DNS request and caller host DNS name;
  2. Kamailio send LIS:HELD NAPTR request for a resolved caller hostname and get LIS server URI in responce.
  3. Kamailio send HELD request for resolved LIS address.

So do get working dynamic LIS discovery required to implement two DNS requests.

If any DNS request will fail, then lost_held_query function returns an error code.
To define required dynamic LIS discovery I suggest use an empty string ("") or NULL value ($null) as the first ("con") function param.

This feature request for discussion with lost module author (Wolfgang Kampichler @wkampich) and other interest devs.
The ticket may be closed at any time.

@wkampich
Copy link
Contributor

wkampich commented Dec 6, 2020

NAPTR support is a good idea and basically also applicable to the LoST service (which I have on my ToDo list anyway). I will have a look at it - just one question:

I assume item (1) below refers to the device IP address (i.e. UE) for reverse DNS (as in https://tools.ietf.org/html/rfc7216#section-4), which may not work in any case. How about expanding the discovery procedure with a NAPTR request sent to the provider's domain (as found in From and/or P-A-I) in case (1) fails?

(1) Kamailio send reverse .in-addr.arpa. or .ip6.arpa. DNS request and caller host DNS name;
(2) Kamailio send LIS:HELD NAPTR request for a resolved caller hostname and LIS server.
(3) Kamailio send HELD request for resolved LIS address.

@sergey-safarov
Copy link
Member Author

sergey-safarov commented Dec 6, 2020

How about expanding the discovery procedure with a NAPTR request sent to the provider's domain (as found in From and/or P-A-I) in case (1) fails

Yes, looks as it will be a good extension.
Domain from From header may be used only if domain not available in P-A-I header.

Here examples of From and P-A-I headers that we can receive
Example 1 - domain matched in From and P-A-I headers

From: <sip:+18556667788@206.147.246.118:5060>;tag=gK0e0d09a4
P-Asserted-Identity: <sip:+18556667788@206.147.246.118:5060>

Example 2 - private IP address in From header and domain in P-A-I header. P-A-I contains tel and sip uri.

From: <sip:+16692481432@198.226.45.84>;tag=gK04090b5e
P-Asserted-Identity: <tel:+16692481432>, <sip:+16692481432@vzimstest.com>

Example 3 - IPv6 address in From header and no domain in P-A-I header

From: "9255111003"<sip:9255111003@[2605:97c0:2058:3120:1::1]:50001>;tag=75fdbcf61a;epid=SC597fbd
P-Asserted-Identity: <tel:9255111003>

Example 4 - no domain in From and P-A-I headers

From: <tel:+13559598013>;tag=SDtl3t701-5f7f754a-5f89c26229204b60-Noo-lucentNGFS-000264
P-Asserted-Identity: <tel:+11005534340>

Think not required to make double reverse and NAPTR DNS lookups if the domain from P-A-I or From headers equals to caller network IP address.

Could you look at this example.

P-Asserted-Identity: <tel:+16692481432>, <sip:+16692481432@vzimstest.com>

IP address does exist here, put present caller domain. So we can skip reverse lookup and execute NAPTR.

wkampich added a commit that referenced this issue Mar 15, 2021
…tion

- features: LoST redirect, dynamic HELD url resolving (#2574), LoST NAPTR,
  POST request to dereference loation
- attributes: reponse_time (-1:emergencyDispatch, 0:emergencyRouting, >0[ms]);
  post_request (POST method to dereference location #2641); recursion (yes/no);
  location_profile (PIDF/LO profile selection: first/last/geo/civic);
  verbose (detailed LoST response as log INFO);
  geoheader_type (filter schema: any/cid/http/https);
  geoheader_order (first/last)
- function: lost_held_dereference (specific function to dereference location
  using POST method); attributes are url (r), resp.-time (r), resp.-type (r),
  pidf (r/w) and error (r/w)
- general: The extension of the module allows dynamic querying of LIS/HELD
  and LOST services via NAPTR lookup. In the case of LOST, a redirect
  response is evaluated. In case a lost_held_request (used to connect
  to a LIS via POST or GET) is passed with an empty string ("") for the
  connection parameter, then P-A-I or From header value hostnames are used
  for NAPTR lookup to get a corresponding service.
sergey-safarov pushed a commit to sergey-safarov/kamailio that referenced this issue Apr 4, 2021
…tion

- features: LoST redirect, dynamic HELD url resolving (kamailio#2574), LoST NAPTR,
  POST request to dereference loation
- attributes: reponse_time (-1:emergencyDispatch, 0:emergencyRouting, >0[ms]);
  post_request (POST method to dereference location kamailio#2641); recursion (yes/no);
  location_profile (PIDF/LO profile selection: first/last/geo/civic);
  verbose (detailed LoST response as log INFO);
  geoheader_type (filter schema: any/cid/http/https);
  geoheader_order (first/last)
- function: lost_held_dereference (specific function to dereference location
  using POST method); attributes are url (r), resp.-time (r), resp.-type (r),
  pidf (r/w) and error (r/w)
- general: The extension of the module allows dynamic querying of LIS/HELD
  and LOST services via NAPTR lookup. In the case of LOST, a redirect
  response is evaluated. In case a lost_held_request (used to connect
  to a LIS via POST or GET) is passed with an empty string ("") for the
  connection parameter, then P-A-I or From header value hostnames are used
  for NAPTR lookup to get a corresponding service.
@miconda
Copy link
Member

miconda commented May 7, 2021

Can this be closed? I see commits referencing it were merged.

@sergey-safarov
Copy link
Member Author

yes, sure.

NGSegovia pushed a commit to NGSegovia/kamailio that referenced this issue Aug 26, 2021
…tion

- features: LoST redirect, dynamic HELD url resolving (kamailio#2574), LoST NAPTR,
  POST request to dereference loation
- attributes: reponse_time (-1:emergencyDispatch, 0:emergencyRouting, >0[ms]);
  post_request (POST method to dereference location kamailio#2641); recursion (yes/no);
  location_profile (PIDF/LO profile selection: first/last/geo/civic);
  verbose (detailed LoST response as log INFO);
  geoheader_type (filter schema: any/cid/http/https);
  geoheader_order (first/last)
- function: lost_held_dereference (specific function to dereference location
  using POST method); attributes are url (r), resp.-time (r), resp.-type (r),
  pidf (r/w) and error (r/w)
- general: The extension of the module allows dynamic querying of LIS/HELD
  and LOST services via NAPTR lookup. In the case of LOST, a redirect
  response is evaluated. In case a lost_held_request (used to connect
  to a LIS via POST or GET) is passed with an empty string ("") for the
  connection parameter, then P-A-I or From header value hostnames are used
  for NAPTR lookup to get a corresponding service.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants