public class Enqueue<E extends java.lang.Enum<?>> extends TwiML
This class directly reflects the Enqueue verb documented at http://www.twilio.com/docs/api/twiml/enqueue
All of the descriptions included in these javadoc comments come directly from the twilio website.
You can use the parameters on the 'waitUrl' request to Say
back to the caller what his or her
queue position is and how long he or she can expect to wait.
Constructor and Description |
---|
Enqueue(java.lang.String queueName)
The
Enqueue verb enqueues the current call in a call queue. |
Modifier and Type | Method and Description |
---|---|
Enqueue<E> |
action(E action)
The 'action' attribute takes an absolute or relative URL as a value (in the form of the enumerated
states you have defined).
|
E |
getAction() |
Method |
getMethod()
Getter for the 'method' attribute.
|
java.lang.String |
getQueueName()
Getter for the queueName.
|
E |
getWaitUrl() |
Method |
getWaitUrlMethod() |
Enqueue<E> |
method(Method method)
The 'method' attribute takes the value 'GET' or 'POST'.
|
Enqueue<E> |
methodGET()
Convenience function that does the same as method(Method.GET).
|
Enqueue<E> |
methodPOST()
Convenience function that does the same as method(Method.POST).
|
void |
toXml(java.lang.StringBuilder buf,
java.lang.String baseUrl)
Converts this object into XML.
|
Enqueue<E> |
waitUrl(E waitUrl)
The 'waitUrl' attribute specifies a URL (in the form of the enumerated states you have
defined) pointing to a TwiML document containing TwiML verbs that will be executed while
the caller is waiting in the queue.
|
Enqueue<E> |
waitUrl(java.lang.String waitUrlString)
The 'waitUrl' attribute specifies a URL (in the form of the enumerated states you have
defined) pointing to a TwiML document containing TwiML verbs that will be executed while
the caller is waiting in the queue.
|
Enqueue<E> |
waitUrlMethod(Method waitUrlMethod)
The 'waitUrlMethod' attribute takes the value 'GET' or 'POST'.
|
Enqueue<E> |
waitUrlMethodGET()
Convenience method that does the same as waitUrlMethod(Method.GET).
|
Enqueue<E> |
waitUrlMethodPOST()
Convenience method that does the same as waitUrlMethod(Method.POST).
|
public Enqueue(java.lang.String queueName)
The Enqueue
verb enqueues the current call in a call queue. Enqueued calls wait
in hold music until the call is dequeued by another caller via the Dial
verb or
transfered out of the queue via the REST API or the Leave
verb.
The Enqueue
verb will create a queue on demand, if the queue does not already
exist.
If the named queue wasn't already created, it will be created on demand. The default maximum length of the queue is 100. This can be modified using the REST API.
The queue name can not be longer than 64 characters.
queueName
- public void toXml(java.lang.StringBuilder buf, java.lang.String baseUrl)
public Enqueue<E> action(E action)
The 'action' attribute takes an absolute or relative URL as a value (in the form of the enumerated
states you have defined). A request is made to this URL when the call leaves the queue, describing the
dequeue reason and details about the time spent in the queue, which are described below. In the case
where a call is dequeued due to a REST API request
or the Leave
verb, the action URL is requested right away. In the case where a call is dequeued
via the Dial
verb, the action URL is hit once when the bridged parties disconnect. If no 'action'
is provided, Twilio will fall through to the next verb in the document, if any.
Twilio will pass the following parameters in addition to the standard TwiML Voice request parameters with its request to the 'action' URL:
Parameter | Description |
---|---|
QueueResult | The final result of the enqueued call. See queue result values below for details. |
QueueSid | The SID of the queue. This is only available if the call was actually enqueued. |
QueueTime | The time the call spent in the queue. This is only available if the call was actually enqueued. |
Value | Description |
---|---|
bridged | The call was dequeued and bridged to the dequeuer. |
queue-full | The targeted queue was full, thus the enqueue attempt was rejected. |
redirected | While in the queue, the call was redirected out of the queue, typically by a REST API request. |
hangup | The enqueued caller hung up before connecting to a dequeued call. |
error | The TwiML contained an error, either in the Enqueue verb itself or in the TwiML retrieved from a 'waitUrl'. Check Notifications. |
system-error | The Twilio system malfunctioned during the enqueue process. |
action
- Allowed values: any of your enumerated states. Default value: same state.EnqueueParameters
,
TwilioParameters
public Enqueue<E> method(Method method)
The 'method' attribute takes the value 'GET' or 'POST'. This tells Twilio whether to request the 'action' URL via HTTP GET or POST. This attribute is modeled after the HTML form 'method' attribute. 'POST' is the default value.
method
- Allowed values: Method.GET, Method.POST. Default value: Method.POST.public Enqueue<E> methodPOST()
public Enqueue<E> methodGET()
public Enqueue<E> waitUrl(E waitUrl)
The 'waitUrl' attribute specifies a URL (in the form of the enumerated states you have defined) pointing to a TwiML document containing TwiML verbs that will be executed while the caller is waiting in the queue.
Once the waitUrl TwiML flow runs out of verbs to execute, Twilio will re-request the
waitUrl and start over, essentially looping hold music indefinitely. The
The following verbs are supported in the waitUrl TwiML document:
Verb | Description |
---|---|
Play |
Plays a file to the caller. |
Say |
Say something to the caller using Twilio text-to-speech. |
Pause |
Pauses for a specified duration. |
Hangup |
Hangs up the call and thereby leaving the queue and ending the call. |
Redirect |
Redirect to another TwiML document. |
Leave |
Makes the current call leave the queue, but doesn't hang up the call. Execution proceeds with the next verb after the 'Enqueue ' verb. |
Twilio will pass the following parameters in addition to the standard TwiML Voice request parameters with its request to the 'waitUrl' URL:
Parameter | Description |
---|---|
QueuePosition | The current queue position for the enqueued call. |
QueueSid | The SID of the Queue that the caller is in. |
QueueTime | The time in seconds that the caller has been in the queue. |
AverageQueueTime | An average of how long time the current enqueued callers has been in the queue. |
CurrentQueueSize | The current number of enqueued calls in this queue. |
Conference
.waitUrl
- the enumerated state url for the hold musicConference
public Enqueue<E> waitUrl(java.lang.String waitUrlString)
The 'waitUrl' attribute specifies a URL (in the form of the enumerated states you have defined) pointing to a TwiML document containing TwiML verbs that will be executed while the caller is waiting in the queue.
Once the waitUrl TwiML flow runs out of verbs to execute, Twilio will re-request the
waitUrl and start over, essentially looping hold music indefinitely. The
The following verbs are supported in the waitUrl TwiML document:
Verb | Description |
---|---|
Play |
Plays a file to the caller. |
Say |
Say something to the caller using Twilio text-to-speech. |
Pause |
Pauses for a specified duration. |
Hangup |
Hangs up the call and thereby leaving the queue and ending the call. |
Redirect |
Redirect to another TwiML document. |
Leave |
Makes the current call leave the queue, but doesn't hang up the call. Execution proceeds with the next verb after the 'Enqueue ' verb. |
Twilio will pass the following parameters in addition to the standard TwiML Voice request parameters with its request to the 'waitUrl' URL:
Parameter | Description |
---|---|
QueuePosition | The current queue position for the enqueued call. |
QueueSid | The SID of the Queue that the caller is in. |
QueueTime | The time in seconds that the caller has been in the queue. |
AverageQueueTime | An average of how long time the current enqueued callers has been in the queue. |
CurrentQueueSize | The current number of enqueued calls in this queue. |
Conference
.waitUrlString
- url for the hold music. default=http://s3.amazonaws.com/com.twilio.sounds.music/index.xmlConference
public Enqueue<E> waitUrlMethod(Method waitUrlMethod)
The 'waitUrlMethod' attribute takes the value 'GET' or 'POST'. This tells Twilio whether to request the 'waitUrl' via HTTP GET or POST. This attribute is modeled after the HTML form 'method' attribute. 'POST' is the default value.
waitUrlMethod
- Allowed values: Method.GET, and Method.POST. Default value: Method.POST.public Enqueue<E> waitUrlMethodPOST()
public Enqueue<E> waitUrlMethodGET()
public java.lang.String getQueueName()
public E getAction()
public Method getMethod()
public E getWaitUrl()
public Method getWaitUrlMethod()
Copyright © 2015 Gentomi, Inc. All Rights Reserved.