CallAgent Class
- java.
lang. Object - com.
azure. android. communication. calling. CallAgent
- com.
public class CallAgent
Call agent created by the CallClient factory method createCallAgent It bears the responsibility of managing calls on behalf of the authenticated user
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
addOnCallsUpdatedListener(CallsUpdatedListener listener)
Adds the specified listener to receive OnCallsUpdated events. CallsUpdated event. Occurs when a new call is created, in case of an incoming call or when an existing call is disconnected. |
void |
addOnIncomingCallListener(IncomingCallListener listener)
Adds the specified listener to receive OnIncomingCall events. onIncomingCall Event. Occurs when incoming call is recieved from PushNotification or Trouter. |
void |
dispose()
Releases all the resources held by CallAgent. CallAgent should be destroyed/nullified after dispose. |
void |
finalize()
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. |
List<Call> |
getCalls()
Returns the list of all active calls. |
CompletableFuture<Void> |
handlePushNotification(final PushNotificationInfo notification)
Handle the push notification. If successful, will raise appropriate incoming call event. |
Call |
join(android.content.Context context, JoinMeetingLocator meetingLocator, JoinCallOptions joinCallOptions)
Join an existing group conversation with the ability to specify call options for the participant joining. |
CompletableFuture<Void> |
registerPushNotification(final String deviceRegistrationToken)
Register the current device for receiving Incoming Calls Push notification alerts. |
void |
removeOnCallsUpdatedListener(CallsUpdatedListener listener)
Removes the specified listener to receive OnCallsUpdated events. CallsUpdated event. Occurs when a new call is created, in case of an incoming call or when an existing call is disconnected. |
void |
removeOnIncomingCallListener(IncomingCallListener listener)
Removes the specified listener to receive OnIncomingCall events. onIncomingCall Event. Occurs when incoming call is recieved from PushNotification or Trouter. |
Call |
startCall(android.content.Context context, Iterable<com.azure.android.communication.common.CommunicationIdentifier> participants, StartCallOptions startCallOptions)
Initiates outgoing call with list of participants with the ability to specify call initiator options. |
Call |
startCall(android.content.Context context, Iterable<com.azure.android.communication.common.CommunicationIdentifier> participants)
Initiates outgoing call with list of participants with default call options (audio on, video off). |
CompletableFuture<Void> |
unregisterPushNotification()
Unregister all previously registered devices from receiving incoming calls push notifications. |
Method Details
addOnCallsUpdatedListener
public void addOnCallsUpdatedListener(CallsUpdatedListener listener)
Adds the specified listener to receive OnCallsUpdated events. CallsUpdated event. Occurs when a new call is created, in case of an incoming call or when an existing call is disconnected.
Parameters:
addOnIncomingCallListener
public void addOnIncomingCallListener(IncomingCallListener listener)
Adds the specified listener to receive OnIncomingCall events. onIncomingCall Event. Occurs when incoming call is recieved from PushNotification or Trouter.
Parameters:
dispose
public void dispose()
Releases all the resources held by CallAgent. CallAgent should be destroyed/nullified after dispose.
finalize
protected void finalize()
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
getCalls
public List
Returns the list of all active calls.
handlePushNotification
public CompletableFuture
Handle the push notification. If successful, will raise appropriate incoming call event.
Parameters:
join
public Call join(android.content.Context context, JoinMeetingLocator meetingLocator, JoinCallOptions joinCallOptions)
Join an existing group conversation with the ability to specify call options for the participant joining.
Parameters:
Returns:
registerPushNotification
public CompletableFuture
Register the current device for receiving Incoming Calls Push notification alerts.
Parameters:
removeOnCallsUpdatedListener
public void removeOnCallsUpdatedListener(CallsUpdatedListener listener)
Removes the specified listener to receive OnCallsUpdated events. CallsUpdated event. Occurs when a new call is created, in case of an incoming call or when an existing call is disconnected.
Parameters:
removeOnIncomingCallListener
public void removeOnIncomingCallListener(IncomingCallListener listener)
Removes the specified listener to receive OnIncomingCall events. onIncomingCall Event. Occurs when incoming call is recieved from PushNotification or Trouter.
Parameters:
startCall
public Call startCall(android.content.Context context, Iterable
Initiates outgoing call with list of participants with the ability to specify call initiator options.
Parameters:
Returns:
startCall
public Call startCall(android.content.Context context, Iterable
Initiates outgoing call with list of participants with default call options (audio on, video off).
Parameters:
Returns:
unregisterPushNotification
public CompletableFuture
Unregister all previously registered devices from receiving incoming calls push notifications.