PHPackages                             mvkaran/exotel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mvkaran/exotel

ActiveLibrary[API Development](/categories/api)

mvkaran/exotel
==============

Exotel Call and SMS API client library

1.1.0(10y ago)04.3k[1 issues](https://github.com/mvkaran/exotel-php/issues)MITPHP

Since Apr 13Pushed 9y agoCompare

[ Source](https://github.com/mvkaran/exotel-php)[ Packagist](https://packagist.org/packages/mvkaran/exotel)[ RSS](/packages/mvkaran-exotel/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Exotel PHP Client Library
=========================

[](#exotel-php-client-library)

Exotel PHP client library for use with Composer package dependency manager

- [Installation](#installation)
- [Usage](#usage)
    - [Connect Two Numbers](#connect-two-numbers)
    - [Connect Call to Flow or App](#connect-call-to-flow-or-app)
    - [Get Details of a Call](#get-details-of-a-call)
    - [Send a SMS](#send-a-sms)
    - [Get Details of a SMS](#get-details-of-a-sms)
- [Exceptions](#exceptions)
- [Reference](#reference)
    - [Call](#call)
    - [SMSMessage](#smsmessage)
- [More Information](#more-information)
- [Errors](#errors)
- [Contribute](#contribute)
- [Change Log](#change-log)

Installation
------------

[](#installation)

The package can be installed by running a simple require command from your project's root or by manually adding it to your composer.json file

```
composer require mvkaran/exotel
```

---

Usage
-----

[](#usage)

Before making any calls / sms through the library, you need to initialize the client with your `Sid` and `Token`. You can get these from the `API` menu under `Settings` in your Exotel account.

```
use MVKaran\Exotel\Client;

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

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

---

#### Connect Two Numbers

[](#connect-two-numbers)

This is the feature which implements number masking. First, the number in `from` is dialled. Once they receive, the number in `to` is dialled and connected. Both the parties see the number which is mentioned in `caller_id` (which needs to be one of your Exophones in your account)

```
$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
]);
```

The `$result` will be an associative array with keys mentioned in [Call](#call)

---

#### Connect Call to Flow or App

[](#connect-call-to-flow-or-app)

With this feature, you can first make an outbound call to a customer (`to`) and when they receive, connect the call to a Flow / App in your Exotel account (with App ID `app_id`)

```
$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
]);
```

The `$result` will be an associative array with keys mentioned in [Call](#call)

---

#### Get Details of a Call

[](#get-details-of-a-call)

You can get the details of a call using the `Sid` of the Call that you received in response when a Call was initiated.

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

The `$result` will be an associative array with keys mentioned in [Call](#call)

---

#### Send a SMS

[](#send-a-sms)

```
$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
]);
```

The `$result` will be an associative array with keys mentioned in [SMSMessage](#smsmessage)

---

#### Get Details of a SMS

[](#get-details-of-a-sms)

You can get the details of a SMS using the `Sid` of the SMS that you received in response when a SMS was sent.

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

The `$result` will be an associative array with keys mentioned in [SMSMessage](#smsmessage)

---

Exceptions
----------

[](#exceptions)

The library raises a few exceptions when errors occur. You can catch these exceptions in your application and handle them.

`ExotelException\InsufficientParametersException` Occurs when any of the above library methods have not been passed with the mandatory fields.

`ExotelException\RateLimitExceededException` Occurs when the API rate limits (default of 200 per minute for all APIs) exceeded for your account. When this exception occurs, retry with your request after some time.

`ExotelException` Any other exception that is thrown by the API

---

\##Reference The following section lists the keys in the Call and SMSMessage array that is returned for call and sms methods respectively

\###Call

KeyDescriptionSidThe unique identifier for this callParentCallSidUnusedDateCreatedTime of creation of this resource in YYYY-MM-DD HH:mm:ss format.DateUpdatedTime of last update of this resource in YYYY-MM-DD HH:mm:ss format.AccountSidThe SID of the account on whose behalf this call was made.ToPhone numberFromPhone numberPhoneNumberSidExophone that was used to make the call.StatusStatus of the callStartTimeStart time of call in YYYY-MM-DD HH:mm:ss format. (UTC +5:30)EndTimeEnd time of call in YYYY-MM-DD HH:mm:ss format. (UTC +5:30)DurationDuration of the call in seconds.PricePrice of the call in Indian Rupees. (INR)DirectionIndicates the direction of the call.AnsweredByN/AForwardedFromN/ACallerNameN/ARecordingUrlURL where the call recording is stored.UriThe URI for this resource, relative to the base URL.CallTypeType of call\###SMSMessage

KeyDescriptionSidUnique identifier of the resourceDateCreatedTime of creation of this resource in YYYY-MM-DD HH:mm:ss format. (UTC +5:30)DateUpdatedTime of last update of this resource in YYYY-MM-DD HH:mm:ss format. (UTC +5:30)DateSentTime when SMS was sent in YYYY-MM-DD HH:mm:ss format. (UTC +5:30)AccountSidSID of the account from which the SMS was sentToThe number to which the SMS was sentFromThe Exophone or SMS ID from which the SMS was sentBodyURL-encoded string of the SMS bodyStatusStatus of SMSDirectionDirection of the SMSPricePrice of the SMS in Indian Rupees (INR)ApiVersionAPI version used to serve this resourceUriThe URI for this resource, relative to the base URL.---

More Information
----------------

[](#more-information)

For more information regarding terminologies or applets, please check out the official API documentations at

---

Errors
------

[](#errors)

If you come across any errors / exceptions while using this library which is not mentioned here, please create an issue on GitHub or report them to us at

---

Contribute
----------

[](#contribute)

Feel free to contribute to this library by forking it. Pull requests are encouraged!

---

Change Log
----------

[](#change-log)

VersionChanges1.0.0Initial release1.1.0Methods return an associative array instead of a JSON string

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3679d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a73bce4ed2fb87f5a3d6a84c63afd5ada2c35684be88e3a9f95ddf3b7807b2b2?d=identicon)[mvkaran](/maintainers/mvkaran)

---

Top Contributors

[![mvkaran](https://avatars.githubusercontent.com/u/8726608?v=4)](https://github.com/mvkaran "mvkaran (1 commits)")

---

Tags

smscallexotel

### Embed Badge

![Health badge](/badges/mvkaran-exotel/health.svg)

```
[![Health](https://phpackages.com/badges/mvkaran-exotel/health.svg)](https://phpackages.com/packages/mvkaran-exotel)
```

###  Alternatives

[plivo/plivo-php

A PHP SDK to make voice calls &amp; send SMS using Plivo and to generate Plivo XML

1102.8M18](/packages/plivo-plivo-php)[plivo/php-sdk

A PHP SDK to make voice calls &amp; send SMS using Plivo and to generate Plivo XML

1101.9M5](/packages/plivo-php-sdk)[africastalking/africastalking

Official Africa's Talking PHP SDK

122557.6k10](/packages/africastalking-africastalking)[ardakilic/mutlucell

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.3k](/packages/ardakilic-mutlucell)[smsfactor/smsfactor-php-sdk

SMSFactor client library for PHP

15382.5k2](/packages/smsfactor-smsfactor-php-sdk)[signalwire-community/signalwire

Client library for connecting to SignalWire.

23126.2k](/packages/signalwire-community-signalwire)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
