All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] Add cdip support
@ 2011-01-12 11:27 Lucas De Marchi
  2011-01-12 11:27 ` [PATCH 1/9] include: add cdip field in ofono_call Lucas De Marchi
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Lucas De Marchi @ 2011-01-12 11:27 UTC (permalink / raw)
  To: ofono

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

Following patches add support for cdip in oFono. It's implement in atmodem and
tested with phonesim.

As I understood from 27.007, this property only makes sense for incoming calls,
so the property in voicecall atom is only presented in this case (and if the
network actually sent this field).

Last patch is only a style fix.

Lucas De Marchi (9):
  include: add cdip field in ofono_call
  voicecall: add support for cdip
  atmodem: add cdip to voicecall
  doc: add CalledLineIdentification property to voicecall
  include: add method for querying cdip support
  call-settings: add support for cdip
  atmodem: add cdip to call-settings
  doc: add CalledLinePresentation property to CallSettings
  call-settings: apply rule M11 of coding style

 doc/call-settings-api.txt       |   15 ++++++
 doc/voicecall-api.txt           |    9 +++
 drivers/atmodem/call-settings.c |   26 +++++++++
 drivers/atmodem/voicecall.c     |   61 +++++++++++++++++++++-
 include/call-settings.h         |    2 +
 include/types.h                 |    1 +
 src/call-settings.c             |  107 ++++++++++++++++++++++++++++++++-------
 src/voicecall.c                 |   38 +++++++++++++-
 8 files changed, 236 insertions(+), 23 deletions(-)

-- 
1.7.3.5


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

* [PATCH 1/9] include: add cdip field in ofono_call
  2011-01-12 11:27 [PATCH 0/9] Add cdip support Lucas De Marchi
@ 2011-01-12 11:27 ` Lucas De Marchi
  2011-01-18 21:04   ` Denis Kenzior
  2011-01-12 11:27 ` [PATCH 2/9] voicecall: add support for cdip Lucas De Marchi
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 13+ messages in thread
From: Lucas De Marchi @ 2011-01-12 11:27 UTC (permalink / raw)
  To: ofono

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

---
 include/types.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/types.h b/include/types.h
index 9fd174d..769b8f0 100644
--- a/include/types.h
+++ b/include/types.h
@@ -99,6 +99,7 @@ struct ofono_call {
 	int status;
 	ofono_bool_t mpty;
 	struct ofono_phone_number phone_number;
+	struct ofono_phone_number called_number;
 	char name[OFONO_MAX_CALLER_NAME_LENGTH + 1];
 	int clip_validity;
 	int cnap_validity;
-- 
1.7.3.5


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

* [PATCH 2/9] voicecall: add support for cdip
  2011-01-12 11:27 [PATCH 0/9] Add cdip support Lucas De Marchi
  2011-01-12 11:27 ` [PATCH 1/9] include: add cdip field in ofono_call Lucas De Marchi
@ 2011-01-12 11:27 ` Lucas De Marchi
  2011-01-12 11:27 ` [PATCH 3/9] atmodem: add cdip to voicecall Lucas De Marchi
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Lucas De Marchi @ 2011-01-12 11:27 UTC (permalink / raw)
  To: ofono

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

Enable oFono to show the identification informed with CDIP.
---
 src/voicecall.c |   38 ++++++++++++++++++++++++++++++++++++--
 1 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index 97fc36b..b96c417 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -370,6 +370,14 @@ static void append_voicecall_properties(struct voicecall *v,
 	ofono_dbus_dict_append(dict, "LineIdentification",
 				DBUS_TYPE_STRING, &callerid);
 
+	if (call->called_number.number[0] != '\0') {
+		const char *calledid;
+
+		calledid = phone_number_to_string(&call->called_number);
+		ofono_dbus_dict_append(dict, "CalledLineIdentification",
+						DBUS_TYPE_STRING, &calledid);
+	}
+
 	ofono_dbus_dict_append(dict, "Name", DBUS_TYPE_STRING, &name);
 
 	if (call->status == CALL_STATUS_ACTIVE ||
@@ -781,6 +789,30 @@ static void voicecall_set_call_lineid(struct voicecall *v,
 	}
 }
 
+static void voicecall_set_call_calledid(struct voicecall *v,
+					const struct ofono_phone_number *ph)
+{
+	struct ofono_call *call = v->call;
+	DBusConnection *conn = ofono_dbus_get_connection();
+	const char *path;
+	const char *calledid_str;
+
+	if (!strcmp(call->called_number.number, ph->number) &&
+					call->called_number.type == ph->type)
+		return;
+
+	strcpy(call->called_number.number, ph->number);
+	call->called_number.type = ph->type;
+
+	path = voicecall_build_path(v->vc, call);
+	calledid_str = phone_number_to_string(ph);
+
+	ofono_dbus_signal_property_changed(conn, path,
+			OFONO_VOICECALL_INTERFACE, "CalledLineIdentification",
+			DBUS_TYPE_STRING, &calledid_str);
+}
+
+
 static void voicecall_set_call_name(struct voicecall *v,
 					const char *name,
 					int cnap_validity)
@@ -1916,8 +1948,9 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc,
 	struct voicecall *v = NULL;
 	struct ofono_call *newcall;
 
-	DBG("Got a voicecall event, status: %d, id: %u, number: %s",
-			call->status, call->id, call->phone_number.number);
+	DBG("Got a voicecall event, status: %d, id: %u, number: %s"
+			" called_number: %s", call->status, call->id,
+			call->phone_number.number, call->called_number.number);
 
 	l = g_slist_find_custom(vc->call_list, GUINT_TO_POINTER(call->id),
 				call_compare_by_id);
@@ -1927,6 +1960,7 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc,
 		voicecall_set_call_status(l->data, call->status);
 		voicecall_set_call_lineid(l->data, &call->phone_number,
 						call->clip_validity);
+		voicecall_set_call_calledid(l->data, &call->called_number);
 		voicecall_set_call_name(l->data, call->name,
 						call->cnap_validity);
 
-- 
1.7.3.5


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

* [PATCH 3/9] atmodem: add cdip to voicecall
  2011-01-12 11:27 [PATCH 0/9] Add cdip support Lucas De Marchi
  2011-01-12 11:27 ` [PATCH 1/9] include: add cdip field in ofono_call Lucas De Marchi
  2011-01-12 11:27 ` [PATCH 2/9] voicecall: add support for cdip Lucas De Marchi
@ 2011-01-12 11:27 ` Lucas De Marchi
  2011-01-12 11:27 ` [PATCH 4/9] doc: add CalledLineIdentification property " Lucas De Marchi
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Lucas De Marchi @ 2011-01-12 11:27 UTC (permalink / raw)
  To: ofono

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

---
 drivers/atmodem/voicecall.c |   61 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/drivers/atmodem/voicecall.c b/drivers/atmodem/voicecall.c
index 75e0c93..43989f2 100644
--- a/drivers/atmodem/voicecall.c
+++ b/drivers/atmodem/voicecall.c
@@ -60,6 +60,7 @@ static const char *atd_prefix[] = { "+COLP:", NULL };
 
 #define FLAG_NEED_CLIP 1
 #define FLAG_NEED_CNAP 2
+#define FLAG_NEED_CDIP 4
 
 struct voicecall_data {
 	GSList *calls;
@@ -202,6 +203,12 @@ static void clcc_poll_cb(gboolean ok, GAtResult *result, gpointer user_data)
 			nc->cnap_validity = oc->cnap_validity;
 
 			/*
+			 * CDIP doesn't arrive as part of CLCC, always
+			 * re-use from the old call
+			 */
+			nc->called_number = oc->called_number;
+
+			/*
 			 * If the CLIP is not provided and the CLIP never
 			 * arrives, or RING is used, then signal the call
 			 * here
@@ -654,7 +661,7 @@ static void ring_notify(GAtResult *result, gpointer user_data)
 
 	/* We don't know the call type, we must run clcc */
 	vd->clcc_source = g_timeout_add(CLIP_INTERVAL, poll_clcc, vc);
-	vd->flags = FLAG_NEED_CLIP | FLAG_NEED_CNAP;
+	vd->flags = FLAG_NEED_CLIP | FLAG_NEED_CNAP | FLAG_NEED_CDIP;
 }
 
 static void cring_notify(GAtResult *result, gpointer user_data)
@@ -705,7 +712,7 @@ static void cring_notify(GAtResult *result, gpointer user_data)
 	 * earlier, we announce the call there
 	 */
 	vd->clcc_source = g_timeout_add(CLIP_INTERVAL, poll_clcc, vc);
-	vd->flags = FLAG_NEED_CLIP | FLAG_NEED_CNAP;
+	vd->flags = FLAG_NEED_CLIP | FLAG_NEED_CNAP | FLAG_NEED_CDIP;
 
 	DBG("");
 }
@@ -771,6 +778,54 @@ static void clip_notify(GAtResult *result, gpointer user_data)
 	vd->flags &= ~FLAG_NEED_CLIP;
 }
 
+static void cdip_notify(GAtResult *result, gpointer user_data)
+{
+	struct ofono_voicecall *vc = user_data;
+	struct voicecall_data *vd = ofono_voicecall_get_data(vc);
+	GAtResultIter iter;
+	const char *num;
+	int type;
+	GSList *l;
+	struct ofono_call *call;
+
+	l = g_slist_find_custom(vd->calls, GINT_TO_POINTER(4),
+				at_util_call_compare_by_status);
+	if (l == NULL) {
+		ofono_error("CDIP for unknown call");
+		return;
+	}
+
+	/* We have already saw a CDIP for this call, no need to parse again */
+	if ((vd->flags & FLAG_NEED_CDIP) == 0)
+		return;
+
+	g_at_result_iter_init(&iter, result);
+
+	if (!g_at_result_iter_next(&iter, "+CDIP:"))
+		return;
+
+	if (!g_at_result_iter_next_string(&iter, &num))
+		return;
+
+	if (!g_at_result_iter_next_number(&iter, &type))
+		return;
+
+	DBG("%s %d", num, type);
+
+	call = l->data;
+
+	strncpy(call->called_number.number, num,
+		OFONO_MAX_PHONE_NUMBER_LENGTH);
+	call->called_number.number[OFONO_MAX_PHONE_NUMBER_LENGTH] = '\0';
+	call->called_number.type = type;
+
+	/* Only signal the call here if we already signaled it to the core */
+	if (call->type == 0 && (vd->flags & FLAG_NEED_CLIP) == 0)
+		ofono_voicecall_notify(vc, call);
+
+	vd->flags &= ~FLAG_NEED_CDIP;
+}
+
 static void cnap_notify(GAtResult *result, gpointer user_data)
 {
 	struct ofono_voicecall *vc = user_data;
@@ -942,6 +997,7 @@ static void at_voicecall_initialized(gboolean ok, GAtResult *result,
 	g_at_chat_register(vd->chat, "RING", ring_notify, FALSE, vc, NULL);
 	g_at_chat_register(vd->chat, "+CRING:", cring_notify, FALSE, vc, NULL);
 	g_at_chat_register(vd->chat, "+CLIP:", clip_notify, FALSE, vc, NULL);
+	g_at_chat_register(vd->chat, "+CDIP:", cdip_notify, FALSE, vc, NULL);
 	g_at_chat_register(vd->chat, "+CNAP:", cnap_notify, FALSE, vc, NULL);
 	g_at_chat_register(vd->chat, "+CCWA:", ccwa_notify, FALSE, vc, NULL);
 
@@ -978,6 +1034,7 @@ static int at_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
 
 	g_at_chat_send(vd->chat, "AT+CRC=1", NULL, NULL, NULL, NULL);
 	g_at_chat_send(vd->chat, "AT+CLIP=1", NULL, NULL, NULL, NULL);
+	g_at_chat_send(vd->chat, "AT+CDIP=1", NULL, NULL, NULL, NULL);
 	g_at_chat_send(vd->chat, "AT+CNAP=1", NULL, NULL, NULL, NULL);
 	g_at_chat_send(vd->chat, "AT+COLP=1", NULL, NULL, NULL, NULL);
 	g_at_chat_send(vd->chat, "AT+VTD?", NULL,
-- 
1.7.3.5


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

* [PATCH 4/9] doc: add CalledLineIdentification property to voicecall
  2011-01-12 11:27 [PATCH 0/9] Add cdip support Lucas De Marchi
                   ` (2 preceding siblings ...)
  2011-01-12 11:27 ` [PATCH 3/9] atmodem: add cdip to voicecall Lucas De Marchi
@ 2011-01-12 11:27 ` Lucas De Marchi
  2011-01-12 11:27 ` [PATCH 5/9] include: add method for querying cdip support Lucas De Marchi
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Lucas De Marchi @ 2011-01-12 11:27 UTC (permalink / raw)
  To: ofono

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

---
 doc/voicecall-api.txt |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/doc/voicecall-api.txt b/doc/voicecall-api.txt
index 4f38e6a..7971fe6 100644
--- a/doc/voicecall-api.txt
+++ b/doc/voicecall-api.txt
@@ -87,6 +87,15 @@ Properties	string LineIdentification [readonly]
 			"override category" option was not provisioned for
 			the current subscriber.
 
+		string CalledLineIdentification [readonly]
+
+			Contains the Called Line Identification information
+			returned by the network. This is only available for
+			incoming calls, in which it indicates the dialed number
+			to make this call. This is useful for subscribers
+			associated to multiple identifications to differentiate
+			the calls received by each one.
+
 		string Name [readonly]
 
 			Contains the Name Identification information returned
-- 
1.7.3.5


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

* [PATCH 5/9] include: add method for querying cdip support
  2011-01-12 11:27 [PATCH 0/9] Add cdip support Lucas De Marchi
                   ` (3 preceding siblings ...)
  2011-01-12 11:27 ` [PATCH 4/9] doc: add CalledLineIdentification property " Lucas De Marchi
@ 2011-01-12 11:27 ` Lucas De Marchi
  2011-01-12 11:27 ` [PATCH 6/9] call-settings: add support for cdip Lucas De Marchi
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Lucas De Marchi @ 2011-01-12 11:27 UTC (permalink / raw)
  To: ofono

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

---
 include/call-settings.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/call-settings.h b/include/call-settings.h
index c1ff668..55300ab 100644
--- a/include/call-settings.h
+++ b/include/call-settings.h
@@ -48,6 +48,8 @@ struct ofono_call_settings_driver {
 				ofono_call_settings_status_cb_t cb, void *data);
 	void (*cnap_query)(struct ofono_call_settings *cs,
 				ofono_call_settings_status_cb_t cb, void *data);
+	void (*cdip_query)(struct ofono_call_settings *cs,
+				ofono_call_settings_status_cb_t cb, void *data);
 	void (*colp_query)(struct ofono_call_settings *cs,
 				ofono_call_settings_status_cb_t cb, void *data);
 	void (*clir_query)(struct ofono_call_settings *cs,
-- 
1.7.3.5


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

* [PATCH 6/9] call-settings: add support for cdip
  2011-01-12 11:27 [PATCH 0/9] Add cdip support Lucas De Marchi
                   ` (4 preceding siblings ...)
  2011-01-12 11:27 ` [PATCH 5/9] include: add method for querying cdip support Lucas De Marchi
@ 2011-01-12 11:27 ` Lucas De Marchi
  2011-01-12 11:27 ` [PATCH 7/9] atmodem: add cdip to call-settings Lucas De Marchi
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Lucas De Marchi @ 2011-01-12 11:27 UTC (permalink / raw)
  To: ofono

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

---
 src/call-settings.c |   73 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 71 insertions(+), 2 deletions(-)

diff --git a/src/call-settings.c b/src/call-settings.c
index 4dac2b6..0214abf 100644
--- a/src/call-settings.c
+++ b/src/call-settings.c
@@ -69,6 +69,13 @@ enum colp_status {
 	COLP_STATUS_UNKNOWN = 2
 };
 
+/* 27.007 Section 7.9 */
+enum cdip_status {
+	CDIP_STATUS_NOT_PROVISIONED =		0,
+	CDIP_STATUS_PROVISIONED =		1,
+	CDIP_STATUS_UNKNOWN =			2
+};
+
 /* This is not defined in 27.007, but presumably the same as CLIP/COLP */
 enum colr_status {
 	COLR_STATUS_NOT_PROVISIONED = 0,
@@ -79,6 +86,7 @@ enum colr_status {
 enum call_setting_type {
 	CALL_SETTING_TYPE_CLIP = 0,
 	CALL_SETTING_TYPE_CNAP,
+	CALL_SETTING_TYPE_CDIP,
 	CALL_SETTING_TYPE_COLP,
 	CALL_SETTING_TYPE_COLR,
 	CALL_SETTING_TYPE_CLIR,
@@ -90,6 +98,7 @@ struct ofono_call_settings {
 	int colr;
 	int clip;
 	int cnap;
+	int cdip;
 	int colp;
 	int clir_setting;
 	int cw;
@@ -117,6 +126,18 @@ static const char *clip_status_to_string(int status)
 	return "unknown";
 }
 
+static const char *cdip_status_to_string(int status)
+{
+	switch (status) {
+	case CDIP_STATUS_NOT_PROVISIONED:
+		return "disabled";
+	case CDIP_STATUS_PROVISIONED:
+		return "enabled";
+	}
+
+	return "unknown";
+}
+
 static const char *cnap_status_to_string(int status)
 {
 	switch (status) {
@@ -227,6 +248,28 @@ static void set_clir_override(struct ofono_call_settings *cs, int override)
 						DBUS_TYPE_STRING, &str);
 }
 
+static void set_cdip(struct ofono_call_settings *cs, int cdip)
+{
+	DBusConnection *conn;
+	const char *path;
+	const char *str;
+
+	if (cs->cdip == cdip)
+		return;
+
+	cs->cdip = cdip;
+
+	conn = ofono_dbus_get_connection();
+	path = __ofono_atom_get_path(cs->atom);
+
+	str = cdip_status_to_string(cdip);
+
+	ofono_dbus_signal_property_changed(conn, path,
+						OFONO_CALL_SETTINGS_INTERFACE,
+						"CalledLinePresentation",
+						DBUS_TYPE_STRING, &str);
+}
+
 static void set_clip(struct ofono_call_settings *cs, int clip)
 {
 	DBusConnection *conn;
@@ -882,6 +925,10 @@ static DBusMessage *generate_get_properties_reply(struct ofono_call_settings *cs
 	ofono_dbus_dict_append(&dict, "ConnectedLineRestriction",
 				DBUS_TYPE_STRING, &str);
 
+	str = cdip_status_to_string(cs->cdip);
+	ofono_dbus_dict_append(&dict, "CalledLinePresentation",
+				DBUS_TYPE_STRING, &str);
+
 	str = clir_status_to_string(cs->clir);
 	ofono_dbus_dict_append(&dict, "CallingLineRestriction",
 				DBUS_TYPE_STRING, &str);
@@ -934,6 +981,28 @@ static void query_clir(struct ofono_call_settings *cs)
 	cs->driver->clir_query(cs, cs_clir_callback, cs);
 }
 
+static void cs_cdip_callback(const struct ofono_error *error,
+				int state, void *data)
+{
+	struct ofono_call_settings *cs = data;
+
+	if (error->type == OFONO_ERROR_TYPE_NO_ERROR)
+		set_cdip(cs, state);
+
+	query_clir(cs);
+}
+
+static void query_cdip(struct ofono_call_settings *cs)
+{
+	if (cs->driver->cdip_query == NULL) {
+		query_clir(cs);
+		return;
+	}
+
+	cs->driver->cdip_query(cs, cs_cdip_callback, cs);
+}
+
+
 static void cs_cnap_callback(const struct ofono_error *error,
 				int state, void *data)
 {
@@ -942,13 +1011,13 @@ static void cs_cnap_callback(const struct ofono_error *error,
 	if (error->type == OFONO_ERROR_TYPE_NO_ERROR)
 		set_cnap(cs, state);
 
-	query_clir(cs);
+	query_cdip(cs);
 }
 
 static void query_cnap(struct ofono_call_settings *cs)
 {
 	if (cs->driver->cnap_query == NULL) {
-		query_clir(cs);
+		query_cdip(cs);
 		return;
 	}
 
-- 
1.7.3.5


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

* [PATCH 7/9] atmodem: add cdip to call-settings
  2011-01-12 11:27 [PATCH 0/9] Add cdip support Lucas De Marchi
                   ` (5 preceding siblings ...)
  2011-01-12 11:27 ` [PATCH 6/9] call-settings: add support for cdip Lucas De Marchi
@ 2011-01-12 11:27 ` Lucas De Marchi
  2011-01-12 11:27 ` [PATCH 8/9] doc: add CalledLinePresentation property to CallSettings Lucas De Marchi
  2011-01-12 11:27 ` [PATCH 9/9] call-settings: apply rule M11 of coding style Lucas De Marchi
  8 siblings, 0 replies; 13+ messages in thread
From: Lucas De Marchi @ 2011-01-12 11:27 UTC (permalink / raw)
  To: ofono

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

---
 drivers/atmodem/call-settings.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/drivers/atmodem/call-settings.c b/drivers/atmodem/call-settings.c
index 3340d5a..2529c8e 100644
--- a/drivers/atmodem/call-settings.c
+++ b/drivers/atmodem/call-settings.c
@@ -46,6 +46,7 @@ static const char *clip_prefix[] = { "+CLIP:", NULL };
 static const char *ccwa_prefix[] = { "+CCWA:", NULL };
 static const char *colr_prefix[] = { "+COLR:", NULL };
 static const char *cnap_prefix[] = { "+CNAP:", NULL };
+static const char *cdip_prefix[] = { "+CDIP:", NULL };
 
 static void ccwa_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
 {
@@ -199,6 +200,30 @@ error:
 	CALLBACK_WITH_FAILURE(cb, -1, data);
 }
 
+static void cdip_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+	query_template("+CDIP:", ok, result, user_data);
+}
+
+static void at_cdip_query(struct ofono_call_settings *cs,
+				ofono_call_settings_status_cb_t cb, void *data)
+{
+	GAtChat *chat = ofono_call_settings_get_data(cs);
+	struct cb_data *cbd = cb_data_new(cb, data);
+
+	if (cbd == NULL)
+		goto error;
+
+	if (g_at_chat_send(chat, "AT+CDIP?", cdip_prefix,
+				cdip_query_cb, cbd, g_free) > 0)
+		return;
+
+error:
+	g_free(cbd);
+
+	CALLBACK_WITH_FAILURE(cb, -1, data);
+}
+
 static void cnap_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
 {
 	query_template("+CNAP:", ok, result, user_data);
@@ -387,6 +412,7 @@ static struct ofono_call_settings_driver driver = {
 	.remove = at_call_settings_remove,
 	.clip_query = at_clip_query,
 	.cnap_query = at_cnap_query,
+	.cdip_query = at_cdip_query,
 	.colp_query = at_colp_query,
 	.clir_query = at_clir_query,
 	.clir_set = at_clir_set,
-- 
1.7.3.5


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

* [PATCH 8/9] doc: add CalledLinePresentation property to CallSettings
  2011-01-12 11:27 [PATCH 0/9] Add cdip support Lucas De Marchi
                   ` (6 preceding siblings ...)
  2011-01-12 11:27 ` [PATCH 7/9] atmodem: add cdip to call-settings Lucas De Marchi
@ 2011-01-12 11:27 ` Lucas De Marchi
  2011-01-13 17:09   ` Lucas De Marchi
  2011-01-12 11:27 ` [PATCH 9/9] call-settings: apply rule M11 of coding style Lucas De Marchi
  8 siblings, 1 reply; 13+ messages in thread
From: Lucas De Marchi @ 2011-01-12 11:27 UTC (permalink / raw)
  To: ofono

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

---
 doc/call-settings-api.txt |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/doc/call-settings-api.txt b/doc/call-settings-api.txt
index b6dc1cc..44e0dbb 100644
--- a/doc/call-settings-api.txt
+++ b/doc/call-settings-api.txt
@@ -30,6 +30,21 @@ Properties	string CallingLinePresentation [readonly]
 				"enabled",
 				"unknown"
 
+Properties	string CalledLinePresentation [readonly]
+
+			Contains the value of the called line identification
+			presentation property.  The value indicates the state
+			of the CDIP supplementary service in the network.  If
+			enabled, when receiving a call the network will provide
+			the identification dialed to makee this call.  This is
+			useful when subscriber can be registered with more than
+			one identification.
+
+			Possible values are:
+				"disabled",
+				"enabled",
+				"unknown"
+
 		string CallingNamePresentation [readonly]
 
 			Contains the value of the calling name identification
-- 
1.7.3.5


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

* [PATCH 9/9] call-settings: apply rule M11 of coding style
  2011-01-12 11:27 [PATCH 0/9] Add cdip support Lucas De Marchi
                   ` (7 preceding siblings ...)
  2011-01-12 11:27 ` [PATCH 8/9] doc: add CalledLinePresentation property to CallSettings Lucas De Marchi
@ 2011-01-12 11:27 ` Lucas De Marchi
  8 siblings, 0 replies; 13+ messages in thread
From: Lucas De Marchi @ 2011-01-12 11:27 UTC (permalink / raw)
  To: ofono

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

---
 src/call-settings.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/call-settings.c b/src/call-settings.c
index 0214abf..109f130 100644
--- a/src/call-settings.c
+++ b/src/call-settings.c
@@ -41,32 +41,32 @@ static GSList *g_drivers = NULL;
 
 /* 27.007 Section 7.7 */
 enum clir_status {
-	CLIR_STATUS_NOT_PROVISIONED = 0,
-	CLIR_STATUS_PROVISIONED_PERMANENT,
-	CLIR_STATUS_UNKNOWN,
-	CLIR_STATUS_TEMPORARY_RESTRICTED,
-	CLIR_STATUS_TEMPORARY_ALLOWED
+	CLIR_STATUS_NOT_PROVISIONED =		0,
+	CLIR_STATUS_PROVISIONED_PERMANENT =	1,
+	CLIR_STATUS_UNKNOWN =			2,
+	CLIR_STATUS_TEMPORARY_RESTRICTED =	3,
+	CLIR_STATUS_TEMPORARY_ALLOWED =		4
 };
 
 /* 27.007 Section 7.6 */
 enum clip_status {
-	CLIP_STATUS_NOT_PROVISIONED = 0,
-	CLIP_STATUS_PROVISIONED,
-	CLIP_STATUS_UNKNOWN
+	CLIP_STATUS_NOT_PROVISIONED =		0,
+	CLIP_STATUS_PROVISIONED =		1,
+	CLIP_STATUS_UNKNOWN =			2
 };
 
 /* 27.007 Section 7.30 */
 enum cnap_status {
-	CNAP_STATUS_NOT_PROVISIONED = 0,
-	CNAP_STATUS_PROVISIONED,
-	CNAP_STATUS_UNKNOWN
+	CNAP_STATUS_NOT_PROVISIONED =		0,
+	CNAP_STATUS_PROVISIONED =		1,
+	CNAP_STATUS_UNKNOWN =			2
 };
 
 /* 27.007 Section 7.8 */
 enum colp_status {
-	COLP_STATUS_NOT_PROVISIONED = 0,
-	COLP_STATUS_PROVISIONED = 1,
-	COLP_STATUS_UNKNOWN = 2
+	COLP_STATUS_NOT_PROVISIONED =		0,
+	COLP_STATUS_PROVISIONED =		1,
+	COLP_STATUS_UNKNOWN =			2
 };
 
 /* 27.007 Section 7.9 */
@@ -78,9 +78,9 @@ enum cdip_status {
 
 /* This is not defined in 27.007, but presumably the same as CLIP/COLP */
 enum colr_status {
-	COLR_STATUS_NOT_PROVISIONED = 0,
-	COLR_STATUS_PROVISIONED = 1,
-	COLR_STATUS_UNKNOWN = 2
+	COLR_STATUS_NOT_PROVISIONED =		0,
+	COLR_STATUS_PROVISIONED =		1,
+	COLR_STATUS_UNKNOWN =			2
 };
 
 enum call_setting_type {
-- 
1.7.3.5


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

* Re: [PATCH 8/9] doc: add CalledLinePresentation property to CallSettings
  2011-01-12 11:27 ` [PATCH 8/9] doc: add CalledLinePresentation property to CallSettings Lucas De Marchi
@ 2011-01-13 17:09   ` Lucas De Marchi
  2011-01-14 13:47     ` [PATCH] " Lucas De Marchi
  0 siblings, 1 reply; 13+ messages in thread
From: Lucas De Marchi @ 2011-01-13 17:09 UTC (permalink / raw)
  To: ofono

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

On Wed, Jan 12, 2011 at 9:27 AM, Lucas De Marchi
<lucas.demarchi@profusion.mobi> wrote:
> ---
>  doc/call-settings-api.txt |   15 +++++++++++++++
>  1 files changed, 15 insertions(+), 0 deletions(-)
>
> diff --git a/doc/call-settings-api.txt b/doc/call-settings-api.txt
> index b6dc1cc..44e0dbb 100644
> --- a/doc/call-settings-api.txt
> +++ b/doc/call-settings-api.txt
> @@ -30,6 +30,21 @@ Properties   string CallingLinePresentation [readonly]
>                                "enabled",
>                                "unknown"
>
> +Properties     string CalledLinePresentation [readonly]

hunmn... This "Properties" shouldn't be here



Lucas De Marchi

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

* [PATCH] doc: add CalledLinePresentation property to CallSettings
  2011-01-13 17:09   ` Lucas De Marchi
@ 2011-01-14 13:47     ` Lucas De Marchi
  0 siblings, 0 replies; 13+ messages in thread
From: Lucas De Marchi @ 2011-01-14 13:47 UTC (permalink / raw)
  To: ofono

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

---
 doc/call-settings-api.txt |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/doc/call-settings-api.txt b/doc/call-settings-api.txt
index b6dc1cc..46a1059 100644
--- a/doc/call-settings-api.txt
+++ b/doc/call-settings-api.txt
@@ -30,6 +30,21 @@ Properties	string CallingLinePresentation [readonly]
 				"enabled",
 				"unknown"
 
+		string CalledLinePresentation [readonly]
+
+			Contains the value of the called line identification
+			presentation property.  The value indicates the state
+			of the CDIP supplementary service in the network.  If
+			enabled, when receiving a call the network will provide
+			the identification dialed to makee this call.  This is
+			useful when subscriber can be registered with more than
+			one identification.
+
+			Possible values are:
+				"disabled",
+				"enabled",
+				"unknown"
+
 		string CallingNamePresentation [readonly]
 
 			Contains the value of the calling name identification
-- 
1.7.3.5


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

* Re: [PATCH 1/9] include: add cdip field in ofono_call
  2011-01-12 11:27 ` [PATCH 1/9] include: add cdip field in ofono_call Lucas De Marchi
@ 2011-01-18 21:04   ` Denis Kenzior
  0 siblings, 0 replies; 13+ messages in thread
From: Denis Kenzior @ 2011-01-18 21:04 UTC (permalink / raw)
  To: ofono

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

Hi Lucas,

On 01/12/2011 05:27 AM, Lucas De Marchi wrote:
> ---
>  include/types.h |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 

I applied all 9 patches in this series but made some minor modifications
afterwards.  Can you review and make sure things are still working as
intended?

Regards,
-Denis

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

end of thread, other threads:[~2011-01-18 21:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-12 11:27 [PATCH 0/9] Add cdip support Lucas De Marchi
2011-01-12 11:27 ` [PATCH 1/9] include: add cdip field in ofono_call Lucas De Marchi
2011-01-18 21:04   ` Denis Kenzior
2011-01-12 11:27 ` [PATCH 2/9] voicecall: add support for cdip Lucas De Marchi
2011-01-12 11:27 ` [PATCH 3/9] atmodem: add cdip to voicecall Lucas De Marchi
2011-01-12 11:27 ` [PATCH 4/9] doc: add CalledLineIdentification property " Lucas De Marchi
2011-01-12 11:27 ` [PATCH 5/9] include: add method for querying cdip support Lucas De Marchi
2011-01-12 11:27 ` [PATCH 6/9] call-settings: add support for cdip Lucas De Marchi
2011-01-12 11:27 ` [PATCH 7/9] atmodem: add cdip to call-settings Lucas De Marchi
2011-01-12 11:27 ` [PATCH 8/9] doc: add CalledLinePresentation property to CallSettings Lucas De Marchi
2011-01-13 17:09   ` Lucas De Marchi
2011-01-14 13:47     ` [PATCH] " Lucas De Marchi
2011-01-12 11:27 ` [PATCH 9/9] call-settings: apply rule M11 of coding style Lucas De Marchi

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.