GitHubContribute in GitHub: Edit online

copyright: years: 2017, 2023 lastupdated: "2023-02-10"


About SMS Gateway

With SMS Gateway, you can set up a cognitive SMS agent that customers can interact with by exchanging SMS messages. Using a dialog from the IBM Watson™ Assistant service, the SMS agent can guide the customer through tasks, answer questions, and more.

SMS Gateway supports multiple usage scenarios, depending on how you configure your environment.

  • Contact center agent initiates SMS sessions: In this scenario, the SMS agent plays a supporting role to a telephone-based contact center. In a typical environment, a contact center agent that is assisting a customer over the phone can start an SMS session and hand the customer over to the SMS agent. From there, the SMS agent can further assist the customer. By offloading some customer interaction to the SMS agent, the contact center can handle increased call volumes.
  • Customer initiates SMS sessions: The SMS agent can also operate independently if you enable customers to contact the SMS agent directly in the configuration. In this scenario, the SMS agent provides assistance without any human intervention. This approach is beneficial for customers who prefer to interact over SMS messages rather than voice calls, such as when they have a quick question.

Architecture

SMS Gateway is one of several components in the overall architecture of your environment.

Key components

  • SMS Gateway, which serves as a central hub that connects and determines the behavior of all other components
  • An SMS provider, which provides a telephone number and sends message information to SMS Gateway via an API
  • The IBM Watson™ Assistant service, which analyzes the message text, maps it to intents, and provides a response according to a dialog that you create
  • An optional service orchestration engine (SOE), which sits between the Watson Assistant service and your SMS agent so that you can further customize your environment

SMS sessions

SMS Gateway includes a REST API that is used to manage SMS sessions. SMS sessions are created between the tenant, which is the phone number from the SMS provider that is configured in SMS Gateway, and the user that wants to exchange SMS messages, such as a customer. Due to the stateless nature of REST APIs, message context is passed with each REST request between the components, with the session state being stored in SMS Gateway. To manage the session, the gateway maintains session timers that can trigger a follow-up response or clear the session state if the customer no longer interacts with the session.

SMS sessions are defined as a tuple of the tenant phone number and the user phone number. As a result, only one session can be active with a particular user phone number at any one time. Because the tenant phone number is a defining element of the session, it's critical that phone number from the SMS provider matches exactly in the SMS Gateway configuration and the REST API requests.

Architecture for agent-initiated SMS sessions

The contact center agent sends a REST request to SMS Gateway to initiate an SMS session. SMS Gateway connects to the Watson Assistant service with another REST request to retrieve a message. SMS Gateway sends the message text to the customer using the SMS API.

With agent-initiated SMS sessions, the interaction with the customer begins in the contact center and is handed over to the SMS agent.

  1. A customer calls the contact center and speaks to a contact center agent.
  2. During the call, the agent decides that the customer can be better served through SMS interaction.
  3. The agent sends a REST request to SMS Gateway to start an SMS session with the customer.
  4. SMS Gateway sends a REST request to the Watson Assistant service to get an initial greeting, and sends the greeting to the SMS provider using the Twilio Messaging API.
  5. The SMS provider forwards the greeting text in an SMS message to the customer.
  6. The customer responds with an SMS message, and the rest of the session is handled by the SMS agent.

Architecture for customer-initiated SMS sessions

The customer sends an SMS message to SMS Gateway, which starts an SMS session. SMS Gateway connects to the Watson Assistant service with a REST request to retrieve a message. SMS Gateway sends the message text to the customer using the SMS API.

In customer-initiated SMS sessions, the entire interaction is handled by the SMS agent.

  1. The customer sends an SMS message to a phone number from the SMS provider using the Twilio Messaging API.
  2. The SMS provider sends the message text to SMS Gateway.
  3. SMS Gateway creates an SMS session and sends the message to the Watson Assistant service.
  4. The Watson Assistant service analyzes the message text and sends a fitting response back to SMS Gateway.
  5. SMS Gateway sends the message text to the SMS provider, which sends it to the customer.

Supported SMS providers

SMS Gateway supports the following service providers for SMS capabilities:

  • Telestax RestcommONE: An SMS platform that supports cloud-based, on-premises, and hybrid deployment configurations. RestcommONE supports connecting to many different SMS providers.
  • Twilio Programmable SMS: A cloud-based SMS provider.

Supported REST APIs

SMS Gateway supports the following REST APIs for communicating between components.

  • SMS Gateway REST API: For controlling SMS sessions between the gateway and the user
  • Twilio Messaging API: For sending requests between the gateway and the SMS provider
  • Watson Assistant API: For sending message text and application-defined context between the gateway and the Watson Assistant service

Supported languages

For a language to be supported in SMS Gateway, the language must be supported by both the Watson Assistant service and your SMS provider.

For a full list of languages that the Watson Assistant service supports, see Supported languages in the Watson Assistant documentation.

For languages that your SMS provider supports, see the documentation for your SMS provider.