* [PATCH] ifxmodem: add CNAP support
@ 2011-02-10 16:16 Jeevaka Badrappan
2011-02-11 17:23 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Jeevaka Badrappan @ 2011-02-10 16:16 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2388 bytes --]
---
drivers/ifxmodem/voicecall.c | 51 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/drivers/ifxmodem/voicecall.c b/drivers/ifxmodem/voicecall.c
index 30e6991..87a48e6 100644
--- a/drivers/ifxmodem/voicecall.c
+++ b/drivers/ifxmodem/voicecall.c
@@ -630,6 +630,56 @@ static void clip_notify(GAtResult *result, gpointer user_data)
ofono_voicecall_notify(vc, call);
}
+static void cnap_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 *name;
+ int validity;
+ GSList *l;
+ struct ofono_call *call;
+
+ /*
+ * Currently, its not clear which URC will contain the
+ * calling party name for the waiting call.
+ */
+ l = g_slist_find_custom(vd->calls,
+ GINT_TO_POINTER(CALL_STATUS_INCOMING),
+ at_util_call_compare_by_status);
+ if (l == NULL) {
+ ofono_error("CNAP for unknown call");
+ return;
+ }
+
+ g_at_result_iter_init(&iter, result);
+
+ if (!g_at_result_iter_next(&iter, "+CNAP:"))
+ return;
+
+ if (!g_at_result_iter_next_string(&iter, &name))
+ return;
+
+ if (strlen(name) > 0)
+ validity = CNAP_VALIDITY_VALID;
+ else
+ validity = CNAP_VALIDITY_NOT_AVAILABLE;
+
+ /* If we have CNI validity field, override our guessed value */
+ g_at_result_iter_next_number(&iter, &validity);
+
+ DBG("%s %d", name, validity);
+
+ call = l->data;
+
+ strncpy(call->name, name, OFONO_MAX_CALLER_NAME_LENGTH);
+ call->name[OFONO_MAX_CALLER_NAME_LENGTH] = '\0';
+ call->cnap_validity = validity;
+
+ if (call->type == 0)
+ ofono_voicecall_notify(vc, call);
+}
+
static void ccwa_notify(GAtResult *result, gpointer user_data)
{
struct ofono_voicecall *vc = user_data;
@@ -746,6 +796,7 @@ static void ifx_voicecall_initialized(gboolean ok, GAtResult *result,
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, "+CNAP:", cnap_notify, FALSE, vc, NULL);
g_at_chat_register(vd->chat, "+CCWA:", ccwa_notify, FALSE, vc, NULL);
g_at_chat_register(vd->chat, "+XEM:", xem_notify, FALSE, vc, NULL);
g_at_chat_register(vd->chat, "+XCALLSTAT:", xcallstat_notify,
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ifxmodem: add CNAP support
2011-02-10 16:16 [PATCH] ifxmodem: add CNAP support Jeevaka Badrappan
@ 2011-02-11 17:23 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2011-02-11 17:23 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 268 bytes --]
Hi Jeevaka,
On 02/10/2011 10:16 AM, Jeevaka Badrappan wrote:
> ---
> drivers/ifxmodem/voicecall.c | 51 ++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 51 insertions(+), 0 deletions(-)
>
Patch has been applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-11 17:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-10 16:16 [PATCH] ifxmodem: add CNAP support Jeevaka Badrappan
2011-02-11 17:23 ` 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.