Add heartbeat
This commit is contained in:
@@ -179,6 +179,13 @@ class DTMFEvent(BaseEvent):
|
||||
digit: str = Field(..., description="DTMF digit (0-9, *, #, A-D)")
|
||||
|
||||
|
||||
class HeartBeatEvent(BaseModel):
|
||||
"""Server-to-client heartbeat to keep connection alive."""
|
||||
|
||||
event: str = Field(default="heartBeat", description="Event type")
|
||||
timestamp: int = Field(default_factory=current_timestamp_ms, description="Event timestamp in milliseconds")
|
||||
|
||||
|
||||
# Event type mapping
|
||||
EVENT_TYPES = {
|
||||
"incoming": IncomingEvent,
|
||||
@@ -198,6 +205,7 @@ EVENT_TYPES = {
|
||||
"metrics": MetricsEvent,
|
||||
"addHistory": AddHistoryEvent,
|
||||
"dtmf": DTMFEvent,
|
||||
"heartBeat": HeartBeatEvent,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user