Fix tel_hold_call() will be rejected, when existing Incoming Call 61/12461/1
authorwootak.jung <wootak.jung@samsung.com>
Wed, 21 Aug 2013 04:45:38 +0000 (13:45 +0900)
committerwootak.jung <wootak.jung@samsung.com>
Fri, 15 Nov 2013 09:49:44 +0000 (18:49 +0900)
Change-Id: Id5d517173e68145d26474666ae660bbe6cf9bcc7

packaging/tel-plugin-atmodem.spec
src/s_call.c

index 4219cb08a93f0afa0029be5b27112d35141345f4..0a6ac8b8d44dc3f3a345f9e1b721544b1748ff1f 100644 (file)
@@ -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
index 859e45e9240acab1ab1ce15621663c7badbe5c2c..256a75085ebc9ffde4dcf4f3f8f6d8e5a3a0e399 100644 (file)
@@ -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 );