diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-07-06 16:41:30 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-07-06 16:50:19 +0200 |
commit | 42cf2e03c936d34c1bda7d491f9e367bf02dddce (patch) | |
tree | f085716b4fc8a4b53f85f37d4011bbed58aa1276 /openbsc/src/libmsc/gsm_04_11.c | |
parent | dcbc83355e1d7243180d436cadabd913bee2c922 (diff) |
sms: Add a way to always route SMS through SMPP systems
default-route would only be looked at after there has been
no subscriber in the local database. Depending on the setup
this is not what one wants. This has been discussed at the
OsmoDevCon and there have been hacks in some branches. Let's
introduce a VTY command to select if SMPP should be consulted
first and then fallback to the current behavior.
Diffstat (limited to 'openbsc/src/libmsc/gsm_04_11.c')
-rw-r--r-- | openbsc/src/libmsc/gsm_04_11.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 2b6966d44..b316d6213 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -280,6 +280,27 @@ int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct msgb *msg, { int rc; +#ifdef BUILD_SMPP + /* + * Route through SMPP first before going to the local database. In case + * of a unroutable message and no local subscriber, SMPP will be tried + * twice. In case of an unknown subscriber continue with the normal + * delivery of the SMS. + */ + if (smpp_route_smpp_first(gsms, conn)) { + rc = smpp_try_deliver(gsms, conn); + if (rc == 1) + goto try_local; + if (rc < 0) { + rc = 21; /* cause 21: short message transfer rejected */ + /* FIXME: handle the error somehow? */ + } + return rc; + } + +try_local: +#endif + /* determine gsms->receiver based on dialled number */ gsms->receiver = subscr_get_by_extension(conn->bts->network->subscr_group, gsms->dst.addr); |