Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions src/outbound.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@

use Twilio\TwiML\VoiceResponse;

function generate_twiml_response() {
$response = new VoiceResponse();
$response->say('Thanks for contacting our sales department. Our next available representative will take your call');
return (string)$response;
}
function generate_twiml_response()
{
$response = new VoiceResponse();
$response->say('Thanks for contacting PropertyLark. Our next available representative will take your call');

if (array_key_exists('QUERY_STRING', $_SERVER)) {
$queryArgs = array();
parse_str($_SERVER['QUERY_STRING'], $queryArgs);
$salesPhone = $queryArgs['sales_phone'];
// Uncomment this code and replace the number with the number you want
// your customers to call.
$response->dial($salesPhone);
}

if (array_key_exists('QUERY_STRING', $_SERVER)) {
$queryArgs = array();
parse_str($_SERVER['QUERY_STRING'], $queryArgs);
$salesPhone = $queryArgs['sales_phone'];
// Uncomment this code and replace the number with the number you want
// your customers to call.
//$response->dial($salesPhone);
return (string)$response;
}


print_r(generate_twiml_response());
?>