A Sample PHP command line application to : Download Call Logs , Call Recordings, Messages etc
Please Keep in mind that this is not a Production ready Application but just a sample demo
- PHP 5.3.29+
- Composer
- CURL Extension
- Adding ReadCallRecording permission
** please contactdevsupport@ringcentral.com
with the name of your RingCentral Application to add the Advanced Permission - Select the application type = Server Only ( NO UI ) and scope =
Private
** This is a mandatory application type for this demo
1.Clone the Repository
$ git clone https://github.com/anilkumarbp/ringcentral-demos-data-archival.git
2.cd into ringcentral-demos-data-archival
. Run the Composer command to install the packages
Install composer (If you do not have Composer installed yet):
$ curl -sS https://getcomposer.org/installer | php
3.Install the packages using composer
$ composer install
4.Create a .env
file within the same folder and the contents as shown below and configure your RingCentral Account details:
For ex:
To run callRecording.php script make RC_SkipDownload= False
To skip callRecording.php script make RC_SkipDownload= True
RC_AppKey=
RC_AppSecret=
RC_Server=
RC_Username=
RC_Extension=
RC_Password=
RC_fromPhoneNumber=
RC_toPhoneNumber=
RC_dateFrom=
RC_dateTo=
RC_callRecordingsCount=
amazonAccessKey=
amazonSecretKey=
dropBoxkey=
dropBoxsecret=
RC_SkipCallLog=
RC_SkipRingOut=
RC_SkipDownload=
RC_SkipDownloadS3=
RC_SkipDownloadDropbox=
5.Run the script:
$ php index.php
require(__DIR__ . '/demo/callLog.php');
Aim : To pull down call-logs in cycles of one business day ( 24 hours ) and save them as .json file Pre-requisite : Before you initiate the call_log.php make sure to pass the "RC_dateFrom" filter in the .env file ( /.env ) Note : The call-log is designed to fetch 100 records per page.
require(__DIR__ . '/demo/callRecording.php');
Aim : Save the call-recordings to your local file system using file stream writer. Creates a directory called "Recordings" and the recordings are stored as .mp3 / .wav format. Pre-requisite : Before you initiate the callRecording.php make sure to pass the "RC_dateFrom" filter in the .env file ( /.env )
require(__DIR__ . '/demo/callRecording_AmazonS3.php');
Aim : Save the call-recordings to your Amazon S3 Buckets using amazon stream writer. Creates a directory called "Recordings" and the recordings are stored as .mp3 / .wav format. Pre-requisite : Before you initiate the callRecording.php make sure to pass the "RC_dateFrom" filter in the .env file ( /.env )
{
"amazonAccessKey": "", // Amazon app key
"amazonSecretKey": "" // Amazon app secret
}
require(__DIR__ . '/demo/callRecording_Dropbox.php');
Aim : Save the call-recordings to your Dropbox Application. Creates a directory called "Recordings" and the recordings are stored as .mp3 / .wav format. Pre-requisite : Before you initiate the callRecording_Dropbox.php make sure to pass the "dropBoxkey" and "dropBoxsecret" within the .env file ( /.env )
{
"dropBoxkey": "", // Dropbox app key
"dropBoxsecret": "" // Dropbox app secret
}
Please take a look in demo
folder to see all the demo scripts.
Project Repo
RingCentral SDK for PHP
RingCentral API Docs
RingCentral API Explorer
Any reports of problems, comments or suggestions are most welcome.
Please report these on ringcentral-demos-data-archival's Issue Tracker in Github.
RingCentral SDK is available under an MIT-style license. See LICENSE.txt for details.
RingCentral SDK © 2016 by RingCentral
- What if I do not have a RingCentral account? Don't have an account, no worries: Become a RingCentral Customer
- I/My company is an Independent Software Vendor (ISV) who would like to integrate with RingCentral, how do I do that? You can apply to Join the RingCentral Partner Program