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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:22:31+00:00 2026-05-23T04:22:31+00:00

I am hoping there are numerous Twilio developer here along with PHP scripters…I am

  • 0

I am hoping there are numerous Twilio developer here along with PHP scripters…I am trying to edit a basic Twimlet FindMe and I am really stuck from a while…I cant find any threads on editing it and I do think there is quite a lot of use for Twimlets and should be documented more as many beginners use it as a starting point. For my case, I need help editing the Twimlet with source below so I can manually add the phone numbers I would like to call in order till one of the people pick up..The current code uses input boxes to gather the info which I dont want to use..I have spent numerous hours trying to get this to work but I am stuck….I tried removing the REQUEST and putting numbers in there but it didnt work and I am beginner at using Twilio so I need a hand. Thanks a lot.

<?php

     require "twilio-lib.php";

    // initiate response library
    $response = new Response();

    // init as array, if it's not
    if(!is_array($_REQUEST['PhoneNumbers']))
        $_REQUEST['PhoneNumbers'] = array($_REQUEST['PhoneNumbers']);

    // remove empty entries from PhoneNumbers
    $_REQUEST['PhoneNumbers'] = @array_filter($_REQUEST['PhoneNumbers']);

    // verify no more than 10 numbers given
    if(count($_REQUEST['PhoneNumbers']) > 10)
        $_REQUEST['PhoneNumbers'] = array_splice($_REQUEST['PhoneNumbers'], 10);

    // if The Dial flag is present, it means we're returning from an attempted Dial
    if(isset($_REQUEST['Dial']) && ($_REQUEST['DialStatus'] == "answered" || $_REQUEST['DialCallStatus'] == "completed")) {

        // answered call, so just hangup
        $response->addHangup();

    } else {

        // No dial flag, or anything other than "answered", roll on to the next (or first, as it may be) number

        // resort the PhoneNumbers array, in case anything untoward happened to it        
        sort($_REQUEST['PhoneNumbers']);

        // get the next number of the array
        if(!$nextNumber = @array_shift($_REQUEST['PhoneNumbers'])) {

            // if no phone numbers left, redirect to the FailUrl

            // FailUrl found, so redirect and kill the cookie
            if(strlen($_REQUEST["FailUrl"])) {
                header("Location: {$_REQUEST["FailUrl"]}");
                die;
            } else {

                // no FailUrl found, so just end the call
                $response->addHangup();

            }

        } else {

            // re-assemble remaining numbers into a QueryString, shifting the 0th off the array
            $qs = "FailUrl=".urlencode($_REQUEST['FailUrl'])."&Timeout=".urlencode($_REQUEST['Timeout'])."&Message=".urlencode($_REQUEST['Message']);
            foreach($_REQUEST['PhoneNumbers'] AS $number)
                $qs .= "&PhoneNumbers%5B%5D=" . urlencode($number);

            // add a dial to the response
            $dial = $response->addDial(array("action"=>"{$_SERVER['SCRIPT_URI']}?Dial=true&$qs", "timeout"=>$_REQUEST['Timeout'] ? $_REQUEST['Timeout'] : 60));

            // add the number to dial
            $dial->addNumber($nextNumber, array("url"=>"whisper?Message=".urlencode($_REQUEST['Message'])));

        }

    } 

    // send the response
    $response->Respond();

?>
  • 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-23T04:22:31+00:00Added an answer on May 23, 2026 at 4:22 am

    The simplest solution would be to set $_REQUEST['PhoneNumbers'] at the top of the script.

    $_REQUEST['PhoneNumbers'] = array('1235556789', '1235551234');
    

    In normal operation, the Twimlet expects the incoming request to provide the array – like this:

    http://twimlets.com/findme?PhoneNumbers%5B0%5D=1235556789&PhoneNumbers%5B1%5D=1235551234&
    

    By setting $_REQUEST['PhoneNumbers] at the top of the script, you’re able to manually set the list of numbers without having to change the rest of the code.

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

Sidebar

Related Questions

I'm hoping there are some fellow doctrine users out there. Here is a simplified
I know there is a very similar question here but I was hoping to
I need to parse DTDs using PHP and am hoping there's a simple library
I'm hoping there are some Cell Phone Operator gurus here today. Would anyone be
I'm hoping there's something obvious I'm missing here, I can't think of a reason
This has already been asked here but I was hoping there was a nicer
Hoping there are more knowledgeable people around, here I go. The attempts to call
I have a basic question and I am hoping there is a simple answer
I'm hoping there's a way to avoid custom configuration files if an application runs
I'm hoping there's something in the same conceptual space as the old VB6 IsNumeric()

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.