Get details of all ongoing calls

This method allows you to retrieve details of all ongoing calls made from an account.

API Endpoint

GET https://api.plivo.com/v1/Account/{auth_id}/Call/?status=live

Arguments

call_direction optional

The direction of the call in case you would like to filter results by call direction. The valid values are ‘inbound’ and ‘outbound’.

from_number optional

The number from which the calls were made in case you would like to filter results by the number from which the call was made. You can filter the details by using the exact number or the desired prefix.

to_number optional

The destination number to which the calls were made in case you would like to filter results by destination called. You can filter the details by using the exact number or the desired prefix.

Returns

Returns the CallUUIDs of all ongoing calls

Response

HTTP Status Code: 200

{
  "api_id": "c9527676-5839-11e1-86da-6ff39efcb949",
  "calls": [
	"eac94337-b1cd-499b-82d1-b39bca50dc31",
	"0a70a7fb-168e-4944-a846-4f3f4d2f96f1"
  ]
}

Example Request

1
2
3
4
5
6
import plivo

client = plivo.RestClient()

response = client.live_calls.list_ids(from_number=123456789, to_number=123456789, call_direction=Inbound)
print(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
# Example for Call List
#
require 'rubygems'
require 'plivo'

include Plivo
include Plivo::Exceptions

api = RestClient.new("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN")

begin
  response = api.calls.list_live(
	from_number: 123456789,
	to_number: 123456789,
	call_direction: outbound
)
  puts response
rescue PlivoRESTError => e
  puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Example for LiveCall list

(function main() {
   'use strict';

   // As the auth_id and auth_token are unspecified, Plivo will fetch them from the PLIVO_AUTH_ID and PLIVO_AUTH_TOKEN environment variables.
   var client = new plivo.Client(Auth_Id, "Auth_Token")
   client.calls.listLiveCalls(
       {
           to_number : "9880156119",
           from_number : "9880156119",
           call_direction : "outbound"
       }
   ).then(function (response) {
       console.log(response);
   }, function (err) {
       console.error(err);
   });
})();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
/**
 * Example for Call list
 */
 require 'vendor/autoload.php';
 use Plivo\RestClient;
 use Plivo\Exceptions\PlivoRestException;
 $client = new RestClient("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN");
 try {
     $response = $client->calls->listLive(
 [
 	to_number => 123456789,
 	from_number => 123456789,
 	call_direction => inbound
 ]
 );
     print_r($response);
 }
 catch (PlivoRestException $ex) {
     print_r(ex);
 }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.plivo.api.samples.livecall;

import java.io.IOException;
import com.plivo.api.Plivo;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.call.LiveCall;
import com.plivo.api.models.call.LiveCallListResponse;

class LiveCallList {
    public static void main(String [] args) {
        Plivo.init();
        try {
            LiveCallListResponse response = LiveCall.listGetter().callDirection(CallDirection.INBOUND).fromNumber("123456789").toNumber("123456789").get();


            System.out.println(response);
        } catch (PlivoRestException | IOException e) {
            e.printStackTrace();
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
 * Example for Live Call List
 */
using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Exception;

namespace PlivoExamples
{
   internal class Program
   {
       public static void Main(string[] args)
       {
           var api = new PlivoApi("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN");
           try
           {
               var response = api.Call.ListLive(callDirection: Inbound, fromNumber: 123456789, toNumber: 123456789);
Console.WriteLine(response);
           }
           catch (PlivoRestException e)
           {
               Console.WriteLine("Exception: " + e.Message);
           }
       }
   }
}
1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Call/?status=live
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Example for LiveCall list
package main

import "fmt"
import "github.com/plivo/plivo-go"

func main() {
	client, err := plivo.NewClient("", "", &plivo.ClientOptions{})
	if err != nil {
		panic(err)
	}
	response, err := client.LiveCalls.IDList()
	if err != nil {
		panic(err)
	}
	fmt.Printf("Response: %#v\n", response)
}