summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrzej Zaborowski <andrew.zaborowski@intel.com>2010-09-08 19:16:03 +0200
committerDenis Kenzior <denkenz@gmail.com>2010-09-09 21:45:22 -0500
commit52161db42889e094d5e9d6e97b2ff512e0e36cf8 (patch)
treeb7f7889e5f2ac91b6c585be09498e47100e2b6df /src
parentc47b3658707d1b931f6b743af0113c3e6aaff9e0 (diff)
downloadofono-52161db42889e094d5e9d6e97b2ff512e0e36cf8.tar.bz2
stk: Fix User Cancel response to Set Up Call
One of the clean-up commits changed the semantics of the dial request callback's parameter (NULL if call setup failed, non-NULL if success or user cancelled).
Diffstat (limited to 'src')
-rw-r--r--src/stk.c2
-rw-r--r--src/voicecall.c14
2 files changed, 15 insertions, 1 deletions
diff --git a/src/stk.c b/src/stk.c
index 3fda2afc..04bfc651 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -1412,7 +1412,7 @@ static void call_setup_connected(struct ofono_call *call, void *data)
static struct ofono_error error = { .type = OFONO_ERROR_TYPE_FAILURE };
static unsigned char facility_rejected_result[] = { 0x9d };
- if (!call) {
+ if (!call || call->status == CALL_STATUS_DISCONNECTED) {
memset(&rsp, 0, sizeof(rsp));
rsp.result.type = STK_RESULT_TYPE_NETWORK_UNAVAILABLE;
diff --git a/src/voicecall.c b/src/voicecall.c
index 8e20e24d..b16b6f23 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -331,6 +331,16 @@ static DBusMessage *voicecall_deflect(DBusConnection *conn,
return NULL;
}
+static void dial_request_user_cancel(struct ofono_voicecall *vc,
+ struct voicecall *call)
+{
+ if (!vc->dial_req)
+ return;
+
+ if (!call || call == vc->dial_req->call)
+ dial_request_finish(vc->dial_req->call->vc, TRUE);
+}
+
static DBusMessage *voicecall_hangup(DBusConnection *conn,
DBusMessage *msg, void *data)
{
@@ -342,6 +352,8 @@ static DBusMessage *voicecall_hangup(DBusConnection *conn,
if (vc->pending)
return __ofono_error_busy(msg);
+ dial_request_user_cancel(vc, v);
+
switch (call->status) {
case CALL_STATUS_DISCONNECTED:
return __ofono_error_failed(msg);
@@ -1253,6 +1265,8 @@ static DBusMessage *manager_hangup_all(DBusConnection *conn,
} else
vc->driver->hangup_all(vc, generic_callback, vc);
+ dial_request_user_cancel(vc, NULL);
+
return NULL;
}