public class

Call

extends Object
java.lang.Object
   ↳ com.nexmo.sdk.conversation.client.Call

Class Overview

Calls can be made towards specified users.

Example usage:

     conversationClient.call(userArray, new RequestHandler() {
         @Override
         public void onSuccess(Call call) {
              // Update the application UI here if needed with the ongoing call.
         }
         @Override
         public void onError(NexmoAPIError error) {
              // Update the application UI here if needed.
         }
    });
 

Subscribe for receiving incoming calls:

         ResultListener callListener = new ResultListener() {
         @Override
         public void onSuccess(Call incomingCall) {
             // Update the app UI with new event: incomingCall.toString();
         }
    });

     conversationClient.callEvent().add(callListener);
 

Subscribe for member events in a call:

         ResultListener callEventListener = new ResultListener() {
         @Override
         public void onSuccess(CallEvent event) {
             // Update the app UI with new event: event.toString();
         }
    });

     call.event().add(callEventListener);
 

Call available actions:

Call properties:

  • name Name of the call in format [CALL_user1_user2.._userx]
  • from The member initiator of the call. In case of an incoming system or PSTN call, the initiator from() is missing.
  • to All the members invited in the call.

Summary

Nested Classes
enum Call.CALL_STATE Enum for Call states. 
enum Call.MEMBER_CALL_STATE Enum for Call Member states.@constant 
Protected Constructors
Call(ConversationPlaceholderOutgoingPhoneCall placeholder)
Call(Conversation conversation)
Call(Conversation conversation, Member from)
Call(Conversation conversation, Member from, Call.CALL_STATE callState)
Public Methods
void answer(RequestHandler<Void> listener)
Answer an incoming call.
EventSource<CallEvent> event()
Listen for incoming member events for this call.
Member from()
Get the Member that initiated the call.
Call.CALL_STATE getCallState()
Get the Call State.
final Conversation getConversation()
String getName()
void hangup(RequestHandler<Void> listener)
Hangs up the call while leaving the generated conversation.
void reject(RequestHandler<Void> listener)
Reject an incoming call.
final List<Member> to()
Get all the members invited in the call.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Protected Constructors

protected Call (ConversationPlaceholderOutgoingPhoneCall placeholder)

protected Call (Conversation conversation)

protected Call (Conversation conversation, Member from)

protected Call (Conversation conversation, Member from, Call.CALL_STATE callState)

Public Methods

public void answer (RequestHandler<Void> listener)

Answer an incoming call. If the call is already answered, an error will be dispatched. Note: answering the call means accepting invitation to conversation and enable audio.

Parameters
listener The completion listener in charge of dispatching the result.

public EventSource<CallEvent> event ()

Listen for incoming member events for this call. CallEvent types:

  • RINGING A member has not yet answered the call.
  • HUNGUP A member hung up the call.
  • ANSWERED A member answered the call.
  • REJECTED A member rejected the call.

public Member from ()

Get the Member that initiated the call.

public Call.CALL_STATE getCallState ()

Get the Call State.

Returns

public final Conversation getConversation ()

public String getName ()

public void hangup (RequestHandler<Void> listener)

Hangs up the call while leaving the generated conversation. The audio is disabled.

Parameters
listener The completion listener in charge of dispatching the result.

public void reject (RequestHandler<Void> listener)

Reject an incoming call.

Note: User cannot reject a call that is already answered answer(RequestHandler). If the call is already in progress user can hangup hangup(RequestHandler) instead.

Parameters
listener The completion listener in charge of dispatching the result.

public final List<Member> to ()

Get all the members invited in the call. Does not contain the initiator of the call from().

Returns
  • List of members.

public String toString ()