Alexa Auto SDK  2.0.0
Classes | Public Member Functions | Protected Member Functions | List of all members
com.amazon.aace.phonecontrol.PhoneCallController Class Referenceabstract

Classes

enum  CallError
 
enum  CallingDeviceConfigurationProperty
 
enum  CallState
 
enum  ConnectionState
 
enum  DTMFError
 

Public Member Functions

boolean dial (String payload)
 
boolean redial (String payload)
 
void answer (String payload)
 
void stop (String payload)
 
void sendDTMF (String payload)
 

Protected Member Functions

final void connectionStateChanged (ConnectionState state)
 
final void callStateChanged (CallState state, String callId)
 
final void callStateChanged (CallState state, String callId, String callerId)
 
final void callFailed (String callId, CallError code)
 
final void callFailed (String callId, CallError code, String message)
 
final void callerIdReceived (String callId, String callerId)
 
final void sendDTMFSucceeded (String callId)
 
final void sendDTMFFailed (String callId, DTMFError code)
 
final void sendDTMFFailed (String callId, DTMFError code, String message)
 
final void deviceConfigurationUpdated (HashMap< CallingDeviceConfigurationProperty, Boolean > configurationMap)
 
final String createCallId ()
 

Detailed Description

PhoneCallController should be extended to allow a user to use Alexa to interact with a calling device such as a connected mobile phone. It provides interfaces for controlling inbound and outbound calls and for notifying the Engine of the state of a call session and the state of platform connection to a calling device.

The platform implementation is responsible for managing the lifecycle and user experience of a call session and connection to the calling device.

Member Function Documentation

◆ dial()

boolean com.amazon.aace.phonecontrol.PhoneCallController.dial ( String  payload)

Notifies the platform implementation to initiate an outgoing phone call to the destination address

Parameters
payloadDetails of the dial request in structured JSON format. See the following payload structure and the description of each field:
{
"callId": "{{STRING}}",
"callee": {
"details": "{{STRING}}",
"defaultContactAddress": {
"protocol": "{{STRING}}",
"format": "{{STRING}}",
"value": "{{STRING}}"
},
"alternativeContactAddresses": [{
"protocol": "{{STRING}}",
"format": "{{STRING}}",
"value": {{STRING}}
}]
},
}
}
  • callId (required): A unique identifier for the call
  • callee (required): The destination of the outgoing call
  • callee.details (optional): Descriptive information about the callee
  • callee.defaultContactAddress (required): The default address to use for calling the callee
  • callee.alternativeContactAddresses (optional): An array of alternate addresses for the callee
  • address.protocol (required): The protocol for this address of the callee. One of PSTN, SIP, H.323
  • address.format (optional): The format for this address of the callee. One of E.164, E.163, E.123, MICROSOFT, DIN5008, RAW
  • address.value (required): The address of the callee.
Returns
true if the platform implementation successfully handled the call

◆ redial()

boolean com.amazon.aace.phonecontrol.PhoneCallController.redial ( String  payload)

Notifies the platform implementation to redial the last called phone number.

After returning true, if no stored number is available to be redialed, PhoneCallController::callFailed with CallError::NO_NUMBER_FOR_REDIAL should be called.

Parameters
payloadDetails of the redial request in structured JSON format. See the following payload structure and the description of each field:
{
"callId": "{{STRING}}"
}
  • callId (required): A unique identifier for the call
Returns
true if the platform implementation successfully handled the call

◆ answer()

void com.amazon.aace.phonecontrol.PhoneCallController.answer ( String  payload)

Notifies the platform implementation to answer an inbound call

Parameters
payloadDetails of the answer request in structured JSON format. See the following payload structure and the description of each field:
{
"callId": "{{STRING}}",
}
  • callId (required): The unique identifier for the call to answer

◆ stop()

void com.amazon.aace.phonecontrol.PhoneCallController.stop ( String  payload)

Notifies the platform implementation to end an ongoing call or stop inbound or outbound call setup

Parameters
payloadDetails of the stop request in structured JSON format. See the following payload structure and the description of each field:
{
"callId": "{{STRING}}"
}
  • callId (required): The unique identifier for the call to be stopped

◆ sendDTMF()

