SMPP Throttling error processing

Anton Virchenko <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi Hillel,

I also thought of making sort order configurable. But before that I would
like developers (Alexander Malysh?) to have a look at sms_priority_compare()
in sms.c first and tell whether LIFO behaviour is a misprint or not. Until
their decision I'd better wait and try not to introduce any new bugs as I am
not a C programmer :)

Anton

On Thu, Feb 25, 2010 at 4:03 PM, Hillel <[email protected]> wrote:

> Hi Anton,
>
> Why don't you change the patch to enable a Kannel user to set a parameter
> in
> their SMSC configuration and so choose if they would like the SMSs that are
> throttled to move to the beginning of the queue or keep the current
> functionality and move the throttled messages to the end of queue (leave as
> the default)?
>
> Hopefully this will be accepted and we can then all use this feature.
>
> rgds
>
>
> ----------------------------------------------------------------------------
> -------------
> Date: Tue, 23 Feb 2010 20:05:01 +0300
> From: Anton Virchenko
> To: [email protected]
> Subject: SMPP Throttling error processing
> Message-ID:
>        <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi all,
>
> I've noticed that after receiving SMPP throttling error 0x58 the message
> that hit the limit is moved to the end of the outgoing_sms queue
> via bb_smscconn_send_failed() in bb_smscconn.c.
> I suggest to keep it in the msgs_to_send queue with the same parameters as
> before the error occurred to have it processed first after the throttling
> condition is over.
>
> I did the following patch to smsc/smsc_smpp.c in "case submit_sm_resp:"
> section from line 1609:
> change
> ***
> if (pdu->u.submit_sm_resp.command_status == SMPP_ESME_RTHROTTLED)
>    time(&(smpp->throttling_err_time));
> else
>    smpp->throttling_err_time = 0;
>
> bb_smscconn_send_failed(smpp->conn, msg, reason,
> octstr_format("0x%08lx/%s",
> pdu->u.submit_sm_resp.command_status,
>
>  smpp_error_to_string(pdu->u.submit_sm_resp.command_status)));
> ***
> to
> ***
> if (pdu->u.submit_sm_resp.command_status == SMPP_ESME_RTHROTTLED) {
>    time(&(smpp->throttling_err_time));
>    /* Put the message back into the SMPP queue */
>    gw_prioqueue_produce(smpp->msgs_to_send, msg);
> } else {
>    smpp->throttling_err_time = 0;
>    bb_smscconn_send_failed(smpp->conn, msg, reason,
> octstr_format("0x%08lx/%s", pdu->u.submit_sm_resp.command_status,
>        smpp_error_to_string(pdu->u.submit_sm_resp.command_status)));
> }
> ***
>
> and in sms.c I have changed the function sms_priority_compare() to reverse
> time sorting order (for some reason it was LIFO):
> if (msg1->sms.time > msg2->sms.time)
>    ret = -1;
> else if (msg1->sms.time < msg2->sms.time)
>    ret = 1;
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <
> http://www.kannel.org/pipermail/devel/attachments/20100223/9c78626b/attachm
> ent-0001.html<http://www.kannel.org/pipermail/devel/attachments/20100223/9c78626b/attachm%0Aent-0001.html>
> >
>
>
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.