sms: Dispatch a failed signal in many of the MT-sms points
This attempts to dispatch a signal whenever a MT-sms is failing. In some cases, e.g. with freeing the transaction, this will also happen for MO-sms.
This commit is contained in:
parent
41c5aaf62c
commit
0eb7666efa
|
@ -61,6 +61,7 @@ enum signal_sms {
|
||||||
S_SMS_DELIVERED, /* A SMS has been successfully delivered to a MS */
|
S_SMS_DELIVERED, /* A SMS has been successfully delivered to a MS */
|
||||||
S_SMS_SMMA, /* A MS tells us it has more space available */
|
S_SMS_SMMA, /* A MS tells us it has more space available */
|
||||||
S_SMS_MEM_EXCEEDED, /* A MS tells us it has no more space available */
|
S_SMS_MEM_EXCEEDED, /* A MS tells us it has no more space available */
|
||||||
|
S_SMS_UNKNOWN_ERROR, /* A MS tells us it has an error */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* SS_ABISIP signals */
|
/* SS_ABISIP signals */
|
||||||
|
|
|
@ -811,8 +811,10 @@ static int gsm411_rx_rp_error(struct msgb *msg, struct gsm_trans *trans,
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
dispatch_signal(SS_SMS, S_SMS_MEM_EXCEEDED, sms);
|
dispatch_signal(SS_SMS, S_SMS_MEM_EXCEEDED, sms);
|
||||||
counter_inc(net->stats.sms.rp_err_mem);
|
counter_inc(net->stats.sms.rp_err_mem);
|
||||||
} else
|
} else {
|
||||||
|
dispatch_signal(SS_SMS, S_SMS_UNKNOWN_ERROR, sms);
|
||||||
counter_inc(net->stats.sms.rp_err_other);
|
counter_inc(net->stats.sms.rp_err_other);
|
||||||
|
}
|
||||||
|
|
||||||
sms_free(sms);
|
sms_free(sms);
|
||||||
trans->sms.sms = NULL;
|
trans->sms.sms = NULL;
|
||||||
|
@ -832,7 +834,7 @@ static int gsm411_rx_rp_smma(struct msgb *msg, struct gsm_trans *trans,
|
||||||
/* MS tells us that it has memory for more SMS, we need
|
/* MS tells us that it has memory for more SMS, we need
|
||||||
* to check if we have any pending messages for it and then
|
* to check if we have any pending messages for it and then
|
||||||
* transfer those */
|
* transfer those */
|
||||||
dispatch_signal(SS_SMS, S_SMS_SMMA, trans);
|
dispatch_signal(SS_SMS, S_SMS_SMMA, trans->subscr);
|
||||||
|
|
||||||
/* check for more messages for this subscriber */
|
/* check for more messages for this subscriber */
|
||||||
sms = db_sms_get_unsent_for_subscr(trans->subscr);
|
sms = db_sms_get_unsent_for_subscr(trans->subscr);
|
||||||
|
@ -1044,6 +1046,7 @@ static int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sm
|
||||||
transaction_id = trans_assign_trans_id(conn->subscr, GSM48_PDISC_SMS, 0);
|
transaction_id = trans_assign_trans_id(conn->subscr, GSM48_PDISC_SMS, 0);
|
||||||
if (transaction_id == -1) {
|
if (transaction_id == -1) {
|
||||||
LOGP(DSMS, LOGL_ERROR, "No available transaction ids\n");
|
LOGP(DSMS, LOGL_ERROR, "No available transaction ids\n");
|
||||||
|
dispatch_signal(SS_SMS, S_SMS_UNKNOWN_ERROR, sms);
|
||||||
sms_free(sms);
|
sms_free(sms);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
@ -1055,6 +1058,7 @@ static int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sm
|
||||||
transaction_id, new_callref++);
|
transaction_id, new_callref++);
|
||||||
if (!trans) {
|
if (!trans) {
|
||||||
LOGP(DSMS, LOGL_ERROR, "No memory for trans\n");
|
LOGP(DSMS, LOGL_ERROR, "No memory for trans\n");
|
||||||
|
dispatch_signal(SS_SMS, S_SMS_UNKNOWN_ERROR, sms);
|
||||||
sms_free(sms);
|
sms_free(sms);
|
||||||
/* FIXME: send some error message */
|
/* FIXME: send some error message */
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -1088,6 +1092,7 @@ static int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sm
|
||||||
/* generate the 03.40 TPDU */
|
/* generate the 03.40 TPDU */
|
||||||
rc = gsm340_gen_tpdu(msg, sms);
|
rc = gsm340_gen_tpdu(msg, sms);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
dispatch_signal(SS_SMS, S_SMS_UNKNOWN_ERROR, sms);
|
||||||
trans_free(trans);
|
trans_free(trans);
|
||||||
sms_free(sms);
|
sms_free(sms);
|
||||||
msgb_free(msg);
|
msgb_free(msg);
|
||||||
|
@ -1127,6 +1132,7 @@ static int paging_cb_send_sms(unsigned int hooknum, unsigned int event,
|
||||||
case GSM_PAGING_EXPIRED:
|
case GSM_PAGING_EXPIRED:
|
||||||
case GSM_PAGING_OOM:
|
case GSM_PAGING_OOM:
|
||||||
case GSM_PAGING_BUSY:
|
case GSM_PAGING_BUSY:
|
||||||
|
dispatch_signal(SS_SMS, S_SMS_UNKNOWN_ERROR, sms);
|
||||||
sms_free(sms);
|
sms_free(sms);
|
||||||
rc = -ETIMEDOUT;
|
rc = -ETIMEDOUT;
|
||||||
break;
|
break;
|
||||||
|
@ -1185,6 +1191,7 @@ void _gsm411_sms_trans_free(struct gsm_trans *trans)
|
||||||
{
|
{
|
||||||
if (trans->sms.sms) {
|
if (trans->sms.sms) {
|
||||||
LOGP(DSMS, LOGL_ERROR, "Transaction contains SMS.\n");
|
LOGP(DSMS, LOGL_ERROR, "Transaction contains SMS.\n");
|
||||||
|
dispatch_signal(SS_SMS, S_SMS_UNKNOWN_ERROR, trans->sms.sms);
|
||||||
sms_free(trans->sms.sms);
|
sms_free(trans->sms.sms);
|
||||||
trans->sms.sms = NULL;
|
trans->sms.sms = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1204,6 +1211,7 @@ void gsm411_sapi_n_reject(struct gsm_subscriber_connection *conn)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dispatch_signal(SS_SMS, S_SMS_UNKNOWN_ERROR, sms);
|
||||||
sms_free(sms);
|
sms_free(sms);
|
||||||
trans->sms.sms = NULL;
|
trans->sms.sms = NULL;
|
||||||
trans_free(trans);
|
trans_free(trans);
|
||||||
|
|
Loading…
Reference in New Issue