Skip to main content

Answer call

POST 

/calls/:call_control_id/actions/answer

Answer an incoming call. You must issue this command before executing subsequent commands on an incoming call.

Expected Webhooks:

  • call.answered
  • streaming.started, streaming.stopped or streaming.failed if stream_url was set

Request

Path Parameters

    call_control_id stringrequired

    Unique identifier and token for controlling the call

Body

required

Answer call request

    billing_group_id uuid

    Use this field to set the Billing Group ID for the call. Must be a valid and existing Billing Group ID.

    client_state string

    Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.

    command_id string

    Use this field to avoid duplicate commands. Telnyx will ignore any command with the same command_id for the same call_control_id.

    custom_headers

    object[]

    Custom headers to be added to the SIP INVITE response.

  • Array [

  • name stringrequired

    The name of the header to add.

    value stringrequired

    The value of the header.

  • ]

  • sip_headers

    object[]

    SIP headers to be added to the SIP INVITE response. Currently only User-to-User header is supported.

  • Array [

  • name stringrequired

    Possible values: [User-to-User]

    The name of the header to add.

    value stringrequired

    The value of the header.

  • ]

  • sound_modifications

    object

    Use this field to modify sound effects, for example adjust the pitch.

    pitch double

    Set the pitch directly, value should be > 0, default 1 (lower = lower tone)

    semitone double

    Adjust the pitch in semitones, values should be between -14 and 14, default 0

    octaves double

    Adjust the pitch in octaves, values should be between -1 and 1, default 0

    track string

    Default value: outbound

    The track to which the sound modifications will be applied. Accepted values are inbound or outbound

    stream_url string

    The destination WebSocket address where the stream is going to be delivered.

    stream_track string

    Possible values: [inbound_track, outbound_track, both_tracks]

    Default value: inbound_track

    Specifies which track should be streamed.

    send_silence_when_idle boolean

    Default value: false

    Generate silence RTP packets when no transmission available.

    webhook_url string

    Use this field to override the URL for which Telnyx will send subsequent webhooks to for this call.

    webhook_url_method string

    Possible values: [POST, GET]

    Default value: POST

    HTTP request type used for webhook_url.

Responses

200: Successful response upon making a call control command.

Schema

    data

    object

    result string

default: Unexpected error

Schema

    errors

    Error[]

  • Array [

  • code integerrequired
    title stringrequired
    detail string

    source

    object

    pointer json-pointer

    JSON pointer (RFC6901) to the offending entity.

    parameter string

    Indicates which query parameter caused the error.

    meta object
  • ]

Callbacks

Loading...