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 | |
$accountSid = $_GET['AccountSid']; | |
// Connect to MySQL, and connect to the Database | |
mysql_connect('xxx.xxx.xxx.xxx', 'id', 'pwd') or die(mysql_error()); | |
mysql_select_db('dbname') or die(mysql_error()); | |
$sql_str="INSERT INTO T_CON(AccountSid) VALUES ('$accountSid')"; | |
$resultCnt = mysql_query($sql_str); | |
?> |
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_once('../Services/Twilio.php'); // Loads the library | |
$sid = "ACxxxxxxxxxx"; | |
$token = "xxxxxxxxxxxxxxxx"; | |
$client = new Services_Twilio($sid, $token); | |
foreach ($client->account->incoming_phone_numbers as $number) { | |
echo $number->phone_number . "\n"; | |
echo $number->sid . "\n"; | |
} |
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_once('../Services/Twilio.php'); // Loads the library | |
$sid = "ACxxxxxxxx"; | |
$token = "xxxxxxxxxxxxxxxx"; | |
$client = new Services_Twilio($sid, $token); | |
$number = $client->account->incoming_phone_numbers->create(array( | |
"FriendlyName" => "REST電話番号購入テスト", | |
"VoiceUrl" => "http://xxx.xxx.xxx.xxx/twiml.xml", | |
"PhoneNumber" => "+8150xxxxyyyy", | |
"VoiceMethod" => "GET" |
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_once('../Services/Twilio.php'); // Loads the library | |
$sid = "ACxxxxxxxxx"; | |
$token = "xxxxxxxxxxxxxxxx"; | |
$client = new Services_Twilio($sid, $token); | |
$numbers = $client->account->available_phone_numbers->getList('JP', 'Local', array( | |
"Contains" => "+8150*******" | |
)); | |
foreach($numbers->available_phone_numbers as $number) { |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Response> | |
<Dial callerId="+8150xxxxyyyy"><Conference>twilioConference</Conference></Dial> | |
</Response> |
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'; | |
// Connect to MySQL, and connect to the Database | |
mysql_connect('[ServerURL]', '[ID]', '[PWD]') or die(mysql_error()); | |
mysql_select_db('[DB]') or die(mysql_error()); | |
$pollDigits = $_REQUEST['Digits']; | |
$sql_telNo = mysql_query("SELECT * FROM poll"); | |
$sql_str="INSERT INTO summitpoll_an(select_digits) VALUES ('$pollDigits')"; |
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(); | |
$gather = $response->gather(array( | |
'action' => '[your url]/process_poll.php', | |
'method' => 'GET', | |
'timeout' => '30', | |
'numDigits' => '1' | |
)); | |
$gather->say("これから投票を行います。1桁の作品番号を押してください。", array('language' => 'ja-jp')); |
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
<script type="text/javascript"> | |
Twilio.Device.setup("<?php echo $token; ?>"); | |
Twilio.Device.ready(function (device) { | |
$("#log").text("架電待機"); | |
}); | |
Twilio.Device.error(function (error) { | |
$("#log").text("Error: " + error.message); | |
}); |
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); |
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 | |
header("content-type: text/xml"); | |
?> | |
<Response> | |
<?PHP if (empty($_POST["Digits"])) { ?> | |
<Say language="ja-jp">リンゴは1を、オレンジは2を、バナナは3を押してください。</Say> | |
<Gather numDigits="1" timeout="30" /> | |
<?PHP } elseif ($_POST["Digits"] == "1") { ?> | |
<Say language="ja-jp">リンゴを選択しました。</Say> | |
<?PHP } elseif ($_POST["Digits"] == "2") { ?> |
NewerOlder