Skip to content

Commit 69f1784

Browse files
committed
fix types
1 parent 7498d6f commit 69f1784

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

livekit-api/livekit/api/_dial_timeout.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
from __future__ import annotations
22

3-
from typing import Optional
3+
from typing import Optional, Union
4+
5+
from livekit.protocol.connector_whatsapp import AcceptWhatsAppCallRequest
6+
from livekit.protocol.sip import CreateSIPParticipantRequest, TransferSIPParticipantRequest
7+
8+
# Requests that carry wait_until_answered / ringing_timeout and share the
9+
# phone-dialing timeout behavior.
10+
DialRequest = Union[
11+
CreateSIPParticipantRequest,
12+
TransferSIPParticipantRequest,
13+
AcceptWhatsAppCallRequest,
14+
]
15+
"""@private"""
416

517
# Calls that dial a phone (SIP CreateSIPParticipant with wait_until_answered and
618
# TransferSIPParticipant; WhatsApp AcceptWhatsAppCall with wait_until_answered)
@@ -15,7 +27,7 @@
1527
"""@private"""
1628

1729

18-
def dial_timeout(user_timeout: Optional[float], request) -> float:
30+
def dial_timeout(user_timeout: Optional[float], request: DialRequest) -> float:
1931
"""Request timeout (seconds) for a phone-dialing call: the user-supplied
2032
value (or the dial default) raised, when needed, to stay at least
2133
RINGING_TIMEOUT_MARGIN above the request's ringing_timeout.

0 commit comments

Comments
 (0)