Module: kamailio
Branch: master
Commit: 425ba921288c8d5a6ae3076287d0cf39c735a8fd
URL: https://github.com/kamailio/kamailio/commit/425ba921288c8d5a6ae3076287d0cf3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-05-11T15:38:14+02:00
siputils: docs - updates to is_first_hop() for mode parameter
---
Modified: src/modules/siputils/doc/siputils_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/425ba921288c8d5a6ae3076287d0cf3…
Patch: https://github.com/kamailio/kamailio/commit/425ba921288c8d5a6ae3076287d0cf3…
---
diff --git a/src/modules/siputils/doc/siputils_admin.xml b/src/modules/siputils/doc/siputils_admin.xml
index 4667e42f63..5764c152d4 100644
--- a/src/modules/siputils/doc/siputils_admin.xml
+++ b/src/modules/siputils/doc/siputils_admin.xml
@@ -1169,22 +1169,35 @@ if (is_supported("outbound")) { ... }
</section>
<section id="siputils.f.is_first_hop">
<title>
- <function moreinfo="none">is_first_hop()</function>
+ <function moreinfo="none">is_first_hop([mode])</function>
</title>
<para>
The function returns true if the proxy is first hop after the
- original sender. For incoming SIP requests, it means there is only
- one Via header. For incoming SIP replies, it means that top
- Record-Route URI is 'myself' and source address is not matching it
- (to avoid detecting in case of local loops). The detection is done
- only when Record-Route has an IP address in its URI (for a domain,
- it returns -1/false).
+ original sender based on a best effort estimation by checking Via
+ and Record-Route headers.
+ </para>
+ <para>
+ For incoming SIP requests, it means there is only one Via header.
+ </para>
+ <para>
+ For incoming SIP replies, if mode==0, it means that top Record-Route
+ URI is 'myself' and source address is not matching local IP (to avoid
+ detecting in case of local loops). Therefore for mode==0 the detection
+ is done only when Record-Route has an IP address in its URI (for a domain,
+ it returns -1/false). If mode==1, then the check of local IP is no
+ longer done, only if top Record-Route is myself, returning true also if
+ there is a domain, assuming that is expected no looping can happen
+ based on config rules.
</para>
<para>
Note that it does not detect spirals, which can have the condition
for replies true also in the case of additional SIP reply reception.
</para>
<para>
+ Parameter mode is optional and can be an integer or a varaible holding
+ an integer. If not provided, the behaviour is like mode==0.
+ </para>
+ <para>
This function can be used from ANY_ROUTE.
</para>
<example>
@@ -1193,6 +1206,8 @@ if (is_supported("outbound")) { ... }
...
if(is_first_hop()) { ... }
...
+if(is_first_hop_mode("1")) { ... }
+...
</programlisting>
</example>
</section>
### 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](https://tools.ietf.org/html/rfc7216#section-4) and [rfc5986#section-4](https://tools.ietf.org/html/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 LIS server.
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.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2574