Back to Blog
Error-Code Fixes

Twilio Error 31208: User Denied Microphone Access: Causes and How to Fix It

The user explicitly denied microphone access in their browser. Error 31208 cannot be fixed in code alone. Here is how to handle it gracefully in your UI.

DA
Danial A
Senior Twilio Consultant, Telphi Consulting
June 21, 2026
6 min read
Twilio
Error
Voice
SIP
Troubleshooting
Twilio Error 31208: User Denied Microphone Access: Causes and How to Fix It

Twilio error 31208 is thrown when the Voice SDK calls getUserMedia to request microphone access and the browser returns a NotAllowedError, meaning the user clicked the deny button on the browser's permission prompt, or the site has a previously saved 'Block' permission for microphone access. Unlike 31201 (hardware access failure), 31208 is a deliberate user or policy decision that cannot be reversed by code: the user or browser must explicitly re-grant the permission.

What Causes This Error

The user clicking 'Block' or 'Deny' when the browser displays the microphone permission request prompt is the primary cause, which sets a persistent 'Block' permission that the browser enforces for all future microphone requests from that origin without showing the prompt again. A previously set 'Block' permission from a past session, stored in the browser's site permissions database, causes 31208 on every call attempt even if the user now intends to allow access, because the stored block prevents the permission prompt from appearing. Browser security policies on iOS devices (both Safari and Chrome on iOS) that require a user gesture (a button click or tap) to trigger getUserMedia requests will cause 31208 if the SDK attempts to acquire the microphone during page load or from a JavaScript timer rather than in direct response to a user action. Enterprise-managed browsers with policy settings that block microphone access for all web applications generate 31208 because the NotAllowedError is returned by the browser's policy enforcement layer before the user is given any choice.

How to Fix It Step by Step

Detect the 31208 error in your Device error handler and display a clear, specific UI message that explains to the user that microphone access is blocked and walks them through the browser-specific steps to re-enable it: in Chrome, click the camera/microphone icon in the address bar then 'Always allow'; in Firefox, click the lock icon then 'More Information' then 'Permissions' then reset the microphone permission; in Safari on macOS, go to Safari menu, then Settings for This Website, then set Microphone to Allow. Provide browser-specific screenshots or a help article link in your UI that matches the user's detected browser (navigator.userAgent parsing), since the permission recovery steps differ between Chrome, Firefox, Safari, and Edge. Before calling Device.connect(), check microphone permission status using the Permissions API (navigator.permissions.query({ name: 'microphone' })) and handle the 'denied' state before the Device error fires, which allows you to show the recovery instructions proactively rather than reactively. For iOS applications, ensure that the Device.connect() call or the getUserMedia call is triggered directly inside a click event handler with no async gaps between the click event and the media request, as iOS requires a direct user gesture chain.

How to Prevent It from Recurring

Display an explicit, friendly microphone permission explanation screen before the browser's native permission prompt appears, explaining why the application needs microphone access and what will happen if it is denied: users who understand the purpose of the request are significantly more likely to grant permission. Trigger the microphone permission request using the Permissions API check first: if the permission state is 'prompt', proceed with getUserMedia; if it is 'denied', show the recovery UI immediately without attempting a call. Add an onboarding step in your first-time user flow that requests and verifies microphone access as part of setup, with clear success and failure states, so that permission issues are resolved during onboarding rather than during the user's first real call. Track the rate of 31208 errors in your application analytics to monitor permission denial rates over time, and A/B test different permission request phrasing and timing to identify which approach produces the highest grant rate.

When to Call a Specialist

For enterprise deployments where users work on managed corporate devices with browser policies that block microphone access, a specialist can identify the specific group policy or mobile device management profile setting that needs to be modified by the IT team to allow browser microphone access for your application's domain. If 31208 errors are appearing even when users report they have not denied permission, there may be a platform-level block (antivirus software, third-party privacy tools, or Windows Privacy Settings blocking app microphone access) that is intercepting the browser's permission request, and a specialist can systematically test each layer to identify the blocking component. A specialist is also useful for implementing a comprehensive permission recovery user experience that handles the full range of browser types, operating systems, and enterprise policy configurations your user base encounters.

Conclusion

Error 31208 is a user-denied permission that cannot be reversed by code: the fix is a clear UI recovery flow that guides the user through the browser-specific steps to re-enable microphone access for your site. If this error is blocking your production system, contact our team and we will diagnose and fix it within the hour.

Share this article:
0 views

Ready to Transform Your Business Communications?

Get a free consultation with our VoIP experts and discover how we can help you save costs, improve efficiency, and scale your business.

Comments (0)

Join the discussion and share your thoughts (AI-moderated for quality)

Protected by AI moderation

Be the first to comment

No comments yet. Share your thoughts below.