Kannel – setting up active-passive failover SMPP gateways

This post documents setting up two SMPP gateways in active-passive failover mode i.e when the active SMPP gateway goes down, traffic is automatically send through the secondary (passive) SMPP gateway.

Prerequisites

This post assumes that you have working knowledge of setting up and running Kannel. Only relevant config is documented, rest of the config parts are snipped off for readability

Setting up active-passive gateways

Assuming the smsc-id of the active SMPP gateway is reliable_smpp_gw and passive is unrealiable_smpp_gw the following config sets up an active-passive gateway

Configuring the active SMPP gateway

group = smsc
smsc = smpp
smsc-id = reliable_smpp_gw
.
.
allowed-smsc-id = reliable_smpp_gw
preferred-smsc-id = reliable_smpp_gw
Configuring the passive SMPP gateway

group = smsc
smsc = smpp
smsc-id = unreliable_smpp_gw
.
.
allowed-smsc-id = unreliable_smpp_gw;realiable_smpp_gw
preferred-smsc-id = unreliable_smpp_gw
Hooking the gateways to an account

group = sendsms-user
username = company_1
password = compant_1_admin
name = company_1
.
.
default-smsc = reliable_smpp_gw
forced-smsc = reliable_smpp_gw

The default-smsc and forced-smsc enforce that messages submitted by user account company_1 are send through smsc realiable_smpp_gw. The passive gateway is configured to send messages for smsc-id realiable_smpp_gw and unrealiable_smpp_gw, this make Kannel use passive (unrealiable_smpp_gw) when active (realiable_smpp_gw) is unavailable. Once active gateway (realiable_smpp_gw) is back online, traffic is automatically send through the active gateway