Open Source Telephony
 help / color / mirror / Atom feed
From: Ronald Tessier <ronald.tessier@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 05/12] service: Add a group [delivery_status] in the msg status
Date: Fri, 24 Aug 2012 15:06:04 +0200	[thread overview]
Message-ID: <1345813571-15775-6-git-send-email-ronald.tessier@linux.intel.com> (raw)
In-Reply-To: <1345813571-15775-1-git-send-email-ronald.tessier@linux.intel.com>

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

This group contains an entry for each message recipients. Each recipient
entry will be updated when the corresponding report will be received
and then remove the temporary stored delivery report.
---
 src/service.c |   33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/src/service.c b/src/service.c
index c3dc40a..ec1b1b9 100644
--- a/src/service.c
+++ b/src/service.c
@@ -69,6 +69,17 @@ static const char *ctl_chars = "\x01\x02\x03\x04\x05\x06\x07\x08\x0A"
 
 static const char *sep_chars = "()<>@,;:\\\"/[]?={} \t";
 
+static const char *delivery_status[] = {
+	"none",
+	"expired",
+	"retrieved",
+	"rejected",
+	"deferred",
+	"indeterminate",
+	"forwarded",
+	"unreachable"
+};
+
 struct mms_request;
 
 typedef gboolean (*mms_request_result_cb_t) (struct mms_request *request);
@@ -1058,6 +1069,28 @@ static DBusMessage *send_message(DBusConnection *conn,
 
 	g_key_file_set_string(meta, "info", "state", "draft");
 
+	if (service->use_delivery_reports) {
+		char **tos;
+		int i;
+
+		tos = g_strsplit(msg->sr.to, ",", 0);
+
+		for (i = 0; tos[i] != NULL; i++) {
+			char *to = g_strdup(tos[i]);
+
+			mms_address_to_string(to);
+
+			DBG("%s=%s", to, delivery_status[0]);
+
+			g_key_file_set_string(meta, "delivery_status", to,
+							delivery_status[0]);
+
+			g_free(to);
+		}
+
+		g_strfreev(tos);
+	}
+
 	mms_store_meta_close(service->identity, msg->uuid, meta, TRUE);
 
 	if (mms_message_register(service, msg) < 0)
-- 
1.7.9.5


  parent reply	other threads:[~2012-08-24 13:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-24 13:05 [PATCH 00/12] mmsd: (resending) Support Delivery Report notification Ronald Tessier
2012-08-24 13:06 ` [PATCH 01/12] mmsutil: Define mms_delivery_ind struct Ronald Tessier
2012-08-28 13:41   ` Denis Kenzior
2012-08-24 13:06 ` [PATCH 02/12] mmsutil: Decode delivery_ind msg Ronald Tessier
2012-08-28 13:41   ` Denis Kenzior
2012-08-24 13:06 ` [PATCH 03/12] service: Store msg_id provided by M-Send.conf PDU Ronald Tessier
2012-08-28 13:45   ` Denis Kenzior
2012-08-24 13:06 ` [PATCH 04/12] service: Move mms_address_to_string() up Ronald Tessier
2012-08-28 13:46   ` Denis Kenzior
2012-08-24 13:06 ` Ronald Tessier [this message]
2012-08-28 13:50   ` [PATCH 05/12] service: Add a group [delivery_status] in the msg status Denis Kenzior
2012-08-24 13:06 ` [PATCH 06/12] service: Support M-Delivery.ind in mms_service_push_notify() Ronald Tessier
2012-08-28 13:50   ` Denis Kenzior
2012-08-24 13:06 ` [PATCH 07/12] service: Support delivery_ind notif on start Ronald Tessier
2012-08-28 14:25   ` Denis Kenzior
2012-08-24 13:06 ` [PATCH 08/12] store: Define MMS_META_UUID_XXX len and suffix Ronald Tessier
2012-08-28 14:25   ` Denis Kenzior
2012-08-24 13:06 ` [PATCH 09/12] service: Process delivery_ind notification Ronald Tessier
2012-08-28 14:26   ` Denis Kenzior
2012-08-24 13:06 ` [PATCH 10/12] service: Send a delivery changed signal Ronald Tessier
2012-08-24 13:06 ` [PATCH 11/12] test: Add ReportChanged to monitored signals Ronald Tessier
2012-08-24 13:06 ` [PATCH 12/12] doc: Add ReportChanged signal description Ronald Tessier
2012-08-28 14:29   ` Denis Kenzior
2012-09-04 15:26     ` Ronald Tessier
2012-09-04 19:20       ` Denis Kenzior
  -- strict thread matches above, loose matches on Subject: below --
2012-08-17 14:35 [PATCH 00/12] mmsd: Support Delivery Report notification Ronald Tessier
2012-08-17 14:35 ` [PATCH 05/12] service: Add a group [delivery_status] in the msg status Ronald Tessier

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=1345813571-15775-6-git-send-email-ronald.tessier@linux.intel.com \
    --to=ronald.tessier@linux.intel.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