AnswerCall

Metreos.CallControl.AnswerCall

Summary

Answers an incoming call, indicating to the remote endpoint that the called party is willing to participate in the call.

Usage

When a call is inbound to an script via IncomingCall, the call is in a ringing state and a script can choose to do one of 5 things: AnswerCall, AcceptCall, Redirect, Reject, or simply do nothing with the call. The practical use of Answer is to establish a call and media connection with a remote endpoint, essentially bringing a script into a telephony conversation and opening up the ability to utilize the other actions and events in the Call Control and Media Control APIs.

From the perspective of the script instance initiated by the incoming call, the telephony protocol of the call has already been chosen by the time IncomingCall has been fired. However, any call created by the application via MakeCall or Barge will use the protocol configured on the partition of the script instance. See Call Routing for more information on how the application server interfaces with the outside world for the routing of calls.

As soon as a call is answered, a number of unsolicited events can potentially occur. These are GotDigits, RemoteHangup, StartTx, StopTx, and StartRx.

Remarks

An audio connection between the called destination and media engine is created automatically when one uses Answer. The application server automatically uses ReserveConnection and CreateConnection while the call is being established with the remote endpoint, with the end result of a valid ConnectionId result data parameter. This ConnectionId can then be used by the Media Control API.

When the call is hung up by either party, the ConnectionId is destroyed automatically by the application server.

The script does not have direct control over which media engine is used when answering the call, unless MmsId is specified. In the case that MmsId is not specified, the media engine used to process the audio connection is determined by the current Media Resource Group on the current application partition.

The Call Control API makes every effort to abstract the complexities of the underlying telephony protocol; however, one should consult the Call Control Feature Matrix to understand what Call Control actions and action parameters are valid for each of the four supported protocols. One can set installation and deployment guidelines based on the Call Control actions and action parameters that an application uses; the Call Control Feature Matrix makes developing such guidelines feasible.

The Reserve Media Early configuration on the script instance partition specifies whether a media engine connection should be provisioned with ReserveConnection as soon as the call is initiated, or if the application server should wait to until the media negotiation phase of the call ensues before reserving the connection. The media negotiation phase often comes as the call is answered by the remote endpoint, but can also come before. Due to the small amount of time AnswerCall usually takes to complete, Reserve Media Early is less important compared to the impact it has on MakeCall.

Action Parameters
Parameter Name.NET TypeDefaultDescription
CallId *System.StringIndicates the call to answer with AnswerCall.
DisplayNameSystem.StringA free string which describes the initiator of the call. Not all telephony protocols support this field; please consult the Call Control Feature Matrix.
MmsIdSystem.UInt32The ID of the media engine to create the connection on. If no MmsId is specified when using AnswerCall, a media engine with the most available resources is dynamically selected from the Media Resource Group associated with the partition of the script instance from which AnswerCall is invoked.
ProxyDTMFCallIdSystem.StringThe CallId to establish a proxy relationship with. Any digits received on one call leg will be proxied to the other.
WaitForMediaSystem.StringIndicates what degree of media negotiation must be established before the call is considered answered. An answered call results in the successful completion of the AnswerCall action. Valid values are as follows:
None

Indicates that the call should be considered completed as soon as the call control signaling has indicated that the call is answered, regardless of the state of media negotiation.

Tx

Indicates that the call should be considered completed as soon as the call control signaling has indicated that the call is answered and the remote endpoint has specified the properties of the audio stream that it wants transmitted to it.

Rx

Indicates that the call should be considered completed as soon as the call control signaling has indicated that the call is answered and the application server has specified the properties of the audio stream that it wants transmitted to the media engine.

TxRx

Indicates that the call should be considered completed as soon as the call control signaling has indicated that the call is answered, the remote endpoint has specified the properties of the audio stream that it wants transmitted to it, and the application server has specified the properties of the audio stream that it wants transmitted to the media engine.

. Note that depending on the value chosen, the result data parameters relating to the negotiated media information may not be valid yet because the media negotiation may not yet be completed.
ConferenceSystem.BooleanIndicates that this call is to be placed in a conference. If a ConferenceId is not specified or is set to 0, then a new conference is created on the media engine and the ConferenceId is the unique identifier for that new conference (assuming WaitForMedia is the default TxRx). If a ConferenceId is specified, then the connection created for this call is moved into the existing conference as soon as the media channels for the call have been fully established.
ConferenceIdSystem.StringThe ConferenceId of the conference to add this call to. Specify no value or 0 if this is to be a new conference. This field is ignored if Conference is false.
HairpinSystem.BooleanIndicates that the new conference should be optimized for two parties. A hairpinned conference does not use any conference resources. However, a hairpin conference will be 'promoted', or converted to a true media conference, if a 3rd participant is added to the conference or if a voice operation is performed on the conference itself. In either case, this will cause each participant and conferenced voice operation to use one conference resource. True conferences also have a slightly increased latency over a hairpinned conference.
TimeoutSystem.Int32The Timeout property specifies to the Application Runtime Environment how long to wait for a response from the provider for the current action. The ReturnValue returned in this case is 'Timeout'. The value must be a literal value in milliseconds.
Result Data
Parameter Name.NET TypeDescription
CallIdSystem.StringIndicates the call that was accepted. This is always the same value passed in as the CallId action parameter.
MmsIdSystem.UInt32Unique identifier used to identify the media engine in control of this connection. A common use for this ID is to ensure that other connections which will ultimately be conferenced with this connection are all created on the same media engine. This correlation is necessary because all connections in a single conference must all reside on the same media engine.
ConnectionIdSystem.StringUnique identifier used to identify this connection in all subsequent Media Control API operations. This connection may not be fully connected, and therefore not ready to use in most Media Control API by the time it is returned to the script if WaitForMedia is not the default TxRx.
ConferenceIdSystem.StringUnique identifier for the conference that this connection was placed in. This field is valid only if Conference was specified as true in the action. In the case that Conference was set to true, and if the ConferenceId action parameter was specified, this event parameter will be that same value. If the ConferenceId action parameter was not specified, then this will be a new ID for the new conference.
MediaTxIPSystem.StringThe IP address that the media engine connection should send audio to. This field can only be relied on if WaitForMedia has been set to a value of Tx or TxRx. However, regardless if this field is available as a result data parameter, the application server will associate the correct value for this parameter to the connection created for this call when it becomes available at the protocol layer.
MediaTxPortSystem.UInt32The port that the media engine connection should send audio to. This field can only be relied on if WaitForMedia has been set to a value of Tx or TxRx. However, regardless if this field is available as a result data parameter, the application server will associate the correct value for this parameter to the connection created for this call when it becomes available at the protocol layer.
MediaTxCodecSystem.StringThe codec that the media engine connection should use when sending audio. This field can only be relied on if WaitForMedia has been set to a value of Tx or TxRx. However, regardless if this field is available as a result data parameter, the application server will associate the correct value for this parameter to the connection created for this call when it becomes available at the protocol layer.
MediaTxFramesizeSystem.UInt32The framesize that the media engine connection should use when sending audio. This field can only be relied on if WaitForMedia has been set to a value of Tx or TxRx. However, regardless if this field is available as a result data parameter, the application server will associate the correct value for this parameter to the connection created for this call when it becomes available at the protocol layer.
MediaRxIPSystem.StringThe IP address chosen by the application server for the Rx RTP stream for this connection. This field can only be relied on if WaitForMedia has been set to a value of Rx or TxRx. However, regardless if this field is available as a result data parameter, the application server will associate the correct value for this parameter to the connection created for this call when it becomes available at the protocol layer.
MediaRxPortSystem.UInt32The port chosen by the application server for the Rx RTP stream for this connection. This field can only be relied on if WaitForMedia has been set to a value of Rx or TxRx. However, regardless if this field is available as a result data parameter, the application server will associate the correct value for this parameter to the connection created for this call when it becomes available at the protocol layer.
MediaRxCodecSystem.StringThe codec chosen by the application server for the Rx RTP stream for this connection. This field can only be relied on if WaitForMedia has been set to a value of Rx or TxRx. However, regardless if this field is available as a result data parameter, the application server will associate the correct value for this parameter to the connection created for this call when it becomes available at the protocol layer.
MediaRxFramesizeSystem.UInt32The framesize chosen by the application server for the Rx RTP stream for this connection. This field can only be relied on if WaitForMedia has been set to a value of Rx or TxRx. However, regardless if this field is available as a result data parameter, the application server will associate the correct value for this parameter to the connection created for this call when it becomes available at the protocol layer.

Branch Conditions 

Success

No description.

Failure

No description.

Timeout

No description.