---
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
Show replies by date
Hi Caiwen,
On 08/12/2011 04:19 AM, Caiwen Zhang wrote:
---
include/cdma-voicecall.h | 3 +++
src/cdma-voicecall.c | 23 +++++++++++++++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)
I applied this patch, however I broke it up into two:
06d45196a8f1e3617c529f9b008d4fa67f84aa92 and
e2be184afbd88cac07e086f5d9ae07133077ae95
In the future please structure your commits such that any new public API
additions (e.g. inside include/) are in a separate commit.
Regards,
-Denis