Class CallAudioSession

java.lang.Object
com.codename1.call.session.CallAudioSession

public final class CallAudioSession extends Object

The moment the operating system hands a call its audio, and the moment it takes it back.

This exists as a type rather than as a bare callback because when the audio arrives is the part of a call implementation that is easiest to get wrong and hardest to notice. On iOS the app configures the audio session's category before reporting a call but must not activate it; CallKit activates it and only then may media start. An app that starts its audio engine when it answers the call instead of when this arrives gets a call with no sound and no error message.

Android has no equivalent handoff, so the Android port and the simulation synthesize this the moment the connection becomes active. Application code therefore has one place to start media on every platform.

  • Method Details

    • getCallId

      public String getCallId()
      The call this audio belongs to.
    • getRoute

      public CallAudioRoute getRoute()
      Where the audio is going as of this moment. It can change afterwards; Calls.getAudioRoute() is the live answer.