Update active Call

Update properties of an active phone call.

Request URL

POSThttps://voice.bandwidth.com/api/v2/accounts/{accountId}/calls/{callId}


Supported Parameters

Parameter Description Mandatory
state (optional) The call state. Possible values:

active to redirect the call (default)
completed to hangup the call
No
redirectUrl (optional) The URL to send the Redirect event to which will provide new BXML

Required if state is active

Not allowed if state is completed
No
redirectMethod (optional) The HTTP method to use for the request to redirectUrl. GET or POST. Default value is POST.

Not allowed if state is completed
No
username (optional) The username to send in the HTTP request to answerUrl and disconnectUrl. No
password (optional) The password to send in the HTTP request to answerUrl and disconnectUrl. No
tag (optional) A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or cleared.

May be cleared by setting tag=""

Max length 256 characters.

Not allowed if state is completed
No

Example: Redirect an existing phone call to a new URL

curl -u username:password -v -X POST https://voice.bandwidth.com/api/v2/accounts/{accountId}/calls/{callId}\
    -H "Content-type: application/json" \
    -d \
    '
    {
        "state":"active",
        "redirectUrl":"http://www.myapp.com/new"
    }'

Example: Hang Up a Phone Call

curl -v -X POST https://voice.bandwidth.com/api/v2/accounts/{accountId}/calls/{callId}\
    -u {token}:{secret} \
    -H "Content-type: application/json" \
    -d \
    '
    {
        "state":"completed"
    }'

results matching ""

    No results matching ""