Skip to content

Conversation

@sobomax
Copy link
Contributor

@sobomax sobomax commented Jan 2, 2026

Summary

This PR adds more flexible control over socket that RTPProxy picks for a new or existing media session. The existing mechanism with I/E designators is a bit crude and limiting.

Details

When rtpp_bind_local AVP is set, its value would be provided to the rtpproxy with "l" modifier, allowing proper address to be selected for the session.

Solution

This can be used either globally by setting the rtpproxy module parameter:

modparam("rtpproxy", "rtpp_bind_local_avp", "$socket_out(ip)")

Or on logic level by setting up the AVP:

route[] {
...
   $avp(rtpp_bind_local) = '1.2.3.4';
   rpproxy_engage();
...

Compatibility

Should be none, it's a new API.

Closing issues

None

When this AVP is set, its value would be provided to the rtpproxy
with "l" modifier, allowing proper address to be selected for the
session.
@razvancrainea
Copy link
Member

@sobomax I love the idea of passing the local socket to rtpproxy, but we're trying to avoid using AVPs for passing information like that, as it might confuse people (happened too many times). That's why we'd rather explicitely using the argument as a flag to rtpproxy_offer/answer/engage(). That's actually why we like to pass all the other flags explicitely (see n[<SOCKET>] param), as it is more clear and avoids erronously inherritting the AVP on replies. That's also why we dropped setting the set_id through an AVP as well, even though the AVP inherittance would be a plus in that scenario. Can you please refactor this to pass the bind socket as a parameter, something likel<SOCKET> (I know we already use l as a forced lookup, but this time is followed by <, so we can clearly differentiate; or simply use a different letter)

Furthermore, not sure if the protocol supports, but it would be nice to have some sort of interface alias/tag - that's useful when using multiple rtpproxy instances in a set, where you have different IPs configuration, and simply choose internal or external interface. Your example shows an IP, so I presumed that currently only IPs are allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants