steep-balloon-41261
07/25/2025, 11:21 AMtall-airline-16756
07/25/2025, 11:21 AMtall-airline-16756
07/25/2025, 11:22 AMsend_dtmf_code Issues:
• Rapid Firing Prevention: Ensure a cooldown mechanism is implemented to prevent sending DTMF codes too quickly. For example, a 3-second cooldown is commonly used.
• Proper Context Management: The function requires access to the room context and local participant. Ensure these are properly initialized and available.
2. end_call Issues:
• Context Availability: Verify that the job context is available before attempting to end calls. Missing context can lead to errors.
• API Error Handling: Wrap API calls in try-catch blocks to handle exceptions, such as connection issues or API errors, gracefully.
3. General API Error Patterns:
• Connection and Timeout Errors: Handle errors like APIConnectionError, APITimeoutError, and APIStatusError effectively.
• Async/Await Issues: Ensure proper use of async/await, including awaiting function calls and handling exceptions in async contexts.
4. Best Practices:
• Implement cooldown mechanisms for DTMF functions to prevent rapid firing.
• Verify that required contexts (e.g., job context, room context) are available before making API calls.
• Include comprehensive logging for debugging purposes.
Note: Specific issues with the delayed_response function were not covered in the available documentation. If you encounter specific problems with this function, please provide additional details for further assistance.
Sources: livekit-plugins/livekit-plugins-inworld/livekit/plugins/inworld/tts.py | ivr-nagivator/README.mdoc | telephony/sip_lifecycle.pytall-airline-16756
07/25/2025, 11:23 AM