Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [RFC PATCH 3/6] Support for basic SMS Status Report.
Date: Fri, 04 Jun 2010 12:01:21 -0500	[thread overview]
Message-ID: <201006041201.21504.denkenz@gmail.com> (raw)
In-Reply-To: <1275650257-30593-4-git-send-email-pasi.miettinen@ixonos.com>

[-- Attachment #1: Type: text/plain, Size: 2569 bytes --]

Hi Pasi,

> ---
>  src/sms.c |  110
>  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 
1 files
>  changed, 109 insertions(+), 1 deletions(-)
> 
> diff --git a/src/sms.c b/src/sms.c
> index 618e035..14748c6 100644
> --- a/src/sms.c
> +++ b/src/sms.c
> @@ -553,6 +553,75 @@ static void dispatch_text_message(struct ofono_sms
>  *sms, }
>  }
> 
> +static void dispatch_sms_delivery_report(struct ofono_sms *sms,
> +					const enum sms_st *st,
> +					const struct sms_address *raddr,
> +					const struct sms_scts *scts,
> +					const struct sms_scts *dt)
> +{
> +	DBusConnection *conn = ofono_dbus_get_connection();
> +	const char *path = __ofono_atom_get_path(sms->atom);
> +	DBusMessage *signal;
> +	DBusMessageIter iter;
> +	DBusMessageIter dict;
> +	char buf[128];
> +	time_t ts;
> +	struct tm remote;
> +	struct tm local;
> +	const char *str = buf;
> +
> +	if (!st) {
> +		DBG("status unavailable");
> +		return;
> +	}
> +
> +	signal = dbus_message_new_signal(path, OFONO_SMS_MANAGER_INTERFACE,
> +						"IncomingStatusReport");
> +
> +	if (!signal)
> +		return;
> +
> +	/*Start assembling dbus-message*/
> +	dbus_message_iter_init_append(signal, &iter);
> +
> +	dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
> +					OFONO_PROPERTIES_ARRAY_SIGNATURE,
> +						&dict);
> +
> +	/*This is the time when sender sent the message*/
> +	ts = sms_scts_to_time(scts, &remote);
> +	localtime_r(&ts, &local);
> +
> +	strftime(buf, 127, "%Y-%m-%dT%H:%M:%S%z", &local);
> +	buf[127] = '\0';
> +	ofono_dbus_dict_append(&dict, "LocalSentTime", DBUS_TYPE_STRING, &str);
> +
> +	/*This is the time when the message was delivered to the recipient*/
> +	ts = sms_scts_to_time(dt, &remote);
> +	localtime_r(&ts, &local);
> +
> +	strftime(buf, 127, "%Y-%m-%dT%H:%M:%S%z", &local);
> +	buf[127] = '\0';
> +	ofono_dbus_dict_append(&dict, "LocalDeliverTime",
> +					DBUS_TYPE_STRING, &str);
> +
> +	/*Status*/
> +	if (*st == 0x00) {
> +		str = sms_address_to_string(raddr);
> +		ofono_dbus_dict_append(&dict, "delivered",
> +					DBUS_TYPE_STRING, &str);
> +	} else {
> +		str = sms_address_to_string(raddr);
> +		ofono_dbus_dict_append(&dict, "undeliverable",
> +					DBUS_TYPE_STRING, &str);
> +	}
> +
> +	/*dbus-message assembled*/
> +	dbus_message_iter_close_container(&iter, &dict);
> +
> +	g_dbus_send_message(conn, signal);
> +}
> +

We tend to do things bottom up here, so this patch should really come last and 
merged with changes from Patch 5.

Regards,
-Denis

  parent reply	other threads:[~2010-06-04 17:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-04 11:17 Next series of delivery report patches Pasi Miettinen
2010-06-04 11:17 ` [RFC PATCH 1/6] Change in at_cds_notify for status report Pasi Miettinen
2010-06-04 11:17   ` [RFC PATCH 2/6] Add IncomingStatusReport a{sv} signal Pasi Miettinen
2010-06-04 11:17     ` [RFC PATCH 3/6] Support for basic SMS Status Report Pasi Miettinen
2010-06-04 11:17       ` [RFC PATCH 4/6] SetProperty for UseDeliveryReports Pasi Miettinen
2010-06-04 11:17         ` [RFC PATCH 5/6] Support for concatenated SMS status report Pasi Miettinen
2010-06-04 11:17           ` [RFC PATCH 6/6] Save pending SMS Status Reports to disk Pasi Miettinen
2010-06-04 22:04           ` [RFC PATCH 5/6] Support for concatenated SMS status report Denis Kenzior
2010-06-05  5:57             ` VS: " Miettinen Pasi
2010-06-07 12:22             ` Miettinen Pasi
2010-06-07 13:02               ` Miettinen Pasi
2010-06-07 17:45               ` Denis Kenzior
2010-06-04 17:08         ` [RFC PATCH 4/6] SetProperty for UseDeliveryReports Denis Kenzior
2010-06-04 17:01       ` Denis Kenzior [this message]
2010-06-04 16:58     ` [RFC PATCH 2/6] Add IncomingStatusReport a{sv} signal Denis Kenzior
2010-06-04 16:52   ` [RFC PATCH 1/6] Change in at_cds_notify for status report Denis Kenzior
2010-06-04 11:28 ` VS: Next series of delivery report patches Miettinen Pasi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201006041201.21504.denkenz@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox