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(java.lang.String transferTo)
Creates builder for transferring call.
|
static Call |
create(BandwidthClient client,
java.util.Map<java.lang.String,java.lang.Object> params)
Dials a call, from a phone number to a phone number.
|
static Call |
create(java.util.Map<java.lang.String,java.lang.Object> params)
Dials a call, from a phone number to a phone number.
|
static Call |
create(java.lang.String to,
java.lang.String from)
Convenience factory method to make an outbound call
|
static Call |
create(java.lang.String to,
java.lang.String from,
java.lang.String callbackUrl,
java.lang.String tag)
Convenience method to dials a call from a phone number to a phone number
|
void |
createGather(java.util.Map<java.lang.String,java.lang.Object> gatherParams,
java.util.Map<java.lang.String,java.lang.Object> promptParams) |
void |
createGather(java.lang.String promptSentence) |
static Call |
get(BandwidthClient client,
java.lang.String callId)
Convenience factory method for Call, returns a Call object given an id
|
static Call |
get(java.lang.String callId)
Factory method for Call, returns information about an active or completed call.
|
java.util.Date |
getActiveTime() |
java.lang.String |
getCallbackUrl() |
java.lang.Long |
getChargeableDuration() |
java.lang.String |
getDirection() |
java.util.Date |
getEndTime() |
EventBase |
getEvent(java.lang.String eventId)
Gets information about one call event.
|
java.lang.String |
getEvents() |
java.util.List<EventBase> |
getEventsList()
Gets the events that occurred during the call.
|
java.lang.String |
getFrom() |
Gather |
getGather(java.lang.String gatherId)
Gets the gather DTMF parameters and results.
|
java.util.List<Recording> |
getRecordings()
Retrieve all recordings related to the call.
|
java.util.Date |
getStartTime() |
java.lang.String |
getState() |
java.lang.String |
getTo() |
protected java.lang.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(java.util.Map<java.lang.String,java.lang.Object> params) |
void |
playRecording(java.lang.String recordingUrl) |
void |
recordingOff()
Turn call recording OFF.
|
void |
recordingOn()
Turn call recording ON.
|
void |
rejectIncoming()
Reject an incoming phone call
|
void |
sendDtmf(java.lang.String dtmf)
Sends DTMF.
|
protected void |
setUp(org.json.simple.JSONObject jsonObject) |
void |
speakSentence(java.util.Map<java.lang.String,java.lang.Object> params) |
void |
speakSentence(java.lang.String sentence) |
void |
speakSentence(java.lang.String sentence,
java.lang.String tag) |
void |
stopAudioFilePlaying()
Stop an audio file playing.
|
void |
stopSentence()
Stop an audio sentence.
|
java.lang.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(java.lang.String callId) throws java.lang.Exception
callId
- call idjava.io.IOException
- unexpected error.java.lang.Exception
public static Call get(BandwidthClient client, java.lang.String callId) throws java.lang.Exception
client
- the clientcallId
- the call idjava.lang.Exception
- error.public static ResourceList<Call> list() throws java.io.IOException
java.io.IOException
- unexpected error.public static ResourceList<Call> list(int page, int size) throws java.io.IOException
page
- the pagesize
- the page sizejava.io.IOException
- unexpected error.public static ResourceList<Call> list(BandwidthClient client, int page, int size) throws java.io.IOException
client
- the clientpage
- the pagesize
- the page sizejava.io.IOException
- unexpected error.public static Call create(java.lang.String to, java.lang.String from) throws java.lang.Exception
to
- the to numberfrom
- the from numberjava.lang.Exception
- error.public static Call create(java.lang.String to, java.lang.String from, java.lang.String callbackUrl, java.lang.String tag) throws java.lang.Exception
to
- the to numberfrom
- the from numbercallbackUrl
- the callback URLtag
- the call tagjava.io.IOException
- unexpected error.java.lang.Exception
public static Call create(java.util.Map<java.lang.String,java.lang.Object> params) throws java.lang.Exception
params
- the call paramsjava.io.IOException
- unexpected error.java.lang.Exception
public static Call create(BandwidthClient client, java.util.Map<java.lang.String,java.lang.Object> params) throws java.lang.Exception
client
- the clientparams
- the call paramsjava.io.IOException
- unexpected error.java.lang.Exception
protected void setUp(org.json.simple.JSONObject jsonObject)
setUp
in class ResourceBase
protected java.lang.String getUri()
public void speakSentence(java.util.Map<java.lang.String,java.lang.Object> params) throws java.io.IOException, AppPlatformException
java.io.IOException
AppPlatformException
public void speakSentence(java.lang.String sentence) throws java.io.IOException, AppPlatformException
java.io.IOException
AppPlatformException
public void speakSentence(java.lang.String sentence, java.lang.String tag) throws java.io.IOException, AppPlatformException
java.io.IOException
AppPlatformException
public void playRecording(java.lang.String recordingUrl) throws java.io.IOException, AppPlatformException
java.io.IOException
AppPlatformException
public void playAudio(java.util.Map<java.lang.String,java.lang.Object> params) throws java.io.IOException, AppPlatformException
java.io.IOException
AppPlatformException
public void createGather(java.lang.String promptSentence) throws java.io.IOException, AppPlatformException
java.io.IOException
AppPlatformException
public void createGather(java.util.Map<java.lang.String,java.lang.Object> gatherParams, java.util.Map<java.lang.String,java.lang.Object> promptParams) throws java.io.IOException, AppPlatformException
java.io.IOException
AppPlatformException
public java.lang.String getDirection()
public java.lang.String getState()
public java.lang.String getFrom()
public java.lang.String getTo()
public java.lang.String getCallbackUrl()
public java.lang.String getEvents()
public java.util.Date getStartTime()
public java.util.Date getActiveTime()
public java.util.Date getEndTime()
public java.lang.Long getChargeableDuration()
public boolean isRecordingEnabled()
public java.util.List<Recording> getRecordings() throws java.lang.Exception
java.io.IOException
- unexpected error.java.lang.Exception
public java.util.List<EventBase> getEventsList() throws java.lang.Exception
java.io.IOException
- unexpected error.java.lang.Exception
public EventBase getEvent(java.lang.String eventId) throws java.lang.Exception
eventId
- event idjava.io.IOException
- unexpected error.java.lang.Exception
public void hangUp() throws java.lang.Exception
java.io.IOException
- unexpected error.java.lang.Exception
public void answerOnIncoming() throws java.lang.Exception
java.io.IOException
- unexpected error.java.lang.Exception
public void rejectIncoming() throws java.lang.Exception
java.io.IOException
- unexpected error.java.lang.Exception
public void recordingOn() throws java.lang.Exception
java.io.IOException
- unexpected error.java.lang.Exception
public void recordingOff() throws java.lang.Exception
java.io.IOException
- unexpected error.java.lang.Exception
public Call.CallTransferBuilder callTransferBuilder(java.lang.String transferTo)
call.callTransferBuilder("{number}").sentence("hello").create();
transferTo
- number for transferringpublic Call.CallAudioBuilder newAudioBuilder()
call.newAudioBuilder().sentence("Hello").create();
public void stopAudioFilePlaying() throws java.io.IOException, AppPlatformException
java.io.IOException
- unexpected error.AppPlatformException
- unexpected exception.public void stopSentence() throws java.io.IOException, AppPlatformException
java.io.IOException
- unexpected error.AppPlatformException
- unexpected exception.public void sendDtmf(java.lang.String dtmf) throws java.io.IOException, AppPlatformException
dtmf
- DTMF valuejava.io.IOException
- unexpected error.AppPlatformException
- unexpected exception.public Call.CallGatherBuilder callGatherBuilder()
call.callGatherBuilder().maxDigits(5).promptFileUrl("url_to_file").create();
public Gather getGather(java.lang.String gatherId) throws java.lang.Exception
gatherId
- gather idjava.io.IOException
- unexpected error.java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2019. All Rights Reserved.