diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-10-29 00:10:03 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-10-29 00:10:03 -0500 |
commit | 8f499841cfcdb8c176679f2d26f993a1ec5f3083 (patch) | |
tree | 60b069311bad6eef71437a0bbce9c2a99c14fd6b /src/voicecall.c | |
parent | 30cc6d6f4b6a153a90c4a8447cdf34b6e2e680e2 (diff) | |
download | ofono-8f499841cfcdb8c176679f2d26f993a1ec5f3083.tar.bz2 |
Fix: Refine logic for hangup
Diffstat (limited to 'src/voicecall.c')
-rw-r--r-- | src/voicecall.c | 10 |
1 files changed, 6 insertions, 4 deletions
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); |