<?php require_once "./plivo.php"; $auth_id = "Your AUTH_ID"; $auth_token = "Your AUTH_TOKEN"; $p = new RestAPI($auth_id, $auth_token); $response = $p->get_cdrs(); // print_r ($response); /* Sample Output ( [status] => 200 [response] => Array ( [api_id] => 22852b7c-ae03-11e4-a2d1-22000ac5040c [meta] => Array ( [limit] => 20 [next] => /v1/Account/XXXXXXXXXXXXXXX/Call/?limit=20&offset=20 [offset] => 0 [previous] => [total_count] => 124 ) [objects] => Array ( [0] => Array ( [bill_duration] => 8 [billed_duration] => 60 [call_direction] => outbound [call_duration] => 8 [call_uuid] => dd9b3414-adc8-11e4-aed8-377ffe01233f [end_time] => 2015-02-06 10:25:20+04:00 [from_number] => [parent_call_uuid] => d66cc0a4-adc8-11e4-ac44-377ffe01233f [resource_uri] => /v1/Account/XXXXXXXXXXXXXXX/Call/dd9b3414-adc8-11e4-aed8-377ffe01233f/
$auth_id = "XXXXXXXXXXXXXXXXXXXXXXXXXXX"; $auth_token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; $p = new RestAPI($auth_id, $auth_token); // Make Call $params = array('to' => '1212121212121', 'from' => '43434343434343', 'ring_url' => 'http://example.com/ring_url', 'answer_url' => 'http://example.com/answer_url', 'hangup_url' => 'http://example.com/hangup_url'); $response = $p->make_call($params); // Hangup Call $params = array('call_uuid' => 'XXXXXXXXXXXXXXXXXXXXXXXXX'); $response = $p->hangup_call($params); // Hangup All Calls $response = $p->hangup_all_calls(); // Transfer Calls $params = array('call_uuid' => 'XXXXXXXXXXXXXXXXXXXXXXXXX', 'url' => 'http://example.com/transfer_call', 'method' => 'POST'); $response = $p->transfer_call($params); // Record Call $params = array('call_uuid' => 'XXXXXXXXXXXXXXXXXXXXXXXXX', 'time_limit' => '60', 'file_format' => 'mp3', 'url' => 'http://example.com/record_url_fetch', 'method' => 'POST'); $response = $p->record($params); // Stop Record $params = array('call_uuid' => 'XXXXXXXXXXXXXXXXXXXXXXXXX', 'url' => 'http://example.com/record_url_fetch'); $response = $p->stop_record($params); // Play Sound $params = array('call_uuid' => 'XXXXXXXXXXXXXXXXXXXXXXXXX', 'url' => 'http://example.com/play_to_call'); $response = $p->play($params); // Stop Play $params = array('call_uuid' => 'XXXXXXXXXXXXXXXXXXXXXXXXX'); $response = $p->stop_play($params); // Get CDRs $response = $p->get_cdrs(); // Get CDR $params = array('record_id' => 'XXXXXXXXXXXXXXXXXXXXXXXXX'); $response = $p->get_cdr($params);