How to setup backup SMS routing

This article shows you how you can create a backup SMS route using your mobile phone. This solution offers a safety connection in case of an internet outage. This system will continue sending the SMS messages through your mobile phone if you have a data package. The article will show you how to add the SMS service connections, how to create the routes and how to set them as backup routes. The process will take about 15 minutes to finish, and it requires a basic knowledge of SMS communication technologies. Don’t waste any time, start sending SMS now!

Failover routing setup

How to reroute sms messages
Figure 1 - Service "A" fails, reroute to service "B"

Use android sms link if no internet
Figure 2 - If the Internet goes offline route SMS to mobile

How to setup backup SMS routing (Clear instructions)

To setup backup SMS routing:

  1. Launch Ozeki SMS Gateway
  2. Add two SMS service connection
  3. Create new route for the first connection
  4. Specify the message route on Settings tab
  5. Do the same with the second connection
  6. Open the Advanced menu of the second routing rule
  7. Click on Create new Condition in Conditions menu
  8. Select Backup tile on Condition details
  9. Configure which connection needs backup
  10. Check the created backup route in Conditions

Add two new connection

The fist step of the process is to create two new connections. One will serve as the regular connection that you use to send SMS with, the second one is the backup connection that will be used in case of an internet outage. To do so, click the blue Add new connection link under the list of existing connections. If you have successfully created the two connection your Connections list will look like on Figure 3.

add two sms service connection
Figure 3 - Add two SMS service connection

Create routes for the services

Now you need to create a route for both connections. To do so, please click the Routes button located on the Toolbar of the Ozeki SMS Gateway. It will open the Routing details page (Figure 4). Here, you need to provide settings for the connection A. Make sure that the route is from the user’s main connection to the smsservicea connection. Name it in a way that the two connection is distinguishable.

add new route for servicea connection
Figure 4 - Add new route for service a connection

To have the other connection set up, repeat the same process with the connection B. Open the Routing details page with the Routes button, provide the properties needed for the route and name the connection something different than service a (Figure 5). This way you have two working connection that could be used to send SMS on.

add new route for serviceb connection
Figure 5 - Add new route for service b connection

Open Advanced route menu

To create the condition that will be watched by the gateway, you need to open the advanced settings of a route. To do so, click the Advanced button located in the data line of on a route (Figure 6). Make sure to choose one of the route created earlier in this tutorial.

open routing rule advanced menu
Figure 6 - Open routing rule advanced menu

Create the conditions

To setup a new backup condition, open the Conditions tab page. Search for the Create new Condition button located next to the Conditions title. Click it and a panel will pop up on the right side of the screen. Choose the backup condition option (Figure 7). This way, the connection will be active in case of the other connections failure.

add new beckup condition to the routing rule
Figure 7 - Add new beckup condition to the routing rule

Set the connection for the backup condition

In the condition details menu, you will see the Setting groupbox. In there you will find a check setting. This setting will tell which connections place it should take in case of an outage. Provide the other created service’s address in this textbox and click the Ok button. This way the backup connection will check the status of the original connection and take all the task from it in case of an outage.

set smsservicea connection for the backup condition
Figure 8 - Set smsservicea connection for the backup condition

Check the result

As the result you will see the created backup condition in the condition list (Figure 9). Now you don’t need to worry about an unreliable service as in case of an error you will be able to send SMS messages using the backup connection.

backup route condition created
Figure 9 - Backup route condition created


How can I reject certain messages starting with a specified telephone number prefix?

SMS routing offers some surprising hidden features beyond just delivery. It can even be used to act as a gatekeeper for outgoing messages. If you want to prevent your customers from sending messages to specific destinations, SMS routing can come to the rescue.

The key here is to create a dummy service provider connection. This connection won't actually send any messages, but it will act as a trap. You'll then need to configure a new rule in your outbound routing table. This rule should be set to identify messages with a specific prefix (the destinations you want to block) using a regular expression. Any message matching that prefix will be routed to the dummy connection instead of your regular SMS service provider. Since the dummy connection is designed to drop messages, they'll be silently discarded, effectively preventing them from being sent. This way, you can maintain control over your communication flow and ensure messages only reach their intended targets.

How can I change the recipient field to a fixed mobile number so all texts submitted go to that mobile?

SMS routing offers more than just message delivery. It can even act as an editor, modifying messages as they travel! This functionality is accessed through the outbound routing table, where you define rules for message content and phone numbers.

Conditions within these rules allow for replacements based on patterns. You can find detailed information about content manipulation on the "SMS content modification during routing" page (link not provided).

For instance, to replace all recipient numbers with a specific number (say, +123456), you would create an outbound route with a condition in field #2 (recipient) that uses a search-and-replace pattern. Here's the magic formula: s/^.*/[+]123456/. This pattern instructs the system to:

  • Search (s/) for any character sequence (.*) at the beginning (^) of the recipient number.
  • Replace (/) the entire sequence (.*) with the desired number (+123456).
With this rule in place, every outgoing SMS will have its recipient number automatically changed to +123456. This allows for creative uses like forwarding messages or anonymizing them before sending.

Is there a way to define outbound rules by phone ranges. I want to route a certain prefix to a certain carrier, is this possible?

Yes, you've absolutely got it! SMS routing lets you leverage the power of regular expressions to define phone number prefixes and even more intricate matching patterns within the outbound routing table.

This means you can create conditions based on both sender and recipient phone numbers. It sounds like you're particularly interested in routing messages based on the recipient's number prefix. Here's how to achieve that:

  • Condition #2: Your Gateway to Control: When defining the outbound route, focus on Condition #2, specifically dedicated to recipient phone numbers.
  • Regular Expression Magic: Enter the following regular expression within the condition field: ^[+]3620.*/
    • /: This character marks the beginning and end of the regular expression for the Ozeki software.
    • ^: Matches the beginning of the phone number string.
    • [+]: Matches a literal plus sign (+).
    • 3620: Matches the specific digits 3, 6, 2, and 0.
    • .*: The wildcard symbol, matching any character sequence following the defined prefix.
With this rule in place, the system will only route outgoing messages where the recipient's phone number starts with "+3620" followed by any additional digits. This unlocks a world of possibilities, allowing you to route messages based on specific regions, mobile network operators, or even custom criteria defined by your regular expressions.