* [PATCH] Add CDMA voice call answering support
@ 2011-08-12 9:19 Caiwen Zhang
2011-08-15 5:58 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Caiwen Zhang @ 2011-08-12 9:19 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1957 bytes --]
---
include/cdma-voicecall.h | 3 +++
src/cdma-voicecall.c | 23 +++++++++++++++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/include/cdma-voicecall.h b/include/cdma-voicecall.h
index 9e741da..6f77462 100644
--- a/include/cdma-voicecall.h
+++ b/include/cdma-voicecall.h
@@ -55,6 +55,9 @@ struct ofono_cdma_voicecall_driver {
/* Hangs up active, dialing, alerting or incoming calls */
void (*hangup)(struct ofono_cdma_voicecall *vc,
ofono_cdma_voicecall_cb_t cb, void *data);
+
+ void (*answer)(struct ofono_cdma_voicecall *vc,
+ ofono_cdma_voicecall_cb_t cb, void *data);
};
void ofono_cdma_voicecall_disconnected(struct ofono_cdma_voicecall *vc,
diff --git a/src/cdma-voicecall.c b/src/cdma-voicecall.c
index 183433d..b7323c8 100644
--- a/src/cdma-voicecall.c
+++ b/src/cdma-voicecall.c
@@ -286,6 +286,27 @@ static DBusMessage *voicecall_manager_hangup(DBusConnection *conn,
return NULL;
}
+static DBusMessage *voicecall_manager_answer(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ struct ofono_cdma_voicecall *vc = data;
+
+ if (vc->pending)
+ return __ofono_error_busy(msg);
+
+ if (vc->driver->answer == NULL)
+ return __ofono_error_not_implemented(msg);
+
+ if (vc->status != CDMA_CALL_STATUS_INCOMING)
+ return __ofono_error_failed(msg);
+
+ vc->pending = dbus_message_ref(msg);
+
+ vc->driver->answer(vc, generic_callback, vc);
+
+ return NULL;
+}
+
static GDBusMethodTable manager_methods[] = {
{ "GetProperties", "", "a{sv}",
voicecall_manager_get_properties },
@@ -293,6 +314,8 @@ static GDBusMethodTable manager_methods[] = {
G_DBUS_METHOD_FLAG_ASYNC },
{ "Hangup", "", "", voicecall_manager_hangup,
G_DBUS_METHOD_FLAG_ASYNC },
+ { "Answer", "", "", voicecall_manager_answer,
+ G_DBUS_METHOD_FLAG_ASYNC },
{ }
};
--
1.7.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-15 5:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-12 9:19 [PATCH] Add CDMA voice call answering support Caiwen Zhang
2011-08-15 5:58 ` 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.