Speed up development with full-stack environments for every branch.

Learn More

How to Broadcast Voice Message [PHP and twilio]

42 Runs 1330 Views 266 Copies
Saved

Saved

sundip 66

sundip
published 3 years ago

<?php
require "twilio-php-master/Services/Twilio.php";
require "storenumbers.php";

/* File Location for use in REST URL */
$url = getenv('BASE_URL');

/* Start TwiML */
header("content-type: text/xml");
$response = new Services_Twilio_Twiml();

/* Check to make sure that the user has contacts in the database */
$From = '+156488546545';
if (getNumbers($From))
{
  $response->record(array
	(
		'action' => $url . 'broadcast.php?number=' . $From
	));
	$response->say('I did not receive a message');
}
else
{
	$response->say('You have not registered any contacts');
}
print $response;
?>
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).