Answer
Answers an inbound call that is currently in the inbound state. If the inbound call is
in the answered state this action is ignored.
Note
Calls are answered implicitly by the first action that interacts with the caller.
Setting the Early media advanced setting for an inbound service will allow the application to play media before answering the call.
Properties
The answer properties are:
| Property | Required/Optional | Default | Description |
|---|---|---|---|
| extra_sip_headers from API V2.0 |
optional | - | A list of SIP header objects. These represent additional headers to include when answering the call. |
Language wrappers
Examples:
"answer" :
{
}
"answer" : {
"extra_sip_headers" : [
{
"name" : "X-EstimatedQueueWaitTime",
"value" : "150"
}
]
}
Answer Class
Namespace: Aculab.Cloud.RestAPIWrapper
Assembly: Aculab.Cloud.RestAPIWrapper.dll
An action to explicitly answer an inbound call.
public class Answer : TelephonyAction
{
// Constructors
public Answer();
// Members
public void AddExtraSIPHeader(SIPHeader header);
}
Examples:
List<TelephonyAction> actions = new List<TelephonyAction>();
actions.Add(new Answer());
List<TelephonyAction> actions = new List<TelephonyAction>();
var answer = new Answer();
answer.AddExtraSIPHeader(new SIPHeader("X-EstimatedQueueWaitTime", "150"));
actions.Add(answer);
public class Answer : TelephonyAction
{
// Constructors
public Answer();
// Members
public void AddExtraSIPHeader(SIPHeader header);
}
Examples:
List<TelephonyAction> actions = new List<TelephonyAction>();
actions.Add(new Answer());
List<TelephonyAction> actions = new List<TelephonyAction>();
var answer = new Answer();
answer.AddExtraSIPHeader(new SIPHeader("X-EstimatedQueueWaitTime", "150"));
actions.Add(answer);
public class Answer : TelephonyAction
{
// Constructors
public Answer();
// Members
public void AddExtraSIPHeader(SIPHeader header);
}
Examples:
List<TelephonyAction> actions = new List<TelephonyAction>();
actions.Add(new Answer());
List<TelephonyAction> actions = new List<TelephonyAction>();
var answer = new Answer();
answer.AddExtraSIPHeader(new SIPHeader("X-EstimatedQueueWaitTime", "150"));
actions.Add(answer);
Answer Class
Namespace: Aculab.Cloud.RestAPIWrapper
Assembly: Aculab.Cloud.RestAPIWrapper.dll
An action to explicitly answer an inbound call.
Public Class Answer
Inherits TelephonyAction
' Constructors
Public Sub New ()
' Members
Public Function AddExtraSIPHeader(header As Sipheader) As Void
End Class
Examples:
Dim actions = New List(Of TelephonyAction)
actions.Add(New Answer())
Dim actions = New List(Of TelephonyAction)
Dim answer = New Answer()
answer.AddExtraSIPHeader(New SIPHeader("X-EstimatedQueueWaitTime", "150"))
actions.Add(answer)
Public Class Answer
Inherits TelephonyAction
' Constructors
Public Sub New ()
' Members
Public Function AddExtraSIPHeader(header As Sipheader) As Void
End Class
Examples:
Dim actions = New List(Of TelephonyAction)
actions.Add(New Answer())
Dim actions = New List(Of TelephonyAction)
Dim answer = New Answer()
answer.AddExtraSIPHeader(New SIPHeader("X-EstimatedQueueWaitTime", "150"))
actions.Add(answer)
class Answer extends TelephonyAction
Represents an answer action.
Class synopsis:
// Constructors:
public Answer()
// Members:
public void addExtraSIPHeader(SIPHeader sipHeader)
public JSONObject toJSONObject()
Examples:
List<TelephonyAction> actions = new ArrayList<TelephonyAction>();
actions.add(new Answer());
List<TelephonyAction> actions = new ArrayList<TelephonyAction>();
Answer answerAction = new Answer();
answerAction.addExtraSIPHeader(new SIPHeader("X-EstimatedQueueWaitTime", "150"));
actions.add(answerAction);
class Answer
Represents an answer action.
Class synopsis:
# Answer object:
Answer()
# Instance methods:
Answer.add_extra_sip_header(name, value)
Examples:
# Create a list of actions that will be passed to the TelephonyResponse constructor
list_of_actions = []
list_of_actions.append(Answer())
# Create a list of actions that will be passed to the TelephonyResponse constructor
list_of_actions = []
answer_action = Answer()
answer_action.add_extra_sip_header("X-EstimatedQueueWaitTime", "150")
list_of_actions.append(answer_action)
The Answer class
Introduction
Represents an answer action.
Class synopsis
class Answer extends ActionBase {
/* methods */
public __construct()
public self addExtraSIPHeader(string $name, string $value)
}
Examples:
$response->addAction(new Aculab\TelephonyRestAPI\Answer());
$answer = new Aculab\TelephonyRestAPI\Answer();
$answer->addExtraSIPHeader("X-EstimatedQueueWaitTime", "150");
$response->addAction($answer);