### Description
In the case of using FQDN in `listen = ... advertise ... ` FQDN is populated in the `Record-Route` header. In this case `is_first_hop()` function is not returning true even if `FQDN == myself` in replies.
#### Reproduction
Add FQND in advertise and check `is_first_hop()` result in a case of reply
#### Log Messages
``` siputils [sipops.c:185]: is_first_hop(): uri host is not an ip address ```
### Possible Solutions
Not use `is_first_hop()` in the case of reply/FQDN in advertising.
### Additional Information
version: kamailio 5.4.4 (x86_64/linux) e16352 flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: e16352 compiled on 09:50:10 May 7 2021 with gcc 4.8.5
* **Operating System**:
``` # uname -a Linux fe-0513-2-dev 3.10.0-1160.21.1.el7.x86_64 #1 SMP Tue Mar 16 18:28:22 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
``` https://github.com/kamailio/kamailio/blob/02240711239149e2f5c4890a70ab158d10...
For replies, the function `is_first_hop()` is a best effort attempt to figure out if the proxy is the node next to the callee and cannot detect spirals. See the readme explaining what it does for a reply.
The parsing of the IP in the record route header is needed to match the source IP and detect loops, this is by design and needed for the expected behaviour.
A new function (or parameter) can be added to control if one needs to detect loops or not, based on how its SIP routing is designed through the proxy.
Daniel, thanks for the clarification, really missed the option it's working only with IP addresses. Then it's definitely not a bug.
Added `is_first_hop(mode)` in master branch that should allow skipping the check for ip address and match against source ip.
Closed #2732.