Docs

Modify live call

https://api.apifonica.com/v2/accounts/{accountSID}/calls/{callSID}

Overview

You can modify the flow of a live call by redirecting its flow control to another controller script.

To do this, make the POST request to the call resource instance /accounts/{accountSID}/calls/{callSID} that is in progress and pass the new controller URL.

ParameterDescription

REQUEST EXAMPLES

The following example demonstrates modifying a live call.

curl –X POST https://api.apifonica.com/v2/accounts/{accountSID}/calls/{callSID} \
-H 'Content-Type: application/json' \
-d '{
    "call_app_sid": "app1f255680-95dd-34c6-b83f-c86b8095adcb"
}' \
-u {accountSID}:{authToken}

RESPONSE EXAMPLE

{
    "status_code": 201,
    "status_message": "CREATED",
    "uri": "/v2/accounts/{accountSID}/calls/{callSID}"
}

APIFONICA REQUEST PARAMETERS BEING SENT TO CONTROLLER URL

The following parameters are sent to controller URL if it is provided. Empty answer or Apifonica XML file is expected in return. Empty answer will be treated as no action. Apifonica XML file will break current scenario and execute as call flow modification

ParameterDescription

EXAMPLE OF REQUEST FROM APIFONICA TO CONTROLLER URL

{
  "call_sid":"calf3efd4c0-f11e-37cd-ba44-085e81f8381c",
  "created":"2017-04-24 09:12:09",
  "status":"answered",
  "from":"883140100000086",
  "to":"79031550066",
  "direction":"outbound",
  "leg_status":"ringing",
  "leg_from":"883140100000086",
  "leg_to":"883140100000099"
}