Created
September 22, 2015 13:03
-
-
Save twilioforkwc/97eb7b432de3f8d980b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require("Services/Twilio.php"); | |
$response = new Services_Twilio_Twiml(); | |
$out_tel_to = "転送先電話番号"; | |
$sound_url = "再生する音声ファイルのURL"; | |
if (empty($_POST["Digits"])) { | |
$gather = $response->gather(array('numDigits' => 1, 'timeout' => 30)); | |
$gather->say("Twilioへようこそ。電話の転送は1を音声ファイルの再生は2を電話の終了は3をおしてください。", array('language' => 'ja-jp')); | |
} elseif ($_POST["Digits"] == "1") { | |
$response->dial($out_tel_to); | |
$gather = $response->gather(array('numDigits' => 1, 'timeout' => 30)); | |
} elseif ($_POST["Digits"] == "2") { | |
$response->play($sound_url, array("loop" => 1)); | |
$gather = $response->gather(array('numDigits' => 1, 'timeout' => 30)); | |
} elseif ($_POST["Digits"] == "3") { | |
$response->say("楽しいAPI Twilioのご利用ありがとうございました。", array('language' => 'ja-jp')); | |
} | |
print $response; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment