public interface Call
A call could be created in a number of different ways, including:
A service can be informed of subsequent call events (such as alerting or answered) by extending
CallListenerAbstract
and overriding corresponding callback methods.
A service may perform a variety of operations on a call, but note that an operation might not be valid at a certain point in a call. The API will generally throw an exception if an operation is attempted at a point in the call where that operation is not valid.
Each call has a unique identifier known as a UCID. This UCID is generally created in the first Avaya Aura server to handle or originate a call, and the UCID is passed within messages between machines in the network. In some cases, a call may also track a parent UCID.
One example of the usage of getUCID() and getParentUCID() is shown here
Participant
,
CallListener
,
CallListenerAbstract
Modifier and Type | Method and Description |
---|---|
void |
addParticipant(Participant party)
Add another participant to the call.
|
void |
allow()
Allow the call to proceed to the original target.
|
void |
divertTo(String target)
Divert the call to a
target . |
void |
drop()
Drop the call.
|
void |
dropParticipant(Participant participantToDrop)
Drop a participant from the call.
|
void |
enableMediaBeforeAnswer()
Deprecated.
Use
CallPolicies.setPreAnswerMediaState(PreAnswerMediaState) and
CallPolicies.setMediaServerInclusion(MediaServerInclusion) instead.Instruct Avaya Breeze to set up resources to allow media operations before a call is answered. The resources will actually be set up once a call operation (for example, allow or divertTo) or media operation ( MediaService ) has been initiated. This method must be invoked in
CallListener.callIntercepted(Call) . |
void |
enableMediaBeforeAnswer(PreAnswerMediaState preAnswerMediaState)
Deprecated.
Use
CallPolicies.setPreAnswerMediaState(PreAnswerMediaState) and
CallPolicies.setMediaServerInclusion(MediaServerInclusion) insetad.Instruct Avaya Breeze to set up resources to allow media operations before a call is answered. The resources will actually be set up once a call operation (for example, allow or divertTo) or media operation ( MediaService ) has been initiated. This method must be invoked in
CallListener.callIntercepted(Call) . |
List |
getActiveParties()
Get the list of Participants currently involved in the call.
|
List |
getAlertingParties()
Get a list of the parties that are alerting on this call.
|
Participant |
getAnsweringParty()
Get details about the party that answered the call.
|
Object |
getAttribute(String name)
Retrieve an attribute that was previously stored with the setAttribute method.
|
Participant |
getCalledParty()
Get a reference to the called party.
|
Participant |
getCallingParty()
Get a reference to the calling party.
|
CallPolicies |
getCallPolicies()
Get the object that tracks call-related policies.
|
String |
getCollectedDigits()
Returns digits collected during the call setup
|
String |
getContextId()
Get the context ID associated with this call.
|
String |
getId()
Every call, or session, has a unique local identifier.
|
String |
getParentUCID()
Get the parent's Universal Call ID associated with this call.
|
String |
getUCID()
Get the Universal Call ID associated with this call.
|
void |
initiate()
Initiates an outgoing call to the target defined while creating the call instance.
|
Boolean |
isCalledPhase()
Returns true if the service is invoked for the called party, false otherwise.
|
Boolean |
isCallingPhase()
Returns true if the service is invoked for the calling party, false otherwise.
|
Call |
setAttribute(String name,
Object attribute)
Deprecated.
Use
Call.setAttribute(String, Serializable) instead.
Store an attribute for later retrieval. If the attribute is not Serializable, it can only be stored by the service which
created the call.
A service can get a reference to a call using If an object of the same name is already bound to this Call, the object is replaced. This can be used by the service writer to hold some data that will be needed at a later point in the call. |
Call |
setAttribute(String name,
Serializable attribute)
Store an attribute for later retrieval.
|
void |
setCollectedDigits(String collectedDigits)
Sets the collected digits portion of the initial invitation message sent to the called party
|
void |
setContextId(String contextId)
Set the context ID associated with this call.
|
void |
suspend()
Suspends the call to proceed further.
|
boolean |
wasServiceCalled()
Returns true if the service was invoked as a Callable service, false if invoked as a Calling Party or Called Party service.
|
String getId()
void allow()
IllegalStateException
- if invoked at a point where the operation is not valid, or in case of an exception in the underlying service.void drop()
IllegalStateException
- if invoked at a point where the operation is not valid, or in case of an exception in the underlying service.void divertTo(String target)
target
. The target
can be a simple telephone number (either E.164 or any digit string
that matches your system's dial plan). It can also be of the form handle@domain or simply handle (where handle
is either a name or telephone number (the case above), and domain is either a host or domain name). When no domain is
supplied, the domain used for the redirection will be the same as the domain of the calledParty.
To receive notification of subsequent events (e.g., alerting, answered) on this call, the service must extend CallListenerAbstract and override corresponding callback methods.
target
- address of the party to which to divert the callIllegalArgumentException
- if target is null, blank, or poorly formedIllegalStateException
- if invoked at a point where the operation is not valid, or in case of an exception in the underlying service.Participant getCallingParty()
Participant getCalledParty()
List getAlertingParties()
Participant getAnsweringParty()
List getActiveParties()
@Deprecated Call setAttribute(String name, Object attribute)
Call.setAttribute(String, Serializable)
instead.
Store an attribute for later retrieval. If the attribute is not Serializable, it can only be stored by the service which
created the call.
A service can get a reference to a call using CallFactory.getCall(String)
or
using the call passed to it in one of the callback methods (such as
CallListenerAbstract.callAnswered(Call)
).
If an object of the same name is already bound to this Call, the object is replaced. This can be used by the service writer to hold some data that will be needed at a later point in the call.
name
- the name of the object to retain; cannot be nullattribute
- the object to retainorg.apache.commons.lang3.SerializationException
- if attempting to store a non-Serializable attribute from a service which did not create this callObject getAttribute(String name)
A service can get a reference to a call using CallFactory.getCall(String)
or using the call
passed to it in one of the callback methods (such as CallListenerAbstract.callAnswered(Call)
).
name
- the name of the attribute to getorg.apache.commons.lang3.SerializationException
- if attempting to retrieve a non Serializable attribute from a service which did not create this callCall setAttribute(String name, Serializable attribute)
By method signature, the attribute is Serializable (null is permitted, for example to clear the attribute). It can be retrieved by any service with access to the call.
However, if the attribute is defined as Serializable but has an inner, not Serializable class, it can only be retrieved by the service which created the call. In order to store the data here and retrieve the data at another service, one of the two following options must be carried out:
If the inner class cannot be made serializable by one of these approaches, then either the external class (the attribute handling it) must declare it as transient (and not stored), or the class being stored here will not be serialized.
A service can get a reference to a call using CallFactory.getCall(String)
or using the call
passed to it in one of the callback methods (such as CallListenerAbstract.callAnswered(Call)
).
If an object of the same name is already bound to this Call, the object is replaced. This can be used by the service writer to hold some data that will be needed at a later point in the call.
name
- the name of the object to retain; cannot be nullattribute
- the Serializable object to retain; can be nullorg.apache.commons.lang3.SerializationException
- if attempting to store a non Serializable attribute from a service which did not create this callvoid suspend()
IllegalStateException
- if invoked at a point where the operation is not valid, or in case of an exception in the underlying service.void initiate()
IllegalStateException
- if invoked at a point where the operation is not valid, or in case of an exception in the underlying service.Boolean isCallingPhase()
Boolean isCalledPhase()
boolean wasServiceCalled()
String getUCID()
String getParentUCID()
String getContextId()
void setContextId(String contextId)
contextId
- the new context IDvoid addParticipant(Participant party)
CallTerminationPolicy
found in CallPolicies
),
addParticipant can be used to add another participant. If the call already has 2 connected (established, talking) participants,
addParticipant is not allowed.party
- The participant to add to the callIllegalStateException
- if invoked at a point where the operation is not valid, or in case of an exception in the underlying service.IllegalArgumentException
- In case the problem is found with provided participant.void dropParticipant(Participant participantToDrop)
participantToDrop
- An existing Participant to drop from the call.IllegalStateException
- In case the participantToDrop is not in the call or is not yet able to be dropped.@Deprecated void enableMediaBeforeAnswer()
CallPolicies.setPreAnswerMediaState(PreAnswerMediaState)
and
CallPolicies.setMediaServerInclusion(MediaServerInclusion)
instead.MediaService
) has been initiated. This method must be invoked in
CallListener.callIntercepted(Call)
.IllegalStateException
- if invoked at any point other than CallListener.callIntercepted(Call)
@Deprecated void enableMediaBeforeAnswer(PreAnswerMediaState preAnswerMediaState)
CallPolicies.setPreAnswerMediaState(PreAnswerMediaState)
and
CallPolicies.setMediaServerInclusion(MediaServerInclusion)
insetad.MediaService
) has been initiated. This method must be invoked in
CallListener.callIntercepted(Call)
.preAnswerMediaState
- instance of PreAnswerMediaStateIllegalStateException
- if invoked at any point other than CallListener.callIntercepted(Call)
String getCollectedDigits()
void setCollectedDigits(String collectedDigits)
collectedDigits
- digits to be set in the initial invitation messageCallPolicies getCallPolicies()
Copyright © 2016 Avaya. All Rights Reserved.