# Class CallConfiguration

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

public final class CallConfiguration extends Object

The calling identity this app presents to the operating system: the name shown above a call, the icon beside it, the ringtone, and what kinds of address the app understands.

Hand one to `Calls.configure(CallConfiguration)` before reporting anything. On Android this registers the `PhoneAccount`, and until it has been registered `TelecomManager` silently ignores every incoming call the app reports -- no error, no call, nothing in the log. That silence is why configuring is a separate step rather than something inferred from the first call.

##### What cannot be set here

On iOS the provider's name, icon and ringtone are also needed before any of this app's code runs, because a call arriving as a VoIP push is reported to the system by native code during launch. Those come from build hints baked into the app -- `ios.call.providerName`, `ios.call.icon`, `ios.call.ringtone` -- and what is set here refines them once the app is up. Setting only this and expecting a pushed call to ring with the right name is the mistake the guide warns about.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CallConfiguration()`
  Creates a configuration with the defaults: audio only, calls in the system call log, no conferencing, phone-number and generic handles.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CallConfiguration`
  `displayName(String name)`
  The name shown above a call.
  `String`
  `getDisplayName()`
  The display name, or null for the application's own.
  `CallHandleType[]`
  `getHandleTypes()`
  The address kinds the app understands.
  `int`
  `getMaximumCallGroups()`
  How many conferences may exist at once.
  `int`
  `getMaximumCallsPerGroup()`
  How many calls may be in one conference.
  `CallConfiguration`
  `handleTypes(CallHandleType[] types)`
  Replaces the set of address kinds the app understands.
  `CallConfiguration`
  `includesCallsInRecents(boolean value)`
  Whether calls appear in the system call log.
  `boolean`
  `isIncludesCallsInRecents()`
  Whether calls appear in the system call log.
  `boolean`
  `isVideoSupported()`
  Whether video is offered.
  `CallConfiguration`
  `maximumCallGroups(int value)`
  How many separate conferences may exist at once.
  `CallConfiguration`
  `maximumCallsPerGroup(int value)`
  How many calls may be in one conference.
  `CallConfiguration`
  `videoSupported(boolean value)`
  Whether the app offers video calls.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CallConfiguration

    public CallConfiguration()
    Creates a configuration with the defaults: audio only, calls in the system call log, no conferencing, phone-number and generic handles.

- ## Method Details

  - ### displayName

    public CallConfiguration displayName(String name)
    The name shown above a call. Defaults to the application name.

  - ### videoSupported

    public CallConfiguration videoSupported(boolean value)
    Whether the app offers video calls.

  - ### includesCallsInRecents

    public CallConfiguration includesCallsInRecents(boolean value)
    Whether calls appear in the system call log. Turning this off also stops the user calling back from Recents, which is usually not what is wanted.

  - ### maximumCallGroups

    public CallConfiguration maximumCallGroups(int value)
    How many separate conferences may exist at once.

  - ### maximumCallsPerGroup

    public CallConfiguration maximumCallsPerGroup(int value)
    How many calls may be in one conference.

  - ### handleTypes

    public CallConfiguration handleTypes(CallHandleType[] types)

    Replaces the set of address kinds the app understands.

    At least one, and `null` restores the defaults. An EMPTY array is refused rather than obeyed or ignored: it reads as "route nothing to me", which is not a configuration an account can hold -- a PhoneAccount with no URI scheme and a provider with no handle type can never be given a call -- and the ports had no way to tell it from "not set", so they filled in the defaults and the app silently got the types it had just removed. Refusing says so where the caller can still act on it.

    Parameters:
      `types` - the kinds, or null for the defaults
    Throws:
      `IllegalArgumentException` - when `types` is present and holds no usable kind

  - ### getDisplayName

    public String getDisplayName()
    The display name, or null for the application's own.

  - ### isVideoSupported

    public boolean isVideoSupported()
    Whether video is offered.

  - ### isIncludesCallsInRecents

    public boolean isIncludesCallsInRecents()
    Whether calls appear in the system call log.

  - ### getMaximumCallGroups

    public int getMaximumCallGroups()
    How many conferences may exist at once.

  - ### getMaximumCallsPerGroup

    public int getMaximumCallsPerGroup()
    How many calls may be in one conference.

  - ### getHandleTypes

    public CallHandleType[] getHandleTypes()
    The address kinds the app understands.