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 | |
// Get the PHP helper library from twilio.com/docs/php/install | |
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library | |
// Your Account Sid and Auth Token from twilio.com/user/account | |
$sid = "ACxxxxxxxxxxxx"; | |
$token = "{{ auth_token }}"; | |
$client = new Services_Twilio($sid, $token); | |
// Get an object from its sid. If you do not have a sid, |
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'); | |
$number = "hoge"; | |
// 画面から入力された電話番号の取得 | |
if (isset($_REQUEST['To'])) { | |
$number = $_REQUEST['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 | |
require "Services/Twilio/Capability.php"; | |
$accountSid = "ACxxxxxxxxxxxxxxxxxxxxx"; | |
$authToken = "yyyyyyyyyyyyyyyyyyyy"; | |
$appSid = "APxxxxxxxxxxxxxxxxx"; | |
$clientName = "Jenny"; | |
$capability = new Services_Twilio_Capability($accountSid, $authToken); | |
$capability->allowClientIncoming($clientName); |
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> | |
<Number | |
statusCallbackEvent="initiated ringing answered completed" | |
statusCallback="https://myapp.com/calls/events" | |
statusCallbackMethod="POST"> | |
+8180xxxxyyyy | |
</Number> | |
</Dial> |
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> | |
<Say language="ja-jp">Twilioへようこそ</Say> | |
<Record /> | |
<Play>http://xxx.xxx.xxx.xxx/recording.mp3</Play> | |
</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'); | |
// 発信者番号:Twilioから取得された電話番号 | |
$callerId = "+8150xxxxyyyy"; | |
// 受信者番号:Twilioの電話番号に電話をかけた際に受信者としてTwilio Client名を設定。(番号でも問題ない) | |
$number = "BrowserPhone"; | |
// 画面から入力された電話番号の取得 | |
if (isset($_REQUEST['tocall'])) { |
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'); | |
$account_sid = "ACXXXXXX"; // Account Sid | |
$auth_token = "YYYYYY"; // Auth Token | |
$client = new Services_Twilio($account_sid, $auth_token); | |
$message = $client->account->messages->sendMessage( | |
'+1xxxxyyyyy', // From a Twilio number in your account | |
'+8180xxxxyyyy', // Text any 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
curl -X POST https://api.twilio.com/2010-04-01/Accounts/ACxxxxxxxxxxxxxxxxxxxxx/Calls \ | |
-d "Url=http://xxx.xxx.xxx.xxx/voice.xml" \ | |
-d "To=%2B8150xxxxyyyy" \ | |
-d "From=%2B8180xxxxyyyy" \ | |
-u 'ACxxxxxxxxxxxxxxxxxxxxx:{AuthToken}' |
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 | |
// Get the PHP helper library from twilio.com/docs/php/install | |
require_once('../Services/Twilio.php'); // Loads the library | |
$sid = "ACxxxxxxxxxx"; | |
$token = "yyyyyyyyyyyyyy"; | |
$client = new Services_Twilio($sid, $token); | |
$call = $client->account->calls->get("CAxxxxxxxxxxx"); | |
echo $call->parent_call_sid; |
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"])) { |