通知
本站点除 Legacy 产品与方案外,已迁移至 声网新文档中心 ,当前页面不再维护
Documentation
All
Console 官网 Community Technical support

How do I avoid sending audio streams to remote users during a phone call?

Type: Integration issues    Platform: Android   Last Updated: 2022/09/14 23:38:27

Issue description

On Android devices, when the local user uses an app that integrates the Agora RTC SDK for real-time engagement, and then dials or answers a phone call, the audio stream is still sent to remote users.

Reason

The SDK listens for Android call events and calls disableAudio to disable the audio module by default when the user dials or answers a phone call. If you add business logic that intercepts call events in your app, the SDK can no longer determine when a user is dialing or receiving a call, so this issue occurs.

Solution

To solve the issue, do the following:

  1. Check which Android call events your app intercepted:
    • CALL_STATE_RINGING
    • CALL_STATE_OFFHOOK
  2. Change your business logic to resume listening for the intercepted call events.