diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.h b/sdk/objc/api/peerconnection/RTCConfiguration.h index 86eaa6cee5..cc6b88dec7 100644 --- a/sdk/objc/api/peerconnection/RTCConfiguration.h +++ b/sdk/objc/api/peerconnection/RTCConfiguration.h @@ -204,6 +204,12 @@ RTC_OBJC_EXPORT */ @property(nonatomic, nullable) RTC_OBJC_TYPE(RTCCryptoOptions) * cryptoOptions; +/** + * An optional string that will be attached to the TURN_ALLOCATE_REQUEST which + * which can be used to correlate client logs with backend logs. + */ +@property(nonatomic, nullable, copy) NSString *turnLoggingId; + /** * Time interval between audio RTCP reports. */ diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.mm b/sdk/objc/api/peerconnection/RTCConfiguration.mm index 55abbcdb18..a4af7febbc 100644 --- a/sdk/objc/api/peerconnection/RTCConfiguration.mm +++ b/sdk/objc/api/peerconnection/RTCConfiguration.mm @@ -53,6 +53,7 @@ @synthesize activeResetSrtpParams = _activeResetSrtpParams; @synthesize allowCodecSwitching = _allowCodecSwitching; @synthesize cryptoOptions = _cryptoOptions; +@synthesize turnLoggingId = _turnLoggingId; @synthesize rtcpAudioReportIntervalMs = _rtcpAudioReportIntervalMs; @synthesize rtcpVideoReportIntervalMs = _rtcpVideoReportIntervalMs; @@ -129,6 +130,7 @@ sframeRequireFrameEncryption:config.crypto_options->sframe .require_frame_encryption]; } + _turnLoggingId = [NSString stringWithUTF8String:config.turn_logging_id.c_str()]; _rtcpAudioReportIntervalMs = config.audio_rtcp_report_interval_ms(); _rtcpVideoReportIntervalMs = config.video_rtcp_report_interval_ms(); _allowCodecSwitching = config.allow_codec_switching.value_or(false); @@ -258,6 +260,7 @@ _cryptoOptions.sframeRequireFrameEncryption ? true : false; nativeConfig->crypto_options = absl::optional(nativeCryptoOptions); } + nativeConfig->turn_logging_id = [_turnLoggingId UTF8String]; nativeConfig->set_audio_rtcp_report_interval_ms(_rtcpAudioReportIntervalMs); nativeConfig->set_video_rtcp_report_interval_ms(_rtcpVideoReportIntervalMs); nativeConfig->allow_codec_switching = _allowCodecSwitching;