fix(proxy-engine): fix inbound route browser ringing and provider-facing SDP advertisement while preventing RTP port exhaustion

This commit is contained in:
2026-04-11 18:40:56 +00:00
parent 21ffc1d017
commit 81441e7853
17 changed files with 208 additions and 469 deletions

View File

@@ -30,6 +30,11 @@ impl Endpoint {
}
/// Provider quirks for codec/protocol workarounds.
//
// Deserialized from provider config for TS parity. Early-media silence
// injection and related workarounds are not yet ported to the Rust engine,
// so every field is populated by serde but not yet consumed.
#[allow(dead_code)]
#[derive(Debug, Clone, Deserialize)]
pub struct Quirks {
#[serde(rename = "earlyMediaSilence")]
@@ -44,6 +49,9 @@ pub struct Quirks {
#[derive(Debug, Clone, Deserialize)]
pub struct ProviderConfig {
pub id: String,
// UI label — populated by serde for parity with the TS config, not
// consumed at runtime.
#[allow(dead_code)]
#[serde(rename = "displayName")]
pub display_name: String,
pub domain: String,
@@ -54,6 +62,8 @@ pub struct ProviderConfig {
#[serde(rename = "registerIntervalSec")]
pub register_interval_sec: u32,
pub codecs: Vec<u8>,
// Workaround knobs populated by serde but not yet acted upon — see Quirks.
#[allow(dead_code)]
pub quirks: Quirks,
}
@@ -84,6 +94,10 @@ pub struct RouteMatch {
/// Route action.
#[derive(Debug, Clone, Deserialize)]
// Several fields (voicemail_box, ivr_menu_id, no_answer_timeout) are read
// by resolve_inbound_route but not yet honored downstream — see the
// multi-target TODO in CallManager::create_inbound_call.
#[allow(dead_code)]
pub struct RouteAction {
pub targets: Option<Vec<String>>,
#[serde(rename = "ringBrowsers")]
@@ -106,7 +120,11 @@ pub struct RouteAction {
/// A routing rule.
#[derive(Debug, Clone, Deserialize)]
pub struct Route {
// `id` and `name` are UI identifiers, populated by serde but not
// consumed by the resolvers.
#[allow(dead_code)]
pub id: String,
#[allow(dead_code)]
pub name: String,
pub priority: i32,
pub enabled: bool,
@@ -192,10 +210,18 @@ pub fn matches_pattern(pattern: Option<&str>, value: &str) -> bool {
/// Result of resolving an outbound route.
pub struct OutboundRouteResult {
pub provider: ProviderConfig,
// TODO: prefix rewriting is unfinished — this is computed but the
// caller ignores it and uses the raw dialed number.
#[allow(dead_code)]
pub transformed_number: String,
}
/// Result of resolving an inbound route.
//
// `device_ids` and `ring_browsers` are consumed by create_inbound_call.
// The remaining fields (voicemail_box, ivr_menu_id, no_answer_timeout)
// are resolved but not yet acted upon — see the multi-target TODO.
#[allow(dead_code)]
pub struct InboundRouteResult {
pub device_ids: Vec<String>,
pub ring_browsers: bool,