### Description

When using Kamailio with `tcp_accept_haproxy=yes`, the `$si` and `$sp` 
variables have the 
 real IP & Port information from the original connection to the LB leaving no 
way to access the connection IP & Port from where the packet is received from 
Kamailio perspective.

### Possible Solutions

Create two new pseudovariables that contain the connection IP & Port where the 
packet was received for use cases where `tcp_accept_haproxy=yes`.

Suggested names (but could be any): $CI and $CP meaning -> Connection IP and 
Connection Port.

### Example

With `tcp_accept_haproxy=yes`:

UAC (1.1.1.1:45621) -> (2.2.2.2:5060) LB **with** Proxy Protocol 
(3.3.3.3:57482) -> (4.4.4.4:5060) Kamailio.

```
$si = 1.1.1.1
$sp = 45621
$CI = 3.3.3.3
$CP = 57482
```

With `tcp_accept_haproxy=no`:

UAC (1.1.1.1:45621) -> (2.2.2.2:5060) LB **without** Proxy Protocol 
(3.3.3.3:57482) -> (4.4.4.4:5060) Kamailio.

```
$si = 3.3.3.3
$sp = 57482
$CI = 3.3.3.3
$CP = 57482
```


I don't think there is any way to get the `3.3.3.3:57482` IP and Port from the 
example above when using `tcp_accept_haproxy=yes` but I could be wrong.

Thanks!
Joel.



-- 
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/2103
_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to