Legs

Answer a ringing or early-media inbound SIP leg (asynchronous)

Signals the inbound-call goroutine to send 200 OK. The HTTP call returns 202 immediately; the actual SIP 200 OK is sent in the background, and the leg's transition is observed via leg.connected. Pre-condition failures (wrong state, unknown codec) still return 4xx synchronously. When the caller offers several m=audio sections they are all accepted; streams optionally routes each accepted stream beyond the primary into its own room, applied once the answer is negotiated.

post/legs/{id}/answer

Request body

speech_detectionboolean

If true, emit speaking.started and speaking.stopped events for this leg. If false, suppress them. Omit to use the server default (SPEECH_DETECTION_ENABLED env var, default false).

codec'PCMU' | 'PCMA' | 'G722' | 'opus' | 'AMR-WB' | 'AMR-NB'

Explicit codec for the answer SDP. Must appear in the remote offer's offered_codecs list. Omit to use the server's default preference order.

{"stackTrail":"components:schemas:AnswerLegRequest:properties:custom_data","oasType":"schema","type":"unknown","description":"Opaque application JSON attached to the leg. Any JSON value is accepted (object, array, string, number, boolean). It is echoed on the leg view and carried at the top level of every event published for this leg, so external state can be correlated without keeping a leg_id lookup table. Capped by CUSTOM_DATA_MAX_BYTES (default 1024 bytes, 0 = unlimited). Omit to leave any existing value untouched; send null to clear it."}

Response

Answer queued

Changes

Changed in 7 of the 67 revisions of this API.38

    • added the new optional request property custom_data

      new-optional-request-property

    • added the new optional request property streams

      new-optional-request-property

    • added the new AMR-NB enum value to the request property codec

      request-property-enum-value-added

    • added the new AMR-WB enum value to the request property codec

      request-property-enum-value-added

    • removed the success response with the status 200

      response-success-status-removed

    • added the new optional request property codec

      new-optional-request-property

    • added the success response with the status 202

      response-success-status-added

    • added optional request body

      request-body-added-optional

  • d09c97c6ca8c21See the full diff
    • removed the request body

      request-body-removed

    • removed the success response with the status 202

      response-success-status-removed

    • added the success response with the status 200

      response-success-status-added

    This revision also has 40 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog