release tizen_2.0 beta
[framework/telephony/tel-plugin-socket_communicator.git] / plugin / src / socket_sim.c
index fe95de9..2a156c6 100644 (file)
 #include "tapi_common.h"
 #include "module_req.h"
 
+static gchar* _convert_access_result_to_string(enum tel_sim_access_result rt)
+{
+       gchar *string_rt = NULL;
+       switch (rt) {
+               case SIM_ACCESS_SUCCESS :
+                       string_rt = "ok\0";
+                       break;
+               case SIM_ACCESS_CARD_ERROR :
+                       string_rt = "card_error\0";
+                       break;
+               case SIM_ACCESS_FILE_NOT_FOUND :
+                       string_rt = "file_not_found\0";
+                       break;
+               case SIM_ACCESS_CONDITION_NOT_SATISFIED :
+                       string_rt = "condition_not_satisfied\0";
+                       break;
+               case SIM_ACCESS_FAILED :
+                       string_rt = "failed\0";
+                       break;
+               default :
+                       dbg("error - rt[%d] is not handled");
+                       string_rt = "failed\0";
+                       break;
+       }
+       return string_rt;
+}
+
 gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlugin *plugin, tapi_service_command_e cmd, gchar *data, void **outparam)
 {
        GSList *co_list = NULL;
@@ -46,37 +73,42 @@ gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlu
        UserRequest *ur = NULL;
        struct tcore_user_info ui = { 0, 0, 0, NULL,0,0, NULL };
        int ret = 0;
+       gboolean result = TRUE;
 
        gchar *tmp = NULL;
        int tmp_len = 0;
        struct _tapi_service_object out_o = {0,};
-       struct _sipc_marshal_object *in_o;
+       struct _sipc_marshal_object *in_o = NULL;
 
        co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_SIM);
        if (!co_list) {
                dbg("err-no sim core object list in current plugin");
-               return FALSE;
+               result = FALSE;
+               goto RETURN;
        }
 
        co_sim = (CoreObject *)co_list->data;
        if (!co_sim) {
                dbg("err-no sim core object in current plugin");
-               return FALSE;
+               result = FALSE;
+               goto RETURN;
        }
 
        g_slist_free(co_list);
 
-       if (cmd == TAPI_SERVICE_SIM_GET_SIMINITINFO || cmd == TAPI_SERVICE_SIM_GET_TYPE
-                       || cmd == TAPI_SERVICE_SIM_GET_IMSI ) {
-               /*synchronous data return case*/
-               out_o.cmd = cmd;
-               out_o.mo = sipc_util_marshal_object_create();
-       } else {
-               /*asynchronous data return case*/
+       dbg("request cmd[0x%x]",cmd);
+
+       out_o.cmd = cmd;
+       out_o.mo = sipc_util_marshal_object_create();
+
+       if ( cmd !=TAPI_SERVICE_SIM_GET_SIMINITINFO
+                       && cmd != TAPI_SERVICE_SIM_GET_TYPE
+                       && cmd != TAPI_SERVICE_SIM_GET_IMSI ) {
                ur = tcore_user_request_new(c, tcore_plugin_get_description(plugin)->name);
                if (!ur) {
                        dbg("err - ur creation failed");
-                       return FALSE;
+                       result = FALSE;
+                       goto RETURN;
                }
 
                ui.channel_id = ch_id;
@@ -84,9 +116,10 @@ gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlu
                tcore_user_request_set_user_info(ur, &ui);
 
                in_o = sipc_util_marshal_object_deserializer(data);
-               if(in_o){
-                       dbg("err - data deserializer failed");
-                       return FALSE;
+               if(!in_o){
+                       dbg("err - data deserializer failed, in_o is null");
+                       result = FALSE;
+                       goto RETURN;
                }
        }
 
@@ -99,24 +132,34 @@ gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlu
                                        SIPC_MARSHAL_DATA_INT_TYPE);
                        sipc_util_marshal_object_add_data(out_o.mo, "new_sim", &sim_changed,
                                        SIPC_MARSHAL_DATA_BOOLEAN_TYPE);
-                       tmp = sipc_util_marshal_object_serializer(out_o.mo);
-                       tmp_len = strlen(tmp);
-                       *outparam = g_new0(char, tmp_len+1);
-                       memcpy(*outparam, tmp, tmp_len);
-                       g_free(tmp);
                }
                        break;
 
                case TAPI_SERVICE_SIM_GET_TYPE : {
                        enum tel_sim_type type = SIM_TYPE_UNKNOWN;
+                       gchar *stype = NULL;
                        type = tcore_sim_get_type(co_sim);
-                       sipc_util_marshal_object_add_data(out_o.mo, "type", &type,
-                                       SIPC_MARSHAL_DATA_INT_TYPE);
-                       tmp = sipc_util_marshal_object_serializer(out_o.mo);
-                       tmp_len = strlen(tmp);
-                       *outparam = g_new0(char, tmp_len+1);
-                       memcpy(*outparam, tmp, tmp_len);
-                       g_free(tmp);
+                       switch (type) {
+                               case SIM_TYPE_UNKNOWN:
+                                       stype = "unknown";
+                                       break;
+                               case SIM_TYPE_GSM:
+                                       stype = "sim";
+                                       break;
+                               case SIM_TYPE_USIM:
+                                       stype = "usim";
+                                       break;
+                               case SIM_TYPE_RUIM:
+                                       stype = "ruim";
+                                       break;
+                               case SIM_TYPE_ISIM:
+                                       stype = "isim";
+                                       break;
+                               default:
+                                       break;
+                       }
+                       sipc_util_marshal_object_add_data(out_o.mo, "type", stype,
+                                       SIPC_MARSHAL_DATA_STRING_TYPE);
                }
                        break;
 
@@ -131,11 +174,6 @@ gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlu
                                                SIPC_MARSHAL_DATA_STRING_TYPE);
                                sipc_util_marshal_object_add_data(out_o.mo, "msin", n_imsi->msin,
                                                SIPC_MARSHAL_DATA_STRING_TYPE);
-                               tmp = sipc_util_marshal_object_serializer(out_o.mo);
-                               tmp_len = strlen(tmp);
-                               *outparam = g_new0(char, tmp_len+1);
-                               memcpy(*outparam, tmp, tmp_len);
-                               g_free(tmp);
                        }
                }
                        break;
