|
18 | 18 | ConnectTwilioCallResponse, |
19 | 19 | ) |
20 | 20 | from ._service import Service |
21 | | -from ._dial_timeout import dial_timeout, pin_ringing_timeout |
| 21 | +from ._dial_timeout import DEFAULT_RINGING_TIMEOUT |
22 | 22 | from .access_token import VideoGrants |
23 | 23 |
|
24 | 24 | SVC = "Connector" |
@@ -119,20 +119,21 @@ async def accept_whatsapp_call( |
119 | 119 | Args: |
120 | 120 | request: AcceptWhatsAppCallRequest containing call parameters and SDP |
121 | 121 | timeout: Optional request timeout in seconds. When the request waits |
122 | | - for an answer (wait_until_answered), it defaults to a longer value |
123 | | - (dialing takes time) and is raised, if needed, to stay above the |
124 | | - request's ringing_timeout. |
| 122 | + for an answer (wait_until_answered), it defaults to the standard |
| 123 | + ring window; set it above the ringing_timeout passed to |
| 124 | + dial_whatsapp_call (the two calls are separate, so the SDK can't |
| 125 | + derive it). |
125 | 126 |
|
126 | 127 | Returns: |
127 | 128 | AcceptWhatsAppCallResponse with the room name |
128 | 129 | """ |
129 | 130 | client_timeout: Optional[aiohttp.ClientTimeout] = None |
130 | 131 | if request.wait_until_answered: |
131 | | - # Waiting for the call to be answered dials a phone, which takes |
132 | | - # longer than a normal request and must outlast ringing. Pin the ring |
133 | | - # window so the timeout doesn't depend on the server's default. |
134 | | - pin_ringing_timeout(request) |
135 | | - client_timeout = aiohttp.ClientTimeout(total=dial_timeout(timeout, request)) |
| 132 | + # Accept can block until the call is answered, so default to the |
| 133 | + # standard ring window; the caller overrides via timeout. |
| 134 | + client_timeout = aiohttp.ClientTimeout( |
| 135 | + total=timeout if timeout else DEFAULT_RINGING_TIMEOUT |
| 136 | + ) |
136 | 137 | elif timeout: |
137 | 138 | client_timeout = aiohttp.ClientTimeout(total=timeout) |
138 | 139 |
|
|
0 commit comments