gnokii-users
[Top][All Lists]
Advanced

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

Re: unable to retrieve listed messages


From: Noel Butler
Subject: Re: unable to retrieve listed messages
Date: Sun, 22 Sep 2013 13:36:29 +1000

On Sat, 2013-09-21 at 16:35 +0200, Daniele Forsi wrote:
2013/9/21 Noel Butler:
>
>
> and message 0 is unable to be retrieved (say, its compressed), gnokii should
> at least, complain about it as it did, but then ignore the
>
>
> My bad, I should have mentioned, even though it complained about the
> message, it still exited with status  0  (hence why our perl script never
> picked up any problems)

there is more than one issue:
in 0.6.31 some regular SMS are detected as compressed SMS, this is
fixed in commit ea2dfe081cc75c58f9528fb0c03ce7a6201c6b81


I'll hunt that down shortly, thanks

gnokii --getsms exits with the status of the last read, changing this
means that you won't be able to read anything past the first error

command line gnokii is a low level tool not suitable for handling SMS
in a loop, better use smsd, but since it works for your use case, as a
workaround you can execute "gnokii --deletesms ... 0 end" to clean up
after "gnokii --getsms ... 0 end --delete" but there is a race so you
delete any message that arrives in between the two commands, you can
execute it once a week to reduce the damage


This would assume that gnokii got the other messages, but it did not, so using this, I would lose the messages
altogether (I had to use --deletesms 0 to get rid of the bad msg, and allow the script to get the good msgs)
I wouldnt mind so much if it did get the other msgs and left "0" because it is the one it had problem with, since OK, "0"
would stay there forever until we manually deleted it, but we would still have got the other msgs.


or since you are using Perl you can use the GSM::Gnokii module,
something like the following is enough to process one message and you
can use GetSMSFolderList to know how many messages are present (there
could be empty locations between them)

use GSM::Gnokii;

my $gsm  = GSM::Gnokii->new ();
$gsm = $gsm->connect ();

my $sms = $gsm->GetSMS ("ME", 1);
print $sms->{'text'};

$gsm->DeleteSMS ("ME", 1);

Might give that a go too, thing is this perl script is called from a 5m cron, it doesnt get many sms's, it's used to send (notices/warnings) them, but some people just cant help themselves and reply :) but we also get some after hours support requests via it. I did look at smsd years ago, If we had a large volume inbound I certainly would use it, but is overkill for our situation I think.

Thanks

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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