Hello,

 

I have a Kamailio machine configured with two interfaces. One public, one private.

Public Address: 10.10.10.10

Private Address: 192.168.1.10

 

Kamailio forwards the SIP packet to another local endpoint: 192.168.1.20

 

When a client sends a SIP packet using TCP to the public address of Kamailio, Kamailio relays the packet using its private interface (private address) to the other endpoint.

TCP: Client -> 10.10.10.10 -> 192.168.1.10 -> 192.18.1.20

 

When a client sends a SIP packet using UDP to the public address of Kamailio, Kamailio (or the OS) relays the packet using its public interface (public address) to the other endpoint.

UDP: Client -> 10.10.10.10 -> 10.10.10.10  -> 192.18.1.20

 

In the case of TCP, the source address is 192.168.1.10.

In the case of UDP, the source address is 10.10.10.10.

Everything is the same in the routing script for both UDP and TCP, except in route[relay] (see below)

 

Is this normal? What is causing this, the OS or Kamailio?

 

Route[RELAY] {

                …

 

                if($pr =~ "TCP") {

                               if (!t_relay_to_tcp()) {

                                               sl_reply_error();

                               }

                } else {

                               if (!t_relay_to_udp()) {

                                               sl_reply_error();

                               }

                }

}