@@ -154,10 +192,52 @@ gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlu
 
                case TAPI_SERVICE_SIM_SET_LANGUAGE : {
                        struct treq_sim_set_language set_language = { 0, };
-                       enum tel_sim_language_type      g_language;
-                       g_language = sipc_util_marshal_object_get_int(in_o, "language");
-
-                       set_language.language = g_language;
+                       gchar *g_language = NULL;
+                       g_language = sipc_util_marshal_object_get_string(in_o, "language");
+                       dbg("tmp - g_language[%s]",g_language);
+
+                       if (!g_strcmp0(g_language, "de")) {
+                               set_language.language = SIM_LANG_GERMAN;
+                       } else if (!g_strcmp0(g_language, "en")) {
+                               set_language.language = SIM_LANG_ENGLISH;
+                       } else if (!g_strcmp0(g_language, "it")) {
+                               set_language.language = SIM_LANG_ITALIAN;
+                       } else if (!g_strcmp0(g_language, "fr")) {
+                               set_language.language = SIM_LANG_FRENCH;
+                       } else if (!g_strcmp0(g_language, "es")) {
+                               set_language.language = SIM_LANG_SPANISH;
+                       } else if (!g_strcmp0(g_language, "nl")) {
+                               set_language.language = SIM_LANG_DUTCH;
+                       } else if (!g_strcmp0(g_language, "sv")) {
+                               set_language.language = SIM_LANG_SWEDISH;
+                       } else if (!g_strcmp0(g_language, "da")) {
+                               set_language.language = SIM_LANG_DANISH;
+                       } else if (!g_strcmp0(g_language, "pt")) {
+                               set_language.language = SIM_LANG_PORTUGUESE;
+                       } else if (!g_strcmp0(g_language, "fi")) {
+                               set_language.language = SIM_LANG_FINNISH;
+                       } else if (!g_strcmp0(g_language, "no")) {
+                               set_language.language = SIM_LANG_NORWEGIAN;
+                       } else if (!g_strcmp0(g_language, "el")) {
+                               set_language.language = SIM_LANG_GREEK;
+                       } else if (!g_strcmp0(g_language, "tr")) {
+                               set_language.language = SIM_LANG_TURKISH;
+                       } else if (!g_strcmp0(g_language, "hu")) {
+                               set_language.language = SIM_LANG_HUNGARIAN;
+                       } else if (!g_strcmp0(g_language, "pl")) {
+                               set_language.language = SIM_LANG_POLISH;
+                       } else if (!g_strcmp0(g_language, "ko")) {
+                               set_language.language = SIM_LANG_KOREAN;
+                       } else if (!g_strcmp0(g_language, "zh")) {
+                               set_language.language = SIM_LANG_CHINESE;
+                       } else if (!g_strcmp0(g_language, "ru")) {
+                               set_language.language = SIM_LANG_RUSSIAN;
+                       } else if (!g_strcmp0(g_language, "ja")) {
+                               set_language.language = SIM_LANG_JAPANESE;
+                       } else  {
+                               result = FALSE;
+                               goto RETURN;
+                       }
 
                        tcore_user_request_set_data(ur, sizeof(struct treq_sim_set_language), &set_language);
                        tcore_user_request_set_command(ur, TREQ_SIM_SET_LANGUAGE);
@@ -192,20 +272,44 @@ gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlu
                        tcore_user_request_set_command(ur, TREQ_SIM_GET_CPHS_INFO);
                        break;
 
+               case TAPI_SERVICE_SIM_GET_MSISDN :
+                       tcore_user_request_set_command(ur, TREQ_SIM_GET_MSISDN);
+                       break;
+
+               case TAPI_SERVICE_SIM_GET_OPLMNWACT :
+                       tcore_user_request_set_command(ur, TREQ_SIM_GET_OPLMNWACT);
+                       break;
+
                case TAPI_SERVICE_SIM_AUTHENTICATION : {
                        struct treq_sim_req_authentication req_auth = { 0, };
-                       enum tel_sim_auth_type g_auth_type;
+                       gchar *g_auth_type = NULL;
                        unsigned int g_autn_length;
-                       unsigned char *g_autn_data;
+                       unsigned char *g_autn_data = NULL;
                        unsigned int g_rand_length;
-                       unsigned char *g_rand_data;
-                       g_auth_type = sipc_util_marshal_object_get_int(in_o, "type");
+                       unsigned char *g_rand_data = NULL;
+                       g_auth_type = sipc_util_marshal_object_get_string(in_o, "type");
                        g_autn_data = sipc_util_marshal_object_get_string(in_o, "autn_data");
-                       g_autn_length = strlen(g_autn_data);
+                       g_autn_length = sipc_util_marshal_object_get_int(in_o, "autn_data_length");
                        g_rand_data = sipc_util_marshal_object_get_string(in_o, "rand_data");
-                       g_rand_length = strlen(g_rand_data);
+                       g_rand_length = sipc_util_marshal_object_get_int(in_o, "rand_data_length");
+
+                       dbg("tmp - g_auth_type[%s]",g_auth_type);
+                       if(g_rand_length)
+                               dbg("tmp - g_rand_data[%s]",g_rand_data);
+                       if(g_autn_length)
+                               dbg("tmp - g_autn_data[%s]",g_autn_data);
+
+                        if (!g_strcmp0(g_auth_type, "ims")) {
+                                req_auth.auth_type = SIM_AUTH_TYPE_IMS;
+                        } else if (!g_strcmp0(g_auth_type, "gsm")) {
+                                req_auth.auth_type = SIM_AUTH_TYPE_GSM;
+                        } else if (!g_strcmp0(g_auth_type, "3g")) {
+                                req_auth.auth_type = SIM_AUTH_TYPE_3G;
+                        } else {
+                                result = FALSE;
+                                goto RETURN;
+                        }
 
-                       req_auth.auth_type = g_auth_type;
                        req_auth.autn_length = g_autn_length;
                        if(req_auth.autn_length)
                                memcpy(req_auth.autn_data, g_autn_data, req_auth.autn_length);
@@ -220,14 +324,31 @@ gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlu
 
                case TAPI_SERVICE_SIM_VERIFYSEC : {
                        struct treq_sim_verify_pins verify_pins = { 0, };
-                       enum tel_sim_pin_type g_pin_type;
+                       gchar *g_pin_type = NULL;
                        unsigned int g_pin_length;
-                       unsigned char *g_pin;
-                       g_pin_type = sipc_util_marshal_object_get_int(in_o, "type");
+                       unsigned char *g_pin = NULL;
+                       g_pin_type = sipc_util_marshal_object_get_string(in_o, "type");
                        g_pin = sipc_util_marshal_object_get_string(in_o, "pw");
                        g_pin_length = strlen(g_pin);
 
-                       verify_pins.pin_type = g_pin_type;
+                       dbg("tmp - g_pin_type[%s]",g_pin_type);
+                       dbg("tmp - g_pin_length[%d]",g_pin_length);
+                       if(g_pin_length)
+                               dbg("tmp - g_pin[%s]",g_pin);
+
+                        if (!g_strcmp0(g_pin_type, "pin1")) {
+                                verify_pins.pin_type = SIM_PTYPE_PIN1;
+                        } else if (!g_strcmp0(g_pin_type, "pin2")) {
+                                verify_pins.pin_type = SIM_PTYPE_PIN2;
+                        } else if (!g_strcmp0(g_pin_type, "admin")) {
+                                verify_pins.pin_type = SIM_PTYPE_ADM;
+                        } else if (!g_strcmp0(g_pin_type, "sim")) {
+                                verify_pins.pin_type = SIM_PTYPE_SIM;
+                        } else {
+                                result = FALSE;
+                                goto RETURN;
+                        }
+
                        verify_pins.pin_length = g_pin_length;
                        memcpy(verify_pins.pin, g_pin, verify_pins.pin_length);
 
@@ -238,18 +359,32 @@ gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlu
 
                case TAPI_SERVICE_SIM_VERIFYPUK : {
                        struct treq_sim_verify_puks verify_puks = { 0, };
-                       enum tel_sim_pin_type g_puk_type;
+                       gchar *g_puk_type = NULL;
                        unsigned int g_puk_length;
-                       unsigned char *g_puk;
+                       unsigned char *g_puk = NULL;
                        unsigned int g_pin_length;
-                       unsigned char *g_pin;
-                       g_puk_type = sipc_util_marshal_object_get_int(in_o, "type");
+                       unsigned char *g_pin = NULL;
+                       g_puk_type = sipc_util_marshal_object_get_string(in_o, "type");
                        g_puk = sipc_util_marshal_object_get_string(in_o, "puk");
                        g_puk_length = strlen(g_puk);
                        g_pin = sipc_util_marshal_object_get_string(in_o, "pin");
                        g_pin_length = strlen(g_pin);
 
-                       verify_puks.puk_type = g_puk_type;
+                       dbg("tmp - g_puk_type[%s]",g_puk_type);
+                       if(g_puk_length)
+                               dbg("tmp - g_puk[%s]",g_puk);
+                       if(g_pin_length)
+                               dbg("tmp - g_pin[%s]",g_pin);
+
+                        if (!g_strcmp0(g_puk_type, "puk1")) {
+                                verify_puks.puk_type = SIM_PTYPE_PUK1;
+                        } else if (!g_strcmp0(g_puk_type, "puk2")) {
+                                verify_puks.puk_type = SIM_PTYPE_PUK2;
+                        } else {
+                                result = FALSE;
+                                goto RETURN;
+                        }
+
                        verify_puks.puk_length = g_puk_length;
                        memcpy(verify_puks.puk, g_puk, verify_puks.puk_length);
                        verify_puks.pin_length = g_pin_length;
@@ -262,18 +397,32 @@ gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlu
 
                case TAPI_SERVICE_SIM_CHANGEPIN : {
                        struct treq_sim_change_pins change_pins = { 0, };
-                       enum tel_sim_pin_type g_type;
+                       gchar *g_type = NULL;
                        unsigned int g_old_pw_length;
-                       unsigned char *g_old_pw;
+                       unsigned char *g_old_pw = NULL;
                        unsigned int g_new_pw_length;
-                       unsigned char *g_new_pw;
-                       g_type = sipc_util_marshal_object_get_int(in_o, "type");
+                       unsigned char *g_new_pw = NULL;
+                       g_type = sipc_util_marshal_object_get_string(in_o, "type");
                        g_old_pw = sipc_util_marshal_object_get_string(in_o, "old_pw");
                        g_old_pw_length = strlen(g_old_pw);
                        g_new_pw = sipc_util_marshal_object_get_string(in_o, "new_pw");
                        g_new_pw_length = strlen(g_new_pw);
 
-                       change_pins.type = g_type;
+                       dbg("tmp - g_type[%s]",g_type);
+                       if(g_old_pw_length)
+                               dbg("tmp - g_old_pw[%s]",g_old_pw);
+                       if(g_new_pw_length)
+                               dbg("tmp - g_new_pw[%s]",g_new_pw);
+
+                        if (!g_strcmp0(g_type, "pin1")) {
+                                change_pins.type = SIM_PTYPE_PIN1;
+                        } else if (!g_strcmp0(g_type, "pin2")) {
+                                change_pins.type = SIM_PTYPE_PIN2;
+                        } else {
+                                result = FALSE;
+                                goto RETURN;
+                        }
+
                        change_pins.old_pin_length = g_old_pw_length;
                        memcpy(change_pins.old_pin, g_old_pw, change_pins.old_pin_length);
                        change_pins.new_pin_length = g_new_pw_length;
@@ -286,14 +435,36 @@ gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlu
 
                case TAPI_SERVICE_SIM_DISABLE_FACILITY : {
                        struct treq_sim_disable_facility dis_facility = { 0, };
-                       enum tel_sim_facility_type g_dis_type;
+                       gchar *g_dis_type = NULL;
                        unsigned int g_dis_pw_length;
-                       unsigned char *g_dis_pw;
-                       g_dis_type = sipc_util_marshal_object_get_int(in_o, "type");
+                       unsigned char *g_dis_pw = NULL;
+                       g_dis_type = sipc_util_marshal_object_get_string(in_o, "type");
                        g_dis_pw = sipc_util_marshal_object_get_string(in_o, "pw");
                        g_dis_pw_length = strlen(g_dis_pw);
 
-                       dis_facility.type = g_dis_type;
+                       dbg("tmp - g_dis_type[%s]",g_dis_type);
+                       if(g_dis_pw_length)
+                               dbg("tmp - g_dis_pw[%s]",g_dis_pw);
+
+                        if (!g_strcmp0(g_dis_type, "ps")) {
+                                dis_facility.type = SIM_FACILITY_PS;
+                        } else if (!g_strcmp0(g_dis_type, "sc")) {
+                                dis_facility.type = SIM_FACILITY_SC;
+                        } else if (!g_strcmp0(g_dis_type, "fd")) {
+                                dis_facility.type = SIM_FACILITY_FD;
+                        } else if (!g_strcmp0(g_dis_type, "pn")) {
+                                dis_facility.type = SIM_FACILITY_PN;
+                        } else if (!g_strcmp0(g_dis_type, "pu")) {
+                                dis_facility.type = SIM_FACILITY_PU;
+                        } else if (!g_strcmp0(g_dis_type, "pp")) {
+                                dis_facility.type = SIM_FACILITY_PP;
+                        } else if (!g_strcmp0(g_dis_type, "pc")) {
+                                dis_facility.type = SIM_FACILITY_PC;
+                        } else {
+                                result = FALSE;
+                                goto RETURN;
+                        }
+
                        dis_facility.password_length = g_dis_pw_length;
                        memcpy(dis_facility.password, g_dis_pw, dis_facility.password_length);
 
@@ -304,14 +475,36 @@ gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlu
 
                case TAPI_SERVICE_SIM_ENABLE_FACILITY : {
                        struct treq_sim_enable_facility en_facility = { 0, };
-                       enum tel_sim_facility_type g_en_type;
+                       gchar *g_en_type = NULL;
                        unsigned int g_en_pw_length;
-                       unsigned char *g_en_pw;
-                       g_en_type = sipc_util_marshal_object_get_int(in_o, "type");
+                       unsigned char *g_en_pw = NULL;
+                       g_en_type = sipc_util_marshal_object_get_string(in_o, "type");
                        g_en_pw = sipc_util_marshal_object_get_string(in_o, "pw");
                        g_en_pw_length = strlen(g_en_pw);
 
-                       en_facility.type = g_en_type;
+                       dbg("tmp - g_en_type[%s]",g_en_type);
+                       if(g_en_pw_length)
+                               dbg("tmp - g_en_pw[%s]",g_en_pw);
+
+                        if (!g_strcmp0(g_en_type, "ps")) {
+                                en_facility.type = SIM_FACILITY_PS;
+                        } else if (!g_strcmp0(g_en_type, "sc")) {
+                                en_facility.type = SIM_FACILITY_SC;
+                        } else if (!g_strcmp0(g_en_type, "fd")) {
+                                en_facility.type = SIM_FACILITY_FD;
+                        } else if (!g_strcmp0(g_en_type, "pn")) {
+                                en_facility.type = SIM_FACILITY_PN;
+                        } else if (!g_strcmp0(g_en_type, "pu")) {
+                                en_facility.type = SIM_FACILITY_PU;
+                        } else if (!g_strcmp0(g_en_type, "pp")) {
+                                en_facility.type = SIM_FACILITY_PP;
+                        } else if (!g_strcmp0(g_en_type, "pc")) {
+                                en_facility.type = SIM_FACILITY_PC;
+                        } else {
+                                result = FALSE;
+                                goto RETURN;
+                        }
+
                        en_facility.password_length = g_en_pw_length;
                        memcpy(en_facility.password, g_en_pw, en_facility.password_length);
 
@@ -322,10 +515,28 @@ gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlu
 
                case TAPI_SERVICE_SIM_GET_FACILITY : {
                        struct treq_sim_get_facility_status facility = { 0, };
-                       enum tel_sim_facility_type g_facility_type;
-                       sipc_util_marshal_object_get_data(in_o, "type", (void **)&g_facility_type, TAPI_OBJECT_DATA_TYPE_INT);
-
-                       facility.type = g_facility_type;
+                       gchar *g_facility_type = NULL;
+                       g_facility_type = sipc_util_marshal_object_get_string(in_o, "type");
+                       dbg("tmp - g_facility_type[%s]",g_facility_type);
+
+                        if (!g_strcmp0(g_facility_type, "ps")) {
+                                facility.type = SIM_FACILITY_PS;
+                        } else if (!g_strcmp0(g_facility_type, "sc")) {
+                                facility.type = SIM_FACILITY_SC;
+                        } else if (!g_strcmp0(g_facility_type, "fd")) {
+                                facility.type = SIM_FACILITY_FD;
+                        } else if (!g_strcmp0(g_facility_type, "pn")) {
+                                facility.type = SIM_FACILITY_PN;
+                        } else if (!g_strcmp0(g_facility_type, "pu")) {
+                                facility.type = SIM_FACILITY_PU;
+                        } else if (!g_strcmp0(g_facility_type, "pp")) {
+                                facility.type = SIM_FACILITY_PP;
+                        } else if (!g_strcmp0(g_facility_type, "pc")) {
+                                facility.type = SIM_FACILITY_PC;
+                        } else {
+                                result = FALSE;
+                                goto RETURN;
+                        }
 
                        tcore_user_request_set_data(ur, sizeof(struct treq_sim_get_facility_status), &facility);
                        tcore_user_request_set_command(ur, TREQ_SIM_GET_FACILITY_STATUS);
@@ -335,9 +546,9 @@ gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlu
                case TAPI_SERVICE_SIM_APDU : {
                        struct treq_sim_transmit_apdu send_apdu ={ 0, };
                        gint g_apdu_length;
-                       gchar *g_apdu;
+                       gchar *g_apdu = NULL;
+                       g_apdu_length = sipc_util_marshal_object_get_int(in_o, "apdu_length");
                        g_apdu = sipc_util_marshal_object_get_string(in_o, "apdu");
-                       g_apdu_length = strlen(g_apdu);
 
                        send_apdu.apdu_length = (unsigned int)g_apdu_length;
                        memcpy(send_apdu.apdu, g_apdu, send_apdu.apdu_length);
@@ -356,18 +567,33 @@ gboolean scomm_service_reqeust_sim(unsigned int ch_id, Communicator *c, TcorePlu
                        break;
        }
 
-       if (cmd == TAPI_SERVICE_SIM_GET_SIMINITINFO || cmd == TAPI_SERVICE_SIM_GET_TYPE
-                       || cmd == TAPI_SERVICE_SIM_GET_IMSI ) {
-               /*synchronous data return case*/
+RETURN:
+       sipc_util_marshal_object_destory(in_o);
+       sipc_util_marshal_object_add_data(out_o.mo, "result", &result, SIPC_MARSHAL_DATA_BOOLEAN_TYPE);
+
+       dbg("result = %d", result);
+
+       tmp = sipc_util_marshal_object_serializer(out_o.mo);
+       tmp_len = strlen(tmp);
+       *outparam = g_new0(char, tmp_len+1);
+       memcpy(*outparam, tmp, tmp_len);
+       sipc_util_marshal_object_destory(out_o.mo);
+       g_free(tmp);
+
+       if ( cmd !=TAPI_SERVICE_SIM_GET_SIMINITINFO
+                       && cmd != TAPI_SERVICE_SIM_GET_TYPE
+                       && cmd != TAPI_SERVICE_SIM_GET_IMSI ) {
+               if (result == FALSE) {
+                       tcore_user_request_unref(ur);
+                       return FALSE;
+               }
 
-       } else {
-               /*asynchronous data return case*/
                ret = tcore_communicator_dispatch_request(c, ur);
                if (ret != TCORE_RETURN_SUCCESS) {
+                       dbg("error - dispatch result[%d]", ret);
                        return FALSE;
                }
        }
-
        return TRUE;
 }
 
@@ -413,112 +639,319 @@ gboolean scomm_service_response_sim(Communicator *comm, UserRequest *ur, enum tc
        out_o = sipc_util_marshal_object_create();
 
        switch (command) {
-               case TRESP_SIM_VERIFY_PINS:
+               case TRESP_SIM_VERIFY_PINS: {
+                       gchar *gtype = NULL;
                        dbg("resp comm - TRESP_SIM_VERIFY_PINS");
+
+                        if (resp_verify_pins->pin_type == SIM_PTYPE_PIN1) {
+                                gtype = "pin1\0";
+                        } else if (resp_verify_pins->pin_type == SIM_PTYPE_PIN2) {
+                                gtype = "pin2\0";
+                        } else if (resp_verify_pins->pin_type == SIM_PTYPE_ADM) {
+                                gtype = "adm\0";
+                        } else if (resp_verify_pins->pin_type == SIM_PTYPE_SIM) {
+                                gtype = "sim\0";
+                        } else {
+                                dbg("error - [%d] is not handled case in here", resp_verify_pins->pin_type);
+                        }
+                        dbg("gtype[%s]",gtype);
                        sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_verify_pins->result, SIPC_MARSHAL_DATA_INT_TYPE);
-                       sipc_util_marshal_object_add_data(out_o, "type", (void*)&resp_verify_pins->pin_type, SIPC_MARSHAL_DATA_INT_TYPE);
+                       sipc_util_marshal_object_add_data(out_o, "type", (void*)gtype, SIPC_MARSHAL_DATA_STRING_TYPE);
                        sipc_util_marshal_object_add_data(out_o, "remain_count", (void*)&resp_verify_pins->retry_count, SIPC_MARSHAL_DATA_INT_TYPE);
+               }
                        break;
 
-               case TRESP_SIM_VERIFY_PUKS:
+               case TRESP_SIM_VERIFY_PUKS: {
+                       gchar *gtype = NULL;
                        dbg("resp comm - TRESP_SIM_VERIFY_PUKS");
+
+                        if (resp_verify_puks->pin_type == SIM_PTYPE_PUK1) {
+                                gtype = "puk1\0";
+                        } else if (resp_verify_puks->pin_type == SIM_PTYPE_PUK2) {
+                                gtype = "puk2\0";
+                        } else {
+                                dbg("error - [%d] is not handled case in here", resp_verify_puks->pin_type);
+                        }
+                        dbg("gtype[%s]",gtype);
                        sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_verify_puks->result, SIPC_MARSHAL_DATA_INT_TYPE);
-                       sipc_util_marshal_object_add_data(out_o, "type", (void*)&resp_verify_puks->pin_type, SIPC_MARSHAL_DATA_INT_TYPE);
+                       sipc_util_marshal_object_add_data(out_o, "type", (void*)gtype, SIPC_MARSHAL_DATA_STRING_TYPE);
                        sipc_util_marshal_object_add_data(out_o, "remain_count", (void*)&resp_verify_puks->retry_count, SIPC_MARSHAL_DATA_INT_TYPE);
+               }
                        break;
 
-               case TRESP_SIM_CHANGE_PINS:
+               case TRESP_SIM_CHANGE_PINS: {
+                       gchar *gtype = NULL;
                        dbg("resp comm - TRESP_SIM_CHANGE_PINS");
+
+                        if (resp_change_pins->pin_type == SIM_PTYPE_PIN1) {
+                                gtype = "pin1\0";
+                        } else if (resp_change_pins->pin_type == SIM_PTYPE_PIN2) {
+                                gtype = "pin2\0";
+                        } else {
+                                dbg("error - [%d] is not handled case in here", resp_change_pins->pin_type);
+                        }
+                        dbg("gtype[%s]",gtype);
                        sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_change_pins->result, SIPC_MARSHAL_DATA_INT_TYPE);
-                       sipc_util_marshal_object_add_data(out_o, "type", (void*)&resp_change_pins->pin_type, SIPC_MARSHAL_DATA_INT_TYPE);
+                       sipc_util_marshal_object_add_data(out_o, "type", (void*)gtype, SIPC_MARSHAL_DATA_STRING_TYPE);
                        sipc_util_marshal_object_add_data(out_o, "remain_count", (void*)&resp_change_pins->retry_count, SIPC_MARSHAL_DATA_INT_TYPE);
+               }
                        break;
 
-               case TRESP_SIM_GET_FACILITY_STATUS:
+               case TRESP_SIM_GET_FACILITY_STATUS: {
+                       gchar *ftype = NULL;
+                       gchar *gstatus = NULL;
                        dbg("resp comm - TRESP_SIM_GET_FACILITY_STATUS");
+
+                        if (resp_get_facility->type == SIM_FACILITY_PS) {
+                                ftype = "ps\0";
+                        } else if (resp_get_facility->type == SIM_FACILITY_SC) {
+                                ftype = "sc\0";
+                        } else if (resp_get_facility->type == SIM_FACILITY_FD) {
+                                ftype = "fd\0";
+                        } else if (resp_get_facility->type == SIM_FACILITY_PN) {
+                                ftype = "pn\0";
+                        } else if (resp_get_facility->type == SIM_FACILITY_PU) {
+                                ftype = "pu\0";
+                        } else if (resp_get_facility->type == SIM_FACILITY_PP) {
+                                ftype = "pp\0";
+                        } else if (resp_get_facility->type == SIM_FACILITY_PC) {
+                                ftype = "pc\0";
+                        } else {
+                                dbg("error - [%d] is not handled case in here", resp_get_facility->type);
+                        }
+                       dbg("ftype[%s]",ftype);
                        sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_get_facility->result, SIPC_MARSHAL_DATA_INT_TYPE);
-                       sipc_util_marshal_object_add_data(out_o, "type", (void*)&resp_get_facility->type, SIPC_MARSHAL_DATA_INT_TYPE);
-                       sipc_util_marshal_object_add_data(out_o, "enabled", (void*)&resp_get_facility->b_enable, SIPC_MARSHAL_DATA_BOOLEAN_TYPE);
+                       sipc_util_marshal_object_add_data(out_o, "type", (void*)ftype, SIPC_MARSHAL_DATA_STRING_TYPE);
+
+                       if (resp_get_facility->result == SIM_PUK_REQUIRED) {
+                               gstatus = "blocked\0";
+                       } else if (resp_get_facility->result == SIM_CARD_ERROR) {
+                               gstatus = "permanent_blocked\0";
+                       } else if (resp_get_facility->result == SIM_PIN_OPERATION_SUCCESS) {
+                               if ( resp_get_facility->b_enable )
+                                       gstatus = "enabled\0";
+                               else
+                                       gstatus = "disabled\0";
+                       } else {
+                               gstatus = "unknown\0";
+                       }
+                       dbg("gstatus[%s]",gstatus);
+                       sipc_util_marshal_object_add_data(out_o, "status", (void*)gstatus, SIPC_MARSHAL_DATA_STRING_TYPE);
+               }
                        break;
 
-               case TRESP_SIM_DISABLE_FACILITY:
+               case TRESP_SIM_DISABLE_FACILITY: {
+                       gchar *ftype = NULL;
                        dbg("resp comm - TRESP_SIM_DISABLE_FACILITY");
+                        if (resp_dis_facility->type == SIM_FACILITY_PS) {
+                                ftype = "ps\0";
+                        } else if (resp_dis_facility->type == SIM_FACILITY_SC) {
+                                ftype = "sc\0";
+                        } else if (resp_dis_facility->type == SIM_FACILITY_FD) {
+                                ftype = "fd\0";
+                        } else if (resp_dis_facility->type == SIM_FACILITY_PN) {
+                                ftype = "pn\0";
+                        } else if (resp_dis_facility->type == SIM_FACILITY_PU) {
+                                ftype = "pu\0";
+                        } else if (resp_dis_facility->type == SIM_FACILITY_PP) {
+                                ftype = "pp\0";
+                        } else if (resp_dis_facility->type == SIM_FACILITY_PC) {
+                                ftype = "pc\0";
+                        } else {
+                                dbg("error - [%d] is not handled case in here", resp_dis_facility->type);
+                        }
+                        dbg("ftype[%s]",ftype);
                        sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_dis_facility->result, SIPC_MARSHAL_DATA_INT_TYPE);
-                       sipc_util_marshal_object_add_data(out_o, "type", (void*)&resp_dis_facility->type, SIPC_MARSHAL_DATA_INT_TYPE);
+                       sipc_util_marshal_object_add_data(out_o, "type", (void*)ftype, SIPC_MARSHAL_DATA_STRING_TYPE);
                        sipc_util_marshal_object_add_data(out_o, "remain_count", (void*)&resp_dis_facility->retry_count, SIPC_MARSHAL_DATA_INT_TYPE);
+               }
                        break;
 
-               case TRESP_SIM_ENABLE_FACILITY:
+               case TRESP_SIM_ENABLE_FACILITY: {
+                       gchar *ftype = NULL;
                        dbg("resp comm - TRESP_SIM_ENABLE_FACILITY");
+                        if (resp_en_facility->type == SIM_FACILITY_PS) {
+                                ftype = "ps\0";
+                        } else if (resp_en_facility->type == SIM_FACILITY_SC) {
+                                ftype = "sc\0";
+                        } else if (resp_en_facility->type == SIM_FACILITY_FD) {
+                                ftype = "fd\0";
+                        } else if (resp_en_facility->type == SIM_FACILITY_PN) {
+                                ftype = "pn\0";
+                        } else if (resp_en_facility->type == SIM_FACILITY_PU) {
+                                ftype = "pu\0";
+                        } else if (resp_en_facility->type == SIM_FACILITY_PP) {
+                                ftype = "pp\0";
+                        } else if (resp_en_facility->type == SIM_FACILITY_PC) {
+                                ftype = "pc\0";
+                        } else {
+                                dbg("error - [%d] is not handled case in here", resp_en_facility->type);
+                        }
+                        dbg("ftype[%s]",ftype);
                        sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_en_facility->result, SIPC_MARSHAL_DATA_INT_TYPE);
-                       sipc_util_marshal_object_add_data(out_o, "type", (void*)&resp_en_facility->type, SIPC_MARSHAL_DATA_INT_TYPE);
+                       sipc_util_marshal_object_add_data(out_o, "type", (void*)ftype, SIPC_MARSHAL_DATA_STRING_TYPE);
                        sipc_util_marshal_object_add_data(out_o, "remain_count", (void*)&resp_en_facility->retry_count, SIPC_MARSHAL_DATA_INT_TYPE);
+               }
                        break;
 
-               case TRESP_SIM_TRANSMIT_APDU:
+               case TRESP_SIM_TRANSMIT_APDU: {
+                       gchar *access_rt = NULL;
                        dbg("resp comm - TRESP_SIM_TRANSMIT_APDU");
-                       sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_apdu->result, SIPC_MARSHAL_DATA_INT_TYPE);
+                       access_rt = _convert_access_result_to_string(resp_apdu->result);
+                       sipc_util_marshal_object_add_data(out_o, "result", (void*)access_rt, SIPC_MARSHAL_DATA_STRING_TYPE);
+                       sipc_util_marshal_object_add_data(out_o, "apdu_length", (void*)&resp_apdu->apdu_resp_length, SIPC_MARSHAL_DATA_INT_TYPE);
                        sipc_util_marshal_object_add_data(out_o, "apdu", (void*)&resp_apdu->apdu_resp, SIPC_MARSHAL_DATA_STRING_TYPE);
+               }
                        break;
 
-               case TRESP_SIM_GET_ATR:
+               case TRESP_SIM_GET_ATR: {
+                       gchar *access_rt = NULL;
                        dbg("resp comm - TRESP_SIM_GET_ATR");
-                       sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_get_atr->result, SIPC_MARSHAL_DATA_INT_TYPE);
+                       access_rt = _convert_access_result_to_string(resp_get_atr->result);
+                       sipc_util_marshal_object_add_data(out_o, "result", (void*)access_rt, SIPC_MARSHAL_DATA_STRING_TYPE);
+                       sipc_util_marshal_object_add_data(out_o, "atr_length", (void*)&resp_get_atr->atr_length, SIPC_MARSHAL_DATA_INT_TYPE);
                        sipc_util_marshal_object_add_data(out_o, "atr", (void*)&resp_get_atr->atr, SIPC_MARSHAL_DATA_STRING_TYPE);
+               }
                        break;
 
-               case TRESP_SIM_REQ_AUTHENTICATION:
+               case TRESP_SIM_REQ_AUTHENTICATION: {
+                       gchar *access_rt = NULL;
+                       gchar *auth_rt = NULL;
                        dbg("resp comm - TRESP_SIM_REQ_AUTHENTICATION");
-                       sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_auth->auth_result, SIPC_MARSHAL_DATA_INT_TYPE);
-                       sipc_util_marshal_object_add_data(out_o, "type", (void*)&resp_auth->auth_type, SIPC_MARSHAL_DATA_STRING_TYPE);
+                       access_rt = _convert_access_result_to_string(resp_auth->result);
+                       sipc_util_marshal_object_add_data(out_o, "result", (void*)access_rt, SIPC_MARSHAL_DATA_STRING_TYPE);
+                       sipc_util_marshal_object_add_data(out_o, "type", (void*)&resp_auth->auth_type, SIPC_MARSHAL_DATA_INT_TYPE);
+
+                       switch (resp_auth->auth_result) {
+                               case SIM_AUTH_NO_ERROR:
+                                       auth_rt = "ok\0";
+                                       break;
+                               case SIM_AUTH_CANNOT_PERFORM:
+                                       auth_rt = "can_not_perform\0";
+                                       break;
+                               case SIM_AUTH_SKIP_RESPONSE:
+                                       auth_rt = "skip_response\0";
+                                       break;
+                               case SIM_AUTH_MAK_CODE_FAILURE:
+                                       auth_rt = "mak_failure\0";
+                                       break;
+                               case SIM_AUTH_SQN_FAILURE:
+                                       auth_rt = "sqn_failure\0";
+                                       break;
+                               case SIM_AUTH_SYNCH_FAILURE:
+                                       auth_rt = "synch_failure\0";
+                                       break;
+                               case SIM_AUTH_UNSUPPORTED_CONTEXT:
+                                       auth_rt = "unsupported_context\0";
+                                       break;
+                               default:
+                                       dbg("[%d] is not handled in here",resp_auth->auth_result );
+                                       auth_rt = "";
+                                       break;
+                       }
+                       sipc_util_marshal_object_add_data(out_o, "auth_result", (void*)auth_rt, SIPC_MARSHAL_DATA_INT_TYPE);
+                       sipc_util_marshal_object_add_data(out_o, "authentication_key_length", (void*)&resp_auth->authentication_key_length, SIPC_MARSHAL_DATA_INT_TYPE);
                        if(resp_auth->authentication_key_length)
                                sipc_util_marshal_object_add_data(out_o, "authentication_key", (void*)&resp_auth->authentication_key, SIPC_MARSHAL_DATA_STRING_TYPE);
+                       sipc_util_marshal_object_add_data(out_o, "cipher_length", (void*)&resp_auth->cipher_length, SIPC_MARSHAL_DATA_INT_TYPE);
                        if(resp_auth->cipher_length)
                                sipc_util_marshal_object_add_data(out_o, "cipher_data", (void*)&resp_auth->cipher_data, SIPC_MARSHAL_DATA_STRING_TYPE);
+                       sipc_util_marshal_object_add_data(out_o, "integrity_length", (void*)&resp_auth->integrity_length, SIPC_MARSHAL_DATA_INT_TYPE);
                        if(resp_auth->integrity_length)
                                sipc_util_marshal_object_add_data(out_o, "integrity_data", (void*)&resp_auth->integrity_data, SIPC_MARSHAL_DATA_STRING_TYPE);
+                       sipc_util_marshal_object_add_data(out_o, "resp_length", (void*)&resp_auth->resp_length, SIPC_MARSHAL_DATA_INT_TYPE);
                        if(resp_auth->resp_length)
                                sipc_util_marshal_object_add_data(out_o, "resp_data", (void*)&resp_auth->resp_data, SIPC_MARSHAL_DATA_STRING_TYPE);
+               }
                        break;
 
-               case TRESP_SIM_SET_LANGUAGE:
+               case TRESP_SIM_SET_LANGUAGE: {
+                       gchar *access_rt = NULL;
                        dbg("resp comm - TRESP_SIM_SET_LANGUAGE");
-                       sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_set_language->result, SIPC_MARSHAL_DATA_INT_TYPE);
+                       access_rt = _convert_access_result_to_string(resp_read->result);
+                       sipc_util_marshal_object_add_data(out_o, "result", (void*)access_rt, SIPC_MARSHAL_DATA_STRING_TYPE);
+               }
                        break;
 
-               case TRESP_SIM_GET_ECC:
+               case TRESP_SIM_GET_ECC: {
+                       gchar *access_rt = NULL;
                        dbg("resp comm - TRESP_SIM_GET_ECC");
-                       sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_read->result, SIPC_MARSHAL_DATA_INT_TYPE);
+                       access_rt = _convert_access_result_to_string(resp_read->result);
+                       sipc_util_marshal_object_add_data(out_o, "result", (void*)access_rt, SIPC_MARSHAL_DATA_STRING_TYPE);
                        sipc_util_marshal_object_add_data(out_o, "count", (void*)&resp_read->data.ecc.ecc_count, SIPC_MARSHAL_DATA_INT_TYPE);
-                       entry_o = sipc_util_marshal_object_create();
+
+                       dbg("tmp - resp_read->data.ecc.ecc_count[%d]",resp_read->data.ecc.ecc_count);
+
                        for(i=0;i < resp_read->data.ecc.ecc_count; i++){
                                gchar *entry_key = NULL;
+                               gchar *gcategory = NULL;
+                               entry_o = sipc_util_marshal_object_create();
+                               dbg("tmp - resp_read->data.ecc.ecc[%d].ecc_string[%s]",i, resp_read->data.ecc.ecc[i].ecc_string);
+                               dbg("tmp - resp_read->data.ecc.ecc[%d].ecc_num[%s]",i, resp_read->data.ecc.ecc[i].ecc_num);
+                               dbg("tmp - resp_read->data.ecc.ecc[%d].ecc_category[%d]",i, resp_read->data.ecc.ecc[i].ecc_category);
                                sipc_util_marshal_object_add_data(entry_o, "name", (void*)&resp_read->data.ecc.ecc[i].ecc_string, SIPC_MARSHAL_DATA_STRING_TYPE);
                                sipc_util_marshal_object_add_data(entry_o, "number", (void*)&resp_read->data.ecc.ecc[i].ecc_num, SIPC_MARSHAL_DATA_STRING_TYPE);
-                               sipc_util_marshal_object_add_data(entry_o, "category", (void*)&resp_read->data.ecc.ecc[i].ecc_category, SIPC_MARSHAL_DATA_INT_TYPE);
+
+                               switch (resp_read->data.ecc.ecc[i].ecc_category) {
+                                       case SIM_ECC_POLICE:
+                                               gcategory = "police\0";
+                                               break;
+                                       case SIM_ECC_AMBULANCE:
+                                               gcategory = "ambulance\0";
+                                               break;
+                                       case SIM_ECC_FIREBRIGADE :
+                                               gcategory = "firebrigade\0";
+                                               break;
+                                       case SIM_ECC_MARAINEGUARD :
+                                               gcategory = "maraineguard\0";
+                                               break;
+                                       case SIM_ECC_MOUTAINRESCUE :
+                                               gcategory = "mountainrescue\0";
+                                               break;
+                                       case SIM_ECC_SPARE :
+                                       default:
+                                               gcategory = "spare\0";
+                                               break;
+                               }
+                               sipc_util_marshal_object_add_data(entry_o, "category", (void*)gcategory, SIPC_MARSHAL_DATA_STRING_TYPE);
                                entry_key = g_strdup_printf("%d", i);
                                sipc_util_marshal_object_add_data(out_o, entry_key, entry_o, SIPC_MARSHAL_DATA_OBJECT_TYPE);
                        }
+               }
                        break;
 
