Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6361673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:48:29+00:00 2026-05-24T23:48:29+00:00

First I have a sequential dialing app which will call an array of phone

  • 0

First I have a sequential dialing app which will call an array of phone numbers ino rder until one of them picks up.

Now what I need to do but am stuck at is when someone SMS’s Twilio, the data or information in the body of the SMS should be read to the person that picks up the phone call using Say verb. I am not sure how I can get the SMS body and have it read in my app. Any ideas on that?

<?php
print_r(error_reporting(-1));

session_start();  


    require 'Services/Twilio.php';
    $version = "2010-04-01";

$arr = array('416..','647...');



    $sid = '...';
    $token = '..';
    $from = '..';
    $callback = 'site.com/Twilio/twilio-twilio-php-a0e9f92/dial.php';


    $client = new Services_Twilio($sid, $token, $version);


if (isset($_REQUEST['index'])) {
$index = $_REQUEST['index'];
} else {
$index = 0;
}

$next = $index + 1;

if ($index==0 && $_REQUEST['CallStatus']=='completed')

{
//Read SMS to the called party



}

else

{

if ($index>=1 && $_REQUEST['CallStatus']=='completed')
{
//Read SMS



}

else
    {

    try {
$call = $client->account->calls->create(
$from,
$arr[$index],
'http://site.com/Twilio/twilio-twilio-php-a0e9f92/dial.php?index=' . $next,
array('Timeout' => 5,'StatusCallback' => $callback)
);

} catch (Exception $e) {
            var_dump($e);
        }
    }   
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:48:30+00:00Added an answer on May 24, 2026 at 11:48 pm

    This can actually be accomplished with very similar code to what you already have, just simplified and separated into a PHP file for handling the incoming SMS and then a callback PHP file for handling the phone call that you make.

    First, we’ll create a file (e.g. smshandler.php) and point our phone number to it in the Twilio dashboard. In it, we will create a call based on the phone number of the SMS user.

    For example:

    <?php
    $number = $_REQUEST['From'];
    $body = $_REQUEST['Body'];
    $call = $client->account->calls->create(
        $from,
        $number,
        'http://path/to/your/callback.php?body=' . $body
    );
    ?>
    

    Then we’ll use create another file (e.g. callback.php) and pass the body of the message to it and then render that body in TwiML to read the contents back to the user we called.

    For example:

    <?php 
    $message = $_REQUEST['body'];
    ?>
    <Response>
        <Say><?php echo message; ?></Say>
    </Response>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have first names stored in one table and last names stored in another.
I have my first professional assignment of making a website in which a photographer's
I have a two forms on a page. The first one has several quantity
I have a simple recursive method, a depth first search. On each call, it
I have an asp.net page which needs to return an object with a one-to-many
So I have an input file. It consists of 40 numbers. The first 20
Motivation I have a long-running boolean function which should be executed in an array
In order to bring up the menu for a DataGridViewComboBoxCell, I first have to
First I have a Listbox and set the DataSource to a MyObjectCollection MyObjectCollection implements
First I have a PHP file that gets data and file from a HTML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.