Last active
August 29, 2015 14:06
-
-
Save twilioforkwc/c87e6be759db7d6e8176 to your computer and use it in GitHub Desktop.
call-ivr.php
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(); | |
$voicetext = "〇〇様からのお電話です、通話をするには1を、通話の拒否は2を押してください。"; | |
$voicetext2 = "電話をお繋ぎします。少々お待ちください。"; | |
$voicetext3 = "電話を切断します。"; | |
if (empty($_POST["Digits"])) { | |
$gather = $response->gather(array('numDigits' => 1, 'timeout' => 30)); | |
$gather->say($voicetext, array('language' => 'ja-jp')); | |
} elseif($_POST["Digits"] == "1") { | |
$response->say($voicetext2, array('language' => 'ja-jp')); | |
} elseif($_POST["Digits"] == "2") { | |
$response->say($voicetext3, array('language' => 'ja-jp')); | |
$response->hangup(); | |
} | |
print $response; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment