aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/smpp_smsc.c
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@wtl.be>2017-07-05 11:46:55 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-08-27 02:33:47 +0200
commitd34ed5768cccab57e879bd32f38872d290c9ae89 (patch)
tree3c9f06ce8ee1931727442ea7094d67953bad01f4 /src/libmsc/smpp_smsc.c
parent95606647ef4805537a28355f1489f32f1f1f16d1 (diff)
smpp: fix return cause
Return cause 38 when default SMPP route is unavailable. This is better than cause 1. Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167
Diffstat (limited to 'src/libmsc/smpp_smsc.c')
-rw-r--r--src/libmsc/smpp_smsc.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c
index 4c2e4aac8..04afc49bb 100644
--- a/src/libmsc/smpp_smsc.c
+++ b/src/libmsc/smpp_smsc.c
@@ -270,8 +270,7 @@ void smpp_esme_put(struct osmo_esme *esme)
}
/*! \brief try to find a SMPP route (ESME) for given destination */
-struct osmo_esme *
-smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest)
+int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **pesme)
{
struct osmo_smpp_route *r;
struct osmo_smpp_acl *acl = NULL;
@@ -314,15 +313,20 @@ smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest)
struct osmo_esme *esme;
DEBUGP(DSMPP, "ACL even has ESME, we can route to it!\n");
esme = acl->esme;
- if (esme->bind_flags & ESME_BIND_RX)
- return esme;
- else
+ if (esme->bind_flags & ESME_BIND_RX) {
+ *pesme = esme;
+ return 0;
+ } else
LOGP(DSMPP, LOGL_NOTICE, "[%s] is matching route, "
"but not bound for Rx, discarding MO SMS\n",
esme->system_id);
}
- return NULL;
+ *pesme = NULL;
+ if (acl)
+ return GSM48_CC_CAUSE_NETWORK_OOO;
+ else
+ return GSM48_CC_CAUSE_UNASSIGNED_NR;
}