-               case TRESP_SIM_GET_LANGUAGE:
+               case TRESP_SIM_GET_LANGUAGE: {
+                       gchar *access_rt = NULL;
+                       char *language_tb[] = { "de", "en", "it", "fr", "es", "nl", "sv", "da", "pt", "fi", "no", "el",
+                                                                                                                       "tr", "hu", "pl", "ko", "zh", "ru", "ja" };
                        dbg("resp comm - TRESP_SIM_GET_LANGUAGE");
-                       sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_read->result, SIPC_MARSHAL_DATA_INT_TYPE);
-                       sipc_util_marshal_object_add_data(out_o, "language", (void*)&resp_read->data.language.language[0] , SIPC_MARSHAL_DATA_INT_TYPE);
+                       access_rt = _convert_access_result_to_string(resp_read->result);
+                       dbg("tmp - access_rt[%s]",access_rt);
+                       dbg("tmp - resp_read->data.language.language[0][%d]",resp_read->data.language.language[0]);
+                       sipc_util_marshal_object_add_data(out_o, "result", (void*)access_rt, SIPC_MARSHAL_DATA_STRING_TYPE);
+                       dbg("tmp-language[%s]",language_tb[resp_read->data.language.language[0]]);
+                       sipc_util_marshal_object_add_data(out_o, "language", (void*)language_tb[resp_read->data.language.language[0]] , SIPC_MARSHAL_DATA_STRING_TYPE);
+               }
                        break;
 
-               case TRESP_SIM_GET_ICCID:
+               case TRESP_SIM_GET_ICCID: {
+                       gchar *access_rt = NULL;
                        dbg("resp comm - TRESP_SIM_GET_ICCID");
-                       sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_read->result, SIPC_MARSHAL_DATA_INT_TYPE);
+                       access_rt = _convert_access_result_to_string(resp_read->result);
+                       sipc_util_marshal_object_add_data(out_o, "result", (void*)access_rt, SIPC_MARSHAL_DATA_STRING_TYPE);
                        sipc_util_marshal_object_add_data(out_o, "iccid", (void*)&resp_read->data.iccid.iccid , SIPC_MARSHAL_DATA_STRING_TYPE);
+               }
                        break;
 
-               case TRESP_SIM_GET_MAILBOX:
+               case TRESP_SIM_GET_MAILBOX: {
+                       gchar *access_rt = NULL;
                        dbg("resp comm - TRESP_SIM_GET_MAILBOX");
-                       sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_read->result, SIPC_MARSHAL_DATA_INT_TYPE);
-                       entry_o = sipc_util_marshal_object_create();
+                       access_rt = _convert_access_result_to_string(resp_read->result);
+                       sipc_util_marshal_object_add_data(out_o, "result", (void*)access_rt, SIPC_MARSHAL_DATA_STRING_TYPE);
+
                        if(resp_read->data.mailbox.voice1.DiallingnumLength){
                                count ++;
+                               entry_o = sipc_util_marshal_object_create();
                                sipc_util_marshal_object_add_data(entry_o, "type", "voice1", SIPC_MARSHAL_DATA_STRING_TYPE);
                                sipc_util_marshal_object_add_data(entry_o, "name", (void*)&resp_read->data.mailbox.voice1.AlphaId, SIPC_MARSHAL_DATA_STRING_TYPE);
                                sipc_util_marshal_object_add_data(entry_o, "number", (void*)&resp_read->data.mailbox.voice1.DiallingNum , SIPC_MARSHAL_DATA_STRING_TYPE);
@@ -526,10 +959,15 @@ gboolean scomm_service_response_sim(Communicator *comm, UserRequest *ur, enum tc
                                sipc_util_marshal_object_add_data(entry_o, "npi", (void*)&resp_read->data.mailbox.voice1.NumberingPlanIdent , SIPC_MARSHAL_DATA_INT_TYPE);
                                entry_key = g_strdup_printf("%d", count);
                                sipc_util_marshal_object_add_data(out_o, entry_key, entry_o, SIPC_MARSHAL_DATA_OBJECT_TYPE);
+                               dbg("tmp - resp_read->data.mailbox.voice1.AlphaId[%s]",resp_read->data.mailbox.voice1.AlphaId);
+                               dbg("tmp - resp_read->data.mailbox.voice1.DiallingNum[%s]",resp_read->data.mailbox.voice1.DiallingNum);
+                               dbg("tmp - resp_read->data.mailbox.voice1.TypeOfNumber[%d]",resp_read->data.mailbox.voice1.TypeOfNumber);
+                               dbg("tmp - resp_read->data.mailbox.voice1.NumberingPlanIdent[%d]",resp_read->data.mailbox.voice1.NumberingPlanIdent);
                        }
 
                        if(resp_read->data.mailbox.voice2.DiallingnumLength){
                                count ++;
+                               entry_o = sipc_util_marshal_object_create();
                                sipc_util_marshal_object_add_data(entry_o, "type", "voice2", SIPC_MARSHAL_DATA_STRING_TYPE);
                                sipc_util_marshal_object_add_data(entry_o, "name", (void*)&resp_read->data.mailbox.voice2.AlphaId, SIPC_MARSHAL_DATA_STRING_TYPE);
                                sipc_util_marshal_object_add_data(entry_o, "number", (void*)&resp_read->data.mailbox.voice2.DiallingNum , SIPC_MARSHAL_DATA_STRING_TYPE);
@@ -537,10 +975,15 @@ gboolean scomm_service_response_sim(Communicator *comm, UserRequest *ur, enum tc
                                sipc_util_marshal_object_add_data(entry_o, "npi", (void*)&resp_read->data.mailbox.voice2.NumberingPlanIdent , SIPC_MARSHAL_DATA_INT_TYPE);
                                entry_key = g_strdup_printf("%d", count);
                                sipc_util_marshal_object_add_data(out_o, entry_key, entry_o, SIPC_MARSHAL_DATA_OBJECT_TYPE);
+                               dbg("tmp - resp_read->data.mailbox.voice2.AlphaId[%s]",resp_read->data.mailbox.voice2.AlphaId);
+                               dbg("tmp - resp_read->data.mailbox.voice2.DiallingNum[%s]",resp_read->data.mailbox.voice2.DiallingNum);
+                               dbg("tmp - resp_read->data.mailbox.voice2.TypeOfNumber[%d]",resp_read->data.mailbox.voice2.TypeOfNumber);
+                               dbg("tmp - resp_read->data.mailbox.voice2.NumberingPlanIdent[%d]",resp_read->data.mailbox.voice2.NumberingPlanIdent);
                        }
 
                        if(resp_read->data.mailbox.fax.DiallingnumLength){
                                count ++;
+                               entry_o = sipc_util_marshal_object_create();
                                sipc_util_marshal_object_add_data(entry_o, "type", "fax", SIPC_MARSHAL_DATA_STRING_TYPE);
                                sipc_util_marshal_object_add_data(entry_o, "name", (void*)&resp_read->data.mailbox.fax.AlphaId, SIPC_MARSHAL_DATA_STRING_TYPE);
                                sipc_util_marshal_object_add_data(entry_o, "number", (void*)&resp_read->data.mailbox.fax.DiallingNum , SIPC_MARSHAL_DATA_STRING_TYPE);
@@ -548,10 +991,15 @@ gboolean scomm_service_response_sim(Communicator *comm, UserRequest *ur, enum tc
                                sipc_util_marshal_object_add_data(entry_o, "npi", (void*)&resp_read->data.mailbox.fax.NumberingPlanIdent , SIPC_MARSHAL_DATA_INT_TYPE);
                                entry_key = g_strdup_printf("%d", count);
                                sipc_util_marshal_object_add_data(out_o, entry_key, entry_o, SIPC_MARSHAL_DATA_OBJECT_TYPE);
+                               dbg("tmp - resp_read->data.mailbox.fax.AlphaId[%s]",resp_read->data.mailbox.fax.AlphaId);
+                               dbg("tmp - resp_read->data.mailbox.fax.DiallingNum[%s]",resp_read->data.mailbox.fax.DiallingNum);
+                               dbg("tmp - resp_read->data.mailbox.fax.TypeOfNumber[%d]",resp_read->data.mailbox.fax.TypeOfNumber);
+                               dbg("tmp - resp_read->data.mailbox.fax.NumberingPlanIdent[%d]",resp_read->data.mailbox.fax.NumberingPlanIdent);
                        }
 
                        if(resp_read->data.mailbox.video.DiallingnumLength){
                                count ++;
+                               entry_o = sipc_util_marshal_object_create();
                                sipc_util_marshal_object_add_data(entry_o, "type", "video", SIPC_MARSHAL_DATA_STRING_TYPE);
                                sipc_util_marshal_object_add_data(entry_o, "name", (void*)&resp_read->data.mailbox.video.AlphaId, SIPC_MARSHAL_DATA_STRING_TYPE);
                                sipc_util_marshal_object_add_data(entry_o, "number", (void*)&resp_read->data.mailbox.video.DiallingNum , SIPC_MARSHAL_DATA_STRING_TYPE);
@@ -559,64 +1007,105 @@ gboolean scomm_service_response_sim(Communicator *comm, UserRequest *ur, enum tc
                                sipc_util_marshal_object_add_data(entry_o, "npi", (void*)&resp_read->data.mailbox.video.NumberingPlanIdent , SIPC_MARSHAL_DATA_INT_TYPE);
                                entry_key = g_strdup_printf("%d", count);
                                sipc_util_marshal_object_add_data(out_o, entry_key, entry_o, SIPC_MARSHAL_DATA_OBJECT_TYPE);
+                               dbg("tmp - resp_read->data.mailbox.video.AlphaId[%s]",resp_read->data.mailbox.video.AlphaId);
+                               dbg("tmp - resp_read->data.mailbox.video.DiallingNum[%s]",resp_read->data.mailbox.video.DiallingNum);
+                               dbg("tmp - resp_read->data.mailbox.video.TypeOfNumber[%d]",resp_read->data.mailbox.video.TypeOfNumber);
+                               dbg("tmp - resp_read->data.mailbox.video.NumberingPlanIdent[%d]",resp_read->data.mailbox.video.NumberingPlanIdent);
                        }
+                       sipc_util_marshal_object_add_data(out_o, "count", (void*)&count, SIPC_MARSHAL_DATA_INT_TYPE);
+                       dbg("tmp - count[%d]", count);
+               }
                        break;
 
-               case TRESP_SIM_GET_CALLFORWARDING:
+               case TRESP_SIM_GET_CALLFORWARDING: {
+                       gchar *access_rt = NULL;
                        dbg("resp comm - TRESP_SIM_GET_CALLFORWARDING");
-                       sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_read->result, SIPC_MARSHAL_DATA_INT_TYPE);
+                       access_rt = _convert_access_result_to_string(resp_read->result);
+                       sipc_util_marshal_object_add_data(out_o, "result", (void*)access_rt, SIPC_MARSHAL_DATA_STRING_TYPE);
                        sipc_util_marshal_object_add_data(out_o, "line1_status", (void*)&resp_read->data.cf.voice1, SIPC_MARSHAL_DATA_BOOLEAN_TYPE);
                        sipc_util_marshal_object_add_data(out_o, "line2_status", (void*)&resp_read->data.cf.voice2, SIPC_MARSHAL_DATA_BOOLEAN_TYPE);
+                       dbg("tmp - resp_read->data.cf.voice1[%d]", resp_read->data.cf.voice1);
+                       dbg("tmp - resp_read->data.cf.voice2[%d]", resp_read->data.cf.voice2);
+               }
                        break;
 
-               case TRESP_SIM_GET_MESSAGEWAITING:
+               case TRESP_SIM_GET_MESSAGEWAITING: {
+                       gchar *access_rt = NULL;
                        dbg("resp comm - TRESP_SIM_GET_MESSAGEWAITING");
-                       sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_read->result, SIPC_MARSHAL_DATA_INT_TYPE);
+                       access_rt = _convert_access_result_to_string(resp_read->result);
+                       sipc_util_marshal_object_add_data(out_o, "result", (void*)access_rt, SIPC_MARSHAL_DATA_STRING_TYPE);
                        if (resp_read->data.mw.b_cphs) {
                                sipc_util_marshal_object_add_data(out_o, "line1_count", (void*)&resp_read->data.mw.mw_data_u.cphs_mw.b_voice1, SIPC_MARSHAL_DATA_INT_TYPE);
                                sipc_util_marshal_object_add_data(out_o, "line2_count", (void*)&resp_read->data.mw.mw_data_u.cphs_mw.b_voice2, SIPC_MARSHAL_DATA_INT_TYPE);
                                sipc_util_marshal_object_add_data(out_o, "fax_count", (void*)&resp_read->data.mw.mw_data_u.cphs_mw.b_fax, SIPC_MARSHAL_DATA_INT_TYPE);
                                sipc_util_marshal_object_add_data(out_o, "video_count", (void*)&resp_read->data.mw.mw_data_u.cphs_mw.b_data, SIPC_MARSHAL_DATA_INT_TYPE);
+                               dbg("tmp - resp_read->data.mw.mw_data_u.cphs_mw.b_voice1[%d]", resp_read->data.mw.mw_data_u.cphs_mw.b_voice1);
+                               dbg("tmp - resp_read->data.mw.mw_data_u.cphs_mw.b_voice2[%d]", resp_read->data.mw.mw_data_u.cphs_mw.b_voice2);
+                               dbg("tmp - resp_read->data.mw.mw_data_u.cphs_mw.b_fax[%d]", resp_read->data.mw.mw_data_u.cphs_mw.b_fax);
+                               dbg("tmp - resp_read->data.mw.mw_data_u.cphs_mw.b_data[%d]", resp_read->data.mw.mw_data_u.cphs_mw.b_data);
                        } else {
                                sipc_util_marshal_object_add_data(out_o, "line1_count", (void*)&resp_read->data.mw.mw_data_u.mw.voice_count, SIPC_MARSHAL_DATA_INT_TYPE);
 /*                             sipc_util_marshal_object_add_data(out_o, "line2_count", (void*)&resp_read->result, SIPC_MARSHAL_DATA_INT_TYPE);*/
                                sipc_util_marshal_object_add_data(out_o, "fax_count", (void*)&resp_read->data.mw.mw_data_u.mw.fax_count, SIPC_MARSHAL_DATA_INT_TYPE);
                                sipc_util_marshal_object_add_data(out_o, "video_count", (void*)&resp_read->data.mw.mw_data_u.mw.video_count, SIPC_MARSHAL_DATA_INT_TYPE);
+                               dbg("tmp - resp_read->data.mw.mw_data_u.mw.voice_count[%d]", resp_read->data.mw.mw_data_u.mw.voice_count);
+                               dbg("tmp - resp_read->data.mw.mw_data_u.mw.fax_count[%d]", resp_read->data.mw.mw_data_u.mw.fax_count);
+                               dbg("tmp - resp_read->data.mw.mw_data_u.mw.video_count[%d]", resp_read->data.mw.mw_data_u.mw.video_count);
                        }
+                       dbg("tmp - resp_read->data.mw.b_cphs[%d]", resp_read->data.mw.b_cphs);
+               }
                        break;
 
-               case TRESP_SIM_GET_CPHS_INFO:
+               case TRESP_SIM_GET_CPHS_INFO: {
+                       gchar *access_rt = NULL;
                        dbg("resp comm - TRESP_SIM_GET_CPHS_INFO");
-                       sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_read->result, SIPC_MARSHAL_DATA_INT_TYPE);
+                       access_rt = _convert_access_result_to_string(resp_read->result);
+                       sipc_util_marshal_object_add_data(out_o, "result", (void*)access_rt, SIPC_MARSHAL_DATA_STRING_TYPE);
+               }
                        break;
 
-               case TRESP_SIM_GET_MSISDN:
+               case TRESP_SIM_GET_MSISDN: {
+                       gchar *access_rt = NULL;
                        dbg("resp comm - TRESP_SIM_GET_MSISDN");
-                       sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_read->result, SIPC_MARSHAL_DATA_INT_TYPE);
+                       access_rt = _convert_access_result_to_string(resp_read->result);
+                       sipc_util_marshal_object_add_data(out_o, "result", (void*)access_rt, SIPC_MARSHAL_DATA_STRING_TYPE);
                        sipc_util_marshal_object_add_data(out_o, "count", (void*)&resp_read->data.msisdn_list.count, SIPC_MARSHAL_DATA_INT_TYPE);
-                       entry_o = sipc_util_marshal_object_create();
+                       dbg("tmp - resp_read->data.msisdn_list.count[%d]", resp_read->data.msisdn_list.count);
+
                        for(i=0;i < resp_read->data.msisdn_list.count; i++){
                                gchar *entry_key = NULL;
+                               entry_o = sipc_util_marshal_object_create();
                                sipc_util_marshal_object_add_data(entry_o, "name", (void*)&resp_read->data.msisdn_list.msisdn[i].name, SIPC_MARSHAL_DATA_STRING_TYPE);
                                sipc_util_marshal_object_add_data(entry_o, "number", (void*)&resp_read->data.msisdn_list.msisdn[i].num, SIPC_MARSHAL_DATA_STRING_TYPE);
                                entry_key = g_strdup_printf("%d", i);
                                sipc_util_marshal_object_add_data(out_o, entry_key, entry_o, SIPC_MARSHAL_DATA_OBJECT_TYPE);
+                               dbg("tmp - resp_read->data.msisdn_list.msisdn[%d].name[%s]", i, resp_read->data.msisdn_list.msisdn[i].name);
+                               dbg("tmp - resp_read->data.msisdn_list.msisdn[%d].num[%s]", i, resp_read->data.msisdn_list.msisdn[i].num);
                        }
+               }
                        break;
 
-               case TRESP_SIM_GET_OPLMNWACT:
+               case TRESP_SIM_GET_OPLMNWACT: {
+                       gchar *access_rt = NULL;
                        dbg("resp comm - TRESP_SIM_GET_OPLMNWACT");
-                       sipc_util_marshal_object_add_data(out_o, "result", (void*)&resp_read->result, SIPC_MARSHAL_DATA_INT_TYPE);
+                       access_rt = _convert_access_result_to_string(resp_read->result);
+                       sipc_util_marshal_object_add_data(out_o, "result", (void*)access_rt, SIPC_MARSHAL_DATA_STRING_TYPE);
                        sipc_util_marshal_object_add_data(out_o, "count", (void*)&resp_read->data.opwa.opwa_count, SIPC_MARSHAL_DATA_INT_TYPE);
-                       entry_o = sipc_util_marshal_object_create();
+                       dbg("tmp - resp_read->data.opwa.opwa_count[%d]",resp_read->data.opwa.opwa_count);
+
                        for(i=0;i < resp_read->data.opwa.opwa_count; i++){
                                gchar *entry_key = NULL;
+                               entry_o = sipc_util_marshal_object_create();
                                sipc_util_marshal_object_add_data(entry_o, "plmn", (void*)&resp_read->data.opwa.opwa[i].plmn, SIPC_MARSHAL_DATA_STRING_TYPE);
                                sipc_util_marshal_object_add_data(entry_o, "b_umts", (void*)&resp_read->data.opwa.opwa[i].b_umts, SIPC_MARSHAL_DATA_BOOLEAN_TYPE);
                                sipc_util_marshal_object_add_data(entry_o, "b_gsm", (void*)&resp_read->data.opwa.opwa[i].b_gsm, SIPC_MARSHAL_DATA_BOOLEAN_TYPE);
                                entry_key = g_strdup_printf("%d", i);
                                sipc_util_marshal_object_add_data(out_o, entry_key, entry_o, SIPC_MARSHAL_DATA_OBJECT_TYPE);
+                               dbg("resp_read->data.opwa.opwa[%d].plmn[%s]",i, resp_read->data.opwa.opwa[i].plmn);
+                               dbg("resp_read->data.opwa.opwa[%d].b_umts[%d]",i, resp_read->data.opwa.opwa[i].b_umts);
+                               dbg("resp_read->data.opwa.opwa[%d].b_gsm[%d]",i, resp_read->data.opwa.opwa[i].b_gsm);
                        }
+               }
                        break;
 
                default:
