linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel Örstadius" <daniel.orstadius@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH] Release conference call in telephony-maemo
Date: Thu, 28 Jan 2010 17:19:36 +0200	[thread overview]
Message-ID: <eb7933e21001280719w32d2adfco89ce9b99940c968b@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

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.

[-- Attachment #2: 0001-Release-conference-call-in-telephony-maemo.patch --]
[-- Type: text/x-patch, Size: 2220 bytes --]

From 83c71f16e235290146ad77ebbd4e818d0b520540 Mon Sep 17 00:00:00 2001
From: Daniel Orstadius <daniel.orstadius@gmail.com>
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


             reply	other threads:[~2010-01-28 15:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-28 15:19 Daniel Örstadius [this message]
2010-01-30 15:23 ` [PATCH] Release conference call in telephony-maemo Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eb7933e21001280719w32d2adfco89ce9b99940c968b@mail.gmail.com \
    --to=daniel.orstadius@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).