[PATCH] Release conference call in telephony-maemo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently telephony-maemo only ends the first call found on
receiving AT+CHUP (hang up) from the headset. This patch checks
if the call is part of a conference call and in that case releases
the whole conference.
From 83c71f16e235290146ad77ebbd4e818d0b520540 Mon Sep 17 00:00:00 2001
From: Daniel Orstadius <daniel.orstadius@xxxxxxxxx>
Date: Thu, 28 Jan 2010 17:14:40 +0200
Subject: [PATCH] Release conference call in telephony-maemo

Currently telephony-maemo only ends the first call found on
receiving AT+CHUP (hang up) from the headset. This patch checks
if the call is part of a conference call and in that case releases
the whole conference.
---
 audio/telephony-maemo.c |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/audio/telephony-maemo.c b/audio/telephony-maemo.c
index 98f4409..81bdfee 100644
--- a/audio/telephony-maemo.c
+++ b/audio/telephony-maemo.c
@@ -106,6 +106,7 @@ static uint32_t callerid = 0;
 #define CSD_CALL_INSTANCE	"com.nokia.csd.Call.Instance"
 #define CSD_CALL_CONFERENCE	"com.nokia.csd.Call.Conference"
 #define CSD_CALL_PATH		"/com/nokia/csd/call"
+#define CSD_CALL_CONFERENCE_PATH "/com/nokia/csd/call/conference"
 
 /* Call status values as exported by the CSD CALL plugin */
 #define CSD_CALL_STATUS_IDLE			0
@@ -313,6 +314,25 @@ static struct csd_call *find_call_with_status(int status)
 	return NULL;
 }
 
+static int release_conference(void)
+{
+	DBusMessage *msg;
+
+	debug("releasing conference call");
+	msg = dbus_message_new_method_call(CSD_CALL_BUS_NAME,
+						CSD_CALL_CONFERENCE_PATH,
+						CSD_CALL_INSTANCE,
+						"Release");
+	if (!msg) {
+		error("Unable to allocate new D-Bus message");
+		return -ENOMEM;
+	}
+
+	g_dbus_send_message(connection, msg);
+
+	return 0;
+}
+
 static int release_call(struct csd_call *call)
 {
 	DBusMessage *msg;
@@ -517,6 +537,7 @@ void telephony_last_dialed_number_req(void *telephony_device)
 void telephony_terminate_call_req(void *telephony_device)
 {
 	struct csd_call *call;
+	int err;
 
 	call = find_call_with_status(CSD_CALL_STATUS_ACTIVE);
 	if (!call)
@@ -529,7 +550,12 @@ void telephony_terminate_call_req(void *telephony_device)
 		return;
 	}
 
-	if (release_call(call) < 0)
+	if (call->conference)
+		err = release_conference();
+	else
+		err = release_call(call);
+
+	if (err < 0)
 		telephony_terminate_call_rsp(telephony_device,
 						CME_ERROR_AG_FAILURE);
 	else
-- 
1.6.0.4


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux