Skip to content

Manage Call with `callLeg`

Request

This method is used to manage ongoing, connected calls. This method is only used when using the PlayFiles and Say instructions in the request body. This method uses SVAML in the request body to perform various tasks related to the call. For more information about SVAML, see the Callback API documentation.

Note: You can only use this method for calls that originate from or terminate to PSTN or SIP networks.

Security
Basic or Signed
Path
callIdstringrequired

The unique identifier of the call. This value is generated by the system.

Example:4398599d1ba84ef3bde0a82dfb61abed
callLegstringrequired

Specifies which part of the call will be managed. This option is used only by the PlayFiles and Say instructions to indicate which channel the sound will be played on. Valid options are caller, callee or both. If not specified, the default value is caller.
The callLeg identifier is ignored for calls that are part of a conference and calls initiated using the Callout API.

Enum ValueDescription
caller

The outgoing call line.

callee

The receiving call line.

both

Both lines.

Example:caller
Bodyapplication/json
instructionsArray of objects(svaml.instruction)

The collection of instructions that can perform various tasks during the call. You can include as many instructions as necessary.

actionobject(svaml.action.patch)
curl -i -X PATCH \
  -u '<username>:<password>' \
  https://calling.api.sinch.com/calling/v1/calls/id/4398599d1ba84ef3bde0a82dfb61abed/leg/caller \
  -H 'Content-Type: application/json' \
  -d '{
    "instructions": [
      {
        "name": "say",
        "text": "Hello, the call is over, hanging up now.  Goodbye",
        "locale": "en-US"
      }
    ],
    "action": {
      "name": "hangup"
    }
  }'

Responses

A success response, or an Error.

Bodyapplication/json
Response
{ "content": "200 Successful response" }