feat: add call history API endpoints and TTS service client
Adds read-only access to persisted call records for the dashboard and implements a client for the Rhema text-to-speech service. - api/call_history.py: New router providing paged call lists and detailed call records with transcript metadata. - services/tts.py: Async client for OpenAI-compatible TTS endpoints (Rhema/Kokoro) used for call-flow steps.
This commit is contained in:
@@ -38,6 +38,7 @@ class Device(DeviceBase):
|
||||
|
||||
id: str
|
||||
is_online: bool = False
|
||||
dnd: bool = False
|
||||
last_seen: Optional[datetime] = None
|
||||
created_at: Optional[datetime] = None
|
||||
updated_at: Optional[datetime] = None
|
||||
@@ -45,6 +46,8 @@ class Device(DeviceBase):
|
||||
@property
|
||||
def can_receive_call(self) -> bool:
|
||||
"""Can this device receive a call right now?"""
|
||||
if self.dnd:
|
||||
return False
|
||||
if self.type in (DeviceType.SIP_PHONE, DeviceType.SOFTPHONE, DeviceType.WEBRTC):
|
||||
return self.is_online and self.sip_uri is not None
|
||||
if self.type == DeviceType.CELL:
|
||||
|
||||
Reference in New Issue
Block a user