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>