Update active Call

Update properties of an active phone call.

For more information about recording and transcribing calls, see the FAQ

Request URL

POSThttps://api.catapult.inetwork.com/v1/users/{userId}/calls/{callId}


Supported Parameters

Parameter Description Mandatory
state The call state. Possible values:

rejected to reject the incoming call
active to answer the incoming call
completed to hangup the active call

transferring to transfer the incoming call to another line. See the docs specific for transferring
No
recordingEnabled Indicates if the call should be recorded. Values true or false. You can turn recording on/off and have multiple recordings on a single call. No
recordingFileFormat The file format of the recorded call. Supported values are wav (default) and mp3. No
transferTo Phone number or SIP address that the call is going to be transferred to. No
transferCallerId This is the caller id that will be used when the call is transferred. This parameter is only considered in transfer state.
- transferring an incoming call: allowed values are 1) private 2) the incoming call from number or 3) any Bandwidth number owned by user.
- transferring an outgoing call call: allowed values are 1) private or 2) any Bandwidth phone number owned by user.
No
whisperAudio Audio to be played to the caller that the call will be transferred to. See tab for audio. No
callbackUrl The server URL where the call events for the new call will be sent upon transferring. No

Example 1 of 5: Answer an Incoming Phone Call

curl -v -X POST https://api.catapult.inetwork.com/v1/users/{userId}/calls/{callId} -u {token}:{secret} -H "Content-type: application/json"     -d
    '
    {
        "state":"active"
    }
    '
//Promise
client.Call.answer("callID").then(function () {});

//Callback
client.Call.answer("callID", function (err) {});
await client.Call.AnswerSync("callID");
call.answer_on_incoming()

Example 2 of 5: Hang Up a Phone Call

curl -v -X POST https://api.catapult.inetwork.com/v1/users/{userId}/calls/{callId}    -u {token}:{secret}     -H "Content-type: application/json"     -d     '
    {
        "state":"completed"
    }'
//Promise
client.Call.hangup("callID").then(function () {});

//Callback
client.Call.hangup("callID", function (err) {});
await client.Call.HangupAsync("callID");
call.hangup()

Example 3 of 5: Turn call recording ON

curl -v -X POST https://api.catapult.inetwork.com/v1/users/{userId}/calls/{callId}    -u {token}:{secret}     -H "Content-type: application/json"     -d     '
    {
        "recordingEnabled":"true"
    }'
//Turn on recording

//Promise
client.Call.enableRecording("callId").then(function (res) {});

//Callback
client.Call.enableRecording("callId", function (err, res) {});
await client.Call.TurnCallRecordingAsync("callID", true);
call.recording_on()

Example 4 of 5: Turn call recording OFF

curl -v -X POST https://api.catapult.inetwork.com/v1/users/{userId}/calls/{callId}    -u {token}:{secret}     -H "Content-type: application/json"     -d     '
    {
        "recordingEnabled":"false"
    }'
//Turn off recording
//Promise
client.Call.disableRecording("callId").then(function (res) {});

//Callback
client.Call.disableRecording("callId", function (err, res) {});
await client.Call.TurnCallRecordingAsync("callID", false);
call.recording_off()

Example 5 of 5: Reject an Incoming Phone Call

curl -v -X POST https://api.catapult.inetwork.com/v1/users/{userId}/calls/{callId} -u {token}:{secret} -H "Content-type: application/json" -d
    '
    {
        "state":"rejected"
    }
    '
//Promise
client.Call.reject("callID").then(function () {});

//Callback
client.Call.reject("callID", function (err) {});
await client.Call.RejectAsync("callID");
call.reject_incoming()

results matching ""

    No results matching ""