From 8f499841cfcdb8c176679f2d26f993a1ec5f3083 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 29 Oct 2009 00:10:03 -0500 Subject: Fix: Refine logic for hangup --- src/voicecall.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/voicecall.c b/src/voicecall.c index c8cc1dd1..399f4c67 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -280,9 +280,6 @@ static DBusMessage *voicecall_hangup(DBusConnection *conn, if (call->status == CALL_STATUS_DISCONNECTED) return __ofono_error_failed(msg); - if (!vc->driver->hangup && !vc->driver->release_specific) - return __ofono_error_not_implemented(msg); - if (vc->pending) return __ofono_error_busy(msg); @@ -294,8 +291,8 @@ static DBusMessage *voicecall_hangup(DBusConnection *conn, return __ofono_error_not_implemented(msg); vc->pending = dbus_message_ref(msg); - vc->driver->hangup(vc, generic_callback, vc); + return NULL; } @@ -303,11 +300,16 @@ static DBusMessage *voicecall_hangup(DBusConnection *conn, (call->status == CALL_STATUS_ACTIVE || call->status == CALL_STATUS_DIALING || call->status == CALL_STATUS_ALERTING)) { + vc->pending = dbus_message_ref(msg); vc->driver->hangup(vc, generic_callback, vc); return NULL; } + if (vc->driver->release_specific == NULL) + return __ofono_error_not_implemented(msg); + + vc->pending = dbus_message_ref(msg); vc->driver->release_specific(vc, call->id, generic_callback, vc); -- cgit v1.2.3