summaryrefslogtreecommitdiffstats
path: root/audio/telephony-maemo.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-02-17 14:16:12 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2009-02-17 14:16:12 +0200
commitc065f11713317d7d73940052b0588ca232026100 (patch)
tree7ba23ae658637082880aa5c322d357db2bd1c05d /audio/telephony-maemo.c
parent16362a9db9a33b15ea9b61722eb7463b55f09c91 (diff)
Add telephony driver hooks for the HSP AT+CKPD command
Diffstat (limited to 'audio/telephony-maemo.c')
-rw-r--r--audio/telephony-maemo.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/audio/telephony-maemo.c b/audio/telephony-maemo.c
index b2849a8c..34136838 100644
--- a/audio/telephony-maemo.c
+++ b/audio/telephony-maemo.c
@@ -802,6 +802,35 @@ void telephony_nr_and_ec_req(void *telephony_device, gboolean enable)
telephony_nr_and_ec_rsp(telephony_device, CME_ERROR_NONE);
}
+void telephony_key_press_req(void *telephony_device, const char *keys)
+{
+ struct csd_call *active, *waiting;
+ int err;
+
+ debug("telephony-maemo: got key press request for %s", keys);
+
+ waiting = find_call_with_status(CSD_CALL_STATUS_COMING);
+ if (!waiting)
+ waiting = find_call_with_status(CSD_CALL_STATUS_MT_ALERTING);
+ if (!waiting)
+ waiting = find_call_with_status(CSD_CALL_STATUS_PROCEEDING);
+
+ active = find_call_with_status(CSD_CALL_STATUS_ACTIVE);
+
+ if (waiting)
+ err = answer_call(waiting);
+ else if (active)
+ err = release_call(active);
+ else
+ err = 0;
+
+ if (err < 0)
+ telephony_key_press_rsp(telephony_device,
+ CME_ERROR_AG_FAILURE);
+ else
+ telephony_key_press_rsp(telephony_device, CME_ERROR_NONE);
+}
+
static void handle_incoming_call(DBusMessage *msg)
{
const char *number, *call_path;