summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-10-17 15:59:14 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2008-12-08 16:10:56 +0200
commit2672738072914639a649253927452821af80dc51 (patch)
treea102003a82fb87ad6d72c5f6ec9a71466222a396 /audio
parent56f63154d8a254d77b302406de805f1fe40fd9b3 (diff)
Do better tracking of the call status
Diffstat (limited to 'audio')
-rw-r--r--audio/telephony-maemo.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/audio/telephony-maemo.c b/audio/telephony-maemo.c
index 3ec7855a..36b34778 100644
--- a/audio/telephony-maemo.c
+++ b/audio/telephony-maemo.c
@@ -435,7 +435,7 @@ static void handle_incoming_call(DBusMessage *msg)
static void handle_call_status(DBusMessage *msg, const char *call_path)
{
- struct csd_call *call;
+ struct csd_call *call, *active_call;
uint8_t status;
if (!dbus_message_get_args(msg, NULL,
@@ -457,16 +457,30 @@ static void handle_call_status(DBusMessage *msg, const char *call_path)
return;
}
- debug("Call %s changed to %s", call_path, call_status_str[status]);
+ debug("Call %s changed from %s to %s", call_path,
+ call_status_str[call->status], call_status_str[status]);
+
+ active_call = find_call_with_status(CSD_CALL_STATUS_ACTIVE);
switch (status) {
case CSD_CALL_STATUS_IDLE:
+ if (!active_call)
+ telephony_update_indicator(maemo_indicators, "call",
+ EV_CALL_INACTIVE);
+ g_free(call->number);
+ call->number = NULL;
+ call->originating = FALSE;
+ call->emergency = FALSE;
+ call->on_hold = FALSE;
+ call->conference = FALSE;
break;
case CSD_CALL_STATUS_CREATE:
+ call->originating = TRUE;
telephony_update_indicator(maemo_indicators, "callsetup",
EV_CALLSETUP_OUTGOING);
break;
case CSD_CALL_STATUS_COMING:
+ call->originating = FALSE;
break;
case CSD_CALL_STATUS_PROCEEDING:
break;
@@ -481,8 +495,11 @@ static void handle_call_status(DBusMessage *msg, const char *call_path)
case CSD_CALL_STATUS_ANSWERED:
break;
case CSD_CALL_STATUS_ACTIVE:
- telephony_update_indicator(maemo_indicators, "call",
- EV_CALL_ACTIVE);
+ if (call->on_hold)
+ call->on_hold = FALSE;
+ else
+ telephony_update_indicator(maemo_indicators, "call",
+ EV_CALL_ACTIVE);
if (status == CSD_CALL_STATUS_MT_ALERTING ||
status == CSD_CALL_STATUS_ANSWERED)
telephony_update_indicator(maemo_indicators,
@@ -496,6 +513,15 @@ static void handle_call_status(DBusMessage *msg, const char *call_path)
case CSD_CALL_STATUS_HOLD_INITIATED:
break;
case CSD_CALL_STATUS_HOLD:
+ call->on_hold = TRUE;
+ if (active_call && active_call != call)
+ telephony_update_indicator(maemo_indicators,
+ "callheld",
+ EV_CALLHELD_MULTIPLE);
+ else
+ telephony_update_indicator(maemo_indicators,
+ "callheld",
+ EV_CALLHELD_ON_HOLD);
break;
case CSD_CALL_STATUS_RETRIEVE_INITIATED:
break;