Skip to content

Commit

Permalink
modules: readme files regenerated - siputils ... [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
kamailio-dev committed May 11, 2021
1 parent 425ba92 commit 9c2fea2
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions src/modules/siputils/README
Expand Up @@ -96,7 +96,7 @@ Gabriel Vasile
4.30. is_reply()
4.31. is_gruu([uri])
4.32. is_supported(option)
4.33. is_first_hop()
4.33. is_first_hop([mode])
4.34. sip_p_charging_vector(flags)
4.35. contact_param_encode(pname, saddr)
4.36. contact_param_decode(pname)
Expand Down Expand Up @@ -217,7 +217,7 @@ Chapter 1. Admin Guide
4.30. is_reply()
4.31. is_gruu([uri])
4.32. is_supported(option)
4.33. is_first_hop()
4.33. is_first_hop([mode])
4.34. sip_p_charging_vector(flags)
4.35. contact_param_encode(pname, saddr)
4.36. contact_param_decode(pname)
Expand Down Expand Up @@ -438,7 +438,7 @@ modparam("auth", "rpid_avp", "$avp(myrpid)")
4.30. is_reply()
4.31. is_gruu([uri])
4.32. is_supported(option)
4.33. is_first_hop()
4.33. is_first_hop([mode])
4.34. sip_p_charging_vector(flags)
4.35. contact_param_encode(pname, saddr)
4.36. contact_param_decode(pname)
Expand Down Expand Up @@ -994,24 +994,37 @@ if(is_gruu()) { ... }
if (is_supported("outbound")) { ... }
...

4.33. is_first_hop()
4.33. is_first_hop([mode])

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).
sender based on a best effort estimation by checking Via and
Record-Route headers.

For incoming SIP requests, it means there is only one Via header.

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.

Note that it does not detect spirals, which can have the condition for
replies true also in the case of additional SIP reply reception.

Parameter mode is optional and can be an integer or a varaible holding
an integer. If not provided, the behaviour is like mode==0.

This function can be used from ANY_ROUTE.

Example 1.42. is_first_hop() usage
...
if(is_first_hop()) { ... }
...
if(is_first_hop_mode("1")) { ... }
...

4.34. sip_p_charging_vector(flags)

Expand Down

0 comments on commit 9c2fea2

Please sign in to comment.