Weitere ähnliche Inhalte
Ähnlich wie Twilio を使えば簡単にできる アプリケーションと電話/SMS連携
Ähnlich wie Twilio を使えば簡単にできる アプリケーションと電話/SMS連携 (20)
Mehr von Masashi Shinbara
Mehr von Masashi Shinbara (20)
Twilio を使えば簡単にできる アプリケーションと電話/SMS連携
- 4. Twilio
(c) 2015 Masashi Shinbara @shin1x1
• 電話、SMSなどコミュニケーションツールに
特化したサービス
• Web アプリケーション、アプリと簡単連携
=> HTTP / REST API / XML
=> 各言語、プラットフォーム用 SDK
• 従量課金(電話番号は固定課金)
- 5. Twilioのサービス
(c) 2015 Masashi Shinbara @shin1x1
• 電話をかける、電話を受ける、匿名通話
• SMSの送受信
• IVR
• 通話録音
• 複数人による通話(カンファレンス)
• IP ベースの Voice チャット(WebRTC)
などなど
- 6. 主なユースケース
(c) 2015 Masashi Shinbara @shin1x1
• 2要素認証(SMS)
• 電話での予約(IVR)、リマインダー(SMS)
• 配送通知(SMS)
• 電話番号を通知せずに通話
• トラッキング(カスタマーサポート等)
- 10. Twilio との連携
(c) 2015 Masashi Shinbara @shin1x1
• REST API
(アプリケーション -> Twilio)
• TwiML / HTTP リクエスト
(Twilio -> アプリケーション)
- 11. REST API
(c) 2015 Masashi Shinbara @shin1x1
• Twillo の REST API を実行
• SDK を利用
• REST API を実行できれば、何でも良い
(curlコマンドでも可)
- 12. 電話をかける(curl)
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/
ACdf02ee81427160677a16baf79c6d0f6e/Calls.json
-d "Url=http://demo.twilio.com/docs/voice.xml"
-d "To=%2B14155551212"
-d "From=%2B14158675309"
-u 'ACdf02ee81427160677a16baf79c6d0f6e:{AuthToken}'
- 13. 電話をかける(PHP)
$twilio = new Services_Twilio('sid', 'token');
$twilio->account->calls->create(
"+14158675309",
"+14155551212",
"http://demo.twilio.com/docs/voice.xml"
);
- 14. 電話をかける [DEMO]
(c) 2015 Masashi Shinbara @shin1x1
Twilio
図図 - twilio
Webサーバ
図図 - twilio
REST API 090-xxxx-xxxx
- 15. TwiML
(c) 2015 Masashi Shinbara @shin1x1
• Twilio への処理を記述
• XML の独自拡張
<Response>
<Say language="ja-JP">こんにちは!</Say>
</Response>
- 16. TwiML タグの例
(c) 2015 Masashi Shinbara @shin1x1
• Say = テキストを音声読み上げ
• Play = 音声ファイル再生
• Sms = SMS / MMS 送信
• Dial = 電話をかける
• Record = 通話録音
• Gather = キーパッド入力受付
- 22. 電話を受ける [DEMO]
(c) 2015 Masashi Shinbara @shin1x1
図図 - twilio
図図 - twilio
Heroku
音声を流す
入力受付
SMS 送信
匿名電話
050-xxxx-xxxx
- 23. Twilio と ChatWork 連携
(c) 2015 Masashi Shinbara @shin1x1
http://www.1x1.jp/blog/2013/12/send-voice-message-from-
twilio-to-chatwork.html
• 留守番電話
- 27. Twilio Video
(c) 2015 Masashi Shinbara @shin1x1
• ビデオチャットを手軽に実現
• WebRTC ベース
• ファイル転送も可能
• IP Messaging
- 29. まとめ
(c) 2015 Masashi Shinbara @shin1x1
• Twilio は、コミュニケーションツールに
特化したサービス
• 誰もが持っている「電話」を繋げる
• HTTP という標準技術で簡単連携
- 31. Twilio-UG 大阪 イベント開催!
(c) 2015 Masashi Shinbara @shin1x1
• 2015/9月頃
• 大阪市内
• Twilio に関するセッション
https://twiliojp-ug.doorkeeper.jp