@@ -111,6 +111,12 @@ enum SIPTransport {
111111 SIP_TRANSPORT_TLS = 3 ;
112112}
113113
114+ enum SIPHeaderOptions {
115+ SIP_NO_HEADERS = 0 ; // do not map any headers, except ones mapped explicitly
116+ SIP_X_HEADERS = 1 ; // map all X-* headers to sip.h.x-* attributes
117+ SIP_ALL_HEADERS = 2 ; // map all headers to sip.h.* attributes
118+ }
119+
114120message SIPTrunkInfo {
115121 option deprecated = true ;
116122
@@ -194,6 +200,13 @@ message SIPInboundTrunkInfo {
194200 // Map LiveKit attributes to SIP X-* headers when sending BYE or REFER requests.
195201 // Keys are the names of attributes and values are the names of X-* headers they will be mapped to.
196202 map <string , string > attributes_to_headers = 14 ;
203+ // Map SIP headers from INVITE to sip.h.* participant attributes automatically.
204+ //
205+ // When the names of required headers is known, using headers_to_attributes is strongly recommended.
206+ //
207+ // When mapping INVITE headers to response headers with attributes_to_headers map,
208+ // lowercase header names should be used, for example: sip.h.x-custom-header.
209+ SIPHeaderOptions include_headers = 15 ;
197210
198211 // Max time for the caller to wait for track subscription.
199212 google.protobuf.Duration ringing_timeout = 11 ;
@@ -202,7 +215,7 @@ message SIPInboundTrunkInfo {
202215
203216 bool krisp_enabled = 13 ;
204217
205- // NEXT ID: 15
218+ // NEXT ID: 16
206219}
207220
208221message CreateSIPOutboundTrunkRequest {
@@ -241,8 +254,15 @@ message SIPOutboundTrunkInfo {
241254 // Map LiveKit attributes to SIP X-* headers when sending BYE or REFER requests.
242255 // Keys are the names of attributes and values are the names of X-* headers they will be mapped to.
243256 map <string , string > attributes_to_headers = 11 ;
257+ // Map SIP headers from 200 OK to sip.h.* participant attributes automatically.
258+ //
259+ // When the names of required headers is known, using headers_to_attributes is strongly recommended.
260+ //
261+ // When mapping 200 OK headers to follow-up request headers with attributes_to_headers map,
262+ // lowercase header names should be used, for example: sip.h.x-custom-header.
263+ SIPHeaderOptions include_headers = 12 ;
244264
245- // NEXT ID: 12
265+ // NEXT ID: 13
246266}
247267
248268message GetSIPInboundTrunkRequest {
@@ -445,6 +465,13 @@ message CreateSIPParticipantRequest {
445465
446466 // These headers are sent as-is and may help identify this call as coming from LiveKit for the other SIP endpoint.
447467 map <string , string > headers = 16 ;
468+ // Map SIP headers from 200 OK to sip.h.* participant attributes automatically.
469+ //
470+ // When the names of required headers is known, using headers_to_attributes is strongly recommended.
471+ //
472+ // When mapping 200 OK headers to follow-up request headers with attributes_to_headers map,
473+ // lowercase header names should be used, for example: sip.h.x-custom-header.
474+ SIPHeaderOptions include_headers = 17 ;
448475
449476 // Max time for the callee to answer the call.
450477 google.protobuf.Duration ringing_timeout = 11 ;
@@ -453,7 +480,7 @@ message CreateSIPParticipantRequest {
453480
454481 // Enable voice isolation for the callee.
455482 bool enable_krisp = 14 ;
456- // NEXT ID: 17
483+ // NEXT ID: 18
457484}
458485
459486message SIPParticipantInfo {
0 commit comments