Hi all,
I've been recently testing kamailio support for proxy protocol which was
introduced by https://github.com/kamailio/kamailio/issues/1757. As reported
by others, even if kamailio is able to decode the proxy protocol and get
the client's original IP address, it is unable to send SIP messages to the
client which initiated the connection through the HA load balancer (nginx
in my case). After investigation I've found that there is no alias added to
the tcp connection aliases list for the tuple
CLIENT_IP:CLIENT_PORT/LOCAL_KAMAILIO_IP:KAMAILIO_PORT. This means that when
trying to forward a message to the originating client kamailio won't use
the existing connection with the load balancer/proxy but will try to
establish a new connection. The fact is that the function which parses the
proxy header overwrites the dst ip/port of the connection with the
"Destination IP" and "Destination Port" fields of the proxy header (
https://github.com/kamailio/kamailio/blob/f677dea597db6ceaa66a2755dd6e9e738…
for v2,
https://github.com/kamailio/kamailio/blob/f677dea597db6ceaa66a2755dd6e9e738…
for v1). This fields contain the IP/port of the Load Balancer, not the
kamailio IP/Port, and kamailio will fail to find a tcp connection toward
the client's src IP since the Load Balancer IP is not a kamailio's local
socket.
I think that the destination IP of the connection shouldn't be rewritten
with the load balancer IP, unless I'm missing something.
Hopefully I've been clear enough explaining the issue :)
If you agree with the analysis I can prepare a PR for it.
Have you all a great weekend,
Federico Cabiddu
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
I noticed in the logs messages similar to errors (in fact, this is INFO level).
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
#### Reproduction
Retrive **kamailioSIPSummaryOutResponses** statistic
`snmpwalk -v 2c -c public localhost .1.3.6.1.4.1.34352.3.1.1.1.3.4`
And you will see errors in log file.
<!--
If the issue can be reproduced, describe how it can be done.
-->
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
INFO /usr/local/sbin/kamailio[15984]: INFO: snmpstats [utilities.c:116]: get_statistic(): failed to retrieve statistics for local_replies
INFO /usr/local/sbin/kamailio[15984]: INFO: snmpstats [utilities.c:116]: get_statistic(): failed to retrieve statistics for relayed_replies
```
### Possible Solutions
I found part of code
https://github.com/kamailio/kamailio/blob/026119200117d20740cbe4d162a14767f…
and it seems that tm module no longer has `local_replies` and `relayed_replies` statistics.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.4.3 (x86_64/linux)
```
--
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/2865
### Description
dlgs: dlgs_tags_count(): always returns 1 and not count of dialogs.
### Possible Solutions
I guess [ki_dlgs_tags_count](https://github.com/kamailio/kamailio/blob/master/src/mo… should return `ret` instead of 1.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.3.5 (x86_64/linux)
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: unknown
compiled with gcc 4.9.2
```
--
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/2884