From 0ce5dea98e069fc01542883dbc403d7bbee7d36b Mon Sep 17 00:00:00 2001 From: "wootak.jung" Date: Wed, 21 Aug 2013 13:45:38 +0900 Subject: [PATCH] Fix tel_hold_call() will be rejected, when existing Incoming Call Change-Id: Id5d517173e68145d26474666ae660bbe6cf9bcc7 --- packaging/tel-plugin-atmodem.spec | 2 +- src/s_call.c | 30 ++++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/packaging/tel-plugin-atmodem.spec b/packaging/tel-plugin-atmodem.spec index 4219cb0..0a6ac8b 100644 --- a/packaging/tel-plugin-atmodem.spec +++ b/packaging/tel-plugin-atmodem.spec @@ -1,7 +1,7 @@ #sbs-git:slp/pkgs/t/tel-plugin-atmodem Name: tel-plugin-atmodem Summary: Telephony AT Modem library -Version: 0.1.39 +Version: 0.1.40 Release: 1 Group: System/Libraries License: Apache diff --git a/src/s_call.c b/src/s_call.c index 859e45e..256a750 100644 --- a/src/s_call.c +++ b/src/s_call.c @@ -1322,7 +1322,7 @@ static gboolean on_notification_call_waiting( CoreObject *o, const void *data, v tcore_call_object_set_cli_info(co, TCORE_CALL_CLI_MODE_DEFAULT, num); tcore_call_object_set_active_line(co, LINE_DEFAULT); - _call_list_get( o, co ); + _call_status_incoming(plugin, co); return TRUE; } @@ -1382,7 +1382,7 @@ static gboolean on_notification_call_incoming( CoreObject *o, const void *data, tcore_call_object_set_cli_info(co, TCORE_CALL_CLI_MODE_DEFAULT, num); tcore_call_object_set_active_line(co, LINE_DEFAULT); - _call_list_get( o, co ); + _call_status_incoming(plugin, co); return TRUE; } @@ -1695,9 +1695,35 @@ static TReturn s_call_hold( CoreObject *o, UserRequest *ur ) { struct treq_call_hold *hold = 0; CallObject *co = 0; + GSList *list_active, *list_incoming, *list_held; hold = (struct treq_call_hold*)tcore_user_request_ref_data( ur, 0 ); + /* + * When Incoming Call and Outgoing Call operates concurrently with one + * already exist Call. Telephony intend to having one Active Call and + * one Incoming Call. But, at that time, Application does not received + * Incoming Call Notification. Therefore, Application call + * tel_hold_call() to hold already exist Active Call. At this point, + * Telephony should reject the request of tel_hold_call() because + * tel_hold_call() sends AT+CHLD=2 which means "place active call on + * hold and accepts the incoming call". + */ + list_active = tcore_call_object_find_by_status(o, TCORE_CALL_STATUS_ACTIVE); + list_incoming = tcore_call_object_find_by_status(o, TCORE_CALL_STATUS_INCOMING); + list_held = tcore_call_object_find_by_status(o, TCORE_CALL_STATUS_HELD); + if (!(list_active != NULL && list_incoming == NULL && list_held == NULL)) { + struct tresp_call_hold resp; + + dbg("Hold Call operation is not allowed"); + + resp.err = CALL_ERROR_SERVICE_NOT_ALLOWED; + resp.id = hold->id; + tcore_user_request_send_response(ur, TRESP_CALL_HOLD, sizeof(resp), &resp); + + return TCORE_RETURN_FAILURE; + } + dbg("call id : [ %d ]", hold->id); co = tcore_call_object_find_by_id( o, hold->id ); -- 2.34.1