From e9341c520354375a3647ad4e0a7db114929cb1b9 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 12 Nov 2009 17:54:26 -0600 Subject: [PATCH] Remove Voicecall.Busy method According to 22.030, UDUB or CHLD=0 can only be invoked on waiting calls. Most AT command based modems do not support using CHLD=0 on an incoming call. So we remove the Busy method and invoke set_udub on a call that is in the waiting state. --- doc/voicecall-api.txt | 27 ++++++++++++++------------- src/voicecall.c | 41 ++++++++++++++--------------------------- 2 files changed, 28 insertions(+), 40 deletions(-) diff --git a/doc/voicecall-api.txt b/doc/voicecall-api.txt index b360cca3..c8e34a47 100644 --- a/doc/voicecall-api.txt +++ b/doc/voicecall-api.txt @@ -7,21 +7,11 @@ Object path [variable prefix]/{modem0,modem1,...}/{voicecall01,voicecall02,...} Methods dict GetProperties() - Returns all global system properties. See the + Returns all properties for this object. See the properties section for available properties. Possible Errors: [service].Error.InvalidArguments - void Busy() - - Notifies the incoming or waiting call that the user - is busy. This is done by setting the User Determined - User Busy (UDUB) condition. This method is only valid - if there is an incoming or waiting call. - - This functionality is generally implemented by using - the +CHLD=0 AT command. - void Deflect(string number) Deflects the incoming or waiting call to number given @@ -39,8 +29,19 @@ Methods dict GetProperties() Hangs up the voice call. - This functionality is generally implemented by - +CHLD=1X, +CHUP or ATH AT commands. + For an incoming call, the call is hung up using ATH or + equivalent. For a waiting call, the remote party is + notified by using the User Determined User Busy (UDUB) + condition. This is generally implemented using CHLD=0. + + Please note that the GSM specification does not allow + the release of a held call when a waiting call exists, + or the release of a particular party in a held + multiparty call. + + Note that releasing a held call or a particular party + of a held multiparty call might not be possible on some + implementations. void Answer() diff --git a/src/voicecall.c b/src/voicecall.c index ee903f12..02ec484c 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -211,30 +211,6 @@ static DBusMessage *voicecall_get_properties(DBusConnection *conn, return reply; } -static DBusMessage *voicecall_busy(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct voicecall *v = data; - struct ofono_voicecall *vc = v->vc; - struct ofono_call *call = v->call; - - if (call->status != CALL_STATUS_INCOMING && - call->status != CALL_STATUS_WAITING) - return __ofono_error_failed(msg); - - if (!vc->driver->set_udub) - return __ofono_error_not_implemented(msg); - - if (vc->pending) - return __ofono_error_busy(msg); - - vc->pending = dbus_message_ref(msg); - - vc->driver->set_udub(vc, generic_callback, vc); - - return NULL; -} - static DBusMessage *voicecall_deflect(DBusConnection *conn, DBusMessage *msg, void *data) { @@ -277,6 +253,7 @@ static DBusMessage *voicecall_hangup(DBusConnection *conn, struct voicecall *v = data; struct ofono_voicecall *vc = v->vc; struct ofono_call *call = v->call; + int num_calls; if (call->status == CALL_STATUS_DISCONNECTED) return __ofono_error_failed(msg); @@ -297,7 +274,19 @@ static DBusMessage *voicecall_hangup(DBusConnection *conn, return NULL; } - if ((g_slist_length(vc->call_list) == 1) && vc->driver->hangup && + if (call->status == CALL_STATUS_WAITING) { + if (vc->driver->set_udub == NULL) + return __ofono_error_not_implemented(msg); + + vc->pending = dbus_message_ref(msg); + vc->driver->set_udub(vc, generic_callback, vc); + + return NULL; + } + + num_calls = g_slist_length(vc->call_list); + + if (num_calls == 1 && vc->driver->hangup && (call->status == CALL_STATUS_ACTIVE || call->status == CALL_STATUS_DIALING || call->status == CALL_STATUS_ALERTING)) { @@ -342,8 +331,6 @@ static DBusMessage *voicecall_answer(DBusConnection *conn, static GDBusMethodTable voicecall_methods[] = { { "GetProperties", "", "a{sv}", voicecall_get_properties }, - { "Busy", "", "", voicecall_busy, - G_DBUS_METHOD_FLAG_ASYNC }, { "Deflect", "s", "", voicecall_deflect, G_DBUS_METHOD_FLAG_ASYNC }, { "Hangup", "", "", voicecall_hangup,