void com.amazon.aace.phonecontrol.PhoneCallController.sendDTMF ( String  payload)

Notifies the platform implementation to send a DTMF signal to the calling device

Parameters
payloadDetails of the DTMF request in structured JSON format. See the following payload structure and the description of each field:
{
"callId": "{{STRING}}",
"signal": "{{STRING}}"
}
  • callId (required): The unique identifier for the call
  • signal (required): The DTMF string to be sent to the calling device associated with the callId

◆ connectionStateChanged()

final void com.amazon.aace.phonecontrol.PhoneCallController.connectionStateChanged ( ConnectionState  state)
protected

Notifies the Engine of a change in connection to a calling device

Parameters
stateThe state of connection to a calling device

◆ callStateChanged() [1/2]

final void com.amazon.aace.phonecontrol.PhoneCallController.callStateChanged ( CallState  state,
String  callId 
)
protected

Notifies the Engine of a change in the state of an ongoing call

Parameters
stateThe state of the call
callIdThe unique identifier associated with the call

◆ callStateChanged() [2/2]

final void com.amazon.aace.phonecontrol.PhoneCallController.callStateChanged ( CallState  state,
String  callId,
String  callerId 
)
protected

Notifies the Engine of a change in the state of an ongoing call

Parameters
stateThe state of the call
callIdThe unique identifier associated with the call
callerIdThe identifier for a contact. May be included for CallState::CALL_RECEIVED

◆ callFailed() [1/2]

final void com.amazon.aace.phonecontrol.PhoneCallController.callFailed ( String  callId,
CallError  code 
)
protected

Notifies the Engine of an error related to a call

Parameters
callIdThe unique identifier for the call associated with the error
codeThe error type

◆ callFailed() [2/2]

final void com.amazon.aace.phonecontrol.PhoneCallController.callFailed ( String  callId,
CallError  code,
String  message 
)
protected

Notifies the Engine of an error related to a call

Parameters
callIdThe unique identifier for the call associated with the error
codeThe error type
messageA description of the error

◆ callerIdReceived()

final void com.amazon.aace.phonecontrol.PhoneCallController.callerIdReceived ( String  callId,
String  callerId 
)
protected

Notifies the Engine that a caller id was received for an inbound call

Parameters
callIdThe unique identifier for the call associated with the callId
callerIdThe caller's identifier or phone number

◆ sendDTMFSucceeded()

final void com.amazon.aace.phonecontrol.PhoneCallController.sendDTMFSucceeded ( String  callId)
protected

Notifies the Engine that sending the DTMF signal succeeded.

Parameters
callIdThe unique identifier for the associated call
See also
PhoneCallController::sendDTMF

◆ sendDTMFFailed() [1/2]

final void com.amazon.aace.phonecontrol.PhoneCallController.sendDTMFFailed ( String  callId,
DTMFError  code 
)
protected

Notifies the Engine that the DTMF signal could not be delivered to the remote party

Parameters
callIdThe unique identifier for the associated call
codeThe error type
See also
PhoneCallController::sendDTMF

◆ sendDTMFFailed() [2/2]

final void com.amazon.aace.phonecontrol.PhoneCallController.sendDTMFFailed ( String  callId,
DTMFError  code,
String  message 
)
protected

Notifies the Engine that the DTMF signal could not be delivered to the remote party

Parameters
callIdThe unique identifier for the associated call
codeThe error type
messageA description of the error
See also
PhoneCallController::sendDTMF

◆ deviceConfigurationUpdated()

final void com.amazon.aace.phonecontrol.PhoneCallController.deviceConfigurationUpdated ( HashMap< CallingDeviceConfigurationProperty, Boolean >  configurationMap)
protected

Notifies the Engine of the calling feature configuration of the connected calling device. The configuration data may change if, for example, the connection mechanism to the calling device changes. The provided configuration will override the default or previous configuration.

See PhoneCallController::CallingDeviceConfigurationProperty for a description of each configurable feature

Parameters
configurationMapA map of configuration properties to the boolean state of the properties

◆ createCallId()

final String com.amazon.aace.phonecontrol.PhoneCallController.createCallId ( )
protected

Generates a unique identifier for a call


Alexa Auto SDK 2.0.0 - Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0