public final class CallSession
- Object
- CallSession
One call, from the system’s point of view.
Obtained from Calls.reportIncoming or Calls.reportOutgoing, or handed
over already ringing by
com.codename1.call.voip.PushedCall#getSession(). A session is a handle
on a call the operating system knows about; it does not carry audio.
Every method here is a request to the system, and every one of them is
asynchronous because the system can refuse. Acting on a call that has
already ended fails with CallError.INVALID_ID rather than doing nothing,
so a bug in the app’s own bookkeeping shows up instead of hiding.
Methods
Inherited methods
Method details
getCallId
public String getCallId()getDirection
public CallDirection getDirection()getHandle
public CallHandle getHandle()getDisplayName
public String getDisplayName()getState
public CallState getState()isMuted
public boolean isMuted()reportStartedConnecting
public void reportStartedConnecting()reportConnected
public void reportConnected()update
public void update(CallHandle newHandle, String newDisplayName)Changes what the system shows for this call. Arguments left null are left alone.
The two fields are written under the session monitor, like the state and the mute flag: a signalling worker calls this while the EDT reads the same session to refresh the in-app call UI, and plain writes gave that reader no reason ever to see them – so the system UI could show the new identity while Java went on displaying the old one, or a mixed pair of the two.
end
public AsyncResource<Boolean> end(CallEndReason reason)Hangs up, and writes reason into the system call log.
Do not call this from
CallActionListener.providerReset() – by then the call no longer
exists.
reportEndedRemotely
public void reportEndedRemotely(CallEndReason reason)end when the hang-up came down the app’s own signalling, so the
call log says what happened.setHeld
public AsyncResource<Boolean> setHeld(boolean held)setMuted
public AsyncResource<Boolean> setMuted(boolean value)Mutes or unmutes the call in the system UI.
This tells the operating system what the mute button should look like. It does not stop the app sending audio – nothing here touches media – so an app that only calls this is still transmitting.
Gated by CallBridge.CAPABILITY_MUTE, which Android does not offer: a
self-managed call there cannot tell Telecom its mute state, so this
answers NOT_SUPPORTED and isMuted() stays where the system left
it. Hearing what the user does with the system’s own mute control is a
separate thing and works everywhere; see
CallActionListener.muteRequested.
sendDigits
public AsyncResource<Boolean> sendDigits(String digits)groupWith
public AsyncResource<Boolean> groupWith(CallSession other)Puts this call in a conference with other, or takes it out of one
when other is null.
Answers NOT_SUPPORTED on every platform today, which is why
CallBridge.CAPABILITY_GROUPING is set by no
port: CallKit’s group action travels system to app with no
app-initiated counterpart, and Telecom conferences self-managed calls
only through a ConnectionService conference this framework does not
build. It stays here because the system may still ask an app to group
calls, and because a conference an app mixes itself needs no
permission from either platform.