Skip to content

Instantly share code, notes, and snippets.

@hunnycode
Last active September 10, 2015 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hunnycode/db0b915b5ad30bbaa95d to your computer and use it in GitHub Desktop.
Save hunnycode/db0b915b5ad30bbaa95d to your computer and use it in GitHub Desktop.
電話API? Twilio? PHPから電話の発信ができちゃいます!! ref: http://qiita.com/joohounsong/items/f516f4e1f6c91572e7f5
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say language="ja-jp">Twilioへようこそ。</Say>
</Response>
<?php
require("Services/Twilio.php"); // PHPライブラリ
$sid = "ACxxxxxxxxxxxxxxxx"; // Account Sid
$token = "yyyyyyyyyyyyyyyy"; // Auth Token
$tel_to = "+8180xxxxyyyy"; // 発信先電話番号
$tel_from = "+8150xxxxyyyy"; // 発信元電話番号
$twiml = "http://xxx.xxx.xxx.xxx/twilio/calling.xml"; // TwiML URL
$client = new Services_Twilio($sid, $token);
$call = $client->account->calls->create($tel_from, $tel_to, $twiml);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment