LoginSignup
2
0

More than 3 years have passed since last update.

IBM Voice Gatewayをアウトバウンドコール機能を利用したWatsonとの自動対話デモ

Posted at

目次

  1. アウトバウンドコールとは
  2. Voice Gatewayアウトバウンドコールの流れ
  3. デモ
    1. アーキテクチャー
    2. 各種設定 -Voice Gateway
    3. 各種設定 -Twillioの設定
    4. いざデモ!
  4. 参考URL
  5. 最後に

1. アウトバウンドコールとは

"アウトバウンド"の本来の意味は、「中から外へ」、逆にインバウンドは「外から中へ」という意味があります。
そこから"アウトバウンドコール"は「企業から顧客へ電話する」を意味します。例えば、顧客への営業の電話やアンケート調査の電話などがアウトバウンドコールに当たります。
(インバウンドコールは、コールセンターなどの問い合わせ窓口に電話するなど「顧客から企業へ電話する」を意味します。)

2. Voice Gatewayアウトバウンドコールの流れ

アウトバウンドコールはvoice gatewayに所定のREST API(or Curl)を送ることで開始されます。
流れとしては以下になります。
1. REST API(Curl)でvoice gatewayにアウトバウンドコール用HTTPリクエストを送る
2. voice gatewayから指定された電話番号にSIPリクエストが送られる
3. 顧客に電話がかかる
4. 応答後、Watson Assistantとの会話が始まる

3. デモ

基本的に以下の記事を参考に設定しております。
https://qiita.com/ishida330/items/b4a19b4b044d41695cc5
他に設定が必要な箇所を当記事にて記載します。

3-1. アーキテクチャー

今回は以下の構成で作成しました。
image.png

3-2. 各種設定 -Voice Gateway

tenantConfig.jsonでアウトバウンドコール用のテナントを作成します。

ポイントは「"enableOutboundCalls": true」の設定と"outboundCalls"の中のテナント名(下の例ではoutbound-tenant01)、HTTPリクエスト時に使用するBasic認証のユーザー名とパスワード("username":"testuser","password":"Passw0rd!")になります。

tenantCofig.json
{
  "tenants": [{
    "tenantURI": "outbound-tenant01",
    "conversation": {
        "url": "https://gateway-tok.watsonplatform.net/assistant/api",
        "workspaceID": "xxxxxxx",
        "apikey": "xxxxxxx",
        "tokenServiceProviderUrl": "https://iam.cloud.ibm.com/identity/token"
      },
      "stt": {
        "credentials": {
          "url": "https://gateway-tok.watsonplatform.net/speech-to-text/api",
          "apikey": "xxxxxxxx",
          "tokenServiceProviderUrl": "https://iam.cloud.ibm.com/identity/token"
        }
      },
      "tts": {
        "credentials": {
          "url": "https://gateway-tok.watsonplatform.net/text-to-speech/api",
          "apikey": "xxxxxxxx",
          "tokenServiceProviderUrl": "https://iam.cloud.ibm.com/identity/token"
        },
      },
      "enableOutboundCalls": true,
      "outboundCalls": {
       "tenantURI": "outbound-tenant01",
       "username":"testuser",
       "password":"Passw0rd!"
     }
  ]
}

3-3. 各種設定 -Twillioの設定

  1. SIP TrunkのTerminationの設定でTermination SIP URIを設定します(名前はなんでも良いが、HTTPリクエストの際に使用する値になる)
  2. AthentificationはVoice GatewayのIPアドレスをACLとして登録します

image.png

3-4. いざデモ!

以下のようにHTTPリクエストを投げます。(今回はCurlにしました)
Basic認証はTenantConfig.jsonで設定したユーザー名とパスワードのものになります。

curl --location --request POST 'http://<vgw ip>:9080/vgw/outboundCalls/outbound-tenant01/startOutboundCall' --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Basic dGVzdHVzZXI6cGFzc3dvcmQ=' --data-raw '{"to": "sip:<顧客電話番号>@<twillio Termination SIP URL Domain name(xxxx.pstn.jp1.twilio.com)>", "from": "sip:<Twillioの電話番号>@<vgw ip>:5060;transport=udp;region=jp1"}'

レスポンスは以下のように返ってきます。

{"msg":"Start an outbound call request successfully completed","vgwSessionID":"a560a122-85ca-4418-97b3-f7512378020c"}

4. 参考URL

(Making outbound calls by using REST API)
https://www.ibm.com/support/knowledgecenter/SS4U29/apioutboundcalls.html
(Configuration environment variables for Voice Gateway -Outbound calls environment variables)
https://www.ibm.com/support/knowledgecenter/SS4U29/config.html#config-outbound-calls

5. 最後に

メモ書きレベルでの記載ですが、参考にしていただけたら幸いです。
この機能のユースケースとしては、アンケート調査や営業電話など考えられます。
よくあるアウトバウンドコールにWatsonが関与することで、自動音声ではなく会話を始めることができるという点が素晴らしい点と思います。
細かい点など記載していないので、リクエストいただければ修正します。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0