Skip to main content

SIP Refer a call

POST 
/calls/:call_control_id/actions/refer

Initiate a SIP Refer on a Call Control call. You can initiate a SIP Refer at any point in the duration of a call.

Expected Webhooks (see callback schema below):

  • call.refer.started
  • call.refer.completed
  • call.refer.failed

Request

Path Parameters

    call_control_id stringrequired

    Unique identifier and token for controlling the call

Body

required

Refer request

    sip_address stringrequired

    The SIP URI to which the call will be referred to.

    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 execution of duplicate commands. Telnyx will ignore subsequent commands with the same command_id as one that has already been executed.

    custom_headers

    object[]

    Custom headers to be added to the SIP INVITE.

  • Array [

  • name stringrequired

    The name of the header to add.

    value stringrequired

    The value of the header.

  • ]

  • Custom headers to be added to the SIP INVITE.

    sip_auth_username string

    SIP Authentication username used for SIP challenges.

    sip_auth_password string

    SIP Authentication password used for SIP challenges.

    sip_headers

    object[]

    SIP headers to be added to the request. 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.

  • ]

  • SIP headers to be added to the request. Currently only User-to-User header is supported.

Responses

200: Successful response upon making a call control command.

default: Unexpected error

Callbacks

Request samples


curl -L 'https://api.telnyx.com/v2/calls/:call_control_id/actions/refer' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"sip_address": "sip:username@sip.non-telnyx-address.com"
}'

Response samples


{
"data": {
"result": "ok"
}
}