sms: Do not interfere with the SMS queue from within gsm_04_11

It was possible that two SMS would be delivered at the same time
which violates GSM 04.11. We should solely rely on the sms queue
to schedule more SMS to the subscriber.
This commit is contained in:
Holger Hans Peter Freyther 2014-02-24 14:29:27 +01:00
parent 7a5e9e0ddf
commit a0cfc328a6
2 changed files with 7 additions and 18 deletions

View file

@ -561,11 +561,6 @@ static int gsm411_rx_rp_ack(struct msgb *msg, struct gsm_trans *trans,
sms_free(sms);
trans->sms.sms = NULL;
/* check for more messages for this subscriber */
sms = db_sms_get_unsent_for_subscr(trans->subscr);
if (sms)
gsm411_send_sms(trans->conn, sms);
return 0;
}
@ -615,7 +610,6 @@ static int gsm411_rx_rp_error(struct msgb *msg, struct gsm_trans *trans,
static int gsm411_rx_rp_smma(struct msgb *msg, struct gsm_trans *trans,
struct gsm411_rp_hdr *rph)
{
struct gsm_sms *sms;
int rc;
rc = gsm411_send_rp_ack(trans, rph->msg_ref);
@ -625,11 +619,6 @@ static int gsm411_rx_rp_smma(struct msgb *msg, struct gsm_trans *trans,
* transfer those */
send_signal(S_SMS_SMMA, trans, NULL, 0);
/* check for more messages for this subscriber */
sms = db_sms_get_unsent_for_subscr(trans->subscr);
if (sms)
gsm411_send_sms(trans->conn, sms);
return rc;
}

View file

@ -380,6 +380,7 @@ static int sms_sms_cb(unsigned int subsys, unsigned int signal,
/* We got a new SMS and maybe should launch the queue again. */
if (signal == S_SMS_SUBMITTED || signal == S_SMS_SMMA) {
/* TODO: For SMMA we might want to re-use the radio connection. */
sms_queue_trigger(network->sms_queue);
return 0;
}
@ -399,15 +400,14 @@ static int sms_sms_cb(unsigned int subsys, unsigned int signal,
switch (signal) {
case S_SMS_DELIVERED:
/*
* Create place for a new SMS but keep the pending data
* so we will not attempt to send the SMS for this subscriber
* as we still have an open channel and will attempt to submit
* SMS to it anyway.
*/
network->sms_queue->pending -= 1;
sms_submit_pending(network->sms_queue);
sms_pending_free(pending);
/*
* TODO: we could specially make sure to re-use the existing
* radio connection here. Maybe something like the readyForSM
* code.
*/
sms_submit_pending(network->sms_queue);
break;
case S_SMS_MEM_EXCEEDED:
network->sms_queue->pending -= 1;