Skip to contentSkip to navigationSkip to topbar
On this page

Initial setup and connection


In this section, you will learn how to configure your application and establish a connection with the SMPP API.


Create or sign in to your Twilio account

create-or-sign-in-to-your-twilio-account page anchor
(information)

Info

Note your Account SID and Auth Token, as you will need them in future steps.


Get your Account SID enabled for using SMPP

get-your-account-sid-enabled-for-using-smpp page anchor
  1. Contact your dedicated Account Manager to express interest in the SMPP API.

  2. Set up an SMPP dedicated Account SID in the Console(link takes you to an external page).

  3. Complete the questionnaire:

    • Your account manager will send you an onboarding questionnaire.
    • Complete the questionnaire and notify your account manager. Once this is done, your account manager will create a support ticket on your behalf.
  4. Receive your credentials: Twilio provides you with the necessary credentials and an integration guide. The information will come via a secure email. Only the "technical contact" specified in the onboarding questionnaire will be able to complete the secure email flow.

    Your SMPP API credentials will be provided in the following format (note that the values shown below are examples):

    • Account SID: ACXXXXXXXXXXXXXXXX
    • System ID: user123456789123
    • Password: A1b2C3d4
    • Inbound Routing URL: https://smpp-mo.twilio.com/mo-groups/{YMXXXXXXXX}
    • Number of Binds allowed per system_id: 5 (default value)
    • Segments per second per bind allowed: 20 (default value)
  5. Once you've obtained your credentials, you can start using them to establish connection between your client and the SMSC and begin sending messages.


Set up your inventory and configure inbound messages

set-up-your-inventory-and-configure-inbound-messages page anchor

Next, you need to obtain and set up your phone numbers for sending and receiving messages in the Twilio Console. This process involves two steps:

Provision inventory

provision-inventory page anchor

Configure your account for inbound messaging

configure-your-account-for-inbound-messaging page anchor

Option 1: Setup via Console:

option-1-setup-via-console page anchor
  1. Navigate to the Account SID of your SMPP integration using the dropdown menu in the top right corner.
  2. On the left-hand side, click on Phone Numbers(link takes you to an external page) or Short Codes(link takes you to an external page)
  3. Select Manage > Active Numbers.
  4. Click on the phone number you want to configure.
  5. Scroll down to the Messaging section. In the A Message comes in field, select Webhook. Paste the MO Routing URL (https://smpp-mo.twilio.com/mo-groups/{MO Routing SID}) where you want to receive incoming messages.
  6. Select HTTP POST from the dropdown menu.
  7. Click Save.

Option 2: Setup via API:

option-2-setup-via-api page anchor
  1. To configure your Twilio phone number to receive incoming messages, you can submit an HTTP POST request to the IncomingPhoneNumber resource associated with that number. To complete this request, you will need the following information:
    • Phone number SID: The PN SID (long code) or SC SID (short code) for the phone number you wish to update.
    • Twilio messaging app details: The URL for your Twilio app (webhook, TwiML Bin, Function, etc.).
    • Your credentials: The Account SID and Auth Token for your Twilio account.

Here is an example of how to configure your Twilio phone number to receive incoming messages via the API:

1
curl -X POST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json \
2
--data-urlencode "SmsUrl=http://www.mysite.com/twilio" \
3
-u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'

Navigate to the ShortCode resource page to learn how to configure short code phone numbers to receive incoming messages.


Client SMPP configuration

client-smpp-configuration page anchor

To establish a TCP socket with Twilio, send a request to their Fully Qualified Domain Name (FQDN) via an encrypted port. Ensure you're using TLS version 1.2 or higher from one of the IP addresses allowlisted during onboarding.

During the TLS handshake, public and private keys are exchanged, and Twilio's SMPP service certificate is presented for validation.

Once completed, you'll initiate an SMPP session by issuing a bind_sm command PDU to establish a persistent connection, enabling the sending of outbound messages and the receiving of inbound messages and delivery receipts.

To connect your client with the SMPP API, please refer to the table below for the required SMPP settings configuration.

SettingsValuesDescription
Twilio Host***************Twilio SMPP API domain name. This will be provided with your initial onboarding email that also includes your system_id and password​.
Twilio Port****Twilio SMPP API port. This will be provided with your initial onboarding email that also includes your system_id and password​.
SMPP version3.4SMPP protocol version used by the Twilio SMPP API.
system_idExample: 12A34b56C78d91EA 15 Character long System ID string provided by your Twilio account manager.
passwordExample: i0oLw3paA 8 Character long password for your Twilio SMPP account provided by your Twilio account manager.
SecurityTLS v.1.2 and aboveConnection encryption protocol.

Troubleshooting connection errors

troubleshooting-connection-errors page anchor
(information)

Info

If you experience any errors during the initial connection process, please reply to the email where you received your SMPP credentials. Alternatively, you can contact us by opening a new support ticket at help.sms@twilio.com.

If Twilio rejects a bind request during an initial bind attempt, the command_status field of the bind requests response will be used to communicate an error message.

Twilio SMPP API doesn't send non-SMPP specification errors on bind requests. For a list of errors and brief descriptions, please visit the SMPP Error Codes page(link takes you to an external page).