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
This commit is contained in:
parent
fd2c1f90ba
commit
638ad068e8
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue