Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH 1/3] Clean up isi_call_any_address_sb_proc
       [not found] <AANLkTik_2_gbnD3EgGJkAtQj8OBHWXA6nY093LSJDN5V@mail.gmail.com>
@ 2011-02-25 19:23 ` Antoine Reversat
  2011-02-25 20:22   ` Denis Kenzior
  2011-02-25 19:23 ` [PATCH 2/3] Add CNAP support for isimodem Antoine Reversat
  2011-02-25 19:23 ` [PATCH 3/3] Add CNAP debugging ofono voicecall Antoine Reversat
  2 siblings, 1 reply; 4+ messages in thread
From: Antoine Reversat @ 2011-02-25 19:23 UTC (permalink / raw)
  To: ofono

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

---
 drivers/isimodem/voicecall.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c
index 0a32f27..0f9753b 100644
--- a/drivers/isimodem/voicecall.c
+++ b/drivers/isimodem/voicecall.c
@@ -210,10 +210,16 @@ static void isi_call_any_address_sb_proc(struct isi_voicecall *ivc,
 	uint8_t len;
 	char *addr;
 
-	if (!g_isi_sb_iter_get_byte(sb, &type, 2) ||
-			!g_isi_sb_iter_get_byte(sb, &pres, 3) ||
-			!g_isi_sb_iter_get_byte(sb, &len, 5) ||
-			!g_isi_sb_iter_get_alpha_tag(sb, &addr, 2 * len, 6))
+	if (!g_isi_sb_iter_get_byte(sb, &type, 2))
+		return;
+
+	if (!g_isi_sb_iter_get_byte(sb, &pres, 3))
+		return;
+
+	if (!g_isi_sb_iter_get_byte(sb, &len, 5))
+		return;
+
+	if (!g_isi_sb_iter_get_alpha_tag(sb, &addr, 2 * len, 6))
 		return;
 
 	call->addr_type = type | 0x80;
-- 
1.7.1


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

* [PATCH 2/3] Add CNAP support for isimodem
       [not found] <AANLkTik_2_gbnD3EgGJkAtQj8OBHWXA6nY093LSJDN5V@mail.gmail.com>
  2011-02-25 19:23 ` [PATCH 1/3] Clean up isi_call_any_address_sb_proc Antoine Reversat
@ 2011-02-25 19:23 ` Antoine Reversat
  2011-02-25 19:23 ` [PATCH 3/3] Add CNAP debugging ofono voicecall Antoine Reversat
  2 siblings, 0 replies; 4+ messages in thread
From: Antoine Reversat @ 2011-02-25 19:23 UTC (permalink / raw)
  To: ofono

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

---
 drivers/isimodem/voicecall.c |   42 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c
index 0f9753b..0870556 100644
--- a/drivers/isimodem/voicecall.c
+++ b/drivers/isimodem/voicecall.c
@@ -56,8 +56,10 @@ struct isi_call {
 	uint8_t cause;
 	uint8_t addr_type;
 	uint8_t presentation;
+	uint8_t name_presentation;
 	uint8_t reason;
 	char address[20];
+	char name[20];
 	char addr_pad[4];
 };
 
@@ -245,6 +247,34 @@ static void isi_call_destination_address_sb_proc(struct isi_voicecall *ivc,
 		isi_call_any_address_sb_proc(ivc, call, sb);
 }
 
+static void isi_call_origin_info_sb_proc(struct isi_voicecall *ivc,
+						struct isi_call *call,
+						GIsiSubBlockIter *sb)
+{
+	uint8_t pres;
+	uint8_t id;
+	uint8_t len;
+	char *name;
+
+	if (!g_isi_sb_iter_get_byte(sb, &pres, 2))
+		return;
+
+	if (!g_isi_sb_iter_get_byte(sb, &id, 6))
+		return;
+
+	if (!g_isi_sb_iter_get_byte(sb, &len, 7))
+		return;
+
+	if (!g_isi_sb_iter_get_alpha_tag(sb, &name, 2 * len, 8))
+		return;
+
+	DBG("Got name %s", name);
+	call->name_presentation = pres;
+	strncpy(call->name, name, sizeof(call->name));
+
+	g_free(name);
+}
+
 static void isi_call_mode_sb_proc(struct isi_voicecall *ivc,
 					struct isi_call *call,
 					GIsiSubBlockIter *sb)
@@ -402,13 +432,18 @@ static struct ofono_call isi_call_as_ofono_call(const struct isi_call *call)
 	ocall.status = isi_call_status_to_clcc(call);
 
 	memcpy(number->number, call->address, sizeof(number->number));
+	memcpy(ocall.name, call->name, sizeof(ocall.name));
 
 	number->type = 0x80 | call->addr_type;
 	ocall.clip_validity = call->presentation & 3;
+	ocall.cnap_validity = call->name_presentation & 3;
 
 	if (ocall.clip_validity == 0 && strlen(number->number) == 0)
 		ocall.clip_validity = 2;
 
+	if (ocall.cnap_validity == 0 && strlen(call->name) == 0)
+		ocall.cnap_validity = 2;
+
 	return ocall;
 }
 
@@ -519,11 +554,12 @@ static void isi_call_notify(struct ofono_voicecall *ovc, struct isi_call *call)
 
 	ocall = isi_call_as_ofono_call(call);
 
-	DBG("id=%u,%s,%u,\"%s\",%u,%u",
+	DBG("id=%u,%s,%u,\"%s\",\"%s\",%u,%u",
 		ocall.id,
 		ocall.direction ? "terminated" : "originated",
 		ocall.status,
 		ocall.phone_number.number,
+		ocall.name,
 		ocall.phone_number.type,
 		ocall.clip_validity);
 
@@ -628,6 +664,10 @@ static void isi_call_status_ind_cb(const GIsiMessage *msg, void *data)
 			isi_call_origin_address_sb_proc(ivc, call, &iter);
 			break;
 
+		case CALL_ORIGIN_INFO:
+			isi_call_origin_info_sb_proc(ivc, call, &iter);
+			break;
+
 		case CALL_GSM_DETAILED_CAUSE:
 		case CALL_DESTINATION_PRE_ADDRESS:
 		case CALL_DESTINATION_POST_ADDRESS:
-- 
1.7.1


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

* [PATCH 3/3] Add CNAP debugging ofono voicecall
       [not found] <AANLkTik_2_gbnD3EgGJkAtQj8OBHWXA6nY093LSJDN5V@mail.gmail.com>
  2011-02-25 19:23 ` [PATCH 1/3] Clean up isi_call_any_address_sb_proc Antoine Reversat
  2011-02-25 19:23 ` [PATCH 2/3] Add CNAP support for isimodem Antoine Reversat
@ 2011-02-25 19:23 ` Antoine Reversat
  2 siblings, 0 replies; 4+ messages in thread
From: Antoine Reversat @ 2011-02-25 19:23 UTC (permalink / raw)
  To: ofono

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

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

diff --git a/src/voicecall.c b/src/voicecall.c
index d6e8539..ec001c0 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -1951,8 +1951,9 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc,
 	struct ofono_call *newcall;
 
 	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);
+			" called_number: %s, called_name %s", call->status,
+			call->id, call->phone_number.number,
+			call->called_number.number, call->name);
 
 	l = g_slist_find_custom(vc->call_list, GUINT_TO_POINTER(call->id),
 				call_compare_by_id);
-- 
1.7.1


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

* Re: [PATCH 1/3] Clean up isi_call_any_address_sb_proc
  2011-02-25 19:23 ` [PATCH 1/3] Clean up isi_call_any_address_sb_proc Antoine Reversat
@ 2011-02-25 20:22   ` Denis Kenzior
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2011-02-25 20:22 UTC (permalink / raw)
  To: ofono

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

Hi Antoine,

On 02/25/2011 01:23 PM, Antoine Reversat wrote:
> ---
>  drivers/isimodem/voicecall.c |   14 ++++++++++----
>  1 files changed, 10 insertions(+), 4 deletions(-)
> 

All three patches have been applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2011-02-25 20:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <AANLkTik_2_gbnD3EgGJkAtQj8OBHWXA6nY093LSJDN5V@mail.gmail.com>
2011-02-25 19:23 ` [PATCH 1/3] Clean up isi_call_any_address_sb_proc Antoine Reversat
2011-02-25 20:22   ` Denis Kenzior
2011-02-25 19:23 ` [PATCH 2/3] Add CNAP support for isimodem Antoine Reversat
2011-02-25 19:23 ` [PATCH 3/3] Add CNAP debugging ofono voicecall Antoine Reversat

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