first commit
This commit is contained in:
commit
efa5080897
127 changed files with 18610 additions and 0 deletions
18
backend/app/voice/relay_config.py
Normal file
18
backend/app/voice/relay_config.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from sqlalchemy import select
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from ..models import PhoneNumber, VoiceSocketEndpoint
|
||||
|
||||
|
||||
def resolve_voice_socket(
|
||||
db: Session,
|
||||
*,
|
||||
phone_number: PhoneNumber,
|
||||
) -> VoiceSocketEndpoint | None:
|
||||
return db.scalar(
|
||||
select(VoiceSocketEndpoint).where(
|
||||
VoiceSocketEndpoint.phone_number_id == phone_number.id,
|
||||
VoiceSocketEndpoint.user_id == phone_number.user_id,
|
||||
VoiceSocketEndpoint.enabled.is_(True),
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue