Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poc sip #301

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Poc sip #301

wants to merge 4 commits into from

Conversation

lebaudantoine
Copy link
Collaborator

Purpose

Description...

Proposal

Description...

  • [] item 1...
  • [] item 2...

Oopsie. Forgot to run migrations while fixing Django warnings.
Enable users to join rooms via SIP telephony by:
- Dialing the SIP trunk number
- Entering the room's PIN followed by '#'

The PIN code needs to be generated before the LiveKit room is created,
allowing the owner to send invites to participants in advance.

With 9-digit PINs (10^9 combinations) and a large number of rooms
(e.g., 1M), collisions are inevitable. However, a retry mechanism reduces
the likelihood of multiple consecutive collisions.

Discussion points:
- The `while` loop should be reviewed. Should we add rate limiting
  for failed attempts?
- A systematic existence check before `INSERT` is more costly for a rare
  event and doesn't prevent race conditions, whereas retrying on integrity
  errors is more efficient overall.
- Should we add logging or monitoring to track and analyze collisions?

I tried balances performance and simplicity while ensuring the
robustness of the PIN generation process.
Users require a phone number and PIN code to join a meeting by phone.

This code is an initial brainstorming effort:
- Phone numbers must be purchased from a SIP Trunk provider, which
  converts phone calls into Voice over IP (VoIP) and initiates a SIP
  connection with our LiveKit SIP server.
- The Trunk provider needs to be configured with the LiveKit SIP server,
  either via CLI commands or API calls.

Open questions for design:
- Should a phone number be persisted in Django settings? This approach
  risks the serialized number becoming out of sync with the actual
  configuration.
- Alternatively, should we list configured numbers from the LiveKit SIP
  server? This ensures accuracy but comes with the performance cost of
  querying the LiveKit API. Could a caching strategy mitigate this issue?

Currently, the right design strategy remains unclear. Data responsibility
seems to naturally belong on the LiveKit side, but further discussion and
exploration are needed.
To ensure consistency, generate a pin code for existing
rooms in db.

Not sure of this approach.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant