Defining volte state variables 31/53831/2
authorSuresh Kumar N <suresh.n@samsung.com>
Wed, 9 Dec 2015 14:30:11 +0000 (20:00 +0530)
committerSuresh Kumar N <suresh.n@samsung.com>
Thu, 10 Dec 2015 10:11:47 +0000 (15:41 +0530)
Change-Id: I59524480b7d3d8a31a65ddebc0b71fe8c1aa6cf6

include/TelCall.h
include/tapi_event.h
src/tapi_call.c
src/tapi_common.c
test_src/call.c
test_src/network.c

index d5780fb0cce0627948afe1630ea968b97951c0ce..69b32eced698de6e72c9f9025ce9e06aa02e1243 100644 (file)
@@ -690,6 +690,7 @@ typedef struct {
        TelCallType_t CallType; /**< Type of call (voice, data, emergency) */
        TelCallStates_t CallState;      /**< Current Call state */
        int bConferenceState;   /**< Whether Call is in Conference */
+       int bVolteCall;                                                 /**< Whether Call is volte call */
 } TelCallStatus_t;
 
 /**
index a1a6662a05438564aca9584297b9d3c0b083b478..fa5633d238833e8805fafefce86e6ace21f8c45e 100644 (file)
@@ -677,11 +677,18 @@ __BEGIN_DECLS
 
 /**
  * @brief Definition for network ims voice support status notification
- * @since_tizen TBD
- * @remarks TBD
+ * @since_tizen 2.4
+ * @remarks 'int' (0: Not available, 1: Available) will be stored
  */
 #define TAPI_PROP_NETWORK_IMS_VOICE_SUPPORT_STATUS     DBUS_TELEPHONY_NETWORK_INTERFACE":ims_voice_status"
 
+/**
+ * @brief Definition for network volte enable status notification
+ * @since_tizen 2.4
+ * @remarks 'int' (0: Not available, 1: Available) will be stored
+ */
+#define TAPI_PROP_NETWORK_VOLTE_ENABLE                 DBUS_TELEPHONY_NETWORK_INTERFACE":volte_enable"
+
 /**
  * @brief Definition for the Ss interface
  */
index 89b0f4764ea113e5778dd773459b4a8b0ba6b88a..812ae403e04975acc7b5677345538bd522da7b63 100644 (file)
@@ -463,7 +463,6 @@ static void on_response_set_preferred_voice_subscription(GObject *source_object,
        g_variant_unref(dbus_result);
 }
 
