I have implemented twilio client calling future using PHP. But sometimes the call is getting disconnected after ringing. When I look into the error log in twilio I can see the message 'You attempted to initiate an outbound phone call to a phone number that is not enabled on your account.'. I am calling from browser to browser and browser to mobile app, so why this message is shown ?.
I am not sure whether this is an issue in caller side or the receiver side.
Twiml code For eg : $to = 'CLIENT3150'
function get_voice_response($to,$from,$name,$image, $group) {
$response = new VoiceResponse();
if (!empty($to) && strlen($to) > 0) {
$number = htmlspecialchars($to);
$dial = $response->dial('', ['callerId' => $from]);
// wrap the phone number or client name in the appropriate TwiML verb
// by checking if the number given has only digits and format symbols
if (preg_match("/^[\d\+\-\(\) ]+$/", $number)) {
$dial->number($number);
} else {
$client = $dial->client($number);
$client->parameter(['name' => 'FirstName', 'value' => $name]);
$client->parameter(['name' => 'Image', 'value' => $image]);
$client->parameter(['name' => 'Group', 'value' => $group]);
}
} else {
$response->say("Thanks for calling!");
}
return (string)$response;
}
Thank you