[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Teoretical Question

From: Rodrigo Montiel
Subject: Re: Teoretical Question
Date: Tue, 24 Nov 2015 15:56:58 -0300
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

Thank you sir!

El 11/20/15 a las 4:44 PM, Jan Derfinak escribió:
On Fri, 20 Nov 2015, Rodrigo Montiel wrote:

Hello Rodrigo.

Below is just an example of my scenario:

| number       | phone | error | dreport | processed |
| number-here  |     3 |     4 |       0 |         1 |
| number-here   |     3 |     11 |       0 |         1 |

I have an option in my gnokii file (sms_retry) that as far as I know impacts
the error type 11 ( GN_ERR_TIMEOUT).
So when error type 11 appears, I believe the message is being retried due to
the timeout issue, prior to set processed column to true.
There are 2 levels of controlling timeout. Sm_retry is lowlevel option which
is not pertinent directly to SMS sending. It is connected to all
communication with the phone, to any frame which is send to phone.

My understandig is that GN_ERR_TIMEOUT is pertinent to entire command which
was send to phone. So, it is the result of high level command.

Sm_retry instructs libgnokii to repeat a frame, but GN_ERR_TIMEOUT gives
posibillity for an application to react on such kind of error.
I would like to know what happens when error type 4? ( GN_ERR_INTERNALERROR
- Problem occurred internal to model specific code).
Is processed column set to true automatically?
Can we setup a sms_retry value on gnokii config file to keep retrying for
any kind of error type received by gn_sms_send() function?
Smsd processes error handling in this case in DB module code. For example in
pq.c (postgres), following code is used:

numError = 0;
  if ((error = WriteSMS (&sms)) == GN_ERR_NONE)
  sleep (1);
while ((error == GN_ERR_TIMEOUT || error == GN_ERR_FAILED) && numError++ < 3);

g_string_printf (buf, "UPDATE %s.outbox SET processed='t', error='%d', \
                 processed_date='now' WHERE id='%s'",
                 schema, error, PQgetvalue (res1, i, 0));

You can see, that if WriteSMS() returned GN_ERR_TIMEOUT or GN_ERR_FAILED,
smsd tries to repeat sending, but not more than 3 times. This value is
hardcoded there.
After smsd leaves the "while" loop, record in table is always updated,
'processed' is always set to True and error is set according to actual
result. Setting 'processed' to True doesn't mean that sms was send. It means
that smsd processed this record with the result in 'error' column. And
also, that this record will be excluded from next loops. If you change
'processed' back to False, smsd will pick up this record in next try and
will try to resend sms.



gnokii-users mailing list

-- Rod

reply via email to

[Prev in Thread] Current Thread [Next in Thread]