I'm trying to set up some phone numbers in Twilio. I am able to call them fine and get connected fine when that specific client is connected (I'm using unique URLs to define which client should be dialed when a specific number is called...like this: https://example.io/my/path/to/the/twiml/?attribute=CLIENT_IDENTIFIER)
The problem arises when the specific client isn't connected to my app. When that happens, the automated message is said but then the call disconnects. I want it to be like a normal phone where it rings until it hits a voicemail. That's the problem I'm having. Here is my PHP:
<?php
declare(strict_types=1);
use Twilio\TwiML\VoiceResponse;
require_once '../../../vendor/autoload.php';
$response = new VoiceResponse();
$response->say('This call may be monitored for quality assurance',
['voice' => 'woman', 'language' => 'us-EN']);
$dial = $response->dial('', [
'record' => 'record-from-ringing-dual',
'recordingStatusCallback' => 'https://example.com/my/callback/'
]);
$dial->client($_GET['CLIENT_IDENTIFIER'], [
'statusCallbackEvent' => 'completed',
'statusCallback' => 'https://example.com/my/callback/'
]);
echo $response;
My status callback isn't getting called, so I know the call isn't getting completed. So my question is really this:
How can I make Twilio not immediately disconnect when It can't connect to the client I pass it?