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
call_app_sid

Link to the existing application, which will be used for Call operations

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
call_sid

Call unique identifier.

created

Date and time of the adding the call to queue.

status

Call (A-leg) status.

from

Caller phone number (conventional or virtual).

to

Recipient’s phone number (conventional or virtual).

direction

Call direction.

Either inbound or outbound.

leg_status

B-leg status.

leg_from

The phone number or virtual number of the caller for B-leg.

leg_to

The phone number or virtual number which is used in B-leg to receive the call.

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"
}