public class Call extends ResourceBase
Modifier and Type | Class and Description |
---|---|
class |
Call.CallAudioBuilder |
class |
Call.CallGatherBuilder |
class |
Call.CallTransferBuilder |
client, id, properties
dateFormat
Constructor and Description |
---|
Call(BandwidthClient client,
org.json.simple.JSONObject jsonObject) |
Modifier and Type | Method and Description |
---|---|
void |
answerOnIncoming()
Answer an incoming phone call.
|
Call.CallGatherBuilder |
callGatherBuilder()
Creates a new builder for collecting a series of DTMF digits from a phone call with an optional prompt.
|
Call.CallTransferBuilder |
callTransferBuilder(String transferTo)
Creates builder for transferring call.
|
static Call |
create(BandwidthClient client,
Map<String,Object> params)
Dials a call, from a phone number to a phone number.
|
static Call |
create(Map<String,Object> params)
Dials a call, from a phone number to a phone number.
|
static Call |
create(String to,
String from)
Convenience factory method to make an outbound call
|
static Call |
create(String to,
String from,
String callbackUrl,
String tag)
Convenience method to dials a call from a phone number to a phone number
|
void |
createGather(Map<String,Object> gatherParams,
Map<String,Object> promptParams) |
void |
createGather(String promptSentence) |
static Call |
get(BandwidthClient client,
String callId)
Convenience factory method for Call, returns a Call object given an id
|
static Call |
get(String callId)
Factory method for Call, returns information about an active or completed call.
|
Date |
getActiveTime() |
String |
getCallbackUrl() |
Long |
getChargeableDuration() |
String |
getDirection() |
Date |
getEndTime() |
EventBase |
getEvent(String eventId)
Gets information about one call event.
|
String |
getEvents() |
List<EventBase> |
getEventsList()
Gets the events that occurred during the call.
|
String |
getFrom() |
Gather |
getGather(String gatherId)
Gets the gather DTMF parameters and results.
|
List<Recording> |
getRecordings()
Retrieve all recordings related to the call.
|
Date |
getStartTime() |
String |
getState() |
String |
getTo() |
protected String |
getUri() |
void |
hangUp()
Hang up a phone call.
|
boolean |
isRecordingEnabled() |
static ResourceList<Call> |
list()
Factory method for Call list, returns a list of Call objects with default page, size
|
static ResourceList<Call> |
list(BandwidthClient client,
int page,
int size)
Factor method for Call list, returns a list of Call objects with page, size preference
|
static ResourceList<Call> |
list(int page,
int size)
Factor method for Call list, returns a list of Call objects with page, size preference
|
Call.CallAudioBuilder |
newAudioBuilder()
Creates new builder for playing an audio file or speaking a sentence in a call.
|
void |
playAudio(Map<String,Object> params) |
void |
playRecording(String recordingUrl) |
void |
recordingOff()
Turn call recording OFF.
|
void |
recordingOn()
Turn call recording ON.
|
void |
rejectIncoming()
Reject an incoming phone call
|
void |
sendDtmf(String dtmf)
Sends DTMF.
|
protected void |
setUp(org.json.simple.JSONObject jsonObject) |
void |
speakSentence(Map<String,Object> params) |
void |
speakSentence(String sentence) |
void |
speakSentence(String sentence,
String tag) |
void |
stopAudioFilePlaying()
Stop an audio file playing.
|
void |
stopSentence()
Stop an audio sentence.
|
String |
toString() |
getClient, getId, getProperties, setId, toJSONArray, toJSONObject
getProperty, getPropertyAsBoolean, getPropertyAsDate, getPropertyAsDouble, getPropertyAsLong, getPropertyAsString, getPropertyAsStringArray, putProperty, toMap, updateProperties
public Call(BandwidthClient client, org.json.simple.JSONObject jsonObject)
public static Call get(String callId) throws Exception
callId
- call idIOException
- unexpected error.Exception
public static Call get(BandwidthClient client, String callId) throws Exception
client
- the clientcallId
- the call idException
- error.public static ResourceList<Call> list() throws IOException
IOException
- unexpected error.public static ResourceList<Call> list(int page, int size) throws IOException
page
- the pagesize
- the page sizeIOException
- unexpected error.public static ResourceList<Call> list(BandwidthClient client, int page, int size) throws IOException
client
- the clientpage
- the pagesize
- the page sizeIOException
- unexpected error.public static Call create(String to, String from) throws Exception
to
- the to numberfrom
- the from numberException
- error.public static Call create(String to, String from, String callbackUrl, String tag) throws Exception
to
- the to numberfrom
- the from numbercallbackUrl
- the callback URLtag
- the call tagIOException
- unexpected error.Exception
public static Call create(Map<String,Object> params) throws Exception
params
- the call paramsIOException
- unexpected error.Exception
public static Call create(BandwidthClient client, Map<String,Object> params) throws Exception
client
- the clientparams
- the call paramsIOException
- unexpected error.Exception
protected void setUp(org.json.simple.JSONObject jsonObject)
setUp
in class ResourceBase
protected String getUri()
public void speakSentence(Map<String,Object> params) throws IOException
IOException
public void speakSentence(String sentence) throws IOException
IOException
public void speakSentence(String sentence, String tag) throws IOException
IOException
public void playRecording(String recordingUrl) throws IOException
IOException
public void playAudio(Map<String,Object> params) throws IOException
IOException
public void createGather(String promptSentence) throws IOException
IOException
public void createGather(Map<String,Object> gatherParams, Map<String,Object> promptParams) throws IOException
IOException
public String getDirection()
public String getState()
public String getFrom()
public String getTo()
public String getCallbackUrl()
public String getEvents()
public Date getStartTime()
public Date getActiveTime()
public Date getEndTime()
public Long getChargeableDuration()
public boolean isRecordingEnabled()
public List<Recording> getRecordings() throws Exception
IOException
- unexpected error.Exception
public List<EventBase> getEventsList() throws Exception
IOException
- unexpected error.Exception
public EventBase getEvent(String eventId) throws Exception
eventId
- event idIOException
- unexpected error.Exception
public void hangUp() throws Exception
IOException
- unexpected error.Exception
public void answerOnIncoming() throws Exception
IOException
- unexpected error.Exception
public void rejectIncoming() throws Exception
IOException
- unexpected error.Exception
public void recordingOn() throws Exception
IOException
- unexpected error.Exception
public void recordingOff() throws Exception
IOException
- unexpected error.Exception
public Call.CallTransferBuilder callTransferBuilder(String transferTo)
call.callTransferBuilder("{number}").sentence("hello").create();
transferTo
- number for transferringpublic Call.CallAudioBuilder newAudioBuilder()
call.newAudioBuilder().sentence("Hello").create();
public void stopAudioFilePlaying() throws IOException
IOException
- unexpected error.public void stopSentence() throws IOException
IOException
- unexpected error.public void sendDtmf(String dtmf) throws IOException
dtmf
- DTMF valueIOException
- unexpected error.public Call.CallGatherBuilder callGatherBuilder()
call.callGatherBuilder().maxDigits(5).promptFileUrl("url_to_file").create();
public Gather getGather(String gatherId) throws Exception
gatherId
- gather idIOException
- unexpected error.Exception
Copyright © 2015. All Rights Reserved.