* [Usage] SMS handling
@ 2010-03-19 13:59 Dario
2010-03-19 14:32 ` Denis Kenzior
0 siblings, 1 reply; 4+ messages in thread
From: Dario @ 2010-03-19 13:59 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 881 bytes --]
Hi all,
I have a question: what is the best practice (or the suggested
behaviour) to handle SMSes in an application using oFono?
I am thinking about two common cases:
1) handling outgoing message status: I use the SendMessage DBus API but
AFAIK I'm not aware of the status of the sending operation (pending,
blocked, sent...) in the DBus response;
2) handling incoming messages when application is (re)starting/crashed:
is there a way to retrieve a message if it comes in during a phase where
the application is not running or it can't receive the IncomingMessage
signal? Does oFono logs or stores the messages somewhere?
I think I found something in the "Example Call History" plugin, does
this mean I need to create an oFono plugin to manage my application
needs or am I missing some info/API somewhere?
Thank you in advance, best regards,
Dario.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Usage] SMS handling
2010-03-19 13:59 [Usage] SMS handling Dario
@ 2010-03-19 14:32 ` Denis Kenzior
2010-03-19 15:33 ` Dario
0 siblings, 1 reply; 4+ messages in thread
From: Denis Kenzior @ 2010-03-19 14:32 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1727 bytes --]
Hi Dario,
> Hi all,
> I have a question: what is the best practice (or the suggested
> behaviour) to handle SMSes in an application using oFono?
> I am thinking about two common cases:
> 1) handling outgoing message status: I use the SendMessage DBus API but
> AFAIK I'm not aware of the status of the sending operation (pending,
> blocked, sent...) in the DBus response;
The current semantics are that the DBusMessage returns only when the SMS has
been successfully sent to the network, or oFono determined that it cannot send
it. So you can assume that SMS is pending as soon as dbus_message_send is
performed by your client. And that SMS has been sent/failed as soon as the
message call returns.
The history plugin is given a bit more information. It is notified when the
SMS is queued, successfully sent / not.
> 2) handling incoming messages when application is (re)starting/crashed:
> is there a way to retrieve a message if it comes in during a phase where
> the application is not running or it can't receive the IncomingMessage
> signal? Does oFono logs or stores the messages somewhere?
This is what the history plugin is for. History is notified when an SMS comes
in and can persist this information however it wishes. The plugin can even
define its own D-Bus interface for notifying external clients if needed.
>
> I think I found something in the "Example Call History" plugin, does
> this mean I need to create an oFono plugin to manage my application
> needs or am I missing some info/API somewhere?
You don't have to use history plugin, but it can make certain tasks really
easy.
>
> Thank you in advance, best regards,
> Dario.
Regards,
-Denis
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Usage] SMS handling
2010-03-19 14:32 ` Denis Kenzior
@ 2010-03-19 15:33 ` Dario
2010-03-19 15:39 ` Denis Kenzior
0 siblings, 1 reply; 4+ messages in thread
From: Dario @ 2010-03-19 15:33 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1502 bytes --]
Hi Denis,
> The current semantics are that the DBusMessage returns only when the SMS has
> been successfully sent to the network, or oFono determined that it cannot send
> it. So you can assume that SMS is pending as soon as dbus_message_send is
> performed by your client. And that SMS has been sent/failed as soon as the
> message call returns.
>
This means I will have to use a synchronous call and wait for the
response? I suppose an error response will mean a send failure, is it
correct?
>
>> 2) handling incoming messages when application is (re)starting/crashed:
>> is there a way to retrieve a message if it comes in during a phase where
>> the application is not running or it can't receive the IncomingMessage
>> signal? Does oFono logs or stores the messages somewhere?
>>
>
> This is what the history plugin is for. History is notified when an SMS comes
> in and can persist this information however it wishes. The plugin can even
> define its own D-Bus interface for notifying external clients if needed.
>
OK, as per our IRC conversation I'm interested in writing an SQLite
history plug-in to store calls and SMSes infos, so I'll try to design a
simple DB and post it here in a few days.
Would it be a problem to have libsqlite as dependency of oFono? Is there
a way to let it out of the project or however do you consider it a
useful dependency for other (future) purposes?
Thank you very much in advance, best regards,
Dario.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Usage] SMS handling
2010-03-19 15:33 ` Dario
@ 2010-03-19 15:39 ` Denis Kenzior
0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2010-03-19 15:39 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1902 bytes --]
Hi Dario,
> Hi Denis,
>
> > The current semantics are that the DBusMessage returns only when the SMS
> > has been successfully sent to the network, or oFono determined that it
> > cannot send it. So you can assume that SMS is pending as soon as
> > dbus_message_send is performed by your client. And that SMS has been
> > sent/failed as soon as the message call returns.
>
> This means I will have to use a synchronous call and wait for the
> response? I suppose an error response will mean a send failure, is it
> correct?
>
Ideally nobody should ever use synchronous calls unless the DBus bindings are
broken. In low-level D-Bus you would use a pending call here.
> >> 2) handling incoming messages when application is (re)starting/crashed:
> >> is there a way to retrieve a message if it comes in during a phase where
> >> the application is not running or it can't receive the IncomingMessage
> >> signal? Does oFono logs or stores the messages somewhere?
> >
> > This is what the history plugin is for. History is notified when an SMS
> > comes in and can persist this information however it wishes. The plugin
> > can even define its own D-Bus interface for notifying external clients if
> > needed.
>
> OK, as per our IRC conversation I'm interested in writing an SQLite
> history plug-in to store calls and SMSes infos, so I'll try to design a
> simple DB and post it here in a few days.
> Would it be a problem to have libsqlite as dependency of oFono? Is there
> a way to let it out of the project or however do you consider it a
> useful dependency for other (future) purposes?
As long as it is a plugin and automake magic properly written (e.g. allows --
disable / autodetection) it shouldn't be a problem. But let us cross that
bridge when we get to it.
> Thank you very much in advance, best regards,
> Dario.
Regards,
-Denis
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-03-19 15:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-19 13:59 [Usage] SMS handling Dario
2010-03-19 14:32 ` Denis Kenzior
2010-03-19 15:33 ` Dario
2010-03-19 15:39 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.