public interface Phone
The application can obtain a phone object from Spark object and use phone to call other Cisco Spark users or PSTN when enabled.
The phone must be registered before it can make or receive calls.
Modifier and Type | Interface and Description |
---|---|
static class |
Phone.DefaultBandwidth
The enumeration of common bandwidth choices.
|
static class |
Phone.FacingMode
The enumeration of Camera facing modes.
|
static interface |
Phone.IncomingCallListener
The interface for a listener for incoming call
|
Modifier and Type | Method and Description |
---|---|
void |
deregister(CompletionHandler<java.lang.Void> callback)
Removes this *phone* from Cisco Spark cloud on behalf of the authenticated user.
|
void |
dial(java.lang.String dialString,
MediaOption option,
CompletionHandler<Call> callback)
Makes a call to an intended recipient on behalf of the authenticated user.
|
void |
disableVideoCodecActivation()
Prevents the SDK from poping up an Alert for the end user to approve the use of H.264 video codec license from Cisco Systems, Inc.
|
int |
getAudioMaxBandwidth()
Return the current maximum bandwidth of audio stream.
|
Phone.FacingMode |
getDefaultFacingMode()
Default camera facing mode of this phone, used as the default when dialing or answering a call.
|
Phone.IncomingCallListener |
getIncomingCallListener()
The listener for incoming call
|
int |
getSharingMaxBandwidth()
Return the current maximum bandwidth of content sharing stream.
|
java.lang.String |
getVideoCodecLicense()
Return the text of the H.264 codec license from Cisco Systems, Inc.
|
java.lang.String |
getVideoCodecLicenseURL()
Return the URL of the H.264 codec license from Cisco Systems, Inc.
|
int |
getVideoMaxBandwidth()
Return the current maximum bandwidth of video stream.
|
void |
register(CompletionHandler<java.lang.Void> callback)
Registers this phone to Cisco Spark cloud on behalf of the authenticated user.
|
void |
requestVideoCodecActivation(android.app.AlertDialog.Builder builder,
CompletionHandler<java.lang.Boolean> callback)
Pops up an Alert for the end user to approve the use of H.264 codec license from Cisco Systems, Inc.
|
void |
setAudioMaxBandwidth(int bandwidth)
Set the max bandwidth for audio in unit bps for the call.
|
void |
setDefaultFacingMode(Phone.FacingMode mode)
Set default camera facing mode of this phone, used as the default when dialing or answering a call.
|
void |
setIncomingCallListener(Phone.IncomingCallListener listener)
Set the listener to listen to the incoming call to this Phone.
|
void |
setSharingMaxBandwidth(int bandwidth)
Set the max bandwidth for content sharing in unit bps for the call.
|
void |
setVideoMaxBandwidth(int bandwidth)
Set the max bandwidth for video in unit bps for the call.
|
void |
startPreview(android.view.View view)
Render a preview of the local party before the call is answered.
|
void |
stopPreview()
Stop rendering the preview of the local party.
|
Phone.IncomingCallListener getIncomingCallListener()
void setIncomingCallListener(Phone.IncomingCallListener listener)
Phone.FacingMode getDefaultFacingMode()
void setDefaultFacingMode(Phone.FacingMode mode)
void register(@NonNull CompletionHandler<java.lang.Void> callback)
It also creates the websocket and connects to Cisco Spark cloud.
Subsequent invocations of this method refresh the registration.
callback
- A closure to be executed when completed, with error if the invocation is illegal or failed, otherwise nil.void deregister(@NonNull CompletionHandler<java.lang.Void> callback)
It also disconnects the websocket from Cisco Spark cloud.
Subsequent invocations of this method behave as a no-op.
callback
- A closure to be executed when completed, with error if the invocation is illegal or failed, otherwise nil.void dial(@NonNull java.lang.String dialString, @NonNull MediaOption option, @NonNull CompletionHandler<Call> callback)
dialString
- Intended recipient address in one of the supported formats.option
- Intended media options - audio only or audio and video - for the call.callback
- A closure to be executed when completed.void startPreview(android.view.View view)
view
- an UI view for rendering video.void stopPreview()
void requestVideoCodecActivation(@NonNull android.app.AlertDialog.Builder builder, @NonNull CompletionHandler<java.lang.Boolean> callback)
builder
- AlertDialog buildercallback
- A closure to be executed when completed. true if the user approve the license , otherwise false.void disableVideoCodecActivation()
java.lang.String getVideoCodecLicense()
java.lang.String getVideoCodecLicenseURL()
void setAudioMaxBandwidth(int bandwidth)
bandwidth
- the suggest value could be Phone.DefaultBandwidth.maxBandwidthAudio
.int getAudioMaxBandwidth()
void setVideoMaxBandwidth(int bandwidth)
bandwidth
- the suggest value could be Phone.DefaultBandwidth.maxBandwidth90p
, Phone.DefaultBandwidth.maxBandwidth180p
,
Phone.DefaultBandwidth.maxBandwidth360p
, Phone.DefaultBandwidth.maxBandwidth720p
, or Phone.DefaultBandwidth.maxBandwidth1080p
.int getVideoMaxBandwidth()
void setSharingMaxBandwidth(int bandwidth)
bandwidth
- the suggest value could be Phone.DefaultBandwidth.maxBandwidthSession
.int getSharingMaxBandwidth()