On 24/01/2023 06.05, [EXT] John Hardiman wrote:
...

So anything between FreeSWITCH and Kamailio/RTPengine uses the private IP's for media, the rest use public IP's.

 

It is good to note that the RTPengine's are the same in each set (3 total RTPengine's), just using the public/private IP's based on set ID.

 ...

# Public IP's ID 1:

modparam("rtpengine", "rtpengine_sock", "1 == udp:5.5.5.5:2223 udp:6.6.6.6:2223 udp:7.7.7.7:2223")

# Internal IP's ID 2:

modparam("rtpengine", "rtpengine_sock", "2 == udp:10.0.0.1:2223 udp:10.0.0.2:2223 udp:10.0.0.3:2223")

 ...

Using the above, the Kamailio starts fine and understands/loads each set of RTPengine's and calls work with audio. but regardless of the set number used (even only using set 2 in both) it defaults to public IP's in the SDP. (This is the only place in the config where this function is defined)

 

Rtpengine doesn't distinguish between which IP address you use to communicate with it, so using multiple sets to talk to the same rtpengine instances (just with different IPs) is pointless for this purpose.

Instead, what you want to do is list the interfaces you have available in rtpengine's config file with different names (e.g. "int" for just the private address, and "ext" for the same address but with the public address as "advertised address") and then use the `direction=` flags in your calls to rtpengine_manage to tell rtpengine which interfaces to use.

The first `direction=` corresponds to where the message is coming from (, the second corresponds to where it's going to. So for example, if the SDP has an internal/private address in it, and you know the outgoing SDP will go an external system requiring the public address,  you would use `direction=int direction=ext`.

There's no need to have multiple rtpengine sets configured in Kamailio for this.

HTH

Cheers