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 6324031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:37:54+00:00 2026-05-24T16:37:54+00:00

A Right now I have sequential dialing being done using Dial verb but now

  • 0

A

Right now I have sequential dialing being done using Dial verb but now I want my application to do the calling for which the dial verb does not work and thus I need the REST api…..

I can’t figure out how to do this, I am new to REST. Does using a timeout make it skip lines? If timeout works then perhaps I can make this work but other than that I really have no ideas..

Also, how can I get the status of the call in REST?

Lets say my code looks like this, how would I change it to get the status of the call and set a timeout on the call?

<?php
// Include the Twilio PHP library
require 'Services/Twilio.php';
// Twilio REST API version
$version = "2010-04-01";
// Set our Account SID and AuthToken
$sid = 'AC123';
$token = 'abcd';
// A phone number you have previously validated with Twilio
$phonenumber = '4151234567';
// Instantiate a new Twilio Rest Client
$client = new Services_Twilio($sid, $token, $version);
try {
// Initiate a new outbound call
$call = $client->account->calls->create(
$phonenumber, // The number of the phone initiating the call
'5101234567', // The number of the phone receiving call
'http://demo.twilio.com/welcom/voice/'
);
echo 'Started call: ' . $call->sid;
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
  • 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-24T16:37:56+00:00Added an answer on May 24, 2026 at 4:37 pm

    Using the PHP helper library:

    <?php
    // Include the Twilio PHP library
    require 'Services/Twilio.php';
    // Twilio REST API version
    $version = "2010-04-01";
    // Set our Account SID and AuthToken
    $sid = 'AC123';
    $token = 'abcd';
    // A phone number you have previously validated with Twilio
    $phonenumber = '4151234567';
    // Instantiate a new Twilio Rest Client
    $client = new Services_Twilio($sid, $token, $version);
    try {
    // Initiate a new outbound call
    $call = $client->account->calls->create(
    $phonenumber, // The number of the phone initiating the call
    '5101234567', // The number of the phone receiving call
    'http://demo.twilio.com/welcom/voice/',
    array('timeout'=>'15','ifmachine'=>'hangup','status_callback'=>'yourNextNumberHandler.php')
    );
    echo 'Started call: ' . $call->sid;
    echo 'The status of the call is '.$call->status;
    } catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
    }
    ?>
    

    This code is based on the documentation in https://github.com/twilio/twilio-php/blame/master/docs/api/rest.rst

    So I did a couple things:

    1. Added an array of parameters to the outgoing call in order to:

      • set the timeout (note: may not be string ’15’, if this does not work
        try 15 as a number)

      • determine what to do if a machine answers (in this case I chose to
        hang up)

      • determine what to do when the call ends (in this case Twilio requests 'yourNextNumberHandler.php' to proccess the next numbers)

    2. On the bottom we have echo 'The status of the call is '.$call->status; which should give you an out put in one of the following setQUEUED,RINGING,IN-PROGRESS, COMPLETED,FAILED,BUSY,or NO_ANSWER
      another way to process multiple calls would be to do a check like

      $i=0;
      $myPhoneList = array(‘14162351836′,’16472871987′,18003984785’);
      if ($call->status == ‘COMPLETED’){
      //Place a new call to number $myPhoneList[$i++];
      }

    instead of using the callback 'yourNextNumberHandler.php' of status_callback parameter

    I haven’t used twilio that much, but I hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I have this SQL query which is valid but always times out:
Right now I have a database (about 2-3 GB) in PostgreSQL, which serves as
Right now I have a few new applications being developed against an Oracle Database,
I have object called Foo. Right now it implements IFoo which has a lot
right now I have a huge Solution in which we use javascript alerts via
right now I have a keyboard macro defined and named, and i want to
Right now, I'm working on a project which requires sequential text key generation. I
Good day! I right now have a function the drags an element from a
Right now I have an SSIS package that runs every morning and gives me
Right now I have the following in my .vimrc : au BufWritePost *.c,*.cpp,*.h !ctags

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.