summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2017-05-03 18:59:05 +0200
committerPablo Neira Ayuso <pablo@gnumonks.org>2017-05-08 14:45:17 +0000
commit638ad068e8597af81dc985d3d256ccc26e82373b (patch)
tree40617177d8e42355c9a5621a5544c248b18b4537
parentfd2c1f90ba590fbb8c790e3619713769817997de (diff)
libmsc: use GSM411_RP_CAUSE_MO_NUM_UNASSIGNED as return value
Instead of hardcoded value of 1 plus comment of the right hand side of the statement. Change-Id: I865bdbd6da17a0389044a8e749deeeebcb9cae06
-rw-r--r--openbsc/src/libmsc/gsm_04_11.c9
-rw-r--r--openbsc/src/libmsc/smpp_openbsc.c2
2 files changed, 5 insertions, 6 deletions
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index 6164a0887..a94b9717b 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -293,7 +293,7 @@ int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct msgb *msg,
*/
if (smpp_first) {
rc = smpp_try_deliver(gsms, conn);
- if (rc == 1)
+ if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED)
goto try_local;
if (rc < 0) {
LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.",
@@ -317,12 +317,11 @@ try_local:
/* Avoid a second look-up */
if (smpp_first) {
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
- return 1; /* cause 1: unknown subscriber */
+ return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED;
}
rc = smpp_try_deliver(gsms, conn);
- if (rc == 1) {
- rc = 1; /* cause 1: unknown subscriber */
+ if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) {
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
} else if (rc < 0) {
LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.",
@@ -333,7 +332,7 @@ try_local:
MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]);
}
#else
- rc = 1; /* cause 1: unknown subscriber */
+ rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED;
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
#endif
return rc;
diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c
index 1671a62b1..ec9dda3c1 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -559,7 +559,7 @@ int smpp_try_deliver(struct gsm_sms *sms, struct gsm_subscriber_connection *conn
esme = smpp_route(g_smsc, &dst);
if (!esme)
- return 1; /* unknown subscriber */
+ return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED;
return deliver_to_esme(esme, sms, conn);
}