E2EE Issue with SIP
Hello LiveKit team! 👋
I have an issue with E2EE encryption during SIP calls and I need your help to resolve it.
Context:
• I'm using LiveKit for calls between web/mobile users and SIP participants (phone)
• I'm using the createOutboundTrunk and createSipParticipant methods from the server SDK
• I've implemented E2EE encryption with a passphrase generated on the server side
• On the frontend, I'm using LiveKit components with the E2EE passphrase
Current Issue:
• When E2EE encryption is enabled on the frontend (with e2eePassphrase), audio works in only one direction
• The web/mobile app user can hear the SIP user (phone) clearly
• But the SIP user hears garbled/encrypted audio from the web/mobile user
• When I disable E2EE encryption on the frontend (without e2eePassphrase), everything works perfectly
Current Implementation:
// Server side - E2EE passphrase generation
generateE2EEKey(roomName: string): string {
const random = randomBytes(32)
const hmac = createHmac('sha256', livekitConfig.serverSecret)
hmac.update(roomName)
hmac.update(random.toString('hex'))
const finalKey = hmac.digest()
return finalKey.toString('base64')
}
// Server side - SIP participant creation (without specific E2EE configuration)
const participant = await sipClient.createSipParticipant(
trunkId,
receiverPhone,
roomName,
{
participantIdentity: receiver.username,
participantName: receiver.displayUsername,
hidePhoneNumber: true,
playDialtone: true,
}
)