Introduce three new NG protocol flags that automatically select the matching
configured rtpengine interface based on the system's routing table:
- inbound-peer=<ip>: resolves to interface for inbound (from) direction
- outbound-peer=<ip>: resolves to interface for outbound (to) direction
- peer=<ip> resolves to interface when only one interface is required
When these flags are used, the system:
- Uses a temporary UDP socket to determine the local address assigned by routing
- Finds the first configured rtpengine interface matching that local address
- Uses that interface for the media stream
This allows dynamic interface selection based on network topology without
requiring explicit interface names in the signaling.
Closes#2033
Change-Id: I211806b9cef9d028fdb689d90ea3fe627bdf5d0d
Instead of opening local sockets directly during call setup, just create
the appropriate objects first, and then open the actual sockets in a
second step.
Move the opening step down, after the bundle logic has run. This way we
can avoid opening sockets that aren't needed.
Removes an intermediate step of obtaining consecutive ports.
Change-Id: Ib94c871ed6b3a433872afd23cb1aebbd9910b33e
The key for an in-kernel stream is a local port, so it is really the
socket (port) that gets pushed into the kernel, not the packet_stream.
Similar to the "confirmed" state, as we expect each socket to only have
one peer address/port.
Change-Id: I34fef771cd8b01701196ffb77e17fcd229c86550
With selected_sfd being protected by in_lock, we pretty much have to
hold at least in_lock everywhere, and end up requiring both locks in
many places. The distinction has become pointless.
Change-Id: Ic0ad976c2d68d9639b9434da7f0e6e9c0d84c185
Separate out the two distinct use cases of requesting a specific port,
and requesting (one or more) random ports.
Change-Id: Ifbe7725d8638d49f620c9f4b9445342d180c8770
Avoid repeated calls to the memory allocated for port pool list
management by picking out the list elements without freeing them,
storing them in the stream_fd object, and then returning them to the
list when the port is released.
Change-Id: I67cd5039e62e4d2965e85d7ba7f0454f08f40494