Error Handling
Common errors, debugging techniques, and troubleshooting guide for the Telnyx React Native SDK.Authentication Errors
Invalid Credentials
Error:AUTH_FAILED or INVALID_CREDENTIALS
Symptoms: Login fails with credential-based authentication.
Solutions:
Token Validation Errors
Error:INVALID_TOKEN or TOKEN_EXPIRED
Symptoms: JWT token authentication fails.
Solutions:
Connection Errors
Error:CONNECTION_FAILED or NETWORK_ERROR
Symptoms: Cannot establish WebRTC connection.
Solutions:
Call Errors
Call Creation Failures
Error:CALL_FAILED or INVALID_DESTINATION
Symptoms: Cannot initiate outgoing calls.
Solutions:
Call Control Errors
Error:CALL_NOT_FOUND or INVALID_STATE
Symptoms: Call control operations fail.
Solutions:
Audio and Media Errors
Audio Permission Errors
Error:MICROPHONE_PERMISSION_DENIED
Symptoms: No audio in calls, microphone access denied.
Solutions:
Audio Routing Issues
Error:AUDIO_ROUTING_FAILED
Symptoms: Audio plays through wrong device (speaker/earpiece).
Solutions:
Push Notification Errors
Token Registration Errors
Error:PUSH_TOKEN_INVALID or PUSH_REGISTRATION_FAILED
Symptoms: Push notifications not working.
Solutions:
Background Processing Errors
Symptoms: Incoming calls not handled when the app is backgrounded or terminated. Do not registermessaging().setBackgroundMessageHandler(...) from JavaScript. Android background push is handled entirely by the native TelnyxFirebaseMessagingService that your AppFirebaseMessagingService extends — a JS handler will race the native service and can drop or double-process calls. There is no TelnyxVoiceApp.handleBackgroundPush step on Android.
Things to check instead:
- Your
MainActivityextendsTelnyxMainActivity. - Your FCM service extends
TelnyxFirebaseMessagingServiceand is registered inAndroidManifest.xml. - Your notification action receiver extends
TelnyxNotificationActionReceiverand is registered inAndroidManifest.xmlwith the correct action names. google-services.jsonis present at the project root and the FCM server key is configured in the Telnyx portal.- On cold-start from push, you are not calling
login*unconditionally — see Push Notification Flow and guard withTelnyxVoipClient.isLaunchedFromPushNotification().
Network and Connectivity Errors
WebRTC Connection Issues
Error:WEBRTC_CONNECTION_FAILED or ICE_CONNECTION_FAILED
Symptoms: Calls connect but no audio, or connection drops frequently.
Solutions:
Firewall and NAT Issues
Error:NAT_TRAVERSAL_FAILED or FIREWALL_BLOCKED
Symptoms: Cannot connect to WebRTC servers, especially on corporate networks.
Solutions:
Memory and Performance Errors
Memory Leaks
Error:MEMORY_WARNING or app crashes
Symptoms: App becomes slow or crashes after extended use.
Solutions:
Performance Issues
Error: Slow UI, delayed call operations Solutions:Debugging Tools
Enable Debug Logging
Network Request Monitoring
Call State Debugging
Error Recovery Strategies
Automatic Recovery
Graceful Degradation
Best Practices
Error Handling Patterns
- Always wrap async operations in try-catch
- Provide user-friendly error messages
- Log detailed error information for debugging
- Implement retry logic for transient failures
- Gracefully degrade functionality when possible
Monitoring and Analytics
Testing Error Scenarios
Getting Help
When encountering persistent issues:- Enable debug logging and collect detailed logs
- Document reproduction steps clearly
- Include device and OS information
- Check the error handling guides for your specific issue
- Contact Telnyx Support with comprehensive information
See Also
- Push Notification Setup: Push notification configuration
- Quickstart Guide: Setup and configuration
- API Reference: Detailed method documentation