public final class PushedCall

  1. Object
  2. PushedCall

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.

Methods

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

Inherited methods

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.