Routing SMS by selecting mobile networks

In this guide you will learn about connecting your SMS system to multiple mobile networks for sending SMS messages. This is useful to achive redundancy and to optimize for costs. You will learn, how to setup SMS routing to select the mobile network you wish to route your message to. The guide does not detail the SMS routing basics and how to setup of IP SMS connections to mobile networks, as there are separate guides for that. The focus is on working with multiple connections, and the ability to control what happens to messages going through your system. You will learn how to select a destination for your messages and how to modify the message content or the message sender and recipient addresses on the fly.

Terms and definitions

Let's get started by defining the most important definitions needed to understand multiple mobile network connections and SMS routing.

What is an SMS message: An SMS message is a sort text or binary message that goes through your system. It carries 140 bytes of useful data. It can carry 160 gsm (latin) characters, which are 7 bit long, 70 unicode characters which are 16 bit long, or 140 bytes of binary data. Long text messages (longer then 160 characters) are split into multiple SMS in order to carry the long text over the network. This technology is called segmentation and reassembly (SAR). The sender mobile phone segments the long text and sends it over the network using multiple SMS messages, and the recipient waits for all message segments to arrive and assembles them. When you are working with SMS routing you route standalone short messages (or message segments of multipart SM). When a multipart message goes through the system, each part is routed individually.

What is an SMS connection: A connection is an interface for an SMS message to either come into the system or to go out from the system. For example you can setup an SMPP client "connection" to connect to a mobile network operator. In this case you can send messages and receive messages through this connection to and from the mobile network. Another example would be a database. You can setup a database with two database tables to send and receive SMS messages. In this case you would add a database "connection" to your system.

What is an SMS route: A route takes a message from one connection and passes it to another connection. For example you can setup a route to take a message from the database connection and to pass it to an SMPP client connection. Routes can also be used to modify a message on the fly (e.g. replace the message text to something else or to change the sender or recipient phone numbers.

What is an SMS routing table: A routing table contains a list of routes. When an SMS message comes in from a connection, the routing table is used. The system checks the first route and if it matches the sms message, it will use it to select the destination connection. If the incoming sms does not match the first route, it tries to use the second route, then the third and so on. Routing stops when a route matches the incoming sms.

Overview

Since the Ozeki SMS software offers many different connections it can be used as an SMS router. It will work at high performance and it can be used to control your messages. In order to setup Ozeki as an SMS router, you need to learn how to setup connection and how to setup SMS routing. Figure 1 gives you an idea on what kind of SMS connections you may setup.

sms connections for routing
Figure 1 - SMS connections

How to route SMS messages?

  1. Open the Ozeki SMS Gateway home scren
  2. Add a new SMS connection to the mobile network
  3. Add a new SMS user or an SMS application
  4. Create an outbound SMS route
  5. Define a phone number prefix for routing
  6. Create an inbound SMS route
  7. Optionally setup recipient phone number condition
  8. Set the order of routes
  9. Optionally modify the SMS message text
  10. Decide if you want to copy the message or move the message

Step 1 - Open the Ozeki SMS Gateway home scren

On the main page of the Ozeki SMS gateway, you can see the Service provider connections, the User/Application connections, outbound and inbound routing rules.

sms connections and routes on the ozeki gui
Figure 2 - SMS connections and routes on the Ozeki GUI

Step 2 - Add a new SMS connection to the mobile network

You can add a service provider connection by clicking Add new connection in the Connections section. Then select the type of connection that suits for you from the list and click Install to add the connection.

add a new sms connection to the mobile network
Figure 3 - Add a new SMS connection to the mobile network

add a new sms connection to the mobile network
Figure 4 - Add a new SMS connection to the mobile network

Step 3 - Add a new SMS user or an SMS application

You can add a User or Application connection by clicking Add new connection in the Users and applications section. Then select the type of connection that suits for you from the list and click Install to add the connection.

add a new sms application
Figure 5 - Add a new SMS application

add a new sms application
Figure 6 - Add a new SMS application

Step 4 - Create an outbound SMS route

You can add an outbound routing rule by clicking add new route in the Outbound section. Then in the Settings, for the From connection, select the User connection from which you are sending the SMS, and for the To connection, select the Service provider connection through which you want to send the SMS to the service provider.

create an outbound sms route
Figure 7 - Create an outbound SMS route

create an outbound sms route settings
Figure 8 - Create an outbound SMS route

Step 5 - Define a phone number prefix for routing

In the SMS Gateway, during routing, you have the option of selecting which service provider connection to send the message to based on the prefix of the recipient's phone number. On the Match tab, in the To address field, you can enter the phone number prefix you want to use in the given routing rule.

route based on phone number prefix
Figure 9 - Route based on phone number prefix

Step 6 - Create an inbound SMS route

You can add an inbound routing rule by clicking add new route in the Inbound section. Then in the Settings, for the From connection, select the Service provider connection from the sms is arrived, and for the To connection, select the User connection where you want to forward the SMS.

create an inbound sms route
Figure 10 - Create an inbound SMS route

create an inbound sms route settings
Figure 11 - Create an inbound SMS route

Step 7 - Optionally setup recipient phone number condition

In the SMS Gateway, during routing, you have the option to select which user connection the message will be forwarded to based on the recipient's phone number. On the Match tab, in the To address field, you can enter the phone number you want to use in the given routing rule.

route based on recipient phone number
Figure 12 - Route based on recipient phone number

Step 8 - Set the order of routes

The order of the routing rules determines the order in which the Ozeki SMS gateway scans them. In the routing table, you can use the arrows in the order section to change the order of the rules.

change the order of routes
Figure 13 - Change the order of routes

Step 9 - Optionally modify the SMS message text

When sending an SMS, you have the option to modify the sent message during routing. You can do this in the Replace message Text field on the modify tab of the routing rule.

modify the sms message text
Figure 14 - Modify the SMS message text

Step 10 - Decide if you want to copy the message or move the message

To send a message over two connections with the Ozeki SMS gateway, all you have to do is create two routing rules. For both, the From connection should be the user whom you want to send the message and the To connection should be the two service providers which you want to send the SMS. Finally set Mode to Copy for both rules.

send a message to two connections
Figure 15 - Send a message to two connections