summaryrefslogtreecommitdiffstats
path: root/audio/telephony-maemo.c
diff options
context:
space:
mode:
authorPekka Pessi <Pekka.Pessi@nokia.com>2008-11-05 11:12:44 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-12-08 16:10:58 +0200
commit30c8ffbc0a7cb3380821cb1e290a32d90a63ad7e (patch)
tree9efaea13a88c8ed0278e21234d97882406f2f19e /audio/telephony-maemo.c
parent6e592c7e418cf337e3acc0aa96a780cdaf1394eb (diff)
fix csd_status_to_hfp()
Diffstat (limited to 'audio/telephony-maemo.c')
-rw-r--r--audio/telephony-maemo.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/audio/telephony-maemo.c b/audio/telephony-maemo.c
index 54d904a8..713a618d 100644
--- a/audio/telephony-maemo.c
+++ b/audio/telephony-maemo.c
@@ -529,31 +529,35 @@ void telephony_subscriber_number_req(void *telephony_device)
telephony_subscriber_number_rsp(telephony_device, CME_ERROR_NONE);
}
-static int csd_status_to_hfp(int csd_status)
+static int csd_status_to_hfp(struct csd_call *call)
{
- switch (csd_status) {
+ switch (call->status) {
case CSD_CALL_STATUS_IDLE:
case CSD_CALL_STATUS_MO_RELEASE:
case CSD_CALL_STATUS_MT_RELEASE:
case CSD_CALL_STATUS_TERMINATED:
return -1;
case CSD_CALL_STATUS_CREATE:
- /* Is PROCEEDING == DIALING correct? */
- case CSD_CALL_STATUS_PROCEEDING:
return CALL_STATUS_DIALING;
+ case CSD_CALL_STATUS_PROCEEDING:
+ /* PROCEEDING can happen in outgoing/incoming */
+ if (call->originating)
+ return CALL_STATUS_DIALING;
+ else
+ return CALL_STATUS_INCOMING;
case CSD_CALL_STATUS_COMING:
return CALL_STATUS_INCOMING;
case CSD_CALL_STATUS_MO_ALERTING:
- return CALL_STATUS_INCOMING;
- case CSD_CALL_STATUS_MT_ALERTING:
return CALL_STATUS_ALERTING;
+ case CSD_CALL_STATUS_MT_ALERTING:
+ return CALL_STATUS_INCOMING;
case CSD_CALL_STATUS_ANSWERED:
case CSD_CALL_STATUS_ACTIVE:
- case CSD_CALL_STATUS_RETRIEVE_INITIATED:
case CSD_CALL_STATUS_RECONNECT_PENDING:
case CSD_CALL_STATUS_SWAP_INITIATED:
- return CALL_STATUS_ACTIVE;
case CSD_CALL_STATUS_HOLD_INITIATED:
+ return CALL_STATUS_ACTIVE;
+ case CSD_CALL_STATUS_RETRIEVE_INITIATED:
case CSD_CALL_STATUS_HOLD:
return CALL_STATUS_HELD;
default:
@@ -572,7 +576,7 @@ void telephony_list_current_calls_req(void *telephony_device)
struct csd_call *call = l->data;
int status, direction, multiparty;
- status = csd_status_to_hfp(call->status);
+ status = csd_status_to_hfp(call);
if (status < 0)
continue;