Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mackerelハンズオン(2017/12/13)

 Mackerelハンズオン(2017/12/13)

2017/12/13 レコチョク様で開催されたMackerel x Twilioのハンズオン資料となります。

5448f8c3e8571ba245c70536e9c8cd9a?s=128

Katsumi Takahashi

December 14, 2017
Tweet

More Decks by Katsumi Takahashi

Other Decks in Business

Transcript

  1. Copyright (C) KDDI Web Communications Inc. All Rights Reserved .BDLFSFMͷ5XJMJP࿈ܞػೳ


    Λ࢖ͬͨࣗಈൃݺ ,%%*΢Σϒίϛϡχέʔγϣϯζ 5XJMJPࣄۀ෦ɹߴڮࠀݾ
  2. Copyright (C) KDDI Web Communications Inc. All Rights Reserved 2

    ࣗݾ঺հ ߴڮࠀݾ גࣜձࣾ,%%*΢Σϒίϛϡχέʔγϣϯζ 5XJMJPࣄۀ෦
 ΤόϯδΣϦετ GBDFCPPLLBUTVNJUBLBIBTIJ HJUIVCNPCJMFCJ[ RJJUBNPCJMFCJ[
  3. © 2009 - 2014 Twilio, Inc. All rights reserved. ΞδΣϯμ

    Twilioͷ͝঺հ ࣗಈՍి ࣗಈՍిͷύλʔϯ Ұ੪ண৴ͷσβΠϯύλʔϯ ॱ࣍ண৴ͷσβΠϯύλʔϯ ࣗಈՍిͷ஫ҙϙΠϯτ
  4. Copyright (C) KDDI Web Communications Inc. All Rights Reserved 5XJMJPͷ͝঺հ

  5. Copyright (C) KDDI Web Communications Inc. All Rights Reserved %PZPVLOPX5XJMJP

  6. © 2009 - 2014 Twilio, Inc. All rights reserved. Twilioͱ͸

    ʮτΡΠϦΦʯͱൃԻ͠·͢ɻ 2008೥͔ΒαʔϏεΛ։࢝ 2013೥ʹ೔ຊͰͷαʔϏε։࢝ શੈքͰͷ։ൃऀ͕100ສਓΛಥഁ ʢ2016ʣ χϡʔϤʔΫূ݊औҾॴʹIPO ʢ2016/6/29ʣ
  7. 7 Engagement Cloud Programmable Communications Cloud Super Network Runtime System

    to customer Department to customer Intelligent services Communications APIs AUTHY NOTIFY TASKROUTER COPILOT CALL CONTROL MEDIA ENGINE INSIGHTS PROG. SMS PROG. VOICE PROG. VIDEO PROG. CHAT PROG. FAX PHONE NUMBERS SHORT CODES SIP TRUNKING WIRELESS CHANNELS Global coverage Elastic capacity Network learning Instant provisioning Clean numbers FUNCTIONS DEBUGGER ASSETS USERS CREDENTIALS SYNC ADD-ONS Individual to customer PROXY UNDERSTAND STUDIO
  8. ߏ੒ྫ Your Server Core Service SMS TwiML/Functions

  9. © 2009 - 2014 Twilio, Inc. All rights reserved. ి࿩Λίϯτϩʔϧ͢Δ̎ͭͷํ๏

    RestAPI Twilioʹରͯ͠ి࿩ൃ৴Λࢦࣔ͢Δ͜ͱ͕Ͱ͖·͢ ૬ख͕Ԡ౴ͨ࣌͠ʹͲ͏͢Δ͔͸ɺTwiMLΛ࢖੍ͬͯޚ͠·͢ TwiML ੜ੒͞Εͨݺʹରͯ͠ɺ༷ʑͳಈ࡞Λͤ͞Δ͜ͱ͕Ͱ͖·͢ ࣗಈԻ੠Λྲྀͨ͠ΓɺIVRػೳͳͲΛ࣮૷͢Δ͜ͱ͕Ͱ͖·͢
  10. 3FTU"1*Ͱి࿩Λ͔͚Δʢ/PEFKTͷྫʣ DPOTUBDDPVOU4JEbZPVS@BDDPVOU@TJE` DPOTUBVUI5PLFOZPVS@BVUI@UPLFO DPOTUDMJFOUSFRVJSF UXJMJP BDDPVOU4JE BVUI5PLFO  DMJFOUDBMMTDSFBUF \

    VSMIUUQEFNPUXJMJPDPNEPDTWPJDFYNM  UP૬खઌి࿩൪߸  GSPNbൃ৴ऀ൪߸ʢ5XJMJPͰߪೖͨ͠൪߸ʣ  ^  UIFO DBMM QSPDFTTTUEPVUXSJUF DBMMTJE 
  11. 5XJ.-ʢ5XJMJPΛૢ࡞͢Δݴޠʣ ʻ%JBMʼɹి࿩Λ͔͚Δ  ʻ$MJFOUʼɹ7P*1ΞϓϦʹՍి  ʻ$POGFSFODFʼɹి࿩ձٞʹࢀՃ  ʻ/VNCFSʼɹ145/ܦ༝ͰՍి  ʻ2VFVFʼɹΩϡʔ͔ΒͷऔΓग़͠

     ʻ4JQʼɹ4*1ΫϥΠΞϯτ΁Սి ʻ&ORVFVFʼɹΩϡʔʹอଘ ʻ(BUIFSʼɹ*73 ʻ)BOHVQʼɹճઢஅ ʻ-FBWFʼɹΩϡʔ͔ΒͷҠಈ ʻ1BVTFʼɹϙʔζ ʻ1MBZʼɹ.18"7σʔλͷ࠶ੜ ʻ3FDPSEʼɹ௨࿩ͷ࿥Ի ʻ3FEJSFDUʼɹผͷ5XJ.-΁ભҠ ʻ3FKFDUʼɹ௨࿩ڋ൱ ʻ4BZʼɹ߹੒Ի੠ͷ࠶ੜ ʻ4NTʼɹ4.4ͷૹ৴ 5XJ.-ͷαϯϓϧ <?xml version=“1.0” encording=“UTF-8”?> <Response> <Say voice=“alice” language=“ja-JP”>͜Μʹͪ͸</Say> <Record maxLength=“20” /> </Response>
  12. Copyright (C) KDDI Web Communications Inc. All Rights Reserved ࣗಈՍి

  13. © 2009 - 2014 Twilio, Inc. All rights reserved. ࣗಈՍిͱ͸

    ϓϩάϥϜ͔Βి࿩Λ͔͚Δ͜ͱ͕Ͱ͖·͢ TwilioͷRestAPIΛར༻͠·͢ ૬ख͕Ԡ౴ͨ࣌͠ͷಈ࡞ΛTwiMLͰఆٛͰ͖·͢ ௨ৗɺTwiML͸Ϣʔβଆͷαʔόʔʹͯੜ੒ͯ͠ɺTwilioʹฦ٫͠·͢ ੩తͳTwiMLͰ͋Ε͹ɺTwiML Binsͱ͍͏πʔϧΛ࢖ͬͯɺTwilio্ʹอଘ ͓ͯ͘͜͠ͱ΋Ͱ͖·͢͠ɺFunctionsΛར༻͢ΔͱαʔόʔϨεͰ΋࣮ߦ ͕ՄೳͰ͢ ௨࿩ͷঢ়ଶʢݺग़தɺԠ౴ɺ࿩தɺਖ਼ৗऴྃʣΛ೺Ѳ͢Δ͜ͱ΋Ͱ͖· ͢
  14. Copyright (C) KDDI Web Communications Inc. All Rights Reserved ࣗಈՍిͷύλʔϯ

  15. ύλʔϯᶃɹҰ੪ಉใ τϦΨʔΛݩʹɺෳ਺ͷ࿈བྷઌʹಉ࣌ʹՍి͠·͢ɻ ͜ͷํ๏Ͱ͸ɺ͞Βʹز͔ͭͷར༻ύλʔϯ͕͋Γ·͢ɻ ୒Ұண৴
 ࠷ॳʹԠ౴ͨ͠ਓ͚͕ͩϝοηʔδΛड͚औΔ શһண৴ʢ೚ҙʣ
 ઌʹԠ౴ͨ͠ਓ͕͍ͯ΋ɺଞͷਓΛݺͼग़͠·͢ɻ શһண৴ʢඞਢʣ
 શһ͕Ԡ౴͢Δ·ͰɺՍిΛ܁Γฦ͠·͢ɻ

  16. ύλʔϯᶄɹॱ࣍ண৴ τϦΨʔΛݩʹɺෳ਺ͷ࿈བྷઌʹ̍݅ͣͭՍిɻ௨ৗɺ୭͔͕Ԡ౴ͨ͠ ஍఺ͰɺՍి͸ऴྃ͠·͢ɻ ୭͔Ұਓʹ௨஌͕͞ΕΕ͹໨త͕ୡ੒͞ΕΔ࣌ʹ࢖ΘΕ·͢ɻ ண৴͢Δॱ൪͸ܾ·͍ͬͯΔέʔε͕΄ͱΜͲͰ͕͢ɺϥ΢ϯυϩϏϯ Ͱண৴ऀΛܾΊ͍ͯ͘ํ๏΋͋Γ·͢ɻ

  17. Copyright 2013 Twilio Inc. Սిύλʔϯͷબ୒ϑϩʔ

  18. Copyright (C) KDDI Web Communications Inc. All Rights Reserved Ұ੪ಉใͷσβΠϯύλʔϯ

  19. Ұ੪ಉใͷσβΠϯύλʔϯ ୒Ұண৴͔ɺશһண৴͔Ͱ࣮૷ํ๏͕ҟͳΓ·͢ɻ ୒Ұண৴Ͱ͔ͭɺ10໊Ҏ಺Ͱͷӡ༻Ͱ͋Ε͹ɺTwiML Bins͚ͩʢϢʔβଆ ͷTwilio࿈ܞ༻αʔόʔ͕ෆཁʣͰରԠ͢Δ͜ͱ͕Ͱ͖·͕͢ɺ11໊Ҏ্ ͷӡ༻ɺ΋͘͠͸શһண৴ͷ৔߹ʹ͸ɺϓϩάϥϜʹͯରԠ͕ඞཁͱͳ Γ·͢ɻ

  20. TwiML Bins͚ͩͰରԠ͢Δ ࣍ϖʔδͷϑϩʔΛࢀর ஫ҙ఺ ୒Ұண৴ͷΈʹରԠ͍ͯ͠·͢ɻ ൃ৴ઌʹࢦఆͰ͖Δͷ͸ɺPSTN͔Clientͷ͍ͣΕ͔Ͱ͢ɻ ྻڍͰ͖Δ൪߸͸ɺ࠷େ10ݸ·ͰͰ͢ɻ

  21. Copyright 2013 Twilio Inc.

  22. Copyright (C) KDDI Web Communications Inc. All Rights Reserved ॱ࣍ண৴ͷσβΠϯύλʔϯ

  23. ॱ࣍ண৴ͷσβΠϯύλʔϯ ୭͔Ұਓ͕Ԡ౴͢Ε͹ɺՍి͸ऴྃ͠·͢ɻ 10໊Ҏ಺Ͱ͋Ε͹ɺTwiML Bins͚ͩʢϢʔβଆͷTwilio࿈ܞ༻αʔόʔ͕ ෆཁʣͰ΋ରԠ͕ՄೳͰ͕͢ɺ11໊Ҏ্Ͱӡ༻͢Δ৔߹͸ɺϓϩάϥϜ ͕ඞཁͰ͢ɻ

  24. TwiML Bins͚ͩͰରԠ͢Δ ඇެ։ύϥϝʔλʮsequential=“true”ʯΛ׆༻͠·͢ɻ ࣍ϖʔδͷϑϩʔΛࢀর ஫ҙ఺ ൃ৴ઌʹࢦఆͰ͖Δͷ͸ɺPSTN͔Clientͷ͍ͣΕ͔Ͱ͢ɻ ྻڍͰ͖Δ൪߸͸ɺ࠷େ10ݸ·ͰͰ͢ɻ

  25. Copyright 2013 Twilio Inc.

  26. ୭͔͕ग़Δ·Ͱϧʔϓͤ͞Δ ୭͔͕ண৴͢Δ·Ͱൃ৴Λ܁Γฦ͍ͤͨ͠͞৔߹ ϓϩάϥϜΛ࡞ͬͯϧʔϓͤ͞·͢ FunctionsΛ࢖͏͜ͱͰɺαʔόʔϨεͰ࣮૷͕ՄೳͰ͢ɻ ࢀߟURLʢhttps://qiita.com/mobilebiz/items/caf5a4d1889da4cc8dfdʣ

  27. 'VODUJPOTʹΑΔॱ࣍ண৴ Handson 'VODUJPOTΛ࢖ͬͯɺॱ࣍ண৴Λͯ͠Έ·͠ΐ͏ɻ

  28. Copyright (C) KDDI Web Communications Inc. All Rights Reserved ࣗಈՍిͷ஫ҙϙΠϯτ

  29. ཹक൪ి࿩ରࡦ ܞଳి࿩ѼͷՍి͸ɺਖ਼ৗऴྃݺͱͳΓ·͢ɻ ൃ৴࣌ͷʮIfMachineʯύϥϝʔλ͸೔ຊͰ͸࢖͑·ͤΜɻ AMDʢAnswer Machine Detectionʣ΋͋Γ·͕͢ɺͪ͜Β΋೔ຊͰ͸ਖ਼ࣜ ʹαϙʔτ͞Ε͍ͯ·ͤΜʢ$0.0075/ೝࣝʣɻ IVRΛ࢖ͬͯ൑ఆ͢Δํ๏ʢԿ͔ΩʔΛԡͤ͞Δʣ͕ҰൠతͰ͢ɻ ੾அ͕ͲͪΒ͔ΒߦΘΕ͔ͨͰػցԠ౴͔Ͳ͏͔Λ൑ఆ͢Δ͜ͱ΋Ͱ͖ ·͢ʢԠ౴ϝοηʔδΛ௕Ίʹઃఆ͠ɺฉ͍ͨΒ੾அ͢ΔΑ͏ʹӡ༻͢

    Δ͜ͱͰɺ੾Εͨ࣌ؒΛΈͯɺԠ౴ϝοηʔδ͕࠷ޙ·ͰྲྀΕ͔ͨͰ൑ ఆ͢Δʣɻ
  30. Սిʹؔ͢Δॾ஫ҙ 0120/0800ΛؚΉ0AB0ʹ͸ൃ৴Ͱ͖·ͤΜʢ050൪߸͔Βͷൃ৴ʣɻ 1ൃ৴/ඵͷ੍ݶ͕͋Γ·͢ɻ ࡂ֐ൃੜ࣌ͳͲ͸ɺΩϟϦΞଆͷൃ৴ن੍ͷӨڹΛड͚·͢ɻ ཹकి͕डిͨ͠৔߹͸ɺਖ਼ৗݺͱͯ͠ՍిઌʹԠͨ͡අ༻͕ൃੜ͠· ͢ɻ ֤ݺͷ௨࿩ऴྃ࣌ʹϙΠϯτ͕Ҿ͖མͱ͞Ε·͢ɻ ۃكʹඇ௨஌΍ɺւ֎൪߸Ͱண৴͢Δ͜ͱ͕͋Γ·͢ɻ ୺຤ଆͰண৴ڋ൱Λͯ͠΋ɺҾ͖ଓ͖ண৴͢Δ͜ͱ͕͋Γ·͢ɻ