sms db: don't attempt to query pending SMS for unset MSISDN
When the subscriber has no MSISDN, we might construct an invalid SQL statement such as ... AND dest_addr= AND ... Instead, don't even query for empty MSISDNs. Related: OS#2706 Change-Id: I7d6169d774b2da04b3051957e364fe620feed51e
This commit is contained in:
parent
a55dda703f
commit
f6704f1a50
|
@ -840,6 +840,10 @@ struct gsm_sms *db_sms_get_unsent_for_subscr(struct vlr_subscr *vsub,
|
|||
if (!vsub->lu_complete)
|
||||
return NULL;
|
||||
|
||||
/* A subscriber having no phone number cannot possibly receive SMS. */
|
||||
if (*vsub->msisdn == '\0')
|
||||
return NULL;
|
||||
|
||||
result = dbi_conn_queryf(conn,
|
||||
"SELECT * FROM SMS"
|
||||
" WHERE sent IS NULL"
|
||||
|
|
Loading…
Reference in New Issue