Re: unable to retrieve listed messages
Noel Butler <[email protected]> Sun, 22 Sep 2013 13:36:29 +1000
| Newsgroups | gmane.linux.drivers.gnokii |
|---|---|
| Message-ID | <1379820989.5593.31.camel@tardis> |
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
_______________________________________________
gnokii-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/gnokii-users
face-smile.png
(image/png, 873 B) - not displayed
signature.asc
(application/pgp-signature, 490 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQEcBAABAgAGBQJSPmW9AAoJECg/hgl/0DbHVJ0H/RIeFAV07Gd9D7zJW0byyD0e SWcxu+zjE+zjbqG+YSZ1PgCIz/l/w8skYzMUM+3XN1wETMHvtWESX5m/xlRkgxS7 CZVwm83DuxsF7k1rFT5WKsc2AptymPRUPXZ2LAntKQspBZ+VHdcZD5EEqHixXJxJ oFcrixkOlsZaP7WfWMXNCsTzO+tnYTto4sXVQZXLLOtKJXAJ7L7nBLJvHJ3my47U ooMYb9Hjv6dKh5DdHigrytAZK6LuK0lbO1FdOaYNNfrKOdkEuQRqg+ObZzR+JgXn 5wcTAbvb9kE+tAKbiCu5He8Adoh6wK/mqOfj31Q+gSdJwO60Ng13qAonhEB9/4k= =A6T+ -----END PGP SIGNATURE-----