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

Mackerelハンズオン資料

 Mackerelハンズオン資料

2017/4/25に開催された「Mackerel x AWS x Twilioハンズオン」のTwilioパートの資料です。

5448f8c3e8571ba245c70536e9c8cd9a?s=128

Katsumi Takahashi

April 25, 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

    ࣗݾ঺հ খग़ൣ޾ ,8$5XJMJPࣄۀ෦
 ౷ׅ੹೚ऀ ߴڮࠀݾ ,8$5XJMJPࣄۀ෦
 ιϦϡʔγϣϯΞʔΩςΫτ +FGG-BXTPO 5XJMJP*OD $&0
  3. © 2009 - 2014 Twilio, Inc. All rights reserved. ΞδΣϯμ

    Twilioͷ͝঺հ ࣗಈՍి ࣗಈՍిͷύλʔϯ Ұ੪ண৴ͷσβΠϯύλʔϯ ॱ࣍ண৴ͷσβΠϯύλʔϯ ࣗಈՍిͷ஫ҙϙΠϯτ ϒϥ΢β͸ɺChrome΋͘͠͸FirefoxΛ ͝ར༻͍ͩ͘͞ɻ Սిઌͷܞଳి࿩Λ͝४උ͍ͩ͘͞ɻ ϝϞாͳͲɺίϐϖ͕Ͱ͖ΔΞϓϦΛ͝ ༻ҙ͍ͩ͘͞ɻ
  4. Copyright (C) KDDI Web Communications Inc. All Rights Reserved 5XJMJPͷ͝঺հ

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

    ʮτΡΠϦΦʯͱൃԻ͠·͢ɻ 2008೥͔ΒαʔϏεΛ։࢝ 2013೥ʹ೔ຊͰͷαʔϏε։࢝ શੈքͰͷ։ൃऀ͕100ສਓΛಥഁ ʢ2016ʣ χϡʔϤʔΫূ݊औҾॴʹIPO ʢ2016/6/29ʣ
  6. Copyright (C) KDDI Web Communications Inc. All Rights Reserved 5XJMJP͕Ͱ͖Δ͜ͱ

    ి࿩΁ͷ௨࿩΍ɺి࿩͔ Βͷண৴ΛϓϩάϥϚϒ ϧʹ੍ޚ͢Δ͜ͱ͕Ͱ͖ ·͢ɻ ϒϥ΢β΍εϚʔτϑΥ ϯͷ7P*1ΞϓϦΛ࢖ͬ ͯɺԻ੠௨࿩Λ࣮ݱͰ͖ ·͢ɻ ϓϩάϥϜΛ࢖ͬͯ4.4 Λૹ৴ͨ͠Γɺ4.4Λ ड͚औͬͨΓ͢Δ͜ͱ͕ Ͱ͖·͢ɻ
  7. ߏ੒ྫ VoIP Client AP Server Core Service +VoIP GW SMS

  8. Copyright (C) KDDI Web Communications Inc. All Rights Reserved 8

    ެऺి࿩໢΁ͷൃ৴ʢ3FTU"1*ʣ 3FTU"1*Λ࢖ͬͨൃ৴ʢ/PEFKTʣɻ 1)1ɺ$ɺ+BWBɺ1ZUIPOɺ3VCZͷϔϧύʔϥΠϒϥϦ΋༻ҙ͞Ε͍ͯ·͢ɻ
  9. 3FTU"1*Λ࢖ͬͨࣗಈՍి %&.0

  10. 5XJ.-ಈࢺ ʻ%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>
  11. Copyright (C) KDDI Web Communications Inc. All Rights Reserved ࣗಈՍి

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

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

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

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

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

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

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

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

  20. Copyright 2013 Twilio Inc.

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

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

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

  24. Copyright 2013 Twilio Inc.

  25. 5XJ.-#JOTʹΑΔॱ࣍ண৴ Handson 5XJ.-#JOTΛ࢖ͬͯɺॱ࣍ண৴Λͯ͠Έ·͠ΐ͏ɻ

  26. ୭͔͕ग़Δ·Ͱϧʔϓͤ͞Δ ୭͔͕ண৴͢Δ·Ͱൃ৴Λ܁Γฦ͍ͤͨ͠͞৔߹ ൃ৴ઌͷ࠷ޙʹɺ࠶౓050൪߸΁ͷൃ৴Λߦ͍·͢ɻ ಉ࣌ʹɺϧʔϓ͍ͤͨ͞TwiML BinsΛݺͼ௚͠·͢ɻ μϛʔͷԠ౴ϝοηʔδʹϙʔζΛೖΕͯɺҰఆ࣌ؒͰ੾அͤ͞·͢ɻ ௨஌ઌ͸࠷େ̕ݸ·ͰͱͳΓ·͢ɻ

  27. Copyright 2013 Twilio Inc.

  28. ॱ࣍ண৴ʢϧʔϓରԠʣ IUUQRJJUBDPNNPCJMFCJ[JUFNTDBBFEDC

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

  30. ཹक൪ి࿩ରࡦ ܞଳి࿩ѼͷՍి͸ɺਖ਼ৗऴྃݺͱͳΓ·͢ɻ ൃ৴࣌ͷʮIfMachineʯύϥϝʔλ͸೔ຊͰ͸࢖͑·ͤΜɻ https://jp.twilio.com/docs/api/rest/making-calles#post IVRΛ࢖ͬͯ൑ఆ͢Δํ๏ʢԿ͔ΩʔΛԡͤ͞Δʣ͕ҰൠతͰ͢ɻ ੾அ͕ͲͪΒ͔ΒߦΘΕ͔ͨͰػցԠ౴͔Ͳ͏͔Λ൑ఆ͢Δ͜ͱ΋Ͱ͖ ·͢ʢԠ౴ϝοηʔδΛ௕Ίʹઃఆ͠ɺฉ͍ͨΒ੾அ͢ΔΑ͏ʹଅ͢ʣɻ

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