All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add ATD>1; support for HFP emulator
@ 2011-06-21 16:48 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
  2011-06-21 16:48 ` [PATCH v2 1/2] message-waiting: API to retrieve voicemail number =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-06-21 16:48 UTC (permalink / raw)
  To: ofono

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

Only ATD>1; will be managed through HFP AG, and it will call the
voicemail number retrieved from the message-waiting atom.

Frédéric Danis (2):
  message-waiting: API to retrieve voicemail number
  voicecall: add ATD> support for HFP emulator

 src/message-waiting.c |    7 +++++++
 src/ofono.h           |    4 ++++
 src/voicecall.c       |   30 +++++++++++++++++++++++++++---
 3 files changed, 38 insertions(+), 3 deletions(-)


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

* [PATCH v2 1/2] message-waiting: API to retrieve voicemail number
  2011-06-21 16:48 [PATCH v2 0/2] Add ATD>1; support for HFP emulator =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2011-06-21 16:48 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
  2011-06-21 16:48 ` [PATCH v2 2/2] voicecall: add ATD> support for HFP emulator =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
  2011-06-21 17:09 ` [PATCH v2 0/2] Add ATD>1; " Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-06-21 16:48 UTC (permalink / raw)
  To: ofono

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

---
 src/message-waiting.c |    7 +++++++
 src/ofono.h           |    4 ++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/message-waiting.c b/src/message-waiting.c
index ad534d9..7e8c3f4 100644
--- a/src/message-waiting.c
+++ b/src/message-waiting.c
@@ -605,6 +605,13 @@ static void mw_cphs_mbdn_changed(int id, void *userdata)
 			mw_cphs_mbdn_read_cb, mw);
 }
 
+const struct ofono_phone_number *__ofono_message_waiting_get_mbdn(
+					struct ofono_message_waiting *mw,
+					unsigned int index)
+{
+	return &mw->mailbox_number[index];
+}
+
 static void mw_mbi_read_cb(int ok, int total_length, int record,
 				const unsigned char *data,
 				int record_length, void *userdata)
diff --git a/src/ofono.h b/src/ofono.h
index 33eaf93..6524806 100644
--- a/src/ofono.h
+++ b/src/ofono.h
@@ -447,6 +447,10 @@ struct sms;
 void __ofono_message_waiting_mwi(struct ofono_message_waiting *mw,
 				struct sms *sms, gboolean *out_discard);
 
+const struct ofono_phone_number *__ofono_message_waiting_get_mbdn(
+					struct ofono_message_waiting *mw,
+					unsigned int index);
+
 #include <ofono/nettime.h>
 
 void __ofono_nettime_probe_drivers(struct ofono_modem *modem);
-- 
1.7.1


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

* [PATCH v2 2/2] voicecall: add ATD> support for HFP emulator
  2011-06-21 16:48 [PATCH v2 0/2] Add ATD>1; support for HFP emulator =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
  2011-06-21 16:48 ` [PATCH v2 1/2] message-waiting: API to retrieve voicemail number =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2011-06-21 16:48 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
  2011-06-21 17:09 ` [PATCH v2 0/2] Add ATD>1; " Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-06-21 16:48 UTC (permalink / raw)
  To: ofono

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

---
 src/voicecall.c |   30 +++++++++++++++++++++++++++---
 1 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index 1f0d3b8..2eb32a6 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -3084,6 +3084,7 @@ static void emulator_atd_cb(struct ofono_emulator *em,
 			struct ofono_emulator_request *req, void *userdata)
 {
 	struct ofono_voicecall *vc = userdata;
+	struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom);
 	const char *str;
 	size_t len;
 	char number[OFONO_MAX_PHONE_NUMBER_LENGTH + 1];
@@ -3102,10 +3103,33 @@ static void emulator_atd_cb(struct ofono_emulator *em,
 				str[len - 1] != ';')
 			goto fail;
 
-		strncpy(number, str, len - 1);
-		number[len - 1] = '\0';
+		if (len == 3 && str[0] == '>' && str[1] == '1') {
+			struct ofono_atom *mw_atom;
+			struct ofono_message_waiting *mw;
+			const struct ofono_phone_number *ph;
+			const char *num;
 
-		emulator_dial(em, vc, number);
+			mw_atom = __ofono_modem_find_atom(modem,
+					OFONO_ATOM_TYPE_MESSAGE_WAITING);
+
+			if (mw_atom == NULL)
+				goto fail;
+
+			mw = __ofono_atom_get_data(mw_atom);
+			ph = __ofono_message_waiting_get_mbdn(mw, 0);
+
+			if (ph == NULL)
+				goto fail;
+
+			num = phone_number_to_string(ph);
+
+			emulator_dial(em, vc, num);
+		} else {
+			strncpy(number, str, len - 1);
+			number[len - 1] = '\0';
+
+			emulator_dial(em, vc, number);
+		}
 		break;
 
 	default:
-- 
1.7.1


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

* Re: [PATCH v2 0/2] Add ATD>1; support for HFP emulator
  2011-06-21 16:48 [PATCH v2 0/2] Add ATD>1; support for HFP emulator =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
  2011-06-21 16:48 ` [PATCH v2 1/2] message-waiting: API to retrieve voicemail number =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
  2011-06-21 16:48 ` [PATCH v2 2/2] voicecall: add ATD> support for HFP emulator =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2011-06-21 17:09 ` Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2011-06-21 17:09 UTC (permalink / raw)
  To: ofono

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

Hi Frédéric,

On 06/21/2011 11:48 AM, Frédéric Danis wrote:
> Only ATD>1; will be managed through HFP AG, and it will call the
> voicemail number retrieved from the message-waiting atom.
> 
> Frédéric Danis (2):
>   message-waiting: API to retrieve voicemail number
>   voicecall: add ATD> support for HFP emulator
> 
>  src/message-waiting.c |    7 +++++++
>  src/ofono.h           |    4 ++++
>  src/voicecall.c       |   30 +++++++++++++++++++++++++++---
>  3 files changed, 38 insertions(+), 3 deletions(-)
> 

Both patches have been applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2011-06-21 17:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-21 16:48 [PATCH v2 0/2] Add ATD>1; support for HFP emulator =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-06-21 16:48 ` [PATCH v2 1/2] message-waiting: API to retrieve voicemail number =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-06-21 16:48 ` [PATCH v2 2/2] voicecall: add ATD> support for HFP emulator =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-06-21 17:09 ` [PATCH v2 0/2] Add ATD>1; " 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.