Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Manage multiparty list in emulator CHLD calls
@ 2011-07-05  5:50 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
  2011-07-05  5:50 ` [PATCH v2 1/2] voicecall: manage multiparty list in AT+CHLD=3 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau @ 2011-07-05  5:50 UTC (permalink / raw)
  To: ofono

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

These patches will manage the multiparty list in emulator CHLD calls.
This allow the mpty field of +CLCC to be set to 1 or 0 depending if there is a multiparty call or not.

Frédéric Dalleau (2):
  voicecall: manage multiparty list in AT+CHLD=3
  voicecall: manage multiparty list in AT+CHLD=2X

 src/voicecall.c |  113 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 107 insertions(+), 6 deletions(-)


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

* [PATCH v2 1/2] voicecall: manage multiparty list in AT+CHLD=3
  2011-07-05  5:50 [PATCH v2 0/2] Manage multiparty list in emulator CHLD calls =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
@ 2011-07-05  5:50 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
  2011-07-05  5:50 ` [PATCH v2 2/2] voicecall: manage multiparty list in AT+CHLD=2X =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
  2011-07-15  1:00 ` [PATCH v2 0/2] Manage multiparty list in emulator CHLD calls Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau @ 2011-07-05  5:50 UTC (permalink / raw)
  To: ofono

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

---
 src/voicecall.c |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index 9620838..14f25ab 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -1788,7 +1788,7 @@ static DBusMessage *multiparty_private_chat(DBusConnection *conn,
 	unsigned int id;
 	GSList *l;
 
-	if (vc->pending)
+	if (vc->pending || vc->pending_em)
 		return __ofono_error_busy(msg);
 
 	if (dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &callpath,
@@ -1886,7 +1886,7 @@ static DBusMessage *multiparty_create(DBusConnection *conn,
 {
 	struct ofono_voicecall *vc = data;
 
-	if (vc->pending)
+	if (vc->pending || vc->pending_em)
 		return __ofono_error_busy(msg);
 
 	if (!voicecalls_have_held(vc) || !voicecalls_have_active(vc))
@@ -1907,7 +1907,7 @@ static DBusMessage *multiparty_hangup(DBusConnection *conn,
 {
 	struct ofono_voicecall *vc = data;
 
-	if (vc->pending || vc->release_list)
+	if (vc->pending || vc->pending_em || vc->release_list)
 		return __ofono_error_busy(msg);
 
 	if (vc->driver->release_specific == NULL)
@@ -2710,6 +2710,44 @@ static void emulator_generic_cb(const struct ofono_error *error, void *data)
 	ofono_emulator_send_final(em, error);
 }
 
+static void emulator_mpty_join_cb(const struct ofono_error *error, void *data)
+{
+	struct ofono_voicecall *vc = data;
+	GSList *old;
+
+	ofono_emulator_send_final(vc->pending_em, error);
+	vc->pending_em = NULL;
+
+	if (error->type != OFONO_ERROR_TYPE_NO_ERROR)
+		return;
+
+	/*
+	 * We just created a multiparty call, gather all held
+	 * active calls and add them to the multiparty list
+	 */
+	old = vc->multiparty_list;
+	vc->multiparty_list = 0;
+
+	vc->multiparty_list = g_slist_concat(vc->multiparty_list,
+						voicecalls_held_list(vc));
+
+	vc->multiparty_list = g_slist_concat(vc->multiparty_list,
+						voicecalls_active_list(vc));
+
+	vc->multiparty_list = g_slist_sort(vc->multiparty_list,
+						call_compare);
+
+	if (g_slist_length(vc->multiparty_list) < 2) {
+		ofono_error("Created multiparty call, but size is less than 2"
+				" panic!");
+		g_slist_free(old);
+		return;
+	}
+
+	voicecalls_multiparty_changed(old, vc->multiparty_list);
+	g_slist_free(old);
+}
+
 static void emulator_ata_cb(struct ofono_emulator *em,
 			struct ofono_emulator_request *req, void *userdata)
 {
@@ -2903,8 +2941,17 @@ static void emulator_chld_cb(struct ofono_emulator *em,
 			if (vc->driver->create_multiparty == NULL)
 				goto fail;
 
+			if (vc->pending_em || vc->pending || vc->dial_req)
+				goto fail;
+
+			if (!voicecalls_have_held(vc)
+					|| !voicecalls_have_active(vc))
+				goto fail;
+
+			vc->pending_em = em;
+
 			vc->driver->create_multiparty(vc,
-					emulator_generic_cb, em);
+					emulator_mpty_join_cb, vc);
 			return;
 		case 4:
 			if (vc->driver->transfer == NULL)
-- 
1.7.1


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

* [PATCH v2 2/2] voicecall: manage multiparty list in AT+CHLD=2X
  2011-07-05  5:50 [PATCH v2 0/2] Manage multiparty list in emulator CHLD calls =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
  2011-07-05  5:50 ` [PATCH v2 1/2] voicecall: manage multiparty list in AT+CHLD=3 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
