[HFP][PATCH] fixes CancelCall

Alok <[email protected]>
Newsgroups gmane.linux.bluez.devel
Message-ID <1201093374.23161.19.camel@greatbear>
Hi Johan/Fredric, 

This patch fixes CancelCall .

Let me know if anything needs to be changed.  

-Alok.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
patch (text/x-patch, 1 KB)
Index: audio/headset.c
===================================================================
RCS file: /cvsroot/bluez/utils/audio/headset.c,v
retrieving revision 1.163
diff -u -5 -p -r1.163 headset.c
--- audio/headset.c	23 Jan 2008 12:13:30 -0000	1.163
+++ audio/headset.c	23 Jan 2008 12:33:59 -0000
@@ -1270,10 +1270,11 @@ static DBusHandlerResult hs_cancel_ringi
 						void *data)
 {
 	struct device *device = data;
 	struct headset *hs = device->headset;
 	DBusMessage *reply = NULL;
+	int err;
 
 	if (hs->state < HEADSET_STATE_CONNECTED)
 		return error_not_connected(conn, msg);
 
 	reply = dbus_message_new_method_return(msg);
@@ -1287,10 +1288,19 @@ static DBusHandlerResult hs_cancel_ringi
 
 	g_source_remove(hs->ring_timer);
 	hs->ring_timer = 0;
 
 done:
+	if (hs->hfp_active) {
+		/*+CIEV: (callsetup = 0)*/
+		err = headset_send(hs, "\r\n+CIEV:3, 0\r\n");
+		if (err < 0) {
+			dbus_message_unref(reply);
+			return error_failed_errno(conn, msg, -err);
+		}
+	}
+
 	send_message_and_unref(conn, reply);
 
 	return DBUS_HANDLER_RESULT_HANDLED;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.