@@ -656,7 +1145,6 @@ gboolean scomm_service_notification_sim(Communicator *comm, CoreObject *source,
        gchar *out_d = NULL, *serial_d = NULL;
 
        struct custom_data *ctx = NULL;
-       sipc_server_t *s = NULL;
 
        struct _tapi_header hdr;
        struct _sipc_marshal_object* out_o = NULL;
@@ -669,24 +1157,27 @@ gboolean scomm_service_notification_sim(Communicator *comm, CoreObject *source,
                return FALSE;
        }
 
-       s = ctx->sk_server;
        dbg("notification !!! (command = 0x%x, data_len = %d)", command, data_len);
 
        out_o = sipc_util_marshal_object_create();
 
        switch (command) {
-               case TNOTI_SIM_STATUS :
+               case TNOTI_SIM_STATUS:
                        dbg("notified sim_status[%d]", n_sim_status->sim_status);
-                       sipc_util_marshal_object_add_data(out_o, "status", (void*)&n_sim_status->sim_status, SIPC_MARSHAL_DATA_INT_TYPE);
-                       sipc_util_marshal_object_add_data(out_o, "new_sim", (void*)&n_sim_status->b_changed, SIPC_MARSHAL_DATA_BOOLEAN_TYPE);
+                       hdr.cmd = TAPI_NOTI_SIM_STATUS;
+                       sipc_util_marshal_object_add_data(out_o, "status", (void*) &n_sim_status->sim_status,
+                                       SIPC_MARSHAL_DATA_INT_TYPE);
+                       sipc_util_marshal_object_add_data(out_o, "new_sim", (void*) &n_sim_status->b_changed,
+                                       SIPC_MARSHAL_DATA_BOOLEAN_TYPE);
                        break;
 
-               default :
-                       dbg("not handled command [%d] here",command);
+               default:
+                       dbg("unknown notification");
+                       return FALSE;
                        break;
        }
 
-       if(out_o){
+       if (out_o) {
                serial_d = sipc_util_marshal_object_serializer(out_o);
                hdr.data_len = strlen(serial_d);
                sipc_util_marshal_object_destory(out_o);
@@ -694,15 +1185,15 @@ gboolean scomm_service_notification_sim(Communicator *comm, CoreObject *source,
 
        out_d = g_new0(char, sizeof(struct _tapi_header)+hdr.data_len);
        memcpy(out_d, &hdr, sizeof(struct _tapi_header));
-       if(serial_d){
-               memcpy(out_d+sizeof(struct _tapi_header), serial_d, hdr.data_len);
+       if (serial_d) {
+               memcpy(out_d + sizeof(struct _tapi_header), serial_d, hdr.data_len);
                g_free(serial_d);
        }
 
-       ret = sipc_server_broadcast(s, out_d, sizeof(struct _tapi_header)+hdr.data_len);
+       ret = sipc_server_broadcast(ctx->sk_server, out_d, sizeof(struct _tapi_header) + hdr.data_len);
        g_free(out_d);
 
-       if(ret < 0){
+       if (ret < 0) {
                return FALSE;
        }
        return TRUE;