Legs

Transfer a SIP leg via REFER (asynchronous)

Changed on

Asynchronously transfers a SIP leg. The HTTP call returns 202 as soon as the request is validated; the REFER is sent in the background and its outcome is surfaced through leg.transfer_initiated / leg.transfer_progress / leg.transfer_completed / leg.transfer_failed events. Blind transfer when replaces_leg_id is omitted; attended transfer when present (the named leg's dialog identity is embedded as a Replaces parameter per RFC 3891). On terminal 2xx the leg (and the replaces leg, if any) is hung up automatically.

post/legs/{id}/transfer

Request

  • Base URL
    http://localhost:8080/v1
  • URL
    http://localhost:8080/v1/legs/{id}/transfer
  • Auth
    none declared

Request body

targetstring required

SIP URI to transfer the call to (e.g. "sip:bob@example.com").

replaces_leg_idstring

ID of an existing connected SIP leg whose dialog should be replaced (attended transfer). Omit for blind transfer.

refer_to_headersobject

SIP headers to carry to the transfer target, embedded as URI headers in the Refer-To (RFC 3261 §19.1.1), e.g. <sip:bob@example.com?User-to-User=...>; the peer copies them into the INVITE it sends to the target. Values are percent-encoded for you. Whether a peer honours them is peer-specific. Dialog and routing headers (RFC 3261 §19.1.5), body and Replaces are rejected — use replaces_leg_id for attended transfer.

headersobject

SIP headers to set on the REFER request itself, read by the peer that receives the REFER. A Referred-By given here replaces the default one. Refer-To, Contact and the dialog and routing headers are rejected.

Response

Transfer request accepted for processing

Changes