From 952afc39845aa6136f38b3102ca1dfa5fe7eb082 Mon Sep 17 00:00:00 2001 From: "data-plane-api(Azure Pipelines)" Date: Fri, 25 Feb 2022 16:03:01 +0000 Subject: [PATCH] sipproxy: enhance routing handler and async framework (#19951) * Enhance the routing handler with specified SIP Header; * Update the async query framework; * Update local_services configuration; * Add 503 Error Response. Signed-off-by: Felix Du Mirrored from https://github.com/envoyproxy/envoy @ 40649c4200f1938011b181be64173dcb10ffaea7 --- .../network/sip_proxy/tra/v3alpha/tra.proto | 2 +- .../network/sip_proxy/v3alpha/route.proto | 6 +++ .../network/sip_proxy/v3alpha/sip_proxy.proto | 49 ++++++++++++++++--- 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/contrib/envoy/extensions/filters/network/sip_proxy/tra/v3alpha/tra.proto b/contrib/envoy/extensions/filters/network/sip_proxy/tra/v3alpha/tra.proto index ca6baf9f..90a29d09 100644 --- a/contrib/envoy/extensions/filters/network/sip_proxy/tra/v3alpha/tra.proto +++ b/contrib/envoy/extensions/filters/network/sip_proxy/tra/v3alpha/tra.proto @@ -18,7 +18,7 @@ option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/fil option java_generic_services = true; option (udpa.annotations.file_status).package_version_status = ACTIVE; -// [#protodoc-title: TrafficRoutingAssistant] +// [#protodoc-title: Tra] service TraService { rpc Create(TraServiceRequest) returns (TraServiceResponse) { diff --git a/contrib/envoy/extensions/filters/network/sip_proxy/v3alpha/route.proto b/contrib/envoy/extensions/filters/network/sip_proxy/v3alpha/route.proto index 11bcdac3..5f906b53 100644 --- a/contrib/envoy/extensions/filters/network/sip_proxy/v3alpha/route.proto +++ b/contrib/envoy/extensions/filters/network/sip_proxy/v3alpha/route.proto @@ -37,6 +37,12 @@ message RouteMatch { // The domain from Request URI or Route Header. string domain = 1; } + + // The header to get match parameter, default is "Route". + string header = 2; + + // The parameter to get domain, default is "host". + string parameter = 3; } message RouteAction { diff --git a/contrib/envoy/extensions/filters/network/sip_proxy/v3alpha/sip_proxy.proto b/contrib/envoy/extensions/filters/network/sip_proxy/v3alpha/sip_proxy.proto index d13c2cde..26a0241d 100644 --- a/contrib/envoy/extensions/filters/network/sip_proxy/v3alpha/sip_proxy.proto +++ b/contrib/envoy/extensions/filters/network/sip_proxy/v3alpha/sip_proxy.proto @@ -61,13 +61,15 @@ message SipProxy { // +---------+-------------------------+----------+------------------------------------------------------------------------------+ google.protobuf.Duration transaction_timeout = 1; - // own domain name - string own_domain = 2; + // The service to match for ep insert + repeated LocalService local_services = 2; - // points to domain match with own_domain - string domain_match_parameter_name = 3; + tra.v3alpha.TraServiceConfig tra_service_config = 3; - tra.v3alpha.TraServiceConfig tra_service_config = 4; + // Whether via header is operated, including add via for request and pop via for response + // False: sip service proxy + // True: sip load balancer + bool operate_via = 4; } // The human readable prefix to use when emitting statistics. @@ -111,14 +113,45 @@ message SipProtocolOptions { bool registration_affinity = 2; // Customized affinity - repeated CustomizedAffinity customized_affinity = 3; + CustomizedAffinity customized_affinity = 3; } // For affinity message CustomizedAffinity { + // Affinity rules to conclude the upstream endpoint + repeated CustomizedAffinityEntry entries = 1; + + // Configures whether load balance should be stopped or continued after affinity handling. + bool stop_load_balance = 2; +} + +message CustomizedAffinityEntry { + // Affinity key for TRA query/subscribe string key_name = 1; - bool query = 2; + // Whether subscribe to TRA is required + bool subscribe = 2; + + // Whether query to TRA is required + bool query = 3; + + // Local cache + Cache cache = 4; +} + +message Cache { + // Affinity local cache item max number + int32 max_cache_item = 1; + + // Whether query result can be added to local cache + bool add_query_to_cache = 2; +} + +// Local Service +message LocalService { + //The domain need to matched + string domain = 1; - bool subscribe = 3; + //The parameter to get domain + string parameter = 2; }