Add new APIs 30/55930/4
authorWootak Jung <wootak.jung@samsung.com>
Wed, 30 Dec 2015 08:15:18 +0000 (17:15 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 31 Dec 2015 07:22:13 +0000 (16:22 +0900)
- get sim lock state
- get gid1
- get sim call forwarding state
- register sim call forwarding state

Change-Id: Ie221eb401946820b67689a036c2fc79e696647aa

include/telephony_call.h
include/telephony_common.h
include/telephony_modem.h
include/telephony_network.h
include/telephony_sim.h
packaging/capi-telephony.spec
src/telephony_common.c
src/telephony_sim.c
test/test_all_api.c

index 1264c0d0f2dab1949b13d5af5287927afe12de50..1d300479e380db72d6fa143d8935e00e0bb2a821 100644 (file)
@@ -244,7 +244,7 @@ int telephony_call_get_handle_id(telephony_call_h call_handle, unsigned int *han
  *
  * @since_tizen 2.4
  *
- * @remarks You must release @c number using free().
+ * @remarks You must release @c number using free() on success case.
  *
  * @param[in] call_handle The handle from #telephony_call_get_call_list()
  * @param[out] number The number of the call
index 2693509beae5710aa8026ea1e2be7b503b11e9c0..12455cdd4fee8e35906717ce9e63f1cc43305a9c 100644 (file)
@@ -75,6 +75,7 @@ typedef enum {
  */
 typedef enum  {
     TELEPHONY_NOTI_SIM_STATUS = 0x10,            /**< Notification to be invoked when the SIM card state changes, '#telephony_sim_state_e' will be delivered in notification data */
+    TELEPHONY_NOTI_SIM_CALL_FORWARDING_STATE, /**< Notification to be invoked when the SIM call forwarding state changes, 'call_forwarding_state(bool)' will be delivered in notification data (@b Since: 3.0) */
 
     TELEPHONY_NOTI_NETWORK_SERVICE_STATE = 0x20, /**< Notification to be invoked when the network service state changes, '#telephony_network_service_state_e' will be delivered in notification data */
     TELEPHONY_NOTI_NETWORK_CELLID,               /**< Notification to be invoked when the cell ID changes, 'cell_id(int)' will be delivered in notification data */
index b8f77e13ec3137d644f76d3c6da607fa5d3d5edb..7e8d15c5cd08c33dfba9b00eb681648b9c069f19 100644 (file)
@@ -55,7 +55,7 @@ typedef enum
  * @privlevel public
  * @privilege %http://tizen.org/privilege/telephony
  *
- * @remarks You must release @c imei using free().
+ * @remarks You must release @c imei using free() on success case.
  *
  * @param[in] handle The handle from telephony_init()
  * @param[out] imei The International Mobile Station Equipment Identity
index dfff3c41bbf878f59b34dac88f328846375b907b..b6958f8c41ea30f09d608fe7688a495f38144e75 100644 (file)
@@ -231,7 +231,7 @@ int telephony_network_get_roaming_status(telephony_h handle, bool *status);
  * @privlevel public
  * @privilege %http://tizen.org/privilege/telephony
  *
- * @remarks You must release @c mcc using free().
+ * @remarks You must release @c mcc using free() on success case.
  *
  * @param[in] handle The handle from telephony_init()
  * @param[out] mcc The Mobile Country Code (three digits)
@@ -259,7 +259,7 @@ int telephony_network_get_mcc(telephony_h handle, char **mcc);
  * @privlevel public
  * @privilege %http://tizen.org/privilege/telephony
  *
- * @remarks You must release @c mnc using free().
+ * @remarks You must release @c mnc using free() on success case.
  *
  * @param[in] handle The handle from telephony_init()
  * @param[out] mnc The Mobile Network Code (three digits)
@@ -287,7 +287,7 @@ int telephony_network_get_mnc(telephony_h handle, char **mnc);
  * @privlevel public
  * @privilege %http://tizen.org/privilege/telephony
  *
- * @remarks You must release @c network_name using free().
+ * @remarks You must release @c network_name using free() on success case.
  *
  * @param[in] handle The handle from telephony_init()
  * @param[out] network_name The name of the current registered network
index 994c755ae1b0949804ed65adf6c0f9f4a6675124..98e1d42de5f69647be6b17b05143f280fafbfc6b 100644 (file)
  * @brief Enumeration for the state of SIM card.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  */
-typedef enum
-{
-    TELEPHONY_SIM_STATE_UNAVAILABLE, /**< SIM is not available on this device */
-    TELEPHONY_SIM_STATE_LOCKED,      /**< SIM is locked */
-    TELEPHONY_SIM_STATE_AVAILABLE,   /**< SIM is available on this device */
-    TELEPHONY_SIM_STATE_UNKNOWN,     /**< SIM is in transition between states */
+typedef enum {
+       TELEPHONY_SIM_STATE_UNAVAILABLE, /**< SIM is not available on this device */
+       TELEPHONY_SIM_STATE_LOCKED,      /**< SIM is locked */
+       TELEPHONY_SIM_STATE_AVAILABLE,   /**< SIM is available on this device */
+       TELEPHONY_SIM_STATE_UNKNOWN,     /**< SIM is in transition between states */
 } telephony_sim_state_e;
 
+/**
+ * @brief Enumeration for the lock state of SIM card.
+ * @since_tizen 3.0
+ */
+typedef enum {
+       TELEPHONY_SIM_LOCK_STATE_UNKNOWN, /**< SIM is not in lock */
+       TELEPHONY_SIM_LOCK_STATE_PIN_REQUIRED, /**< SIM is PIN(Personal Identification Number) locked */
+       TELEPHONY_SIM_LOCK_STATE_PUK_REQUIRED, /**< SIM is PUK(Personal Unblocking Code) locked */
+       TELEPHONY_SIM_LOCK_STATE_PERM_LOCKED, /**< SIM is permanently blocked(All the attempts for PIN/PUK failed) */
+       TELEPHONY_SIM_LOCK_STATE_NCK_REQUIRED, /**< SIM is NCK(Network Control Key) locked */
+       TELEPHONY_SIM_LOCK_STATE_NSCK_REQUIRED, /**< SIM is NSCK(Network Subset Control Key) locked */
+       TELEPHONY_SIM_LOCK_STATE_SPCK_REQUIRED, /**< SIM is SPCK(Service Provider Control Key) locked */
+       TELEPHONY_SIM_LOCK_STATE_CCK_REQUIRED, /**< SIM is CCK(Corporate Control Key) locked */
+       TELEPHONY_SIM_LOCK_STATE_PHONE_REQUIRED /**< SIM is PH-SIM(Phone-SIM) locked */
+} telephony_sim_lock_state_e;
 
 /**
  * @brief Enumeration for the type of SIM card .
@@ -66,7 +80,7 @@ typedef enum {
  * @privlevel public
  * @privilege %http://tizen.org/privilege/telephony
  *
- * @remarks You must release @c icc_id using free().
+ * @remarks You must release @c icc_id using free() on success case.
  *
  * @param[in] handle The handle from telephony_init()
  * @param[out] icc_id The Integrated Circuit Card Identification
@@ -95,7 +109,7 @@ int telephony_sim_get_icc_id(telephony_h handle, char **icc_id);
  * @privlevel public
  * @privilege %http://tizen.org/privilege/telephony
  *
- * @remarks You must release @c sim_operator using free().
+ * @remarks You must release @c sim_operator using free() on success case.
  *
  * @param[in] handle The handle from telephony_init()
  * @param[out] sim_operator The SIM Operator
@@ -124,7 +138,7 @@ int telephony_sim_get_operator(telephony_h handle, char **sim_operator);
  * @privlevel public
  * @privilege %http://tizen.org/privilege/telephony
  *
- * @remarks You must release @c msin using free().
+ * @remarks You must release @c msin using free() on success case.
  *
  * @param[in] handle The handle from telephony_init()
  * @param[out] msin The Mobile Subscription Identification Number
@@ -154,7 +168,7 @@ int telephony_sim_get_msin(telephony_h handle, char **msin);
  * @privlevel public
  * @privilege %http://tizen.org/privilege/telephony
  *
- * @remarks You must release @c spn using free().
+ * @remarks You must release @c spn using free() on success case.
  *
  * @param[in] handle The handle from telephony_init()
  * @param[out] spn The Service Provider Name
@@ -258,7 +272,7 @@ int telephony_sim_get_application_list(telephony_h handle, unsigned int *app_lis
  * @privlevel public
  * @privilege %http://tizen.org/privilege/telephony
  *
- * @remarks You must release @c subscriber_number using free().
+ * @remarks You must release @c subscriber_number using free() on success case.
  *
  * @param[in] handle The handle from telephony_init()
  * @param[out] subscriber_number The subscriber number in the SIM
@@ -287,7 +301,7 @@ int telephony_sim_get_subscriber_number(telephony_h handle, char **subscriber_nu
  * @privlevel public
  * @privilege %http://tizen.org/privilege/telephony
  *
- * @remarks You must release @c subscriber_id using free().
+ * @remarks You must release @c subscriber_id using free() on success case.
  *
  * @param[in] handle The handle from telephony_init()
  * @param[out] subscriber_id The subscriber ID
@@ -305,12 +319,93 @@ int telephony_sim_get_subscriber_number(telephony_h handle, char **subscriber_nu
  */
 int telephony_sim_get_subscriber_id(telephony_h handle, char **subscriber_id);
 
+/**
+ * @brief Gets the lock state of the SIM.
+ * @details This function gets SIM card lock state.
+ *          If SIM state is #TELEPHONY_SIM_STATE_LOCKED, you can use this function to retrieve lock state.
+ *
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/telephony
+ *
+ * @param[in] handle The handle from telephony_init()
+ * @param[out] lock_state The current lock state of the SIM
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #TELEPHONY_ERROR_NONE              Successful
+ * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Out of memory
+ * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #TELEPHONY_ERROR_NOT_SUPPORTED     Not supported
+ * @retval #TELEPHONY_ERROR_OPERATION_FAILED  Invalid parameter
+ *
+ * @pre The SIM state must be #TELEPHONY_SIM_STATE_LOCKED.
+ *
+ * @see telephony_sim_get_state()
+ */
+int telephony_sim_get_lock_state(telephony_h handle, telephony_sim_lock_state_e *lock_state);
+
+/**
+ * @brief Gets the Group Identifier Level 1(GID1).
+ * @details This function gets Group Identifier Level 1(GID1) embedded in the SIM card.
+ *          If this value is not stored in SIM card, @c NULL will be returned.
+ *
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/telephony
+ *
+ * @remarks You must release @c gid1 using free() on success case.
+ *
+ * @param[in] handle The handle from telephony_init()
+ * @param[out] gid1 The GID1
+ *
+ * @retval #TELEPHONY_ERROR_NONE              Successful
+ * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Out of memory
+ * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #TELEPHONY_ERROR_NOT_SUPPORTED     Not supported
+ * @retval #TELEPHONY_ERROR_OPERATION_FAILED  Invalid parameter
+ * @retval #TELEPHONY_ERROR_SIM_NOT_AVAILABLE SIM is not available
+ *
+ * @pre The SIM state must be #TELEPHONY_SIM_STATE_AVAILABLE.
+ *
+ * @see telephony_sim_get_state()
+ */
+int telephony_sim_get_gid1(telephony_h handle, char **gid1);
+
+/**
+ * @brief Gets the call fowarding state of the SIM.
+ * @details If the state is true, incoming call will be forwareded to selected number.
+ *
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/telephony
+ *
+ * @param[in] handle The handle from telephony_init()
+ * @param[out] call_forwarding_state The value whether incoming call will be forwarded or not.
+ *                                   (true: forwared, false: not forwared)
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #TELEPHONY_ERROR_NONE              Successful
+ * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Out of memory
+ * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #TELEPHONY_ERROR_NOT_SUPPORTED     Not supported
+ * @retval #TELEPHONY_ERROR_OPERATION_FAILED  Invalid parameter
+ *
+ * @pre The SIM state must be #TELEPHONY_SIM_STATE_LOCKED.
+ *
+ * @see telephony_sim_get_state()
+ */
+int telephony_sim_get_call_forwarding_state(telephony_h handle, bool *call_forwarding_state);
+
 /**
  * @}
  */
 
 #ifdef __cplusplus
- }
+}
 #endif
 
-#endif // __CAPI_TELEPHONY_SIM_H__
+#endif /* __CAPI_TELEPHONY_SIM_H__ */
index e6784bd303f73acf8a87c900ffdbc8ceaba395cd..1bafad5d4cbe8536e3896e5da8e9816bde7b3e19 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-telephony
 Summary:    Telephony Core API
-Version:    0.1.49
+Version:    0.1.50
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index a63e5dc34f0a30d61dad0ffc43da852f53851b5e..8073a26672377223979361a7105ad17c37536376 100644 (file)
@@ -77,6 +77,8 @@ static const char *_mapping_noti_id(telephony_noti_e noti_id)
        switch (noti_id) {
        case TELEPHONY_NOTI_SIM_STATUS:
                return TAPI_NOTI_SIM_STATUS;
+       case TELEPHONY_NOTI_SIM_CALL_FORWARDING_STATE:
+               return TAPI_PROP_SIM_CALL_FORWARD_STATE;
        case TELEPHONY_NOTI_NETWORK_SERVICE_STATE:
                return TAPI_PROP_NETWORK_SERVICE_TYPE;
        case TELEPHONY_NOTI_NETWORK_CELLID:
@@ -247,6 +249,9 @@ static void on_signal_callback(TapiHandle *tapi_h, const char *evt_id,
        if (!g_strcmp0(evt_id, TAPI_NOTI_SIM_STATUS)) {
                int sim_status = _mapping_sim_status(*(TelSimCardStatus_t *)data);
                CALLBACK_CALL(&sim_status);
+       } else if (!g_strcmp0(evt_id, TAPI_PROP_SIM_CALL_FORWARD_STATE)) {
+               bool call_forwarding_state = *(bool *)data;
+               CALLBACK_CALL(&call_forwarding_state);
        } else if (!g_strcmp0(evt_id, TAPI_PROP_NETWORK_SERVICE_TYPE)) {
                int service_state = _mapping_service_state(*(int *)data);
                CALLBACK_CALL(&service_state);
index b09618370b9c59e2a84bc28a0b0ebd7e03f61413..fb69829a2db7b63e9389d86f79510736783f5400 100644 (file)
@@ -305,13 +305,13 @@ int telephony_sim_get_state(telephony_h handle, telephony_sim_state_e *sim_state
        switch (sim_card_state) {
        case TAPI_SIM_STATUS_CARD_ERROR:
        case TAPI_SIM_STATUS_CARD_NOT_PRESENT:
-       case TAPI_SIM_STATUS_CARD_BLOCKED:
        case TAPI_SIM_STATUS_CARD_REMOVED:
        case TAPI_SIM_STATUS_CARD_CRASHED:
                *sim_state = TELEPHONY_SIM_STATE_UNAVAILABLE;
                break;
        case TAPI_SIM_STATUS_SIM_PIN_REQUIRED:
        case TAPI_SIM_STATUS_SIM_PUK_REQUIRED:
+       case TAPI_SIM_STATUS_CARD_BLOCKED:
        case TAPI_SIM_STATUS_SIM_NCK_REQUIRED:
        case TAPI_SIM_STATUS_SIM_NSCK_REQUIRED:
        case TAPI_SIM_STATUS_SIM_SPCK_REQUIRED:
@@ -460,3 +460,137 @@ int telephony_sim_get_subscriber_id(telephony_h handle, char **subscriber_id)
 
        return error_code;
 }
+
+int telephony_sim_get_lock_state(telephony_h handle, telephony_sim_lock_state_e *lock_state)
+{
+       TelSimCardStatus_t sim_card_state;
+       int error_code = TELEPHONY_ERROR_NONE;
+       TapiHandle *tapi_h;
+
+       CHECK_TELEPHONY_SUPPORTED(TELEPHONY_FEATURE);
+       CHECK_INPUT_PARAMETER(handle);
+       tapi_h = ((telephony_data *)handle)->tapi_h;
+       CHECK_INPUT_PARAMETER(tapi_h);
+       CHECK_INPUT_PARAMETER(lock_state);
+       GET_SIM_STATUS(tapi_h, sim_card_state);
+
+       switch (sim_card_state) {
+       case TAPI_SIM_STATUS_SIM_PIN_REQUIRED:
+               *lock_state = TELEPHONY_SIM_LOCK_STATE_PIN_REQUIRED;
+               break;
+       case TAPI_SIM_STATUS_SIM_PUK_REQUIRED:
+               *lock_state = TELEPHONY_SIM_LOCK_STATE_PUK_REQUIRED;
+               break;
+       case TAPI_SIM_STATUS_CARD_BLOCKED:
+               *lock_state = TELEPHONY_SIM_LOCK_STATE_PERM_LOCKED;
+               break;
+       case TAPI_SIM_STATUS_SIM_NCK_REQUIRED:
+               *lock_state = TELEPHONY_SIM_LOCK_STATE_NCK_REQUIRED;
+               break;
+       case TAPI_SIM_STATUS_SIM_NSCK_REQUIRED:
+               *lock_state = TELEPHONY_SIM_LOCK_STATE_NSCK_REQUIRED;
+               break;
+       case TAPI_SIM_STATUS_SIM_SPCK_REQUIRED:
+               *lock_state = TELEPHONY_SIM_LOCK_STATE_SPCK_REQUIRED;
+               break;
+       case TAPI_SIM_STATUS_SIM_CCK_REQUIRED:
+               *lock_state = TELEPHONY_SIM_LOCK_STATE_CCK_REQUIRED;
+               break;
+       case TAPI_SIM_STATUS_SIM_LOCK_REQUIRED:
+               *lock_state = TELEPHONY_SIM_LOCK_STATE_PHONE_REQUIRED;
+               break;
+       default:
+               *lock_state = TELEPHONY_SIM_LOCK_STATE_UNKNOWN;
+               break;
+       }
+
+       return error_code;
+}
+
+int telephony_sim_get_gid1(telephony_h handle, char **gid1)
+{
+       int error_code = TELEPHONY_ERROR_NONE;
+       TelSimCardStatus_t sim_card_state = TAPI_SIM_STATUS_UNKNOWN;
+       TapiHandle *tapi_h;
+
+       CHECK_TELEPHONY_SUPPORTED(TELEPHONY_FEATURE);
+       CHECK_INPUT_PARAMETER(handle);
+       tapi_h = ((telephony_data *)handle)->tapi_h;
+       CHECK_INPUT_PARAMETER(tapi_h);
+       CHECK_INPUT_PARAMETER(gid1);
+       GET_SIM_STATUS(tapi_h, sim_card_state);
+
+       *gid1 = NULL;
+       if (sim_card_state != TAPI_SIM_STATUS_SIM_INIT_COMPLETED) {
+               error_code = TELEPHONY_ERROR_SIM_NOT_AVAILABLE;
+       } else {
+               GError *gerr = NULL;
+               TelSimAccessResult_t result = TAPI_SIM_ACCESS_SUCCESS;
+               GVariant *sync_gv = NULL;
+               GVariant *gid_gv = NULL;
+               GVariant *inner_gv = NULL;
+               GVariantIter *iter = NULL;
+               TelSimGid_t tel_gid;
+               int i = 0;
+               guchar value = 0;
+
+               sync_gv = g_dbus_connection_call_sync(tapi_h->dbus_connection,
+                       DBUS_TELEPHONY_SERVICE, tapi_h->path, DBUS_TELEPHONY_SIM_INTERFACE,
+                       "GetGID", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, &gerr);
+
+               if (sync_gv) {
+                       g_variant_get(sync_gv, "(ii@v)", &result, &tel_gid.GroupIdentifierLen, &gid_gv);
+                       if (result == TAPI_SIM_ACCESS_SUCCESS) {
+                               inner_gv = g_variant_get_variant(gid_gv);
+                               g_variant_get(inner_gv, "ay", &iter);
+                               while (g_variant_iter_loop(iter, "y", &value) && i < TAPI_SIM_GROUP_IDENTIFIER_LEN_MAX) {
+                                       tel_gid.szGroupIdentifier[i] = value;
+                                       i++;
+                               }
+                               *gid1 = malloc(tel_gid.GroupIdentifierLen * 2 + 1);
+                               for (i = 0; i < tel_gid.GroupIdentifierLen; i++) {
+                                       snprintf(*gid1 + (i * 2), 3, "%02x", tel_gid.szGroupIdentifier[i]);
+                               }
+                               g_variant_iter_free(iter);
+                               g_variant_unref(inner_gv);
+                               g_variant_unref(gid_gv);
+                       } else {
+                               error_code = TELEPHONY_ERROR_OPERATION_FAILED;
+                       }
+               } else {
+                       LOGE("g_dbus_conn failed. error (%s)", gerr->message);
+                       error_code = _convert_dbus_errmsg_to_sim_error(gerr->message);
+                       g_error_free(gerr);
+               }
+       }
+
+       return error_code;
+}
+
+int telephony_sim_get_call_forwarding_state(telephony_h handle, bool *call_forwarding_state)
+{
+       int error_code;
+       TapiHandle *tapi_h;
+       int tel_state;
+
+       CHECK_TELEPHONY_SUPPORTED(TELEPHONY_FEATURE);
+       CHECK_INPUT_PARAMETER(handle);
+       tapi_h = ((telephony_data *)handle)->tapi_h;
+       CHECK_INPUT_PARAMETER(tapi_h);
+       CHECK_INPUT_PARAMETER(call_forwarding_state);
+
+       error_code = tel_get_property_int(tapi_h, TAPI_PROP_SIM_CALL_FORWARD_STATE, &tel_state);
+       if (error_code == TAPI_API_SUCCESS) {
+               *call_forwarding_state = (bool)tel_state;
+               LOGI("call_forwarding_state: [%s]", *call_forwarding_state ? "ON" : "OFF");
+               error_code = TELEPHONY_ERROR_NONE;
+       } else if (error_code == TAPI_API_ACCESS_DENIED) {
+               LOGE("PERMISSION_DENIED");
+               error_code = TELEPHONY_ERROR_PERMISSION_DENIED;
+       } else {
+               LOGE("OPERATION_FAILED");
+               error_code = TELEPHONY_ERROR_OPERATION_FAILED;
+       }
+
+       return error_code;
+}
index c5b454d50d1782c0e5401590faa4b6990a2aae65..e03f80b7701945e3c3de3794019c7ece626cece8 100644 (file)
 static GMainLoop *event_loop;
 static telephony_handle_list_s handle_list;
 
+static int sim_noti_tbl[] = {
+       TELEPHONY_NOTI_SIM_STATUS,
+       TELEPHONY_NOTI_SIM_CALL_FORWARDING_STATE
+};
+
 static int network_noti_tbl[] = {
        TELEPHONY_NOTI_NETWORK_SERVICE_STATE,
        TELEPHONY_NOTI_NETWORK_CELLID,
@@ -319,6 +324,9 @@ int main()
        char *subscriber_number = NULL;
        char *subscriber_id = NULL;
        bool is_changed = FALSE;
+       telephony_sim_lock_state_e lock_state = 0;
+       char *gid1 = NULL;
+       bool call_forwarding_state = FALSE;
 
        /* Network value */
        int cell_id = 0;
@@ -430,6 +438,28 @@ int main()
                free(subscriber_id);
        }
 
+       ret_value = telephony_sim_get_lock_state(handle_list.handle[0], &lock_state);
+       if (ret_value != TELEPHONY_ERROR_NONE) {
+               LOGE("telephony_sim_get_lock_state() failed!!! [%d]", ret_value);
+       } else {
+               LOGI("Lock state is [%d]", lock_state);
+       }
+
+       ret_value = telephony_sim_get_gid1(handle_list.handle[0], &gid1);
+       if (ret_value != TELEPHONY_ERROR_NONE) {
+               LOGE("telephony_sim_get_gid1() failed!!! [%d]", ret_value);
+       } else {
+               LOGI("GID1 is [%s]", gid1);
+               free(gid1);
+       }
+
+       ret_value = telephony_sim_get_call_forwarding_state(handle_list.handle[0], &call_forwarding_state);
+       if (ret_value != TELEPHONY_ERROR_NONE) {
+               LOGE("telephony_sim_get_call_forwarding_state() failed!!! [%d]", ret_value);
+       } else {
+               LOGI("Call forwarding state is [%s]", call_forwarding_state ? "ON" : "OFF");
+       }
+
        /* Network API */
        ret_value = telephony_network_get_cell_id(handle_list.handle[0], &cell_id);
        if (ret_value != TELEPHONY_ERROR_NONE)
@@ -576,9 +606,11 @@ int main()
                LOGI("Modem power status is [%d] (0=on,1=off,2=rst,3=low)", power_status);
 
        /* set_noti_cb */
-       ret_value = telephony_set_noti_cb(handle_list.handle[0], TELEPHONY_NOTI_SIM_STATUS, sim_noti_cb, NULL);
-       if (ret_value != TELEPHONY_ERROR_NONE)
-               LOGE("Set noti failed!!!");
+       for (i = 0; i < (sizeof(sim_noti_tbl) / sizeof(int)); i++) {
+               ret_value = telephony_set_noti_cb(handle_list.handle[0], sim_noti_tbl[i], sim_noti_cb, NULL);
+               if (ret_value != TELEPHONY_ERROR_NONE)
+                       LOGE("Set noti failed!!!");
+       }
 
        for (i = 0; i < (sizeof(network_noti_tbl) / sizeof(int)); i++) {
                ret_value = telephony_set_noti_cb(handle_list.handle[0], network_noti_tbl[i], network_noti_cb, NULL);
@@ -608,9 +640,11 @@ int main()
        event_loop = g_main_loop_new(NULL, FALSE);
        g_main_loop_run(event_loop);
 
-       ret_value = telephony_unset_noti_cb(handle_list.handle[0], TELEPHONY_NOTI_SIM_STATUS);
-       if (ret_value != TELEPHONY_ERROR_NONE)
-               LOGE("Unset noti failed!!!");
+       for (i = 0; i < (sizeof(sim_noti_tbl) / sizeof(int)); i++) {
+               ret_value = telephony_unset_noti_cb(handle_list.handle[0], sim_noti_tbl[i]);
+               if (ret_value != TELEPHONY_ERROR_NONE)
+                       LOGE("Unset noti failed!!!");
+       }
 
        for (i = 0; i < (sizeof(network_noti_tbl) / sizeof(int)); i++) {
                ret_value = telephony_unset_noti_cb(handle_list.handle[0], network_noti_tbl[i]);