summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-11-12 17:54:26 -0600
committerDenis Kenzior <denkenz@gmail.com>2009-11-12 19:16:31 -0600
commite9341c520354375a3647ad4e0a7db114929cb1b9 (patch)
tree31402a8d1250e3ea76d4335b01b85322b187a3cb /src
parent9b084e965662d82c14661ab721e270039217d8e5 (diff)
downloadofono-e9341c520354375a3647ad4e0a7db114929cb1b9.tar.bz2
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.
Diffstat (limited to 'src')
-rw-r--r--src/voicecall.c41
1 files changed, 14 insertions, 27 deletions
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,