# Class PushedCall

java.lang.Object
com.codename1.call.voip.PushedCall

public final class PushedCall extends Object

A call that is already ringing when the app finds out about it.

This is the part of VoIP that surprises people. On iOS a call arriving as a push must be shown to the user before any of this app's code runs -- the operating system requires it and kills the app otherwise -- so by the time a `VoipPushListener` is told, the phone is ringing, the lock screen shows the caller, and the user may already have answered.

The app's job is therefore not to decide whether to ring. It is to attach media to a call that exists, and then wait for `com.codename1.call.session.CallActionListener#answerRequested` like any other call. Android does not have the same constraint, but the port synthesizes the same shape so that application code has one path.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getData()`
  The opaque `data` field from the push payload, or null.
  `CallHandle`
  `getHandle()`
  Who is calling, as the push said.
  `long`
  `getReceivedAt()`
  When the push arrived, in wall-clock milliseconds.
  `CallSession`
  `getSession()`
  The call, already reported to the system and usually ringing.
  `boolean`
  `isIdentifierSynthesized()`
  Whether the identifier was invented locally because the push payload carried none or carried a malformed one.
  `boolean`
  `isStale()`
  The call is over and cannot be answered.

  ### Methods inherited from class Object

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

- ## Method Details

  - ### getSession

    public CallSession getSession()
    The call, already reported to the system and usually ringing.

  - ### getHandle

    public CallHandle getHandle()
    Who is calling, as the push said.

  - ### getData

    public String getData()

    The opaque `data` field from the push payload, or null.

    The framework never parses this. It exists because the deadline-bound native path cannot run app code, so anything the app needs -- a room id, a session token -- has to travel through and be read later.

  - ### isStale

    public boolean isStale()

    The call is over and cannot be answered.

    True for a call that rang while the app was not running and was finished -- unanswered, cancelled, or killed with the process -- before the app got here. Log it as a missed call and show it in history; do not attach media, and do not expect an answer action.

  - ### isIdentifierSynthesized

    public boolean isIdentifierSynthesized()

    Whether the identifier was invented locally because the push payload carried none or carried a malformed one.

    The call was still rung -- refusing would have killed the app -- but the identifier will not match the sender's, so signalling keyed on it will not line up. This flag exists so that a server-side bug is findable instead of presenting as calls that mysteriously never connect.

  - ### getReceivedAt

    public long getReceivedAt()
    When the push arrived, in wall-clock milliseconds.