-
 EXPORT_API int tel_dial_call(TapiHandle *handle, const TelCallDial_t *pParams, tapi_response_cb callback, void *user_data)
 {
        struct tapi_resp_data *evt_cb_data = 0;
@@ -769,6 +768,7 @@ EXPORT_API int tel_get_call_status(TapiHandle *handle, int callHandle, TelCallSt
        gboolean call_direction = FALSE;
        gint call_state = 0;
        gboolean call_multiparty_state = FALSE;
+       gboolean volte_call = FALSE;
 
        TAPI_RET_ERR_NUM_IF_FAIL(handle, TAPI_API_INVALID_PTR);
        TAPI_RET_ERR_NUM_IF_FAIL(out, TAPI_API_INVALID_PTR);
@@ -782,7 +782,9 @@ EXPORT_API int tel_get_call_status(TapiHandle *handle, int callHandle, TelCallSt
                        "GetStatus", param, 0, G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, handle->ca, &gerr);
 
        if (gv) {
-               g_variant_get(gv, "(isibibb)", &callHandle, &call_number, &call_type, &call_direction, &call_state, &call_multiparty_state);
+               g_variant_get(gv, "(isibibb)",  &callHandle,
+                       &call_number, &call_type, &call_direction,
+                       &call_state, &call_multiparty_state, &volte_call);
 
                out->CallHandle = (int)callHandle;
                out->bMoCall = (int)call_direction;
@@ -793,6 +795,7 @@ EXPORT_API int tel_get_call_status(TapiHandle *handle, int callHandle, TelCallSt
                out->CallType = (TelCallType_t)call_type;
                out->CallState = (TelCallStates_t)call_state;
                out->bConferenceState = (int)call_multiparty_state;
+               out->bVolteCall = (int)volte_call;
 
                g_free(call_number);
                g_variant_unref(gv);
@@ -828,6 +831,7 @@ EXPORT_API int tel_get_call_status_all(TapiHandle *handle, TelCallStatusCallback
                gchar *key = 0;
                GVariant *value = 0;
 
+               memset(&data, 0x0, sizeof(TelCallStatus_t));
                g_variant_get(gv, "(aa{sv})", &iter);
 
                while (g_variant_iter_next(iter, "a{sv}", &iter_row)) {
@@ -844,6 +848,8 @@ EXPORT_API int tel_get_call_status_all(TapiHandle *handle, TelCallStatusCallback
                                        data.CallState = (int)g_variant_get_int32(value);
                                else if (!g_strcmp0(key, "call_multiparty_state"))
                                        data.bConferenceState = (int)g_variant_get_boolean(value);
+                               else if (!g_strcmp0(key, "is_volte_call"))
+                                       data.bVolteCall = (int)g_variant_get_boolean(value);
                        }
                        g_variant_iter_free(iter_row);
 
@@ -1076,4 +1082,3 @@ EXPORT_API int tel_get_call_preferred_voice_subscription(TapiHandle *handle, Tel
 
        return ret;
 }
-
index 580aa5e4064d66dade50cff58ff32e24b01016a2..1411fd307d231a0ffae6eac91196a9dc4f09b958 100644 (file)
@@ -232,52 +232,52 @@ static void _process_call_event(const gchar *sig, GVariant *param,
                TelCallInfoWaitingNoti_t data;
                g_variant_get(param, "(i)", &data.id);
                msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Waiting noti", data.id);
-               TAPI_INVOKE_NOTI_CALLBACK(&data.id);
+               TAPI_INVOKE_NOTI_CALLBACK(&data);
        } else if (!g_strcmp0(sig, "Forwarded")) {
                TelCallInfoForwardedNoti_t data;
                g_variant_get(param, "(i)", &data.id);
                msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Forwarded noti", data.id);
-               TAPI_INVOKE_NOTI_CALLBACK(&data.id);
+               TAPI_INVOKE_NOTI_CALLBACK(&data);
        } else if (!g_strcmp0(sig, "ForwardedCall")) {
                TelCallInfoForwardedCallNoti_t data;
                g_variant_get(param, "(i)", &data.id);
                dbg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Forwarded Call noti", data.id);
-               TAPI_INVOKE_NOTI_CALLBACK(&data.id);
+               TAPI_INVOKE_NOTI_CALLBACK(&data);
        } else if (!g_strcmp0(sig, "BarredIncoming")) {
                TelCallInfoBarredIncomingNoti_t data;
                g_variant_get(param, "(i)", &data.id);
                msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Barred Incoming noti", data.id);
-               TAPI_INVOKE_NOTI_CALLBACK(&data.id);
+               TAPI_INVOKE_NOTI_CALLBACK(&data);
        } else if (!g_strcmp0(sig, "BarredOutgoing")) {
                TelCallInfoBarredOutgoingNoti_t data;
                g_variant_get(param, "(i)", &data.id);
                msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Barred Outgoing noti", data.id);
-               TAPI_INVOKE_NOTI_CALLBACK(&data.id);
+               TAPI_INVOKE_NOTI_CALLBACK(&data);
        } else if (!g_strcmp0(sig, "ForwardConditional")) {
                TelCallInfoForwardConditionalNoti_t data;
                g_variant_get(param, "(i)", &data.id);
                msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Forward Conditional noti", data.id);
-               TAPI_INVOKE_NOTI_CALLBACK(&data.id);
+               TAPI_INVOKE_NOTI_CALLBACK(&data);
        } else if (!g_strcmp0(sig, "ForwardUnconditional")) {
                TelCallInfoForwardUnconditionalNoti_t data;
                g_variant_get(param, "(i)", &data.id);
                msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Forward Unconditional noti", data.id);
-               TAPI_INVOKE_NOTI_CALLBACK(&data.id);
+               TAPI_INVOKE_NOTI_CALLBACK(&data);
        } else if (!g_strcmp0(sig, "CallActive")) {
                TelCallInfoActiveNoti_t data;
                g_variant_get(param, "(i)", &data.id);
                msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Call Active noti", data.id);
-               TAPI_INVOKE_NOTI_CALLBACK(&data.id);
+               TAPI_INVOKE_NOTI_CALLBACK(&data);
        } else if (!g_strcmp0(sig, "CallHeld")) {
                TelCallInfoHeldNoti_t data;
                g_variant_get(param, "(i)", &data.id);
                msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Call Held noti", data.id);
-               TAPI_INVOKE_NOTI_CALLBACK(&data.id);
+               TAPI_INVOKE_NOTI_CALLBACK(&data);
        } else if (!g_strcmp0(sig, "CallJoined")) {
                TelCallInfoJoinedNoti_t data;
                g_variant_get(param, "(i)", &data.id);
                msg("[ check ] (%s) %s : data.id(%d)", handle->cp_name, "Call Info Call Joined noti", data.id);
-               TAPI_INVOKE_NOTI_CALLBACK(&data.id);
+               TAPI_INVOKE_NOTI_CALLBACK(&data);
        } else if (!g_strcmp0(sig, "CallPrivacyMode")) {
                TelCallVoicePrivacyNoti_t data;
                g_variant_get(param, "(i)", &data.privacy_mode);
@@ -1124,12 +1124,10 @@ static void _process_oem_event(const gchar *sig, GVariant *param,
        if (!g_strcmp0(sig, "OemData")) {
                TelOemNotiData_t oem_data = {0};
                gchar *data = NULL;
-               gsize decoded_data_len = 0;
 
                g_variant_get(param, "(is)", &oem_data.oem_id, &data);
-               oem_data.data = g_base64_decode((const gchar *)data, &decoded_data_len);
+               oem_data.data = g_base64_decode((const gchar *)data, &oem_data.data_len);
                if (oem_data.data) {
-                       oem_data.data_len = (unsigned int)decoded_data_len;
                        msg("[%s] id:[%d] len:[%d]", handle->cp_name, oem_data.oem_id, oem_data.data_len);
                        TAPI_INVOKE_NOTI_CALLBACK(&oem_data);
 
index 5e709e650876ff69c5a4b2ef76b2dbcc9ffd497d..a81a3e3d11eb7cb1d6168aba46397506cbb9d20a 100644 (file)
@@ -84,7 +84,7 @@ static void call_status_callback(TelCallStatus_t *status, void *user_data)
        msg(" - type = %d", status->CallType);
        msg(" - state = %d[%s]", status->CallState, __get_call_state_string(status->CallState));
        msg(" - multiparty = %d", status->bConferenceState);
-
+       msg(" - volte = %d", status->bVolteCall);
 }
 
 static void on_noti_call_status_idle(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
index a8be2886653a87af8fa26d6338e8604081f2bd57..56e190d33417010eb2a9147b5dcb9230c1045c7f 100644 (file)
@@ -198,6 +198,17 @@ static void on_prop_ims_voice_status(TapiHandle *handle, const char *noti_id, vo
                msg(" - ims_voice_support_status = %d", *status);
 }
 
+static void on_noti_volte_enable(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+{
+       int *status = data;
+
+       msg("");
+       msgp("property(%s) receive !!", TAPI_PROP_NETWORK_VOLTE_ENABLE);
+
+       if (status != NULL)
+               msg(" - volte_enable = %d", *status);
+}
+
 static void on_noti_registration_status(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
 {
        TelNetworkRegistrationStatus_t *noti = data;
@@ -1177,4 +1188,9 @@ void register_network_event(TapiHandle *handle)
                        TAPI_PROP_NETWORK_IMS_VOICE_SUPPORT_STATUS, on_prop_ims_voice_status, NULL);
        if (ret != TAPI_API_SUCCESS)
                msg("event register failed(%d)", ret);
+
+       ret = tel_register_noti_event (handle,
+                       TAPI_PROP_NETWORK_VOLTE_ENABLE, on_noti_volte_enable, NULL);
+       if (ret != TAPI_API_SUCCESS)
+               msg("event register failed(%d)", ret);
 }