sms send pending now sends _all_ pending at the same time

This commit is contained in:
Harald Welte (local) 2009-08-14 16:01:20 +02:00
parent 86b17172fd
commit 05e676356f
1 changed files with 11 additions and 8 deletions

View File

@ -1176,18 +1176,21 @@ DEFUN(sms_send_pend,
"Send all pending SMS starting from MIN_ID")
{
struct gsm_sms *sms;
int id = atoi(argv[0]);
sms = db_sms_get_unsent(gsmnet, atoi(argv[0]));
if (!sms)
return CMD_WARNING;
while (1) {
sms = db_sms_get_unsent(gsmnet, id++);
if (!sms)
return CMD_WARNING;
if (!sms->receiver) {
sms_free(sms);
return CMD_WARNING;
if (!sms->receiver) {
sms_free(sms);
continue;
}
gsm411_send_sms_subscr(sms->receiver, sms);
}
gsm411_send_sms_subscr(sms->receiver, sms);
return CMD_SUCCESS;
}