Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Twilioハンズオン!電話の自動音声応答を作ってみよう
Search
friendtree16
September 02, 2021
Programming
210
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Twilioハンズオン!電話の自動音声応答を作ってみよう
以下イベントのハンズオンで利用した資料です。
https://kaishi-fc.connpass.com/event/220524/
friendtree16
September 02, 2021
More Decks by friendtree16
See All by friendtree16
Watsonを使ってVoiceControllerを作る
friendtree16
0
74
bluemixユーザー会発表資料
friendtree16
1
1.6k
Other Decks in Programming
See All in Programming
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
150
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
170
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
350
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
6
1.9k
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
240
自分的「カンファレンスの楽しみ方」
syumai
0
200
AIエージェント時代のコードレビューを設計する
nogu66
6
2.7k
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
270
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
270
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
230
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
310
Webの地図
yosuke_furukawa
PRO
6
4.4k
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
560
Designing Powerful Visuals for Engaging Learning
tmiket
1
550
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Ruling the World: When Life Gets Gamed
codingconduct
0
330
Prompt Engineering for Job Search
mfonobong
0
450
Rails Girls Zürich Keynote
gr2m
96
14k
The agentic SEO stack - context over prompts
schlessera
0
940
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
520
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Documentation Writing (for coders)
carmenintech
77
5.5k
A better future with KSS
kneath
240
18k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
790
Transcript
5XJMJPϋϯζΦϯʂ ిͷࣗಈԠΛ࡞ͬͯΈΑ͏
ࣗݾհ ໊લɿᷤɹஐلʢ͔ͭɹͱ͖ʣ ॴଐɿKDDIΣϒίϛϡχέʔγϣϯζ ɹɹɹTwilioຊ෦ɹϚʔέςΟϯάνʔϜ ܦྺɿ 2014ΑΓiOSɺAndroidͷωΠςΟϒΞϓϦέʔγϣϯ։ൃɺAngularLaravelΛ༻͍ͨΣϒΞϓϦέʔ γϣϯ։ൃʹैࣄɻ20205݄ΑΓTwilioࣄۀ෦ʹδϣΠϯ͠ɺTwilioͷ࠷৽ใͷൃ৴TwilioΛ༻͍ͨ Ҭ՝ղܾΛ୲ɻ 2021ʙɿTwilio Champion
ஶॻɿʢ2021/3ʣʰ͡ΊͯͷTwilioʱֶࣾ
ΞδΣϯμ 1. Twilioʹ͍ͭͯ 2. TwilioΞΧϯτͷ࡞ 3. ి൪߸ͷߪೖ 4. ిͷࣗಈԻԠͷ࡞ʢൃ৴ɾண৴ʣ 5.
SMSૹ৴ 6. Twilio Questͷհ
Twilio ʹ͍ͭͯ
Twilioͱ
Twilio͕ఏڙ͍ͯ͠ΔϓϩμΫτҰཡ
Twilioͷར༻ྫ
Twilioͷར༻ྫ
Twilioͷར༻ྫ
Twilioͷར༻ྫ
KDDIΣϒίϛϡχέʔγϣϯζͱTwilio
TwilioΞΧϯτͷ࡞
TwilioΞΧϯτͷ࡞
TwilioΞΧϯτͷ࡞
ి൪߸ͷߪೖ
ి൪߸ʹ͍ͭͯ • TwilioͰఏڙ͍ͯ͠Δి൪߸ͷࠃ • 100ΧࠃҎ্ • ຊͷ൪߸Ͱఏڙ͍ͯ͠Δి൪߸ͷछྨ • 050൪߸ʢిͷडൃ৴ͷΈɾSMSૹ৴ෆՄʣ •
0120/0800൪߸ʢண՝ۚํࣜʣ • ຊ൪߸ߪೖʹ͋ͨͬͯཹҙࣄ߲ • ຊਓ֬ೝ͕ඞཁ • https://cloudapi.kddi-web.com/magazine/twilio-lesson/how-to-buy-a-telephone-number • 0120൪߸Λߪೖ͢Δʹɺฐࣾ·Ͱ͓͍߹Θ͍ͤͩ͘͞ɻ
ి൪߸ͷߪೖ
ిͷࣗಈԻԠͷ࡞ʢൃ৴ʣ
TwilioͰࣗಈԻԠΛ࡞Δ࣌ͷߏ IBM Cloud
IBM CloudίϚϯυͷ४උ curl -fsSL https://clis.cloud.ibm.com/install/osx | sh iex(New-Object Net.WebClient).DownloadString('https://clis.cloud.ibm.com/ install/powershell')
ࢀরϖʔδ https://cloud.ibm.com/docs/cli?topic=cli-install-ibmcloud-cli&locale=ja Mac Windows PowerShell Login Ibmcloud login
IBM Cloud FunctionsΛ༗ޮԽ͢Δ 1.IBM CloudͷΞΧϯτʹϩάΠϯ 2.Cloud FunctionsμογϡϘʔυΛදࣔ 3.໊લۭؒΛબ
ιʔείʔυͷ४උ https://github.com/friendtree16/TwiMLServer-IBMCloud-Functions
ιʔείʔυͷ४උ Index.js
ιʔείʔυͷ४උ ύοέʔδΠϯετʔϧ WebpackόϯυϧΛϏϧυ IBM Cloud FunctionsʹσϓϩΠ npm install npm run
build npm run deploy
IBM Cloud FunctionsΛ४උ
IBM Cloud FunctionsΛ४උ
IBM Cloud FunctionsΛ४උ
IBM Cloud FunctionsΛ४උ ύεɿ’/twiml’ͱೖྗ͠·͢ verbɿPOSTΛબ͠·͢ ΞΫγϣϯΛؚΉύοέʔδɿσϑΥϧτΛબ͠·͢ ΞΫγϣϯɿhello-twilioΛબΛબ͠·͢ ԠίϯςϯπɾλΠϓɿΞΫγϣϯ͔Β”Context-Type” ϔομʔΛ༻͠·͢Λબ͠·͢
IBM Cloud FunctionsΛ४උ
IBM Cloud FunctionsΛ४උ URLܦ࿏ͷޙΖʹ/twimlΛ͚ͭͨͷʹͳΓ·͢ɻ ྫɿhttps://xxxxxxxx.us-south.apigw.appdomain.cloud/api/twiml
ిΛൃ৴ʢAPIʣ curl -X POST https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/Calls.json \ --data-urlencode "Url=https://xxxxxxxx.us-south.apigw.appdomain.cloud/api/twiml" \ --data-urlencode
"To=+819012345678" \ (ൃ৴͢Δઌͷి൪߸) --data-urlencode "From=+15017122661" \ (ൃ৴͢Δݩͷి൪߸) -u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
ిΛൃ৴ʢAPI Explorerʣ ൃ৴ઌి൪߸ ൃ৴ݩి൪߸ TwiMLͷURL
ిͷࣗಈԻԠͷ࡞ʢண৴ʣ
ి൪߸ʹURLΛઃఆ ͜͜ʹURLΛઃఆ͢Δ
TwiML Appͷ࡞
TwiML Appͷ࡞ ҙͷ໊લ URL
ண৴ςετ
ϏδϡΞϧϓϩάϥϛϯάͰϑϩʔΛ࡞
Twilio Studio • ίϛϡχέʔγϣϯϫʔΫϑϩʔͷ࡞͔ΒཧΛɺશͯϒϥβ্Ͱߦ͏͜ͱ͕Ͱ͖·͢ ༻్ʹԠͨ͡ίϛϡχέʔγϣϯϫʔΫϑϩʔΛ࡞͠ɺͦΕΒΛҰݩཧ͢Δ͜ͱ͕Ͱ͖·͢ɻϒϥβ ্Ͱ࡞͢ΔίϛϡχέʔγϣϯϫʔΫϑϩʔͷ࣮ߦճʹର͢Δ੍ݶ͋Γ·ͤΜɻ • దͳίϛϡχέʔγϣϯνϟωϧͰͷ௨৴ Twilioɺ༷ʑͳίϛϡχέʔγϣϯνϟωϧΛ༻ҙ͓ͯ͠Γ·͢ɻ ిɺSMSɺFacebook
MessengerLINE ͳͲɺ͓͖ͳίϛϡχέʔγϣϯνϟωϧͱ࿈ܞ͠ɺίϛϡχέʔγϣϯϫʔΫϑϩʔΛߏங͢Δ͜ͱ͕ ՄೳͰ͢ɻ • γʔϜϨεͳσʔλ࿈ܞ ࣗࣾͰطʹ༻͍ͯ͠ΔαʔυύʔςΟγεςϜγεςϜج൫ͱ࿈ܞͰ͖·͢ɻ͜ΕʹΑΓɺγʔϜϨ εͳσʔλͷ࿈ܞ͕ՄೳʹͳΓ·͢ɻ
Twilio StudioͰϑϩʔΛ࡞
Twilio StudioͰϑϩʔΛ࡞ ͢͜ͱ ݴޠͷछྨ Իͷछྨ
ి൪߸ʹϑϩʔΛઃఆ Studio FlowΛબ ࡞ͬͨFlowΛઃఆ
TwiML AppʹURLΛઃఆ ίϐʔ ϖʔετ
ண৴ςετ
SMSͷૹ৴
Programmable SMSͷಛ • SMSΛૹ৴͢ΔࡍΞϝϦΧͷ൪߸Λར༻ • ΦϓγϣϯͰࠃऩϧʔτఏڙ • ૹ৴ݩͱͯ͠ɺΞϧϑΝϕοτΛઃఆ͢Δ͜ͱՄೳ • SMSΛड৴͢Δ͜ͱͰ͖Δ͕ɺૹ৴ऀଆ͕ࠃࡍSMSʹͳͬͯ͠·͏ͨΊɺҙ
SMSૹ৴ curl -X POST https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/Messages.json \ --data-urlencode “Body=͜͜ͰຊจΛࢦఆ͠·͢ɻ" \ --data-urlencode
"From=+15017122661" \ (ૹ৴ݩి൪߸) --data-urlencode “To=+819012345678" \ʢૹ৴ઌి൪߸ʣ -u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
Twilio Questͷհ
Twilio Questͷհ https://www.twilio.com/quest/ja
͝ࢹௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