All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Emit initial LineIdentification and State.
@ 2010-08-09 18:47 Pekka.Pessi
  2010-08-11 23:28 ` Denis Kenzior
  0 siblings, 1 reply; 4+ messages in thread
From: Pekka.Pessi @ 2010-08-09 18:47 UTC (permalink / raw)
  To: ofono

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

From: Pekka Pessi <Pekka.Pessi@nokia.com>

Allow following of call states without calling GetProperties.
---
 src/voicecall.c |   64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index a30aaa5..8f996e6 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -66,6 +66,8 @@ struct voicecall {
 	struct ofono_voicecall *vc;
 	time_t start_time;
 	time_t detect_time;
+	gboolean clip_emitted;
+	gboolean status_emitted;
 };
 
 static const char *default_en_list[] = { "911", "112", NULL };
@@ -428,6 +430,7 @@ static void voicecall_set_call_status(struct voicecall *call,
 						OFONO_VOICECALL_INTERFACE,
 						"State", DBUS_TYPE_STRING,
 						&status_str);
+	call->status_emitted = TRUE;
 
 	if (status == CALL_STATUS_ACTIVE &&
 		(old_status == CALL_STATUS_INCOMING ||
@@ -485,6 +488,8 @@ static void voicecall_set_call_lineid(struct voicecall *v,
 						OFONO_VOICECALL_INTERFACE,
 						"LineIdentification",
 						DBUS_TYPE_STRING, &lineid_str);
+
+	v->clip_emitted = TRUE;
 }
 
 static gboolean voicecall_dbus_register(struct voicecall *v)
@@ -684,6 +689,63 @@ static gboolean voicecalls_have_incoming(struct ofono_voicecall *vc)
 	return voicecalls_have_with_status(vc, CALL_STATUS_INCOMING);
 }
 
+static void emit_initial_call_clip(struct ofono_voicecall *vc,
+					struct voicecall *v)
+{
+	const struct ofono_call *call = v->call;
+	const struct ofono_phone_number *ph = &call->phone_number;
+	DBusConnection *conn = ofono_dbus_get_connection();
+	const char *lineid;
+	const char *path;
+
+	path = voicecall_build_path(vc, call);
+
+	if (call->direction == CALL_DIRECTION_MOBILE_TERMINATED)
+		lineid = phone_and_clip_to_string(ph, call->clip_validity);
+	else
+		lineid = phone_number_to_string(ph);
+
+	ofono_dbus_signal_property_changed(conn, path,
+						OFONO_VOICECALL_INTERFACE,
+						"LineIdentification",
+						DBUS_TYPE_STRING, &lineid);
+
+	v->clip_emitted = TRUE;
+}
+
+static void emit_initial_call_status(struct ofono_voicecall *vc,
+					struct voicecall *v)
+{
+	const struct ofono_call *call = v->call;
+	DBusConnection *conn = ofono_dbus_get_connection();
+	char const *path;
+	char const *status;
+
+	path = voicecall_build_path(vc, call);
+	status = call_status_to_string(call->status);
+
+	ofono_dbus_signal_property_changed(conn, path,
+						OFONO_VOICECALL_INTERFACE,
+						"State",
+						DBUS_TYPE_STRING, &status);
+
+	v->status_emitted = TRUE;
+}
+
+static void emit_initial_call(struct ofono_voicecall *vc)
+{
+	GSList *l;
+
+	for (l = vc->call_list; l; l = l->next) {
+		struct voicecall *v = (struct voicecall *)l->data;
+
+		if (!v->clip_emitted)
+			emit_initial_call_clip(vc, v);
+		if (!v->status_emitted)
+			emit_initial_call_status(vc, v);
+	}
+}
+
 static gboolean real_emit_call_list_changed(void *data)
 {
 	struct ofono_voicecall *vc = data;
@@ -702,6 +764,8 @@ static gboolean real_emit_call_list_changed(void *data)
 
 	vc->emit_calls_source = 0;
 
+	emit_initial_call(vc);
+
 	return FALSE;
 }
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Emit initial LineIdentification and State.
  2010-08-09 18:47 [PATCH] Emit initial LineIdentification and State Pekka.Pessi
@ 2010-08-11 23:28 ` Denis Kenzior
  2010-08-13  9:12   ` Pekka Pessi
  0 siblings, 1 reply; 4+ messages in thread
From: Denis Kenzior @ 2010-08-11 23:28 UTC (permalink / raw)
  To: ofono

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

Hi Pekka,

On 08/09/2010 01:47 PM, Pekka.Pessi(a)nokia.com wrote:
> From: Pekka Pessi <Pekka.Pessi@nokia.com>
> 
> Allow following of call states without calling GetProperties.

We decided to solve this a little bit more nicely and address some of
the long standing round-trip issues with the Voicecall API.  Please
check the latest doc/voicecall-api.txt & doc/voicecallmanager-api.txt
for more details.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Emit initial LineIdentification and State.
  2010-08-11 23:28 ` Denis Kenzior
@ 2010-08-13  9:12   ` Pekka Pessi
  2010-08-13 13:28     ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Pekka Pessi @ 2010-08-13  9:12 UTC (permalink / raw)
  To: ofono

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

Hi Denis,

2010/8/12 Denis Kenzior <denkenz@gmail.com>:
>> Allow following of call states without calling GetProperties.
>
> We decided to solve this a little bit more nicely and address some of
> the long standing round-trip issues with the Voicecall API.  Please
> check the latest doc/voicecall-api.txt & doc/voicecallmanager-api.txt
> for more details.

OK, cool. I'll go and update tp-ring..

-- 
Pekka.Pessi mail at nokia.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Emit initial LineIdentification and State.
  2010-08-13  9:12   ` Pekka Pessi
@ 2010-08-13 13:28     ` Marcel Holtmann
  0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2010-08-13 13:28 UTC (permalink / raw)
  To: ofono

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

Hi Pekka,

> >> Allow following of call states without calling GetProperties.
> >
> > We decided to solve this a little bit more nicely and address some of
> > the long standing round-trip issues with the Voicecall API.  Please
> > check the latest doc/voicecall-api.txt & doc/voicecallmanager-api.txt
> > for more details.
> 
> OK, cool. I'll go and update tp-ring..

give Denis at least a bit to do the needed core changes. So far we only
updated the documentation ;)

Regards

Marcel



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-13 13:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-09 18:47 [PATCH] Emit initial LineIdentification and State Pekka.Pessi
2010-08-11 23:28 ` Denis Kenzior
2010-08-13  9:12   ` Pekka Pessi
2010-08-13 13:28     ` Marcel Holtmann

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.