PHP code example of mvkaran / exotel

1. Go to this page and download the library: Download mvkaran/exotel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mvkaran / exotel example snippets


use MVKaran\Exotel\Client;

$sid = "rajnikanth"; //Use your Sid here
$token = "asd7dfg87dfg8dsugf8s9df7s89f7s89df7df"; //Use your token here

$client = new Client($sid, $token);

$result = $client->call_number([
	'from' => '0987654321', 
	'to' => '09879879876', 
	'caller_id' => '08088919888', //One of your Exophones,

	'time_limit' => '', //Optional. Can be ignored from the array itself
	'time_out' => '', //Optional. Can be ignored from the array itself
	'status_callback' => '', //Optional. Can be ignored from the array itself
]);


$result = $client->call_flow([
	'to' => '09879879876', 
	'app_id' => '1234',
	'caller_id' => '08088919888', //One of your Exophones,

	'time_limit' => '', //Optional. Can be ignored from the array itself
	'time_out' => '', //Optional. Can be ignored from the array itself
	'status_callback' => '', //Optional. Can be ignored from the array itself
	'custom_field' => '', //Optional. Can be ignored from the array itself
]);


$result = $client->call_details($call_sid);

$result = $client->send_sms([
	'from' => '08088919888', //One of your Exophones,
	'to' => '09879879876', 
	'body' => 'Hey there! Explore Exotel!', 

	'priority' => 'normal', //Optional. Can be ignored from the array itself
	'status_callback' => '', //Optional. Can be ignored from the array itself
]);


$result = $client->sms_details($sms_sid);