@ 2011-07-05  5:50 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
  2011-07-15  1:00 ` [PATCH v2 0/2] Manage multiparty list in emulator CHLD calls Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau @ 2011-07-05  5:50 UTC (permalink / raw)
  To: ofono

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

---
 src/voicecall.c |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index 14f25ab..01d7c0a 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -78,6 +78,7 @@ struct ofono_voicecall {
 	GKeyFile *settings;
 	char *imsi;
 	struct ofono_emulator *pending_em;
+	unsigned int pending_id;
 	char *em_atd_number;
 };
 
@@ -2748,6 +2749,38 @@ static void emulator_mpty_join_cb(const struct ofono_error *error, void *data)
 	g_slist_free(old);
 }
 
+static void emulator_mpty_private_chat_cb(const struct ofono_error *error,
+							void *data)
+{
+	struct ofono_voicecall *vc = data;
+	GSList *old;
+	GSList *l;
+
+	ofono_emulator_send_final(vc->pending_em, error);
+	vc->pending_em = NULL;
+
+	if (error->type != OFONO_ERROR_TYPE_NO_ERROR)
+		return;
+
+	old = g_slist_copy(vc->multiparty_list);
+
+	l = g_slist_find_custom(vc->multiparty_list,
+			GINT_TO_POINTER(vc->pending_id), call_compare_by_id);
+
+	if (l) {
+		vc->multiparty_list =
+			g_slist_remove(vc->multiparty_list, l->data);
+
+		if (vc->multiparty_list->next == NULL) {
+			g_slist_free(vc->multiparty_list);
+			vc->multiparty_list = 0;
+		}
+	}
+
+	voicecalls_multiparty_changed(old, vc->multiparty_list);
+	g_slist_free(old);
+}
+
 static void emulator_ata_cb(struct ofono_emulator *em,
 			struct ofono_emulator_request *req, void *userdata)
 {
@@ -2974,11 +3007,32 @@ static void emulator_chld_cb(struct ofono_emulator *em,
 		}
 
 		if (chld >= 21 && chld <= 27) {
+			GSList *l;
+			unsigned int id = chld - 20;
+
 			if (vc->driver->private_chat == NULL)
 				goto fail;
 
-			vc->driver->private_chat(vc, chld - 20,
-					emulator_generic_cb, em);
+			if (vc->pending_em || vc->pending || vc->dial_req)
+				goto fail;
+
+			for (l = vc->multiparty_list; l; l = l->next) {
+				struct voicecall *v = l->data;
+				if (v->call->id == id)
+					break;
+			}
+
+			if (l == NULL)
+				goto fail;
+
+			if (voicecalls_have_held(vc))
+				goto fail;
+
+			vc->pending_em = em;
+			vc->pending_id = id;
+
+			vc->driver->private_chat(vc, id,
+					emulator_mpty_private_chat_cb, vc);
 			return;
 		}
 
-- 
1.7.1


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

* Re: [PATCH v2 0/2] Manage multiparty list in emulator CHLD calls
  2011-07-05  5:50 [PATCH v2 0/2] Manage multiparty list in emulator CHLD calls =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
  2011-07-05  5:50 ` [PATCH v2 1/2] voicecall: manage multiparty list in AT+CHLD=3 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
  2011-07-05  5:50 ` [PATCH v2 2/2] voicecall: manage multiparty list in AT+CHLD=2X =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
@ 2011-07-15  1:00 ` Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2011-07-15  1:00 UTC (permalink / raw)
  To: ofono

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

Hi Frédéric,

On 07/05/2011 12:50 AM, Frédéric Dalleau wrote:
> These patches will manage the multiparty list in emulator CHLD calls.
> This allow the mpty field of +CLCC to be set to 1 or 0 depending if there is a multiparty call or not.
> 
> Frédéric Dalleau (2):
>   voicecall: manage multiparty list in AT+CHLD=3
>   voicecall: manage multiparty list in AT+CHLD=2X
> 

Both patches have been applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2011-07-15  1:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-05  5:50 [PATCH v2 0/2] Manage multiparty list in emulator CHLD calls =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
2011-07-05  5:50 ` [PATCH v2 1/2] voicecall: manage multiparty list in AT+CHLD=3 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
2011-07-05  5:50 ` [PATCH v2 2/2] voicecall: manage multiparty list in AT+CHLD=2X =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
2011-07-15  1:00 ` [PATCH v2 0/2] Manage multiparty list in emulator CHLD calls Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox