Fix 64bit build error
[platform/core/telephony/tel-plugin-imc.git] / src / imc_ss.c
index ac5b876..59ef8c9 100644 (file)
@@ -1,7 +1,9 @@
 /*
  * tel-plugin-imc
  *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: sharanayya mathapati <sharan.m@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  */
 
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-
 #include <glib.h>
 
 #include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <core_object.h>
 #include <hal.h>
+#include <core_object.h>
+#include <plugin.h>
 #include <queue.h>
-#include <storage.h>
-#include <at.h>
-
+#include <co_call.h>
 #include <co_ss.h>
+#include <user_request.h>
+#include <util.h>
+#include <server.h>
+#include <at.h>
 
-#include "imc_ss.h"
 #include "imc_common.h"
+#include "imc_ss.h"
 
-/* AT+CUSD = [<n> [, <str> [, <dcs>]]]
- * where,
- * <n>
- * 0 Disable
- * 1 Enable
- * 2 Cancel the session
- *
- * <str>
- * Ussd string
- *
- * <dcs>
- * Decoding format
- */
-static gboolean on_notification_imc_ss_ussd(CoreObject *co, const void *event_data, void *user_data)
+#define NUM_TYPE_INTERNATIONAL      0x01
+#define NUM_PLAN_ISDN                   0x01
+
+/* To avoid sending multiple response to application */
+static gboolean UssdResp = FALSE;
+
+enum  telephony_ss_opcode {
+       SS_OPCO_REG = 0x01,       /* 0x01 : Registration */
+       SS_OPCO_DEREG,            /* 0x02 : De-registration(erase) */
+       SS_OPCO_ACTIVATE,         /* 0x03 : Activation */
+       SS_OPCO_DEACTIVATE,       /* 0x04 : De-activation */
+       SS_OPCO_MAX
+};
+
+struct ss_confirm_info {
+       enum telephony_ss_class class;
+       int flavor_type;
+       enum tcore_response_command resp;
+       void *data;
+       int data_len;
+};
+
+static gboolean _ss_request_message(TcorePending *pending, CoreObject *o, UserRequest *ur, void *on_resp, void *user_data);
+
+static TReturn _ss_barring_get(CoreObject *o, UserRequest *ur, enum telephony_ss_class class, enum telephony_ss_barring_mode type, enum tcore_response_command resp);
+
+static TReturn _ss_forwarding_get(CoreObject *o, UserRequest *ur, enum telephony_ss_class class, enum telephony_ss_forwarding_mode type, enum tcore_response_command resp);
+
+static TReturn _ss_waiting_get(CoreObject *o, UserRequest *ur, enum telephony_ss_class class, enum tcore_response_command resp);
+
+static TReturn imc_ss_barring_activate(CoreObject *o, UserRequest *ur);
+static TReturn imc_ss_barring_deactivate(CoreObject *o, UserRequest *ur);
+static TReturn imc_ss_barring_change_password(CoreObject *o, UserRequest *ur);
+static TReturn imc_ss_barring_get_status(CoreObject *o, UserRequest *ur);
+
+static TReturn imc_ss_forwarding_activate(CoreObject *o, UserRequest *ur);
+static TReturn imc_ss_forwarding_deactivate(CoreObject *o, UserRequest *ur);
+static TReturn imc_ss_forwarding_register(CoreObject *o, UserRequest *ur);
+static TReturn imc_ss_forwarding_deregister(CoreObject *o, UserRequest *ur);
+static TReturn imc_ss_forwarding_get_status(CoreObject *o, UserRequest *ur);
+
+static TReturn imc_ss_waiting_activate(CoreObject *o, UserRequest *ur);
+static TReturn imc_ss_waiting_deactivate(CoreObject *o, UserRequest *ur);
+static TReturn imc_ss_waiting_get_status(CoreObject *o, UserRequest *ur);
+
+static TReturn imc_ss_cli_activate(CoreObject *o, UserRequest *ur);
+static TReturn imc_ss_cli_deactivate(CoreObject *o, UserRequest *ur);
+static TReturn imc_ss_cli_get_status(CoreObject *o, UserRequest *ur);
+
+static TReturn imc_ss_send_ussd(CoreObject *o, UserRequest *ur);
+
+static TReturn imc_ss_set_aoc(CoreObject *o, UserRequest *ur);
+static TReturn imc_ss_get_aoc(CoreObject *o, UserRequest *ur);
+
+static TReturn imc_ss_manage_call_0_send(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data);
+static TReturn imc_ss_manage_call_1_send(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data);
+static TReturn imc_ss_manage_call_1x_send(CoreObject *o, UserRequest *ur, const int id, ConfirmCallback cb, void *user_data);
+static TReturn imc_ss_manage_call_2_send(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data);
+static TReturn imc_ss_manage_call_2x_send(CoreObject *o, UserRequest *ur, const int id, ConfirmCallback cb, void *user_data);
+static TReturn imc_ss_manage_call_3_send(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data);
+static TReturn imc_ss_manage_call_4_send(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data);
+static TReturn imc_ss_manage_call_4dn_send(CoreObject *o, UserRequest *ur, const char *number, ConfirmCallback cb, void *user_data);
+
+static void on_confirmation_ss_message_send(TcorePending *p, gboolean result, void *user_data);
+
+static void _ss_ussd_response(UserRequest *ur, const char *ussd_str, enum telephony_ss_ussd_type type, enum telephony_ss_ussd_status status);
+static void _ss_ussd_notification(TcorePlugin *p, const char *ussd_str, enum telephony_ss_ussd_status status);
+
+static gboolean on_notification_ss_ussd(CoreObject *o, const void *data, void *user_data);
+
+
+static gboolean _ss_request_message(TcorePending *pending,
+       CoreObject *o, UserRequest *ur,
+       void *on_resp, void *user_data)
 {
-       gchar *cmd = 0;
-       gchar *resp_str = NULL;
-       guchar *dcs_str = NULL;
-       TelUtilAlphabetFormat dcs = TEL_UTIL_ALPHABET_FORMAT_SMS_DEFAULT;
-       gushort len;
+       TcoreHal *hal = NULL;
+       TReturn ret;
+       dbg("Entry");
+
+       if (on_resp)
+               tcore_pending_set_response_callback(pending, on_resp, user_data);
+
+       tcore_pending_set_send_callback(pending, on_confirmation_ss_message_send, NULL);
+
+       if (ur)
+               tcore_pending_link_user_request(pending, ur);
+       else
+               err("User Request is NULL, is this internal request??");
+
+       hal = tcore_object_get_hal(o);
+
+       /* Send request to HAL */
+       ret = tcore_hal_send_request(hal, pending);
+       if (TCORE_RETURN_SUCCESS != ret) {
+               err("Request send failed");
+               return FALSE;
+       }
+
+       dbg("Exit");
+       return TRUE;
+}
+
+static void _ss_ussd_response(UserRequest *ur,
+       const char *ussd_str, enum telephony_ss_ussd_type type,
+       enum telephony_ss_ussd_status status)
+{
+       struct tresp_ss_ussd resp;
+       dbg("Entry");
+
+       if (ur) {
+               memset(&resp, 0x0, sizeof(struct tresp_ss_ussd));
+               resp.type = type;
+               resp.status = status;
+               resp.err = SS_ERROR_NONE;
+               dbg("ussd_str = %s resp.type - %d resp.status - %d", ussd_str, resp.type, resp.status);
+
+               if (ussd_str) {
+                       int len = strlen(ussd_str);
+                       if (len < MAX_SS_USSD_LEN) {
+                               memcpy(resp.str, ussd_str, len);
+                               resp.str[len] = '\0';
+                       } else {
+                               memcpy(resp.str, ussd_str, MAX_SS_USSD_LEN);
+                               resp.str[MAX_SS_USSD_LEN - 1] = '\0';
+                       }
+                       dbg("Response string: %s", resp.str);
+               } else {
+                       dbg("USSD string is not present");
+                       memset(resp.str, '\0', MAX_SS_USSD_LEN);
+               }
+               UssdResp = TRUE;
+
+               /* Send response to TAPI */
+               tcore_user_request_send_response(ur, TRESP_SS_SEND_USSD, sizeof(struct tresp_ss_ussd), &resp);
+       } else {
+               err("User request is NULL");
+       }
+
+       dbg("Exit");
+       return;
+}
+
+static void _ss_ussd_notification(TcorePlugin *p, const char *ussd_str, enum telephony_ss_ussd_status status)
+{
+       CoreObject *core_obj = 0;
+       struct tnoti_ss_ussd noti;
+
+       dbg("function enter");
+       if (!p) {
+               dbg("[ error ] p : (NULL)");
+               return;
+       }
+       noti.status = status;
+       if (ussd_str) {
+               int len = strlen(ussd_str);
+               if (len < MAX_SS_USSD_LEN) {
+                       memcpy(noti.str, ussd_str, len);
+                       noti.str[len] = '\0';
+               } else {
+                       memcpy(noti.str, ussd_str, MAX_SS_USSD_LEN);
+                       noti.str[MAX_SS_USSD_LEN - 1] = '\0';
+               }
+       } else {
+               memset(noti.str, '\0', MAX_SS_USSD_LEN);
+       }
+       dbg("noti.str - %s", noti.str);
+
+       core_obj = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SS);
+       tcore_server_send_notification(tcore_plugin_ref_server(p),
+                                                                  core_obj,
+                                                                  TNOTI_SS_USSD,
+                                                                  sizeof(struct tnoti_ss_ussd),
+                                                                  (void *) &noti);
+}
+
+static gboolean on_notification_ss_ussd(CoreObject *o, const void *data, void *user_data)
+{
+       enum telephony_ss_ussd_status status;
+       UssdSession *ussd_session = 0;
+       char *ussd_str = 0, *cmd = 0;
+       TcorePlugin *plugin = 0;
+       int m = -1, dcs = 0;
+       char *ussdnoti = NULL, *str = NULL, *dcs_str = NULL;
        GSList *tokens = NULL;
        GSList *lines = NULL;
-       int ussd_status = 0;
-       TelSsUssdNoti ussd_noti = {0,};
+       char *ussd_string = NULL;
+       unsigned int len;
+
+       plugin = tcore_object_ref_plugin(o);
+       ussd_session = tcore_ss_ussd_get_session(o);
+
+       dbg("function enter");
+       lines = (GSList *) data;
+       if (1 != g_slist_length(lines)) {
+               dbg("unsolicited msg but multiple line");
+               return TRUE;
+       }
+
+       cmd = (char *)(lines->data);
+
+       /* parse ussd status */
+       tokens = tcore_at_tok_new(cmd);
+
+       /* parse <m> */
+       ussdnoti = g_slist_nth_data(tokens, 0);
+       if (!ussdnoti) {
+               dbg("+CUSD<m> is missing from %CUSD Notification");
+       } else {
+               m = atoi(ussdnoti);
+               dbg("USSD status  %d", m);
+
+               /* parse [ <str>, <dcs>] */
+               ussd_string = g_slist_nth_data(tokens, 1);
+               if (ussd_string) {
+                       /* Strike off starting & ending quotes. 1 extra character for NULL termination */
+                       str = malloc(strlen(ussd_string) - 1);
+                       dbg("length of Ussd Stirng - %d", strlen(ussd_string));
+                       if (str) {
+                               memset(str, 0x00, strlen(ussd_string) - 1);
+                       } else {
+                               dbg("malloc failed");
+                               if (NULL != tokens)
+                                       tcore_at_tok_free(tokens);
+
+                               return FALSE;
+                       }
+
+                       len = strlen(ussd_string) - 1;
+                       ++ussd_string;
+                       strncpy(str, ussd_string, len);
+
+                       dbg("USSD String - %s len = %d", str, strlen(str));
+               }
+
+               if ((dcs_str = g_slist_nth_data(tokens, 2))) {
+                       dcs = atoi(dcs_str);
+                       dbg("USSD dcs %d", dcs);
+               }
+       }
+
+       switch (m) {
+       case 0:
+               status = SS_USSD_NO_ACTION_REQUIRE;
+       break;
+
+       case 1:
+               status = SS_USSD_ACTION_REQUIRE;
+       break;
+
+       case 2:
+               status = SS_USSD_TERMINATED_BY_NET;
+       break;
+
+       case 3:
+               status = SS_USSD_OTHER_CLIENT;
+       break;
+
+       case 4:
+               status = SS_USSD_NOT_SUPPORT;
+       break;
+
+       case 5:
+               status = SS_USSD_TIME_OUT;
+       break;
+
+       default:
+               dbg("unsupported m : %d", m);
+               status = SS_USSD_MAX;
+       break;
+       }
+
+       switch (tcore_util_get_cbs_coding_scheme(dcs)) {
+       case TCORE_DCS_TYPE_7_BIT:
+       case TCORE_DCS_TYPE_UNSPECIFIED:
+       /* ussd_str = tcore_util_unpack_gsm7bit(str, strlen(str)); */
+       /* break; */
+
+       case TCORE_DCS_TYPE_UCS2:
+       case TCORE_DCS_TYPE_8_BIT:
+               if ((str != NULL) && (strlen(str) > 0)) {
+                       ussd_str = g_new0(char, strlen(str) + 1);
+                       if (ussd_str != NULL) {
+                               memcpy(ussd_str, str, strlen(str));
+                               ussd_str[strlen(str)] = '\0';
+                       }
+               }
+       break;
+
+       default:
+               dbg("[ error ] unknown dcs type. ussd_session : %x", ussd_session);
+               if (ussd_session) {
+                       UserRequest *ur = 0;
+                       enum telephony_ss_ussd_type type;
+
+                       tcore_ss_ussd_get_session_data(ussd_session, (void **) &ur);
+                       if (!ur) {
+                               dbg("[ error ] ur : (0)");
+                               goto CATCH;
+                       }
+
+                       type = (enum telephony_ss_ussd_type)tcore_ss_ussd_get_session_type(ussd_session);
+                       dbg("ussd type  - %d", type);
+
+                       _ss_ussd_response(ur, ussd_str, type, status);
+               }
+
+CATCH:
+               if (NULL != tokens)
+                       tcore_at_tok_free(tokens);
+
+               if (NULL != str)
+                       free(str);
+
+               return FALSE;
+       }
+
+       switch (status) {
+       case SS_USSD_NO_ACTION_REQUIRE:
+       case SS_USSD_ACTION_REQUIRE:
+       case SS_USSD_OTHER_CLIENT:
+       case SS_USSD_NOT_SUPPORT:
+       case SS_USSD_TIME_OUT:
+               if (ussd_session) {
+                       UserRequest *ur = 0;
+                       enum telephony_ss_ussd_type type;
+
+                       tcore_ss_ussd_get_session_data(ussd_session, (void **)&ur);
+                       if (!ur) {
+                               dbg("[ error ] ur : (0)");
+                               if (NULL != tokens)
+                                       tcore_at_tok_free(tokens);
+
+                               if (NULL != str)
+                                       free(str);
+
+                               if (ussd_str)
+                                       g_free(ussd_str);
+
+                               return FALSE;
+                       }
+                       type = (enum telephony_ss_ussd_type)tcore_ss_ussd_get_session_type(ussd_session);
+                       dbg("ussd type  - %d", type);
+
+                       _ss_ussd_response(ur, (const char *)ussd_str, type, status);
+
+                       if (ussd_str)
+                               g_free(ussd_str);
+               } else {
+                       tcore_ss_ussd_create_session(o, TCORE_SS_USSD_TYPE_NETWORK_INITIATED, 0, 0);
+                       _ss_ussd_notification(plugin, (const char *)ussd_str, status);
+
+                       if (ussd_str)
+                               g_free(ussd_str);
+               }
+       break;
+
+       case SS_USSD_TERMINATED_BY_NET:
+               if (ussd_session) {
+                       UserRequest *ur = 0;
+                       tcore_ss_ussd_get_session_data(ussd_session, (void **)&ur);
+                       if (ur)
+                               tcore_user_request_unref(ur);
+
+                       tcore_ss_ussd_destroy_session(ussd_session);
+               }
+       break;
+
+       default:
+       break;
+       }
+
+       if (NULL != tokens)
+               tcore_at_tok_free(tokens);
+
+       if (NULL != str)
+               free(str);
+
+       dbg("Exit");
+       return TRUE;
+}
+
+static gboolean on_notification_ss_cssu_info(CoreObject *co,
+       const void *event_data, void *user_data)
+{
+       TcorePlugin *p = NULL;
+       CoreObject *o = NULL;
+       GSList *tokens = NULL;
+       enum tcore_notification_command command = TNOTI_UNKNOWN;
+       char *resp = NULL;
+       char *cmd = 0;
+       int index = 0;
+       int code2 = -1;
+       char *number = NULL;
+       int id = 1;     /* TODO: Need to check how to fetch Call id */
+
+       dbg("entry");
+
+       p = tcore_object_ref_plugin(co);
+       o = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_CALL);
+       if (!o) {
+               err(" Call CoreObject not found ");
+               return FALSE;
+       }
+
+       if (1 != g_slist_length((GSList *) event_data)) {
+               err("unsolicited msg but multiple line");
+               return TRUE;
+       }
+       cmd = (char *) ((GSList *) event_data)->data;
+       info("ss notification message[%s]", cmd);
+
+       tokens = tcore_at_tok_new(cmd);
+
+       /* parse <code2> */
+       resp = g_slist_nth_data(tokens, 0);
+       if (NULL == resp) {
+               err("Code2 is missing from +CSSU indication");
+               tcore_at_tok_free(tokens);
+               return TRUE;
+       }
+       code2 = atoi(resp);
+
+       /* parse [ <index>, <number> <type>] */
+       if ((resp = g_slist_nth_data(tokens, 1)))
+               index = atoi(resp);
+
+       if ((resp = g_slist_nth_data(tokens, 2))) {
+               /* Strike off double quotes */
+               number = tcore_at_tok_extract(resp);
+       }
+
+       info("+CSSU: <code2> = %d <index> = %d ", code2, index);
+
+       /* <code2> - other values will be ignored */
+       switch (code2) {
+       case 0:
+               command = TNOTI_CALL_INFO_FORWARDED_CALL;
+       break;
+
+       case 2:
+               command = TNOTI_CALL_INFO_HELD;
+       break;
+
+       case 3:
+               command = TNOTI_CALL_INFO_ACTIVE;
+       break;
+
+       case 4:
+               command = TNOTI_CALL_INFO_JOINED;
+       break;
+
+       case 5:
+               command = TNOTI_CALL_INFO_RELEASED_ON_HOLD;
+       break;
+
+       case 6:
+               command = TNOTI_CALL_INFO_CF_CHECK_MESSAGE;
+       break;
+
+       case 7:
+               command = TNOTI_CALL_INFO_TRANSFER_ALERT;
+       break;
+
+       case 8:
+               command = TNOTI_CALL_INFO_TRANSFERED_CALL;
+       break;
+
+       case 9:
+               command = TNOTI_CALL_INFO_DEFLECTED_CALL;
+       break;
+
+       default:
+               err("Unsupported +CSSU notification : %d", code2);
+       break;
+       }
+
+       /* Send notification */
+       if (command != TNOTI_UNKNOWN) {
+               tcore_server_send_notification(tcore_plugin_ref_server(tcore_object_ref_plugin(o)),
+                       o, command, sizeof(unsigned int), (void *)&id);
+       }
+       tcore_at_tok_free(tokens);
+       g_free(number);
+
+       return TRUE;
+}
+
+static gboolean on_notification_ss_cssi_info(CoreObject *co,
+       const void *event_data, void *user_data)
+{
+       TcorePlugin *p = NULL;
+       CoreObject *o = NULL;
+       GSList *tokens = NULL;
+       enum tcore_notification_command command = TNOTI_UNKNOWN;
+       char *resp = NULL;
+       char *cmd = 0;
+       int index = 0;
+       int code1 = -1;
+       int id = 1;     /* TODO: Need to check how to fetch Call id */
+
+       dbg("entry");
+
+       p = tcore_object_ref_plugin(co);
+       o = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_CALL);
+       if (!o) {
+               err(" Call CoreObject not found ");
+               return FALSE;
+       }
+
+       if (1 != g_slist_length((GSList *) event_data)) {
+               err("unsolicited msg but multiple line");
+               return TRUE;
+       }
+       cmd = (char *) ((GSList *) event_data)->data;
+       info("ss notification message[%s]", cmd);
+
+       tokens = tcore_at_tok_new(cmd);
+
+       /* parse <code1> */
+       resp = g_slist_nth_data(tokens, 0);
+       if (NULL == resp) {
+               err("<code1> is missing from %CSSI indication");
+               tcore_at_tok_free(tokens);
+               return TRUE;
+       }
+       code1 = atoi(resp);
+
+       /* parse [ <index>] */
+       if ((resp = g_slist_nth_data(tokens, 1)))
+               index = atoi(resp);
+
+       info("+CSSI: <code1> = %d <index> = %d ", code1, index);
+
+       /* <code1> - other values will be ignored */
+       switch (code1) {
+       case 0:
+               command = TNOTI_CALL_INFO_FORWARD_UNCONDITIONAL;
+       break;
+
+       case 1:
+               command = TNOTI_CALL_INFO_FORWARD_CONDITIONAL;
+       break;
+
+       case 2:
+               command = TNOTI_CALL_INFO_FORWARDED;
+       break;
+
+       case 3:
+               command = TNOTI_CALL_INFO_WAITING;
+       break;
+
+       case 5:
+               command = TNOTI_CALL_INFO_BARRED_OUTGOING;
+       break;
+
+       case 6:
+               command = TNOTI_CALL_INFO_BARRED_INCOMING;
+       break;
+
+       case 7:
+               command = TNOTI_CALL_INFO_CLIR_SUPPRESSION_REJECT;
+       break;
+
+       case 8:
+               command  = TNOTI_CALL_INFO_DEFLECTED;
+       break;
+
+       default:
+               dbg("Unsupported +CSSI notification : %d", code1);
+       break;
+       }
+
+       /* Send notification */
+       if (command != TNOTI_UNKNOWN) {
+               tcore_server_send_notification(tcore_plugin_ref_server(tcore_object_ref_plugin(o)),
+                       o, command, sizeof(unsigned int), (void *)&id);
+       }
+       tcore_at_tok_free(tokens);
+
+       return TRUE;
+}
+
+static void on_confirmation_ss_message_send(TcorePending *p, gboolean result, void *user_data)
+{
+       dbg("");
+
+       if (result == FALSE) {
+               /* Fail */
+               dbg("FAIL");
+       } else {
+               dbg("SEND OK");
+       }
+}
+
+static void on_response_ss_barring_set(TcorePending *p, int data_len, const void *data, void *user_data)
+{
+       struct ss_confirm_info *info = 0;
+       enum telephony_ss_class class;
+       CoreObject *o = 0;
+       UserRequest *ur;
+       struct tresp_ss_barring resp = {0, };
+       UserRequest *ur_dup = 0;
+       GSList *tokens = NULL;
+       const char *line;
+       int error;
+       const TcoreATResponse *response;
+
+       dbg("function enter");
+       response = data;
+       o = tcore_pending_ref_core_object(p);
+       ur = tcore_pending_ref_user_request(p);
+
+       info = (struct ss_confirm_info *)user_data;
+       class = info->class;
+
+       if (response->success > 0) {
+               dbg("RESPONSE OK");
+               resp.err = SS_ERROR_NONE;
+       } else {
+               dbg("RESPONSE NOT OK");
+               line = (const char *)response->final_response;
+               tokens = tcore_at_tok_new(line);
+
+               if (g_slist_length(tokens) < 1) {
+                       dbg("err cause not specified or string corrupted");
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               } else {
+                       error = atoi(g_slist_nth_data(tokens, 0));
+                       err("Error: [%d]", error);
+                       /* TODO: CMEE error mapping is required. */
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               }
+               tcore_at_tok_free(tokens);
+       }
+
+       dbg("on_response_ss_barring_set - rsp.err : %d, ur : %x flavor_type = %d", resp.err, ur, info->flavor_type);
+       dbg("[ check ] class : 0x%x", info->class);
+
+       if (response->success > 0) {
+               if (info->class == SS_CLASS_VOICE)
+                       class = SS_CLASS_ALL_TELE_BEARER;
+
+               ur_dup = tcore_user_request_ref(ur);
+
+               if (info->flavor_type == SS_BARR_MODE_AB || info->flavor_type == SS_BARR_MODE_AOB)
+                       _ss_barring_get(o, ur_dup, class, SS_BARR_MODE_BAOC, info->resp);
+               else if (info->flavor_type == SS_BARR_MODE_AIB)
+                       _ss_barring_get(o, ur_dup, class, SS_BARR_MODE_BAIC, info->resp);
+               else
+                       _ss_barring_get(o, ur_dup, class, info->flavor_type, info->resp);
+       } else {
+               if (ur)
+                       tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_barring), &resp);
+               else
+                       dbg("[ error ] ur is 0");
+       }
+       g_free(user_data);
+}
+
+static void on_response_ss_barring_change_pwd(TcorePending *p, int data_len, const void *data, void *user_data)
+{
+       const TcoreATResponse *response = data;
+       struct ss_confirm_info *info = 0;
+       UserRequest *ur;
+       struct tresp_ss_general resp;
+       int error;
+       GSList *tokens = NULL;
+       const char *line;
+
+       dbg("function enter");
+       ur = tcore_pending_ref_user_request(p);
+       info = (struct ss_confirm_info *) user_data;
+
+       if (response->success > 0) {
+               dbg("RESPONSE OK");
+               resp.err = SS_ERROR_NONE;
+       } else {
+               dbg("RESPONSE NOT OK");
+
+               line = (const char *) response->final_response;
+               tokens = tcore_at_tok_new(line);
+
+               if (g_slist_length(tokens) < 1) {
+                       dbg("err cause not specified or string corrupted");
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               } else {
+                       error = atoi(g_slist_nth_data(tokens, 0));
+                       err("Error: [%d]", error);
+                       /* TODO: CMEE error mapping is required. */
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               }
+               tcore_at_tok_free(tokens);
+       }
+
+       dbg("on_response_ss_barring_change_pwd: rsp.err : %d, usr : %x", resp.err, ur);
+       if (ur)
+               tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_general), &resp);
+       else
+               dbg("[ error ] ur is 0");
+
+       g_free(user_data);
+}
+
+static void on_response_ss_forwarding_set(TcorePending *p, int data_len, const void *data, void *user_data)
+{
+       CoreObject *o = 0;
+       UserRequest *ur = 0, *dup_ur = 0;
+       struct ss_confirm_info *info = 0;
+       struct tresp_ss_forwarding resp = {0,};
+       GSList *tokens = NULL;
+       const char *line;
+       int error;
+       const TcoreATResponse *response;
+
+       dbg("function enter");
+
+       response = data;
+       o = tcore_pending_ref_core_object(p);
+       ur = tcore_pending_ref_user_request(p);
+
+       info = (struct ss_confirm_info *) user_data;
+
+       if (response->success > 0) {
+               dbg("RESPONSE OK");
+               resp.err = SS_ERROR_NONE;
+       } else {
+               dbg("RESPONSE NOT OK");
+
+               /* Extract Error */
+               line = (const char *) response->final_response;
+               tokens = tcore_at_tok_new(line);
+
+               if (g_slist_length(tokens) < 1) {
+                       dbg("Error cause not specified or string corrupted");
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               } else {
+                       error = atoi(g_slist_nth_data(tokens, 0));
+                       err("Error: [%d]", error);
+                       /* / TODO: CMEE error mapping is required. */
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               }
+
+               tcore_at_tok_free(tokens);
+       }
+
+       dbg("[ check ] class : 0x%x", info->class);
+       dbg("[ check ] flavor_type : 0x%x", info->flavor_type);
+
+       dbg("on_response_ss_forwarding_set - rsp.err : %d, ur : %x", resp.err, ur);
+
+       if (response->success > 0) {
+               if (info->flavor_type == SS_CF_MODE_CF_ALL ||
+                               info->flavor_type == SS_CF_MODE_CFC) {
+                       if (ur)
+                               tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_forwarding), &resp);
+                       else
+                               dbg("[ error ] ur is 0");
+               } else {
+                       dup_ur = tcore_user_request_ref(ur);
+                       _ss_forwarding_get(o, dup_ur, info->class, info->flavor_type, info->resp);
+               }
+       } else {
+               if (ur)
+                       tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_forwarding), &resp);
+               else
+                       dbg("[ error ] ur is 0");
+       }
+       g_free(user_data);
+}
+
+static void on_response_ss_waiting_set(TcorePending *p, int data_len, const void *data, void *user_data)
+{
+       CoreObject *core_obj = 0;
+       UserRequest *ur = 0;
+       UserRequest *ur_dup = 0;
+       struct ss_confirm_info *info = 0;
+       struct tresp_ss_waiting resp = {0,};
+       GSList *tokens = NULL;
+       const char *line;
+       int error;
+       const TcoreATResponse *response;
+
+       dbg("function enter");
+       response = data;
+       core_obj = tcore_pending_ref_core_object(p);
+       ur = tcore_pending_ref_user_request(p);
+
+       info = (struct ss_confirm_info *)user_data;
+
+       if (response->success > 0) {
+               dbg("RESPONSE OK");
+               resp.err = SS_ERROR_NONE;
+       } else {
+               dbg("RESPONSE NOT OK");
+
+               /* Extract Error */
+               line = (const char *) response->final_response;
+               tokens = tcore_at_tok_new(line);
+
+               if (g_slist_length(tokens) < 1) {
+                       dbg("Error cause not specified or string corrupted");
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               } else {
+                       error = atoi(g_slist_nth_data(tokens, 0));
+                       err("Error: [%d]", error);
+                       /* TODO: CMEE error mapping is required. */
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               }
+
+               /* Free tokens */
+               tcore_at_tok_free(tokens);
+       }
+
+       dbg("Call Waiting - Error: [%d], UR: [0x%x] class: [0x%2x]", resp.err, ur, info->class);
+       if (resp.err == SS_ERROR_NONE) {
+               ur_dup = tcore_user_request_ref(ur);
+
+               dbg("Get Call Waiting status");
+               _ss_waiting_get(core_obj, ur_dup, info->class, info->resp);
+       } else {
+               if (ur)
+                       tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_waiting), &resp);
+               else
+                       err("User request is NULL");
+       }
+       g_free(user_data);
+}
+
+
+static void on_confirmation_ss_ussd(TcorePending *p, int data_len, const void *data, void *user_data)
+{
+       CoreObject *core_obj = 0;
+       struct ss_confirm_info *info = 0;
+       struct tresp_ss_ussd resp;
+       UserRequest *ur = NULL, *ussd_ur = NULL;
+       GSList *tokens = NULL;
+       const char *line;
+       int error;
+       UssdSession *ussd_s = NULL;
+       enum tcore_ss_ussd_type type = TCORE_SS_USSD_TYPE_MAX;
+       const TcoreATResponse *response;
+
+       dbg("function enter");
+       response = data;
+       ur = tcore_pending_ref_user_request(p);
+       info = (struct ss_confirm_info *) user_data;
+
+       memset(resp.str, 0x00, MAX_SS_USSD_LEN);
+
+       core_obj = tcore_pending_ref_core_object(p);
+       ussd_s = tcore_ss_ussd_get_session(core_obj);
+
+       if (ussd_s)
+               type = tcore_ss_ussd_get_session_type(ussd_s);
+       else
+               dbg("[ error ] ussd_s : (0)");
+
+       resp.type = (enum telephony_ss_ussd_type) type;
+       resp.status = SS_USSD_MAX; /* hardcoded value. */
+
+       if (response->success > 0) {
+               dbg("RESPONSE OK");
+               resp.err = SS_ERROR_NONE;
+       } else {
+               dbg("RESPONSE NOT OK");
+
+               line = (const char *) response->final_response;
+               tokens = tcore_at_tok_new(line);
+
+               if (g_slist_length(tokens) < 1) {
+                       dbg("err cause not specified or string corrupted");
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               } else {
+                       error = atoi(g_slist_nth_data(tokens, 0));
+                       err("Error: [%d]", error);
+                       /* TODO: CMEE error mapping is required. */
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               }
+               tcore_at_tok_free(tokens);
+       }
+
+       dbg("on_confirmation_ss_ussd - rsp.err : %d, ur : %x", resp.err, ur);
+
+       if (response->success > 0) {
+               if (type == TCORE_SS_USSD_TYPE_USER_INITIATED) {
+                       dbg("ussd type %d", resp.type);
+
+                       if (ussd_s) {
+                               tcore_ss_ussd_get_session_data(ussd_s, (void **) &ussd_ur);
+                               if (ussd_ur)
+                                       tcore_user_request_free(ussd_ur);
+                       }
+               }
+       }
+
+       if (ussd_s)
+               tcore_ss_ussd_destroy_session(ussd_s);
+
+       if (ur) {
+               if (UssdResp == FALSE) { /* to avoid sending multiple response to application. */
+                       tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_ussd), &resp);
+               }
+               UssdResp = FALSE;
+       } else
+               dbg("[ error ] ur : (0)");
+
+       g_free(user_data);
+}
+
+static void on_response_ss_barring_get(TcorePending *p, int data_len, const void *data, void *user_data)
+{
+       UserRequest *ur = 0;
+       int status = 0, classx = 0, ss_err = 0;
+       GSList *respdata;
+       struct ss_confirm_info *info = 0;
+       struct tresp_ss_barring resp;
+       int countRecords = 0, countValidRecords = 0;
+       GSList *tokens = NULL;
+       const char *line;
+       char *classx_str;
+       char *stat = NULL;
+       const TcoreATResponse *response;
+
+       dbg("function enter");
+
+       response = data;
+       ur = tcore_pending_ref_user_request(p);
+       info = (struct ss_confirm_info *) user_data;
+
+       if (response->lines) {
+               respdata = (GSList *) response->lines;
+               countRecords = g_slist_length(respdata);
+               dbg("total records : %d", countRecords);
+       } else {
+               countRecords = 0;
+               dbg("no active status - return to user");
+       }
+       resp.record_num = countRecords;
+       resp.record = 0;
+       if (resp.record_num > 0) {
+               resp.record = g_new0(struct barring_info, resp.record_num);
+               for (countValidRecords = 0; respdata != NULL; respdata = respdata->next) {
+                       line = (const char *) (respdata->data);
+                       tokens = tcore_at_tok_new(line);
+
+                       /* parse <status> */
+                       stat = g_slist_nth_data(tokens, 0);
+                       if (!stat) {
+                               dbg("Stat is missing");
+                               goto error;
+                       }
+
+                       status = atoi(stat);
+                       if (status == 1)
+                               resp.record[countValidRecords].status = SS_STATUS_ACTIVATE;
+                       else
+                               resp.record[countValidRecords].status = SS_STATUS_DEACTIVATE;
+
+                       dbg("call barring status - %d", status);
+
+                       /* Parse <class> */
+                       classx_str = g_slist_nth_data(tokens, 1);
+
+                       if (!classx_str) {
+                               dbg("class error. classx not exist - set to requested one : %d", info->class);
+                               switch (info->class) {
+                               case SS_CLASS_ALL_TELE:
+                                       classx = 7;
+                               break;
+
+                               case SS_CLASS_VOICE:
+                                       classx = 1;
+                               break;
+
+                               case SS_CLASS_ALL_DATA_TELE:
+                                       classx = 2;
+                               break;
+
+                               case SS_CLASS_FAX:
+                                       classx = 4;
+                               break;
+
+                               case SS_CLASS_SMS:
+                                       classx = 8;
+                               break;
+
+                               case SS_CLASS_ALL_CS_SYNC:
+                                       classx = 16;
+                               break;
+
+                               default:
+                                       classx = 7;
+                                       dbg("unsupported class %d. set to default : 7", info->class);
+                               break;
+                               }
+                       } else {
+                               classx = atoi(classx_str);
+                               dbg("call barring classx - %d", classx);
+                       }
+
+                       switch (classx) {
+                       case 1:
+                               resp.record[countValidRecords].class = SS_CLASS_VOICE;
+                       break;
+
+                       case 2:
+                               resp.record[countValidRecords].class = SS_CLASS_ALL_DATA_TELE;
+                       break;
+
+                       case 4:
+                               resp.record[countValidRecords].class = SS_CLASS_FAX;
+                       break;
+
+                       case 7:
+                               resp.record[countValidRecords].class = SS_CLASS_ALL_TELE;
+                       break;
+
+                       case 8:
+                               resp.record[countValidRecords].class = SS_CLASS_SMS;
+                       break;
+
+                       case 16:
+                               resp.record[countValidRecords].class = SS_CLASS_ALL_CS_SYNC;
+                       break;
+
+                       case 32:
+                               resp.record[countValidRecords].class = SS_CLASS_ALL_CS_ASYNC;
+                       break;
+
+                       default:
+                               dbg("unspoorted class : [%d]\n", classx);
+                               goto error;
+                       }
+                       resp.record[countValidRecords].mode = (enum telephony_ss_barring_mode) (info->flavor_type);
+                       countValidRecords++;
+                       tcore_at_tok_free(tokens);
+                       continue;
+
+error:
+                       dbg("invalid field found. coutinue");
+                       tcore_at_tok_free(tokens);
+                       continue;
+               }
+
+               dbg("valid count :%d", countValidRecords);
+               resp.record_num = countValidRecords;
+               resp.err = SS_ERROR_NONE;
+       } else {
+               dbg("no active status - return to user");
+       }
+
+       if (response->success > 0) {
+               dbg("RESPONSE OK");
+               resp.err = SS_ERROR_NONE;
+       } else {
+               dbg("RESPONSE NOT OK");
+               resp.err = TCORE_RETURN_FAILURE;
+               resp.record = 0;
+               resp.record_num = 0;
+
+               line = (const char *) response->final_response;
+               tokens = tcore_at_tok_new(line);
+
+               if (g_slist_length(tokens) < 1) {
+                       dbg("err cause not specified or string corrupted");
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               } else {
+                       ss_err = atoi(g_slist_nth_data(tokens, 0));
+                       err("Error: [%d]", ss_err);
+                       /* TODO: CMEE error mapping is required. */
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               }
+               tcore_at_tok_free(tokens);
+       }
+
+       dbg("on_response_ss_barring_get- rsp.err : %d, ur : %x", resp.err, ur);
+
+       if (ur)
+               tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_barring), &resp);
+       else
+               dbg("[ error ] ur is 0");
+
+       if (resp.record) {
+               g_free(resp.record);
+               resp.record = NULL;
+       }
+
+       g_free(user_data);
+}
+
+static void on_response_ss_forwarding_get(TcorePending *p, int data_len, const void *data, void *user_data)
+{
+       UserRequest *ur = 0;
+       int classx = 0, ss_err = 0, time = 0;
+       char *num;
+       struct ss_confirm_info *info = 0;
+       struct tresp_ss_forwarding resp;
+       int countRecords = 0, countValidRecords = 0;
+
+       GSList *respdata = NULL, *tokens = NULL;
+       const char *line;
+       char *classx_str, *status, *ton, *time_str;
+       const TcoreATResponse *response;
+
+       dbg("function enter");
+       response = data;
+
+       ur = tcore_pending_ref_user_request(p);
+       info = (struct ss_confirm_info *) user_data;
+       if (response->lines) {
+               respdata = (GSList *) response->lines;
+               countRecords = g_slist_length(respdata);
+               dbg("total records : %d", countRecords);
+       } else {
+               countRecords = 0;
+               dbg("no active status - return to user");
+       }
+       resp.record_num = countRecords;
+       resp.record = 0;
+       if (resp.record_num > 0) {
+               resp.record = g_new0(struct forwarding_info, resp.record_num);
+
+               for (countValidRecords = 0; respdata != NULL; respdata = respdata->next) {
+                       line = (const char *) (respdata->data);
+                       tokens = tcore_at_tok_new(line);
+
+                       /* parse <status> */
+                       status = g_slist_nth_data(tokens, 0);
+                       if (!status) {
+                               dbg("start line error. skip this line");
+                               goto error;
+                       } else {
+                               if (atoi(status) == 1)
+                                       resp.record[countValidRecords].status = SS_STATUS_ACTIVATE;
+                               else
+                                       resp.record[countValidRecords].status = SS_STATUS_DEACTIVATE;
+                       }
+
+                       /* Parse <class> */
+                       classx_str = g_slist_nth_data(tokens, 1);
+                       if (!classx_str) {
+                               dbg("class error. skip this line");
+                               goto error;
+                       } else {
+                               switch (atoi(classx_str)) {
+                               case 1:
+                                       resp.record[countValidRecords].class = SS_CLASS_VOICE;
+                               break;
+
+                               case 2:
+                                       resp.record[countValidRecords].class = SS_CLASS_ALL_DATA_TELE;
+                               break;
+
+                               case 4:
+                                       resp.record[countValidRecords].class = SS_CLASS_FAX;
+                               break;
+
+                               case 7:
+                                       resp.record[countValidRecords].class = SS_CLASS_ALL_TELE;
+                               break;
+
+                               case 8:
+                                       resp.record[countValidRecords].class = SS_CLASS_SMS;
+                               break;
+
+                               case 16:
+                                       resp.record[countValidRecords].class = SS_CLASS_ALL_CS_SYNC;
+                               break;
+
+                               case 32:
+                                       resp.record[countValidRecords].class = SS_CLASS_ALL_CS_ASYNC;
+                               break;
+
+                               default:
+                                       dbg("unspoorted class : [%d]\n", classx);
+                                       goto error;
+                               }
+                       }
+
+                       /* parse  <numer> <type> */
+                       num = g_slist_nth_data(tokens, 2);
+                       if (num) {
+                               dbg("number  - %s", num);
+                               memcpy((resp.record[countValidRecords].number), num, strlen(num));
+                               resp.record[countValidRecords].number_present = TRUE;
+
+                               ton = g_slist_nth_data(tokens, 3);
+                               if (ton) {
+                                       resp.record[countValidRecords].ton = atoi(ton);
+                                       dbg("number  type - %d", resp.record[countValidRecords].ton);
+                               }
+                       }
+
+                       /* skip  <subaddr> <satype> */
+                       /* parse  <time> */
+                       time_str = g_slist_nth_data(tokens, 6);
+                       if (time_str) {
+                               time = atoi(time_str);
+                               resp.record[countValidRecords].time = (enum telephony_ss_forwarding_no_reply_time) time;
+                               dbg("time  - %d", time);
+                       }
+
+                       resp.record[countValidRecords].mode = (enum telephony_ss_forwarding_mode) (info->flavor_type);
+                       dbg("flavor_type  - %d", (enum telephony_ss_forwarding_mode) (info->flavor_type));
+
+                       countValidRecords++;
+                       tcore_at_tok_free(tokens);
+                       continue;
+error:
+                       dbg("invalid field found. coutinue");
+                       tcore_at_tok_free(tokens);
+                       continue;
+               }
+               dbg("valid count :%d", countValidRecords);
+               resp.record_num = countValidRecords;
+               resp.err = SS_ERROR_NONE;
+       } else {
+               dbg("no active status - return to user");
+       }
+
+       if (response->success > 0) {
+               dbg("RESPONSE OK");
+               resp.err = SS_ERROR_NONE;
+       } else {
+               dbg("RESPONSE NOT OK");
+               resp.record = 0;
+               resp.record_num = 0;
+               line = (const char *) response->final_response;
+               tokens = tcore_at_tok_new(line);
+
+               if (g_slist_length(tokens) < 1) {
+                       dbg("err cause not specified or string corrupted");
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               } else {
+                       ss_err = atoi(g_slist_nth_data(tokens, 0));
+                       err("Error: [%d]", ss_err);
+                       /* TODO: CMEE error mapping is required. */
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               }
+               tcore_at_tok_free(tokens);
+       }
+
+       dbg("on_response_ss_forwarding_get- rsp.err : %d, ur : %x", resp.err, ur);
+       if (ur)
+               tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_forwarding), &resp);
+       else
+               dbg("[ error ] ur is 0");
+
+       if (resp.record) {
+               g_free(resp.record);
+               resp.record = NULL;
+       }
+       g_free(user_data);
+}
+
+static void on_response_ss_waiting_get(TcorePending *p, int data_len, const void *data, void *user_data)
+{
+       UserRequest *ur = 0;
+       GSList *respdata, *tokens = NULL;
+       int classx = 0, ss_err = 0;
+       struct ss_confirm_info *info = 0;
+       struct tresp_ss_waiting resp;
+       int countRecords = 0, countValidRecords = 0;
+       const char *line;
+       char *classx_str, *status;
+       const TcoreATResponse *response;
+
+       dbg("function enter");
+       response = data;
+       ur = tcore_pending_ref_user_request(p);
+       info = (struct ss_confirm_info *) user_data;
+
+       if (response->lines) {
+               respdata = (GSList *) response->lines;
+               countRecords = g_slist_length(respdata);
+               dbg("total records : %d", countRecords);
+       } else {
+               countRecords = 0;
+               dbg("no active status - return to user");
+       }
+       resp.record_num = countRecords;
+       resp.record = 0;
+
+       if (resp.record_num > 0) {
+               resp.record = g_new0(struct waiting_info, resp.record_num);
+
+               for (countValidRecords = 0; respdata != NULL; respdata = respdata->next) {
+                       line = (const char *) (respdata->data);
+                       tokens = tcore_at_tok_new(line);
+
+                       /* parse <status> */
+                       status = g_slist_nth_data(tokens, 0);
+                       if (!status) {
+                               dbg("Missing stat  in responce ");
+                               goto error;
+                       } else {
+                               if (atoi(status) == 1)
+                                       resp.record[countValidRecords].status = SS_STATUS_ACTIVATE;
+                               else
+                                       resp.record[countValidRecords].status = SS_STATUS_DEACTIVATE;
+                       }
+                       dbg("status = %d", resp.record[countValidRecords].status);
+
+                       /* Parse <class> */
+                       classx_str = g_slist_nth_data(tokens, 1);
+                       if (!classx_str) {
+                               dbg("error - class is missing");
+                               goto error;
+                       } else {
+                               switch (atoi(classx_str)) {
+                               case 1:
+                                       resp.record[countValidRecords].class = SS_CLASS_VOICE;
+                               break;
 
-       lines = (GSList *) event_data;
+                               case 2:
+                                       resp.record[countValidRecords].class = SS_CLASS_ALL_DATA_TELE;
+                               break;
 
-       if (g_slist_length(lines) != 1) {
-               dbg("Unsolicited message but multiple lines");
-               return TRUE;
-       }
+                               case 4:
+                                       resp.record[countValidRecords].class = SS_CLASS_FAX;
+                               break;
 
-       cmd = (char *) (lines->data);
-       tokens = tcore_at_tok_new(cmd);
+                               case 7:
+                                       resp.record[countValidRecords].class = SS_CLASS_ALL_TELE;
+                               break;
 
-       /* Parse USSD status */
-       resp_str = g_slist_nth_data(tokens, 0);
-       if (NULL == resp_str) {
-               err("status is missing from %CUSD Notification");
-               tcore_at_tok_free(tokens);
-               return TRUE;
-       } else {
-               ussd_status = atoi(resp_str);
-               dbg("USSD status[%d]", ussd_status);
+                               case 8:
+                                       resp.record[countValidRecords].class = SS_CLASS_SMS;
+                               break;
 
-               if (ussd_status < TEL_SS_USSD_STATUS_NO_ACTION_REQUIRED ||
-                               ussd_status > TEL_SS_USSD_STATUS_TIME_OUT) {
-                       err("invalid USSD status");
-                       tcore_at_tok_free(tokens);
-                       return TRUE;
-               }
+                               case 16:
+                                       resp.record[countValidRecords].class = SS_CLASS_ALL_CS_SYNC;
+                               break;
 
-               /* When network terminated the USSD session, no need to send notification to application */
-               if (ussd_status == TEL_SS_USSD_STATUS_TERMINATED_BY_NETWORK) {
-                       /* destroy USSD session if any */
-                       UssdSession *ussd_session;
-                       ussd_session = tcore_ss_ussd_get_session(co);
+                               case 32:
+                                       resp.record[countValidRecords].class = SS_CLASS_ALL_CS_ASYNC;
+                               break;
 
-                       if (ussd_session)
-                               tcore_ss_ussd_destroy_session(ussd_session);
+                               default:
+                                       dbg("unspoorted class : [%d]\n", classx);
+                                       goto error;
+                               }
+                               dbg("class info %d", resp.record[countValidRecords].class);
+                       }
 
+                       countValidRecords++;
                        tcore_at_tok_free(tokens);
-                       return TRUE;
-               }
-
-               /* Parse USSD string */
-               resp_str = g_slist_nth_data(tokens, 1);
-
-               resp_str = tcore_at_tok_extract(resp_str);
-               if (resp_str) {
-                       len = strlen((gchar *)resp_str);
-                       dbg("USSD String: [%s], len: [%d]", resp_str, len);
-               } else {
-                       dbg("Ussd strings is missing from %CUSD Notification");
+                       continue;
+error:
+                       dbg("invalid field found. coutinue");
                        tcore_at_tok_free(tokens);
-                       return TRUE;
+                       continue;
                }
 
-               dcs_str = g_slist_nth_data(tokens, 2);
+               dbg("valid count :%d", countValidRecords);
+               resp.record_num = countValidRecords;
+               resp.err = SS_ERROR_NONE;
+       } else {
+               dbg("no active status - return to user");
        }
 
-       if (dcs_str) {
-               dcs = tcore_util_get_cbs_coding_scheme(atoi((gchar *)dcs_str));
+       if (response->success > 0) {
+               dbg("RESPONSE OK");
+               resp.err = SS_ERROR_NONE;
        } else {
-               warn("No dcs string. Using default dcs value");
+               dbg("RESPONSE NOT OK");
+               resp.record = 0;
+               resp.record_num = 0;
+               line = (const char *) response->final_response;
+               tokens = tcore_at_tok_new(line);
+
+               if (g_slist_length(tokens) < 1) {
+                       dbg("err cause not specified or string corrupted");
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               } else {
+                       ss_err = atoi(g_slist_nth_data(tokens, 0));
+                       err("Error: [%d]", ss_err);
+                       /* TODO: CMEE error mapping is required. */
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               }
+               tcore_at_tok_free(tokens);
        }
 
-       ussd_noti.str = tcore_malloc0(len+1);
+       dbg("on_response_ss_waiting_get - rsp.err : %d, ur : %x", resp.err, ur);
+       if (ur)
+               tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_waiting), &resp);
+       else
+               dbg("[ error ] ur is 0");
 
-       if ((tcore_util_convert_str_to_utf8(ussd_noti.str, &len, dcs,
-               (const guchar *)resp_str, len+1)) == FALSE) {
-               /* In case of Unhandled dcs type(Reserved), ussd string to ussd_noti.str */
-               memcpy(ussd_noti.str, resp_str, len);
+       if (resp.record) {
+               g_free(resp.record);
+               resp.record = NULL;
        }
+       g_free(user_data);
+}
 
-       dbg("ussd_noti.str[%s]", ussd_noti.str);
 
-       ussd_noti.status = ussd_status;
+static void on_response_ss_cli_get(TcorePending *p, int data_len, const void *data, void *user_data)
+{
+       UserRequest *ur = 0;
+       struct tresp_ss_cli resp;
+       enum telephony_ss_cli_type *p_type = NULL;
+       char *line = NULL, *status;
+       int error = FALSE;
+       int cli_adj, stat = 0;
+       GSList *tokens = NULL;
+       const TcoreATResponse *response;
 
-       tcore_object_send_notification(co,
-               TCORE_NOTIFICATION_SS_USSD,
-               sizeof(TelSsUssdNoti), (void *)&ussd_noti);
+       dbg("function enter");
+       response = data;
+       ur = tcore_pending_ref_user_request(p);
+       p_type = (enum telephony_ss_cli_type *) (user_data);
 
-       tcore_at_tok_free(tokens);
-       tcore_free(resp_str);
-       tcore_free(ussd_noti.str);
+       if (response->success > 0) {
+               line = (char *) (((GSList *) response->lines)->data);
+               tokens = tcore_at_tok_new(line);
 
-       return TRUE;
-}
+               if (*p_type == SS_CLI_TYPE_CLIR) {
+                       /* +CLIR: <n> <m> */
+                       dbg("CLI type is CLIR");
+                       /* parse <n> */
+                       status = g_slist_nth_data(tokens, 0);
 
-static gboolean __imc_ss_convert_modem_class_to_class(gint classx, TelSsClass *class)
-{
-       switch(classx)
-       {
-       case 7:
-               *class = TEL_SS_CLASS_ALL_TELE;
-               break;
+                       if (!status) {
+                               dbg("Call line identification adjustment missing <n>");
+                       } else {
+                               cli_adj = atoi(status);
+                               dbg("CLIR response value of <n> - %d", cli_adj);
+
+                               if (cli_adj == 0) {
+                                       /* parse <m> */
+                                       status = g_slist_nth_data(tokens, 1);
+                                       if (!status)
+                                               dbg("status is missing<m>");
+                                       else
+                                               stat = atoi(status);
+                                       dbg("CLIR response value of <m> - %d", stat);
+
+                                       if (stat == 1 || stat == 3)
+                                               resp.status = TRUE;
+                                       else
+                                               resp.status = FALSE;
+                               } else if (cli_adj == 1) {
+                                       resp.status = TRUE;
+                               } else {
+                                       resp.status = FALSE;
+                               }
+                               dbg("resp.status -  %d", resp.status);
+                       }
+                       tcore_at_tok_free(tokens);
+               } else {
+                       /* parse <n> */
+                       status = g_slist_nth_data(tokens, 0);
+                       if (!status) {
+                               dbg("Stat is missing");
+                       } else {
+                               stat = atoi(status);
+                               if (stat == 1)
+                                       resp.status = TRUE;
+                               else
+                                       resp.status = FALSE;
 
-       case 1:
-               *class = TEL_SS_CLASS_VOICE;
-               break;
+                               dbg("resp.status -  %d", resp.status);
+                       }
+                       tcore_at_tok_free(tokens);
+               }
+       }
 
-       case 2:
-               *class = TEL_SS_CLASS_ALL_DATA_TELE;
-               break;
+       if (response->success > 0) {
+               dbg("RESPONSE OK");
+               resp.err = SS_ERROR_NONE;
+       } else {
+               dbg("RESPONSE NOT OK");
 
-       case 4:
-               *class = TEL_SS_CLASS_FAX;
-               break;
+               line = (char *) response->final_response;
+               tokens = tcore_at_tok_new(line);
 
-       case 8:
-               *class = TEL_SS_CLASS_SMS;
-               break;
+               if (g_slist_length(tokens) < 1) {
+                       dbg("err cause not specified or string corrupted");
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               } else {
+                       error = atoi(g_slist_nth_data(tokens, 0));
+                       err("Error: [%d]", error);
+                       /* TODO: CMEE error mapping is required. */
+                       resp.err = SS_ERROR_SYSTEMFAILURE;
+               }
+               tcore_at_tok_free(tokens);
+       }
 
-       case 16:
-               *class = TEL_SS_CLASS_ALL_CS_SYNC;
-               break;
+       resp.type = *p_type;
+       dbg("check - resp.type = %d ", resp.type);
+       if (ur)
+               tcore_user_request_send_response(ur, TRESP_SS_CLI_GET_STATUS, sizeof(struct tresp_ss_cli), &resp);
+       else
+               dbg("[ error ] ur : (0)");
 
-       case 32:
-               *class = TEL_SS_CLASS_ALL_CS_ASYNC;
-               break;
+       g_free(user_data);
+}
 
-       case 64:
-               *class = TEL_SS_CLASS_ALL_DEDI_PS;
-               break;
+static struct tcore_ss_operations ss_ops = {
+       .barring_activate = imc_ss_barring_activate,
+       .barring_deactivate = imc_ss_barring_deactivate,
+       .barring_change_password = imc_ss_barring_change_password,
+       .barring_get_status = imc_ss_barring_get_status,
+       .forwarding_activate = imc_ss_forwarding_activate,
+       .forwarding_deactivate = imc_ss_forwarding_deactivate,
+       .forwarding_register = imc_ss_forwarding_register,
+       .forwarding_deregister = imc_ss_forwarding_deregister,
+       .forwarding_get_status = imc_ss_forwarding_get_status,
+       .waiting_activate = imc_ss_waiting_activate,
+       .waiting_deactivate = imc_ss_waiting_deactivate,
+       .waiting_get_status = imc_ss_waiting_get_status,
+       .cli_activate = imc_ss_cli_activate,
+       .cli_deactivate = imc_ss_cli_deactivate,
+       .cli_get_status = imc_ss_cli_get_status,
+       .send_ussd = imc_ss_send_ussd,
+       .set_aoc = imc_ss_set_aoc,
+       .get_aoc = imc_ss_get_aoc,
+};
 
-       case 128:
-               *class = TEL_SS_CLASS_ALL_DEDI_PAD;
-               break;
+
+static TReturn _ss_barring_set(CoreObject *o, UserRequest *ur, enum telephony_ss_opcode op)
+{
+       struct treq_ss_barring *barring = 0;
+       struct ss_confirm_info *user_data = 0;
+       char *cmd_str = NULL;
+       TcorePending *pending = NULL;
+       TcoreATRequest *req;
+       char passwd[MAX_SS_BARRING_PASSWORD_LEN + 1];
+       int opco;
+       int classx;
+       char *facility = NULL;
+       gboolean ret = FALSE;
+
+       dbg("function enter");
+       barring = (struct treq_ss_barring *) tcore_user_request_ref_data(ur, 0);
+
+       switch (op) {
+       case SS_OPCO_ACTIVATE:
+               opco = 1;
+       break;
+
+       case SS_OPCO_DEACTIVATE:
+               opco = 0;
+       break;
 
        default:
-               err("Invalid modem class: [%d]", classx);
-               return FALSE;
+               dbg("unsupported opco : %d", op);
+               return TCORE_RETURN_FAILURE;
        }
+       dbg("opco - %d", opco);
 
-       return TRUE;
-}
-
-static guint __imc_ss_convert_class_to_imc_class(TelSsClass class)
-{
-       switch(class)
-       {
-       case TEL_SS_CLASS_ALL_TELE:
-               return 7;
-
-       case TEL_SS_CLASS_VOICE:
-               return 1;
+       switch (barring->mode) {
+       case SS_BARR_MODE_BAOC:
+               facility = "AO";
+       break;
 
-       case TEL_SS_CLASS_ALL_DATA_TELE:
-               return 2;
+       case SS_BARR_MODE_BOIC:
+               facility = "OI";
+       break;
 
-       case TEL_SS_CLASS_FAX:
-               return 4;
+       case SS_BARR_MODE_BOIC_NOT_HC:
+               facility = "OX";
+       break;
 
-       case TEL_SS_CLASS_SMS:
-               return 8;
+       case SS_BARR_MODE_BAIC:
+               facility = "AI";
+       break;
 
-       case TEL_SS_CLASS_ALL_CS_SYNC:
-               return 16;
+       case SS_BARR_MODE_BIC_ROAM:
+               facility = "IR";
+       break;
 
-       case TEL_SS_CLASS_ALL_CS_ASYNC:
-               return 32;
+       case SS_BARR_MODE_AB:
+               facility = "AB";
+       break;
 
-       case TEL_SS_CLASS_ALL_DEDI_PS:
-               return 64;
+       case SS_BARR_MODE_AOB:
+               facility = "AG";
+       break;
 
-       case TEL_SS_CLASS_ALL_DEDI_PAD:
-               return 128;
+       case SS_BARR_MODE_AIB:
+               facility = "AC";
+       break;
 
+       case SS_BARR_MODE_BIC_NOT_SIM:
+       /* facility = "NS"; */
        default:
-               dbg("Unsupported class: [%d], returning default value 7", class);
-               return 7;
+               dbg("unspported mode %d", barring->mode);
+               return TCORE_RETURN_FAILURE;
        }
-}
 
-static gboolean __imc_ss_convert_barring_type_to_facility(TelSsBarringType type, gchar **facility)
-{
-       switch(type)
-       {
-       case TEL_SS_CB_TYPE_BAOC:
-               *facility = "AO";
-               break;
+       dbg("facility - %s", facility);
 
-       case TEL_SS_CB_TYPE_BOIC:
-               *facility = "OI";
+       switch (barring->class) {
+       case SS_CLASS_ALL_TELE:
+               classx = 7;
                break;
 
-       case TEL_SS_CB_TYPE_BOIC_NOT_HC:
-               *facility = "OX";
+       case SS_CLASS_VOICE:
+               classx = 1;
                break;
 
-       case TEL_SS_CB_TYPE_BAIC:
-               *facility = "AI";
+       case SS_CLASS_ALL_DATA_TELE:
+               classx = 2;
                break;
 
-       case TEL_SS_CB_TYPE_BIC_ROAM:
-               *facility = "IR";
+       case SS_CLASS_FAX:
+               classx = 4;
                break;
 
-       case TEL_SS_CB_TYPE_AB:
-               *facility = "AB";
+       case SS_CLASS_SMS:
+               classx = 8;
                break;
 
-       case TEL_SS_CB_TYPE_AOB:
-               *facility = "AG";
+       case SS_CLASS_ALL_CS_SYNC:
+               classx = 16;
                break;
 
-       case TEL_SS_CB_TYPE_AIB:
-               *facility = "AC";
+       default:
+               classx = 7;
+               dbg("unsupported class %d. set to default : 7", barring->class);
                break;
+       }
 
-       case TEL_SS_CB_TYPE_NS:
-               *facility = "NS";
-               break;
+       dbg("classx - %d", classx);
 
-       default:
-               err("Unspported type: [%d]", type);
-               return FALSE;
+       user_data = g_new0(struct ss_confirm_info, 1);
+       if (!user_data) {
+               dbg("[ error ] failed to allocate memory");
+               return TCORE_RETURN_ENOMEM;
        }
-       return TRUE;
+
+       /* null-ended pwd handling added - unexpected  0x11 value observed in req string */
+       memcpy(passwd, barring->password, MAX_SS_BARRING_PASSWORD_LEN);
+       passwd[MAX_SS_BARRING_PASSWORD_LEN] = '\0';
+       dbg("passwd - %s", passwd);
+
+       pending = tcore_pending_new(o, 0);
+
+       cmd_str = g_strdup_printf("AT+CLCK=\"%s\",%d,\"%s\",%d", facility, opco, passwd, classx);
+       dbg("request command : %s", cmd_str);
+
+       req = tcore_at_request_new(cmd_str, NULL, TCORE_AT_NO_RESULT);
+       if (req == NULL) {
+               tcore_pending_free(pending);
+               g_free(cmd_str);
+               return TCORE_RETURN_FAILURE;
+       }
+       dbg("cmd : %s, prefix(if any) :%s, cmd_len : %d", req->cmd, req->prefix, strlen(req->cmd));
+
+       tcore_pending_set_request_data(pending, 0, req);
+
+       if (op == SS_OPCO_ACTIVATE) {
+               user_data->resp = TRESP_SS_BARRING_ACTIVATE;
+       } else if (op == SS_OPCO_DEACTIVATE) {
+               user_data->resp = TRESP_SS_BARRING_DEACTIVATE;
+       } else {
+               dbg("[ error ] wrong ss opco (0x%x)", op);
+               if (user_data != NULL)
+                       g_free(user_data);
+
+               g_free(cmd_str);
+               tcore_pending_free(pending);
+               tcore_at_request_free(req);
+               return TCORE_RETURN_FAILURE;
+       }
+       user_data->flavor_type = (int) (barring->mode);
+       user_data->class = barring->class;
+
+       ret = _ss_request_message(pending, o, ur, on_response_ss_barring_set, user_data);
+       g_free(cmd_str);
+
+       if (!ret) {
+               dbg("AT request sent failed ");
+               if (user_data != NULL) {
+                       g_free(user_data);
+                       tcore_pending_free(pending);
+                       tcore_at_request_free(req);
+               }
+               return TCORE_RETURN_FAILURE;
+       }
+       return TCORE_RETURN_SUCCESS;
 }
 
-static gboolean __imc_ss_convert_forwarding_mode_to_modem_mode(TelSsForwardMode mode, guint *modex)
+static TReturn _ss_barring_get(CoreObject *o,
+                                                          UserRequest *ur,
+                                                          enum telephony_ss_class class,
+                                                          enum telephony_ss_barring_mode mode,
+                                                          enum tcore_response_command resp)
 {
-       switch(mode)
-       {
-       case TEL_SS_CF_MODE_DISABLE:
-               *modex = 0;
+       struct ss_confirm_info *user_data = 0;
+       gboolean ret = FALSE;
+       char *cmd_str = NULL;
+       int opco, classx;
+       char *facility = NULL;
+       TcorePending *pending = NULL;
+       TcoreATRequest *req;
+
+       dbg("function enter");
+
+       /* query status - opco is fixed to 2 */
+       opco = 2;
+       /* barring mode */
+       switch (mode) {
+       case SS_BARR_MODE_BAOC:
+               facility = "AO";
+               break;
+
+       case SS_BARR_MODE_BOIC:
+               facility = "OI";
                break;
 
-       case TEL_SS_CF_MODE_ENABLE:
-               *modex = 1;
+       case SS_BARR_MODE_BOIC_NOT_HC:
+               facility = "OX";
                break;
 
-       case TEL_SS_CF_MODE_REGISTER:
-               *modex = 3;
+       case SS_BARR_MODE_BAIC:
+               facility = "AI";
                break;
 
-       case TEL_SS_CF_MODE_DEREGISTER:
-               *modex = 4;
+       case SS_BARR_MODE_BIC_ROAM:
+               facility = "IR";
                break;
 
+       case SS_BARR_MODE_AB:
+       case SS_BARR_MODE_AOB:
+       case SS_BARR_MODE_AIB:
+       case SS_BARR_MODE_BIC_NOT_SIM:
        default:
-               err("Unspported mode: [%d]", mode);
-               return FALSE;
+               dbg("unsupported mode %d", mode);
+               return TCORE_RETURN_FAILURE;
        }
-       return TRUE;
-}
 
-static gboolean __imc_ss_convert_forwarding_condition_to_modem_reason(TelSsForwardCondition condition, guint *reason)
-{
-       switch (condition) {
-       case TEL_SS_CF_COND_CFU:
-               *reason = 0;
+       dbg("facility - %s", facility);
+
+       switch (class) {
+       case SS_CLASS_ALL_TELE:
+               classx = 7;
                break;
 
-       case TEL_SS_CF_COND_CFB:
-               *reason = 1;
+       case SS_CLASS_VOICE:
+               classx = 1;
                break;
 
-       case TEL_SS_CF_COND_CFNRY:
-               *reason = 2;
+       case SS_CLASS_ALL_DATA_TELE:
+               classx = 2;
                break;
 
-       case TEL_SS_CF_COND_CFNRC:
-               *reason = 3;
+       case SS_CLASS_FAX:
+               classx = 4;
                break;
 
-       case TEL_SS_CF_COND_ALL:
-               *reason = 4;
+       case SS_CLASS_SMS:
+               classx = 8;
                break;
 
-       case TEL_SS_CF_COND_ALL_CFC:
-               *reason = 5;
+       case SS_CLASS_ALL_CS_SYNC:
+               classx = 16;
                break;
 
        default:
-               dbg("Unsupported condition: [%d]", condition);
-               return FALSE;
-       }
-       return TRUE;
-}
-
-static gint __imc_ss_convert_cli_status_modem_status(gint cli_status)
-{
-       if (cli_status == TEL_SS_CLI_DISABLE)
-               return 0;
-       else if (cli_status == TEL_SS_CLI_ENABLE)
-               return 1;
-       else {
-               err("Invalid CLI status: [%d]", cli_status);
-               return -1;
+               classx = 7;
+               dbg("unsupported class %d. set to default : 7", class);
+               break;
        }
-}
 
-static gint __imc_ss_convert_clir_status_modem_status(gint clir_status)
-{
-       if (clir_status == TEL_CLIR_STATUS_DEFAULT)
-                return 0;
-       else if (clir_status == TEL_CLIR_STATUS_INVOCATION)
-                return 1;
-       else if (clir_status == TEL_CLIR_STATUS_SUPPRESSION)
-                return 2;
-       else {
-               err("Invalid CLIR status: [%d]", clir_status);
-               return -1;
+       user_data = g_new0(struct ss_confirm_info, 1);
+       if (!user_data) {
+               dbg("[ error ] failed to allocate memory");
+               return TCORE_RETURN_ENOMEM;
        }
-}
-
-static gboolean __imc_ss_convert_cli_info_modem_info(const TelSsCliInfo **cli_info,    gint *status,
-       gchar **cmd_prefix)
-{
-       switch((*cli_info)->type)
-       {
-       case TEL_SS_CLI_CLIR:
-               if ((*status = __imc_ss_convert_clir_status_modem_status((*cli_info)->status.clir)) != -1)
-                       *cmd_prefix = "+CLIR";
-               else
-                       err("invalid clir status");
-               break;
 
-       case TEL_SS_CLI_CLIP:
-               if ((*status =__imc_ss_convert_cli_status_modem_status((*cli_info)->status.clip) != -1))
-                       *cmd_prefix = "+CLIP";
-               else
-                       err("invalid cli status");
-               break;
-       case TEL_SS_CLI_COLP:
-               if ((*status =__imc_ss_convert_cli_status_modem_status((*cli_info)->status.colp) != -1))
-                       *cmd_prefix = "+COLP";
-               else
-                       err("invalid cli status");
-               break;
-       case TEL_SS_CLI_COLR:
-               if ((*status =__imc_ss_convert_cli_status_modem_status((*cli_info)->status.colr) != -1))
-                       *cmd_prefix = "+COLR";
-               else
-                       err("invalid cli status");
-               break;
+       dbg("class - %d", classx);
+       if (classx == 7)
+               cmd_str = g_strdup_printf("AT+CLCK=\"%s\",%d", facility, opco);
+       else
+               cmd_str = g_strdup_printf("AT+CLCK=\"%s\",%d,,%d", facility, opco, classx);
 
-       case TEL_SS_CLI_CNAP:
-               if ((*status =__imc_ss_convert_cli_status_modem_status((*cli_info)->status.cnap) != -1))
-                       *cmd_prefix = "+CNAP";
-               else
-                       err("invalid cli status");
+       dbg("request command : %s", cmd_str);
 
-               break;
-       case TEL_SS_CLI_CDIP:
-       default:
-               err("Unsupported CLI type: [%d]", (*cli_info)->type);
-               return FALSE;
+       pending = tcore_pending_new(o, 0);
+       req = tcore_at_request_new(cmd_str, "+CLCK", TCORE_AT_MULTILINE);
+       if (req == NULL) {
+               tcore_pending_free(pending);
+               g_free(cmd_str);
+               return TCORE_RETURN_FAILURE;
        }
+       dbg("cmd : %s, prefix(if any) :%s, cmd_len : %d", req->cmd, req->prefix, strlen(req->cmd));
 
-       if (*cmd_prefix == NULL)
-               return FALSE;
+       tcore_pending_set_request_data(pending, 0, req);
 
-       return TRUE;
-}
+       user_data->resp = resp;
+       user_data->flavor_type = (int) (mode);
+       user_data->class = class;
 
-static gboolean __imc_ss_convert_modem_cli_net_status_cli_status(TelSsCliType cli_type, gint net_status,
-        gint *status)
-{
-       if (cli_type == TEL_SS_CLI_CLIR) {
-               switch (net_status) {
-                       case 0:
-                               *status = TEL_CLIR_STATUS_NOT_PROVISIONED;
-                               break;
-                       case 1:
-                               *status = TEL_CLIR_STATUS_PROVISIONED;
-                               break;
-                       case 2:
-                               *status = TEL_CLIR_STATUS_UNKNOWN;
-                               break;
-                       case 3:
-                               *status = TEL_CLIR_STATUS_TEMP_RESTRICTED;
-                               break;
-                       case 4:
-                               *status = TEL_CLIR_STATUS_TEMP_ALLOWED;
-                               break;
-                       default:
-                               err("Invalid clir net status: [%d]", net_status);
-                               return FALSE;
-               }
-       } else { //CLIP, COLP,COLR,CNAP.
-               switch (net_status) {
-               case 0:
-                       *status = TEL_SS_CLI_NOT_PROVISIONED;
-                       break;
-               case 1:
-                       *status = TEL_SS_CLI_PROVISIONED;
-                       break;
-               case 2:
-                       *status = TEL_SS_CLI_UNKNOWN;
-                       break;
-               default:
-                       err("Invalid status: [%d]", net_status);
-                       return FALSE;
+       ret = _ss_request_message(pending, o, ur, on_response_ss_barring_get, user_data);
+       g_free(cmd_str);
+
+       if (!ret) {
+               dbg("AT request sent failed ");
+               if (user_data != NULL) {
+                       g_free(user_data);
+                       tcore_pending_free(pending);
+                       tcore_at_request_free(req);
                }
+               return TCORE_RETURN_FAILURE;
        }
-       return TRUE;
+
+       return TCORE_RETURN_SUCCESS;
 }
 
-static gboolean __imc_ss_convert_modem_cli_dev_status_cli_status(TelSsCliType cli_type,
-       gint dev_status, gint *status)
+static TReturn imc_ss_barring_activate(CoreObject *o, UserRequest *ur)
 {
-       if (cli_type == TEL_SS_CLI_CLIR) {
-               switch (dev_status) {
-               case 0:
-                       *status = TEL_CLIR_STATUS_DEFAULT;
-                       break;
-               case 1:
-                       *status = TEL_CLIR_STATUS_INVOCATION;
-                       break;
-               case 2:
-                       *status = TEL_CLIR_STATUS_SUPPRESSION;
-                       break;
-               default:
-                       err("Invalid dev status: [%d]", dev_status);
-                       return FALSE;
-               }
-       } else { //CLIP, COLP,COLR,CNAP.
-               switch(dev_status) {
-               case 0:
-                       *status  = TEL_SS_CLI_DISABLE;
-                       break;
-               case 1:
-                       *status  = TEL_SS_CLI_ENABLE;
-                       break;
-               default:
-                       err("Invalid dev status: [%d]", dev_status);
-                       return FALSE;
-               }
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
        }
-       return TRUE;
+       return _ss_barring_set(o, ur, SS_OPCO_ACTIVATE);
 }
 
-/* SS Responses */
-static void on_response_imc_ss_set_barring(TcorePending *p,
-               guint data_len, const void *data, void *user_data)
+static TReturn imc_ss_barring_deactivate(CoreObject *o, UserRequest *ur)
 {
-       const TcoreAtResponse *at_resp = data;
-       CoreObject *co = tcore_pending_ref_core_object(p);
-       ImcRespCbData *resp_cb_data = user_data;
-
-       TelSsResult result = TEL_SS_RESULT_FAILURE; // TODO: CMEE error mapping is required
-       dbg("Enter");
-
-       tcore_check_return_assert(co != NULL);
-       tcore_check_return_assert(resp_cb_data != NULL);
-
-       if (at_resp && at_resp->success)
-               result = TEL_SS_RESULT_SUCCESS;
-
-       dbg("Setting Barring status: [%s]",
-                       (result == TEL_SS_RESULT_SUCCESS ? "SUCCESS" : "FAIL"));
-
-       /* Invoke callback */
-       if (resp_cb_data->cb)
-               resp_cb_data->cb(co, (gint)result, NULL, resp_cb_data->cb_data);
-
-       imc_destroy_resp_cb_data(resp_cb_data);
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
+       }
+       return _ss_barring_set(o, ur, SS_OPCO_DEACTIVATE);
 }
 
-static void on_response_imc_ss_get_barring_status(TcorePending *p,
-               guint data_len, const void *data, void *user_data)
+static TReturn imc_ss_barring_change_password(CoreObject *o, UserRequest *ur)
 {
-       const TcoreAtResponse *at_resp = data;
-       CoreObject *co = tcore_pending_ref_core_object(p);
-       ImcRespCbData *resp_cb_data = user_data;
-       TelSsBarringResp barring_resp = {0,};
-       TelSsBarringGetInfo *req_info;
-       gint valid_records = 0;
-       GSList *resp_data = NULL;
-
-       TelSsResult result = TEL_SS_RESULT_FAILURE; // TODO: CMEE error mapping is required
-       dbg("Enter");
-
-       tcore_check_return_assert(co != NULL);
-       tcore_check_return_assert(resp_cb_data != NULL);
-
-       req_info = (TelSsBarringGetInfo *)IMC_GET_DATA_FROM_RESP_CB_DATA(resp_cb_data);
-
-       if (at_resp) {
-               if (at_resp->lines && at_resp->success) {
-                       resp_data = (GSList *) at_resp->lines;
-                       barring_resp.record_num= g_slist_length(resp_data);
-                       dbg("Total records: [%d]", barring_resp.record_num);
-               }
-               else {
-                       err("RESPONSE - [NOK]");
-               }
-       } else {
-               err("No response data");
+       TcorePending *pending = NULL;
+       TcoreATRequest *req;
+       struct treq_ss_barring_change_password *barring = 0;
+       struct ss_confirm_info *user_data = 0;
+       char *cmd_str = NULL;
+       gboolean ret = FALSE;
+       char old_password[MAX_SS_BARRING_PASSWORD_LEN + 1];
+       char new_password[MAX_SS_BARRING_PASSWORD_LEN + 1];
+
+       dbg("function enter");
+
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
        }
 
-       if (barring_resp.record_num > 0) {
-               barring_resp.records = tcore_malloc0((barring_resp.record_num) *
-                       sizeof(TelSsBarringInfoRecord));
-               for (valid_records = 0; resp_data != NULL; resp_data = resp_data->next) {
-                       const gchar *line;
-                       GSList *tokens = NULL;
-
-                       line = (const char *) resp_data->data;
-                       tokens = tcore_at_tok_new(line);
-                       if (g_slist_length(tokens) > 0) {
-                               gchar *classx_str;
-                               gchar *status = NULL;
-
-                               status = g_slist_nth_data(tokens, 0);
-                               if (!status) {
-                                       dbg("Status is missing");
-                                       tcore_at_tok_free(tokens);
-                                       continue;
-                               }
-
-                               if (atoi(status) == 1) {
-                                       barring_resp.records[valid_records].enable = TRUE;
-                               } else {
-                                       barring_resp.records[valid_records].enable = FALSE;
-                               }
+       barring = (struct treq_ss_barring_change_password *) tcore_user_request_ref_data(ur, 0);
 
-                               classx_str = g_slist_nth_data(tokens, 1);
-                               if (!classx_str) {
-                                       dbg("Class error. Setting to the requested class: [%d]", req_info->class);
-                                       barring_resp.records[valid_records].class = req_info->class;
-                               } else {
-                                       if (__imc_ss_convert_modem_class_to_class(atoi(classx_str),
-                                               &(barring_resp.records[valid_records].class)) == FALSE) {
-                                               tcore_at_tok_free(tokens);
-                                               continue;
-                                       }
-                               }
+       memcpy(old_password, barring->password_old, MAX_SS_BARRING_PASSWORD_LEN);
+       old_password[MAX_SS_BARRING_PASSWORD_LEN] = '\0';
+       memcpy(new_password, barring->password_new, MAX_SS_BARRING_PASSWORD_LEN);
+       new_password[MAX_SS_BARRING_PASSWORD_LEN] = '\0';
 
-                               barring_resp.records[valid_records].type= req_info->type;
-                               result = TEL_SS_RESULT_SUCCESS;
-                               valid_records++;
-                       } else {
-                               err("Invalid response message");
-                       }
-                       tcore_at_tok_free(tokens);
-               }
+       user_data = g_new0(struct ss_confirm_info, 1);
+       if (!user_data) {
+               dbg("[ error ] failed to allocate memory");
+               return TCORE_RETURN_ENOMEM;
        }
+       user_data->resp = TRESP_SS_BARRING_CHANGE_PASSWORD;
+
+       dbg("old passwd - %s new passwd- %s", old_password, new_password);
+       cmd_str = g_strdup_printf("AT+CPWD=\"%s\",\"%s\",\"%s\"", "AB", old_password, new_password);
+       dbg("request command : %s", cmd_str);
+
+       pending = tcore_pending_new(o, 0);
+       req = tcore_at_request_new(cmd_str, NULL, TCORE_AT_NO_RESULT);
+       if (req == NULL) {
+               tcore_pending_free(pending);
+               g_free(cmd_str);
+               return TCORE_RETURN_FAILURE;
+       }
+       dbg("cmd : %s, prefix(if any) :%s, cmd_len : %d", req->cmd, req->prefix, strlen(req->cmd));
 
-       dbg("Getting Barring status: [%s]",
-                       (result == TEL_SS_RESULT_SUCCESS ? "SUCCESS" : "FAIL"));
-       barring_resp.record_num = valid_records;
-
-       /* Invoke callback */
-       if (resp_cb_data->cb)
-               resp_cb_data->cb(co, (gint)result, &barring_resp, resp_cb_data->cb_data);
+       tcore_pending_set_request_data(pending, 0, req);
 
-       imc_destroy_resp_cb_data(resp_cb_data);
+       ret = _ss_request_message(pending, o, ur, on_response_ss_barring_change_pwd, user_data);
+       g_free(cmd_str);
+       if (!ret) {
+               dbg("AT request sent failed ");
+               if (user_data != NULL)
+                       g_free(user_data);
 
-       if (barring_resp.records) {
-               tcore_free(barring_resp.records);
+               tcore_pending_free(pending);
+               tcore_at_request_free(req);
+               return TCORE_RETURN_FAILURE;
        }
+       return TCORE_RETURN_SUCCESS;
 }
 
-static void on_response_imc_ss_change_barring_password(TcorePending *p,
-               guint data_len, const void *data, void *user_data)
+static TReturn imc_ss_barring_get_status(CoreObject *o, UserRequest *ur)
 {
-       const TcoreAtResponse *at_resp = data;
-       CoreObject *co = tcore_pending_ref_core_object(p);
-       ImcRespCbData *resp_cb_data = user_data;
-
-       TelSsResult result = TEL_SS_RESULT_FAILURE;  // TODO: CMEE error mapping is required
-       dbg("Enter");
-
-       tcore_check_return_assert(co != NULL);
-       tcore_check_return_assert(resp_cb_data != NULL);
-
-       if (at_resp && at_resp->success)
-               result = TEL_SS_RESULT_SUCCESS;
-
-       dbg("Change Barring Password: [%s]",
-                       (result == TEL_SS_RESULT_SUCCESS ? "SUCCESS" : "FAIL"));
+       struct treq_ss_barring *barring = 0;
 
-       /* Invoke callback */
-       if (resp_cb_data->cb)
-               resp_cb_data->cb(co, (gint)result, NULL, resp_cb_data->cb_data);
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
+       }
+       barring = (struct treq_ss_barring *) tcore_user_request_ref_data(ur, 0);
 
-       imc_destroy_resp_cb_data(resp_cb_data);
+       return _ss_barring_get(o, ur, barring->class, barring->mode, TRESP_SS_BARRING_GET_STATUS);
 }
 
-static void on_response_imc_ss_set_forwarding(TcorePending *p,
-               guint data_len, const void *data, void *user_data)
+static TReturn _ss_forwarding_set(CoreObject *o, UserRequest *ur, enum telephony_ss_opcode op)
 {
-       const TcoreAtResponse *at_resp = data;
-       CoreObject *co = tcore_pending_ref_core_object(p);
-       ImcRespCbData *resp_cb_data = user_data;
-
-       TelSsResult result = TEL_SS_RESULT_FAILURE;  // TODO: CMEE error mapping is required
-       dbg("Enter");
+       struct treq_ss_forwarding *forwarding = 0;
+       struct ss_confirm_info *user_data = 0;
+       gboolean ret = FALSE;
+       int len = 0;
+       char *cmd_str = NULL;
+       char *tmp_str = NULL;
+       int reason = 0, mode = 0, num_type = 0, classx = 0, time = 0;
+       TcorePending *pending = NULL;
+       TcoreATRequest *req;
+
+       dbg("_ss_forwarding_set with opco %d ", op);
+
+       forwarding = (struct treq_ss_forwarding *) tcore_user_request_ref_data(ur, 0);
+       switch (forwarding->mode) {
+       case SS_CF_MODE_CFU:
+               reason = 0;
+               break;
 
-       tcore_check_return_assert(co != NULL);
-       tcore_check_return_assert(resp_cb_data != NULL);
+       case SS_CF_MODE_CFB:
+               reason = 1;
+               break;
 
-       if (at_resp && at_resp->success)
-               result = TEL_SS_RESULT_SUCCESS;
+       case SS_CF_MODE_CFNRy:
+               reason = 2;
+               break;
 
-       dbg("Set Forwarding Status: [%s]",
-                       (result == TEL_SS_RESULT_SUCCESS ? "SUCCESS" : "FAIL"));
+       case SS_CF_MODE_CFNRc:
+               reason = 3;
+               break;
 
-       /* Invoke callback */
-       if (resp_cb_data->cb)
-               resp_cb_data->cb(co, (gint)result, NULL, resp_cb_data->cb_data);
+       case SS_CF_MODE_CF_ALL:
+               reason = 4;
+               break;
 
-       imc_destroy_resp_cb_data(resp_cb_data);
-}
+       case SS_CF_MODE_CFC:
+               reason = 5;
+               break;
 
-static void on_response_imc_ss_get_forwarding_status(TcorePending *p,
-               guint data_len, const void *data, void *user_data)
-{
-       const TcoreAtResponse *at_resp = data;
-       CoreObject *co = tcore_pending_ref_core_object(p);
-       ImcRespCbData *resp_cb_data = user_data;
-       TelSsForwardingResp forwarding_resp = {0,};
-       TelSsForwardGetInfo *req_info;
-       gint valid_records = 0;
-       GSList *resp_data = NULL;
-
-       TelSsResult result = TEL_SS_RESULT_FAILURE; // TODO: CMEE error mapping is required
-       dbg("Enter");
-
-       tcore_check_return_assert(co != NULL);
-       tcore_check_return_assert(resp_cb_data != NULL);
-
-       req_info = (TelSsForwardGetInfo *)IMC_GET_DATA_FROM_RESP_CB_DATA(resp_cb_data);
-
-       if (at_resp) {
-               if (at_resp->lines && at_resp->success) {
-                       resp_data = (GSList *) at_resp->lines;
-                       forwarding_resp.record_num= g_slist_length(resp_data);
-                       dbg("Total records: [%d]", forwarding_resp.record_num);
-               }
-               else {
-                       err("RESPONSE - [NOK]");
-               }
-       } else {
-               err("No response data");
+       default:
+               dbg("unsupported reason : %d");
+               return TCORE_RETURN_FAILURE;
+               break;
        }
 
-       if (forwarding_resp.record_num > 0) {
-               forwarding_resp.records = tcore_malloc0((forwarding_resp.record_num) *
-                       sizeof(TelSsForwardingInfoRecord));
-               for (valid_records = 0; resp_data != NULL; resp_data = resp_data->next) {
-                       const gchar *line;
-                       GSList *tokens = NULL;
-
-                       line = (const char *) resp_data->data;
-                       tokens = tcore_at_tok_new(line);
-                       if (g_slist_length(tokens) > 0) {
-                               gchar *classx_str;
-                               gchar *status = NULL;
-                               gchar *number = NULL;
-                               gchar *time_str = NULL;
-
-                               status = g_slist_nth_data(tokens, 0);
-                               if (!status) {
-                                       dbg("Status is missing");
-                                       tcore_at_tok_free(tokens);
-                                       continue;
-                               }
-
-                               if (atoi(status) == 1) {
-                                       forwarding_resp.records[valid_records].enable = TRUE;
-                               } else {
-                                       forwarding_resp.records[valid_records].enable = FALSE;
-                               }
-
-                               classx_str = g_slist_nth_data(tokens, 1);
-                               if (!classx_str) {
-                                       dbg("Class error. Setting to the requested class: [%d]", req_info->class);
-                                       forwarding_resp.records[valid_records].class = req_info->class;
-                               } else {
-                                       if (__imc_ss_convert_modem_class_to_class(atoi(classx_str),
-                                               &(forwarding_resp.records[valid_records].class)) == FALSE) {
-                                               tcore_at_tok_free(tokens);
-                                               continue;
-                                       }
-                               }
+       dbg("reason = %d", reason);
+       switch (op) {
+       case SS_OPCO_DEACTIVATE:
+               mode = 0;
+               break;
 
-                               number = g_slist_nth_data(tokens, 2);
-                               if (number) {
-                                       number =  tcore_at_tok_extract(number);
-                                       memcpy((forwarding_resp.records[valid_records].number), number, strlen(number));
-                                       g_free(number);
-                               }
+       case SS_OPCO_ACTIVATE:
+               mode = 1;
+               break;
 
-                               time_str = g_slist_nth_data(tokens, 6);
-                               if (time_str)
-                                       forwarding_resp.records[valid_records].wait_time = atoi(time_str);
+       case SS_OPCO_REG:
+               mode = 3;
+               break;
 
-                               forwarding_resp.records[valid_records].condition = req_info->condition;
+       case SS_OPCO_DEREG:
+               mode = 4;
+               break;
 
-                               result = TEL_SS_RESULT_SUCCESS;
-                               valid_records++;
-                       } else {
-                               err("Invalid response message");
-                       }
-                       tcore_at_tok_free(tokens);
-               }
+       default:
+               dbg("unsupported opco : %d", op);
+               return TCORE_RETURN_FAILURE;
        }
 
-       dbg("Getting Forwarding Status: [%s]",
-                       (result == TEL_SS_RESULT_SUCCESS ? "SUCCESS" : "FAIL"));
-       forwarding_resp.record_num = valid_records;
-
-       /* Invoke callback */
-       if (resp_cb_data->cb)
-               resp_cb_data->cb(co, (gint)result, &forwarding_resp, resp_cb_data->cb_data);
-
-       imc_destroy_resp_cb_data(resp_cb_data);
-
-       if (forwarding_resp.records) {
-               tcore_free(forwarding_resp.records);
-       }
-}
+       dbg("mode = %d", mode);
 
-static void on_response_imc_ss_set_waiting(TcorePending *p,
-               guint data_len, const void *data, void *user_data)
-{
-       const TcoreAtResponse *at_resp = data;
-       CoreObject *co = tcore_pending_ref_core_object(p);
-       ImcRespCbData *resp_cb_data = user_data;
+       /* class */
+       switch (forwarding->class) {
+       case SS_CLASS_ALL_TELE:
+               classx = 7;
+               break;
 
-       TelSsResult result = TEL_SS_RESULT_FAILURE;  // TODO: CMEE error mapping is required
-       dbg("Enter");
+       case SS_CLASS_VOICE:
+               classx = 1;
+               break;
 
-       tcore_check_return_assert(co != NULL);
-       tcore_check_return_assert(resp_cb_data != NULL);
+       case SS_CLASS_ALL_DATA_TELE:
+               classx = 2;
+               break;
 
-       if (at_resp && at_resp->success)
-               result = TEL_SS_RESULT_SUCCESS;
+       case SS_CLASS_FAX:
+               classx = 4;
+               break;
 
-       dbg("Set Waiting Status: [%s]",
-                       (result == TEL_SS_RESULT_SUCCESS ? "SUCCESS" : "FAIL"));
+       case SS_CLASS_SMS:
+               classx = 8;
+               break;
 
-       /* Invoke callback */
-       if (resp_cb_data->cb)
-               resp_cb_data->cb(co, (gint)result, NULL, resp_cb_data->cb_data);
+       case SS_CLASS_ALL_CS_SYNC:
+               classx = 16;
+               break;
 
-       imc_destroy_resp_cb_data(resp_cb_data);
-}
+       default:
+               classx = 7;
+               dbg("unsupported class %d. set to default : 7", forwarding->class);
+               break;
+       }
+       dbg("classx = %d", classx);
 
-static void on_response_imc_ss_get_waiting_status(TcorePending *p,
-               guint data_len, const void *data, void *user_data)
-{
-       const TcoreAtResponse *at_resp = data;
-       CoreObject *co = tcore_pending_ref_core_object(p);
-       ImcRespCbData *resp_cb_data = user_data;
-       TelSsWaitingResp waiting_resp = {0,};
-       TelSsClass *class;
-       gint valid_records = 0;
-       GSList *resp_data = NULL;
-
-       TelSsResult result = TEL_SS_RESULT_FAILURE; // TODO: CMEE error mapping is required
-       dbg("Enter");
-
-       tcore_check_return_assert(co != NULL);
-       tcore_check_return_assert(resp_cb_data != NULL);
-
-       class = (TelSsClass *)IMC_GET_DATA_FROM_RESP_CB_DATA(resp_cb_data);
-
-       if (at_resp) {
-               if (at_resp->lines && at_resp->success) {
-                       resp_data = (GSList *) at_resp->lines;
-                       waiting_resp.record_num= g_slist_length(resp_data);
-                       dbg("Total records: [%d]", waiting_resp.record_num);
-               }
-               else {
-                       err("RESPONSE - [NOK]");
-               }
-       } else {
-               err("No response data");
+       /* number */
+       len = strlen(forwarding->number);
+       if (len > 0) {
+               if (forwarding->number[0] == '+')
+                       num_type = ((NUM_TYPE_INTERNATIONAL << 4) | NUM_PLAN_ISDN);
+               else
+                       num_type = 0;
        }
+       dbg("number = %s", forwarding->number);
 
-       if (waiting_resp.record_num > 0) {
-               waiting_resp.records = tcore_malloc0((waiting_resp.record_num) * sizeof(TelSsWaitingInfo));
-               for (valid_records = 0; resp_data != NULL; resp_data = resp_data->next) {
-                       const gchar *line;
-                       GSList *tokens = NULL;
+       user_data = g_new0(struct ss_confirm_info, 1);
+       if (!user_data) {
+               dbg("[ error ] failed to allocate memory");
+               return TCORE_RETURN_ENOMEM;
+       }
 
-                       line = (const char *) resp_data->data;
-                       tokens = tcore_at_tok_new(line);
-                       if (g_slist_length(tokens) > 0) {
-                               gchar *classx_str;
-                               gchar *status = NULL;
+       switch (op) {
+       case SS_OPCO_REG:
+               user_data->resp = TRESP_SS_FORWARDING_REGISTER;
+               break;
 
-                               status = g_slist_nth_data(tokens, 0);
-                               if (!status) {
-                                       dbg("Status is missing");
-                                       tcore_at_tok_free(tokens);
-                                       continue;
-                               }
+       case SS_OPCO_DEREG:
+               user_data->resp = TRESP_SS_FORWARDING_DEREGISTER;
+               break;
 
-                               if (atoi(status) == 1) {
-                                       waiting_resp.records[valid_records].enable= TRUE;
-                               } else {
-                                       waiting_resp.records[valid_records].enable = FALSE;
-                               }
+       case SS_OPCO_ACTIVATE:
+               user_data->resp = TRESP_SS_FORWARDING_ACTIVATE;
+               break;
 
-                               classx_str = g_slist_nth_data(tokens, 1);
-                               if (!classx_str) {
-                                       dbg("Class error. Setting to the requested class: [%d]", *class);
-                                       waiting_resp.records[valid_records].class = *class;
-                               } else {
-                                       if (__imc_ss_convert_modem_class_to_class(atoi(classx_str), &(waiting_resp.records[valid_records].class)) == FALSE) {
-                                               tcore_at_tok_free(tokens);
-                                               continue;
-                                       }
-                               }
+       case SS_OPCO_DEACTIVATE:
+               user_data->resp = TRESP_SS_FORWARDING_DEACTIVATE;
+               break;
 
-                               result = TEL_SS_RESULT_SUCCESS;
-                               valid_records++;
-                       } else {
-                               err("Invalid response message");
-                       }
-                       tcore_at_tok_free(tokens);
-               }
+       default:
+               dbg("[ error ] unknown op (0x%x)", op);
+               break;
        }
 
-       dbg("Getting Waiting Status: [%s]",
-                       (result == TEL_SS_RESULT_SUCCESS ? "SUCCESS" : "FAIL"));
-       waiting_resp.record_num = valid_records;
+       if (forwarding->number[0] == '+')
+               num_type = 145;
+       else
+               num_type = 129;
 
-       /* Invoke callback */
-       if (resp_cb_data->cb)
-               resp_cb_data->cb(co, (gint)result, &waiting_resp, resp_cb_data->cb_data);
+       if (op == SS_OPCO_REG)
+               tmp_str = g_strdup_printf("AT+CCFC=%d,%d,\"%s\",%d,%d", reason, mode, forwarding->number, num_type, classx);
+       else /* other opcode does not need num field */
+               tmp_str = g_strdup_printf("AT+CCFC=%d,%d,,,%d", reason, mode, classx);
 
-       imc_destroy_resp_cb_data(resp_cb_data);
+       if (forwarding->mode == SS_CF_MODE_CFNRy) {
+               /* add time info to 'no reply' case */
+               time = (int) (forwarding->time);
+               cmd_str = g_strdup_printf("%s,,,%d", tmp_str, time);
+       } else {
+               cmd_str = g_strdup_printf("%s", tmp_str);
+       }
 
-       if (waiting_resp.records) {
-               tcore_free(waiting_resp.records);
+       dbg("request command : %s", cmd_str);
+       pending = tcore_pending_new(o, 0);
+       req = tcore_at_request_new(cmd_str, NULL, TCORE_AT_NO_RESULT);
+       if (req == NULL) {
+               tcore_pending_free(pending);
+               g_free(cmd_str);
+               g_free(tmp_str);
+               return TCORE_RETURN_FAILURE;
        }
-}
+       dbg("cmd : %s, prefix(if any) :%s, cmd_len : %d", req->cmd, req->prefix, strlen(req->cmd));
 
-static void on_response_imc_ss_set_cli(TcorePending *p,
-               guint data_len, const void *data, void *user_data)
-{
-       const TcoreAtResponse *at_resp = data;
-       CoreObject *co = tcore_pending_ref_core_object(p);
-       ImcRespCbData *resp_cb_data = user_data;
+       tcore_pending_set_request_data(pending, 0, req);
 
-       TelSsResult result = TEL_SS_RESULT_FAILURE;  // TODO: CMEE error mapping is required
-       dbg("Enter");
+       user_data->flavor_type = forwarding->mode;
+       user_data->class = forwarding->class;
 
-       tcore_check_return_assert(co != NULL);
-       tcore_check_return_assert(resp_cb_data != NULL);
+       ret = _ss_request_message(pending, o, ur, on_response_ss_forwarding_set, user_data);
 
-       if (at_resp && at_resp->success)
-               result = TEL_SS_RESULT_SUCCESS;
+       g_free(tmp_str);
+       g_free(cmd_str);
 
-       dbg("Set Cli Status: [%s]",
-                       (result == TEL_SS_RESULT_SUCCESS ? "SUCCESS" : "FAIL"));
+       if (!ret) {
+               dbg("AT request sent failed ");
+               if (user_data != NULL)
+                       g_free(user_data);
 
-       /* Invoke callback */
-       if (resp_cb_data->cb)
-               resp_cb_data->cb(co, (gint)result, NULL, resp_cb_data->cb_data);
+               return TCORE_RETURN_FAILURE;
+       }
 
-       imc_destroy_resp_cb_data(resp_cb_data);
+       return TCORE_RETURN_SUCCESS;
 }
 
-static void on_response_imc_ss_get_cli_status(TcorePending *p,
-               guint data_len, const void *data, void *user_data)
+static TReturn _ss_forwarding_get(CoreObject *o,
+         UserRequest *ur,
+         enum telephony_ss_class class,
+         enum telephony_ss_forwarding_mode type,
+         enum tcore_response_command resp)
 {
-       const TcoreAtResponse *at_resp = data;
-       CoreObject *co = tcore_pending_ref_core_object(p);
-       ImcRespCbData *resp_cb_data = user_data;
-       TelSsCliResp cli_resp = {0,};
-       TelSsCliType *cli_type;
-       GSList *tokens = NULL;
-
-       TelSsResult result = TEL_SS_RESULT_FAILURE; // TODO: CMEE error mapping is required
-       dbg("Enter");
+       struct ss_confirm_info *user_data = 0;
+       gboolean ret = FALSE;
+       char *cmd_str = NULL;
+       int reason = 0, mode = 0, classx = 0;
+       TcorePending *pending = NULL;
+       TcoreATRequest *req;
 
-       tcore_check_return_assert(co != NULL);
-       tcore_check_return_assert(resp_cb_data != NULL);
+       dbg("function enter");
 
-       cli_type = (TelSsCliType *)IMC_GET_DATA_FROM_RESP_CB_DATA(resp_cb_data);
-
-       if (*cli_type == TEL_SS_CLI_CDIP) {
-               err("Unsupported CLI type: [%d]", *cli_type);
-               result = TEL_SS_RESULT_INVALID_PARAMETER;
-               goto END;
-       }
+       switch (type) {
+       case SS_CF_MODE_CFU:
+               reason = 0;
+       break;
 
-       if (at_resp && at_resp->success) {
-               const gchar *line;
-               gchar  *status = NULL;
-               gint net_status;
-               gint dev_status;
+       case SS_CF_MODE_CFB:
+               reason = 1;
+       break;
 
-               if (!at_resp->lines) {
-                       err("Invalid response message");
-                       goto END;
-               }
-               line = (const gchar *)at_resp->lines->data;
-               tokens = tcore_at_tok_new(line);
-               if (g_slist_length(tokens) < 1) {
-                       err("Invalid response message");
-                       goto END;
-               }
+       case SS_CF_MODE_CFNRy:
+               reason = 2;
+       break;
 
-               dbg("RESPONSE OK");
-               status = g_slist_nth_data(tokens, 0);
-               if (!status) {
-                       err("dev_status is missing");
-                       goto END;
-               }
-               if (!__imc_ss_convert_modem_cli_dev_status_cli_status(*cli_type, atoi(status), &dev_status))
-                       goto END;
+       case SS_CF_MODE_CFNRc:
+               reason = 3;
+       break;
 
-               status = g_slist_nth_data(tokens, 1);
-               if (!status) {
-                       err("net_status is missing");
-                       goto END;
-               }
-               if (!__imc_ss_convert_modem_cli_net_status_cli_status(*cli_type, atoi(status), &net_status))
-                       goto END;
+       case SS_CF_MODE_CF_ALL:
+               reason = 4;
+       break;
 
-               switch(*cli_type){
-               case TEL_SS_CLI_CLIR:
-                       cli_resp.status.clir.net_status = net_status;
-                       cli_resp.status.clir.dev_status = dev_status;
-                       break;
-               case TEL_SS_CLI_CLIP:
-                       cli_resp.status.clip.net_status = net_status;
-                       cli_resp.status.clip.dev_status = dev_status;
-                       break;
-               case TEL_SS_CLI_COLP:
-                       cli_resp.status.colp.net_status = net_status;
-                       cli_resp.status.colp.dev_status = dev_status;
-                       break;
-               case TEL_SS_CLI_COLR:
-                       cli_resp.status.colr.net_status = net_status;
-                       cli_resp.status.colr.dev_status = dev_status;
-                       break;
-               case TEL_SS_CLI_CNAP:
-                       cli_resp.status.cnap.net_status = net_status;
-                       cli_resp.status.cnap.dev_status = dev_status;
-                       break;
-               default:
-                       err("Unsupported CLI type: [%d]", *cli_type);
-                       result = TEL_SS_RESULT_INVALID_PARAMETER;
-                       goto END;
-               }
+       case SS_CF_MODE_CFC:
+               reason = 5;
+       break;
 
-               cli_resp.type = *cli_type;
-               result = TEL_SS_RESULT_SUCCESS;
-       } else{
-               err("RESPONSE NOK");
+       default:
+               dbg("unsupported reason : %d");
+       break;
        }
+       dbg("reason  = %d", reason);
 
-END:
-       tcore_at_tok_free(tokens);
+       switch (class) {
+       case SS_CLASS_ALL_TELE:
+               classx = 7;
+       break;
 
-       /* Invoke callback */
-       if (resp_cb_data->cb)
-               resp_cb_data->cb(co, (gint)result, &cli_resp, resp_cb_data->cb_data);
+       case SS_CLASS_VOICE:
+               classx = 1;
+       break;
 
-       imc_destroy_resp_cb_data(resp_cb_data);
-}
+       case SS_CLASS_ALL_DATA_TELE:
+               classx = 2;
+       break;
 
-static void on_response_imc_ss_send_ussd_request(TcorePending *p,
-               guint data_len, const void *data, void *user_data)
-{
-       const TcoreAtResponse *at_resp = data;
-       CoreObject *co = tcore_pending_ref_core_object(p);
-       ImcRespCbData *resp_cb_data = user_data;
-       TelSsUssdResp ussd_resp = {0,};
-       UssdSession *ussd_s = NULL;
+       case SS_CLASS_FAX:
+               classx = 4;
+       break;
 
-       TelSsResult result = TEL_SS_RESULT_FAILURE;  // TODO: CMEE error mapping is required
-       dbg("Enter");
+       case SS_CLASS_SMS:
+               classx = 8;
+       break;
 
-       tcore_check_return_assert(co != NULL);
-       tcore_check_return_assert(resp_cb_data != NULL);
+       case SS_CLASS_ALL_CS_SYNC:
+               classx = 16;
+       break;
 
-       ussd_s = tcore_ss_ussd_get_session(co);
-       tcore_check_return(ussd_s != NULL);
+       default:
+               classx = 7;
+               dbg("unsupported class %d. set to default : 7", class);
+       break;
+       }
 
-       tcore_ss_ussd_get_session_type(ussd_s, &ussd_resp.type);
+       dbg("classx  = %d", classx);
 
-       if (at_resp && at_resp->success) {
-               result = TEL_SS_RESULT_SUCCESS;
-               /* Need to initialise ussd response string  */
-               ussd_resp.str = (unsigned char *)g_strdup("Operation success");
-       } else {
-               ussd_resp.str = (unsigned char *)g_strdup("Operation failed");
+       /* query status - mode set to 2 */
+       mode = 2;
+       user_data = g_new0(struct ss_confirm_info, 1);
+       if (!user_data) {
+               dbg("[ error ] failed to allocate memory");
+               return TCORE_RETURN_ENOMEM;
        }
+       user_data->resp = resp;
+       user_data->class = class;
+       user_data->flavor_type = type;
+
+       if (classx == 7)
+               cmd_str = g_strdup_printf("AT+CCFC=%d,%d", reason, mode);
+       else
+               cmd_str = g_strdup_printf("AT+CCFC=%d,%d,,,%d", reason, mode, classx);
 
+       dbg("request command : %s", cmd_str);
 
-       dbg("Send Ussd Request: [%s]",
-                       (result == TEL_SS_RESULT_SUCCESS ? "SUCCESS" : "FAIL"));
+       pending = tcore_pending_new(o, 0);
+       req = tcore_at_request_new(cmd_str, "+CCFC", TCORE_AT_MULTILINE);
+       if (req == NULL) {
+               tcore_pending_free(pending);
+               g_free(cmd_str);
+               return TCORE_RETURN_FAILURE;
+       }
+       dbg("cmd : %s, prefix(if any) :%s, cmd_len : %d", req->cmd, req->prefix, strlen(req->cmd));
 
-       tcore_ss_ussd_destroy_session(ussd_s);
+       tcore_pending_set_request_data(pending, 0, req);
 
+       ret = _ss_request_message(pending, o, ur, on_response_ss_forwarding_get, user_data);
+       g_free(cmd_str);
 
-       /* Invoke callback */
-       if (resp_cb_data->cb)
-               resp_cb_data->cb(co, (gint)result, &ussd_resp, resp_cb_data->cb_data);
+       if (!ret) {
+               dbg("AT request sent failed ");
+               if (user_data != NULL) {
+                       g_free(user_data);
+                       tcore_pending_free(pending);
+                       tcore_at_request_free(req);
+               }
+               return TCORE_RETURN_FAILURE;
+       }
 
-       imc_destroy_resp_cb_data(resp_cb_data);
-       g_free(ussd_resp.str);
+       return TCORE_RETURN_SUCCESS;
 }
 
-/* SS Operations */
-/*
- * Operation - set_barring/get_barring_status
- *
- * Request -
- * AT-Command: AT+CLCK=<fac>,<mode>[,<passwd>[,<class>]]
- * where,
- * <fac>
- * Barring facility type. Ref #TelSsBarringType
- *
- * <mode>
- * 0 unlock
- * 1 lock
- * 2 query status
- *
- * <passwd>
- * Barring Password
- *
- * <class>
- * SS class. Ref #TelSsClass
- *
- * <status>
- * 0 not active
- * 1 active
- *
- * Success: when <mode>=2:
- *     OK
- *     +CLCK: <status>[,<class1> [<CR><LF>
- *     +CLCK: <status>,<class2> [...]]
- *
- * Failure:
- *     +CME ERROR: <error>
- */
-static TelReturn imc_ss_set_barring(CoreObject *co, const TelSsBarringInfo *barring_info,
-               TcoreObjectResponseCallback cb, void *cb_data)
+static TReturn imc_ss_forwarding_activate(CoreObject *o, UserRequest *ur)
 {
-       gchar *at_cmd = NULL;
-       guint mode;
-       guint classx;
-       gchar *facility = NULL;
-       ImcRespCbData *resp_cb_data = NULL;
-       TelReturn ret = TEL_RETURN_INVALID_PARAMETER;
-
-       if (barring_info->enable == TRUE)
-               mode = 1;
-       else
-               mode = 0;
-
-       if (__imc_ss_convert_barring_type_to_facility(barring_info->type, &facility) == FALSE) {
-               err("Invalid arguments");
-               return ret;
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
        }
+       return _ss_forwarding_set(o, ur, SS_OPCO_ACTIVATE);
+}
 
-       classx = __imc_ss_convert_class_to_imc_class(barring_info->class);
-
-       dbg("facility: [%s], classx:[%d], mode: [%d]", facility, classx, mode);
+static TReturn imc_ss_forwarding_deactivate(CoreObject *o, UserRequest *ur)
+{
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
+       }
+       return _ss_forwarding_set(o, ur, SS_OPCO_DEACTIVATE);
+}
 
-       /* AT-Command */
-       at_cmd = g_strdup_printf("AT+CLCK=\"%s\",%d,\"%s\",%d", facility, mode, barring_info->pwd, classx);
+static TReturn imc_ss_forwarding_register(CoreObject *o, UserRequest *ur)
+{
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
+       }
+       return _ss_forwarding_set(o, ur, SS_OPCO_REG);
+}
 
-       resp_cb_data = imc_create_resp_cb_data(cb, cb_data, NULL, 0);
+static TReturn imc_ss_forwarding_deregister(CoreObject *o, UserRequest *ur)
+{
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
+       }
+       return _ss_forwarding_set(o, ur, SS_OPCO_DEREG);
+}
 
-       /* Send Request to modem */
-       ret = tcore_at_prepare_and_send_request(co,
-                       at_cmd, NULL,
-                       TCORE_AT_COMMAND_TYPE_NO_RESULT,
-                       TCORE_PENDING_PRIORITY_DEFAULT,
-                       NULL,
-                       on_response_imc_ss_set_barring, resp_cb_data,
-                       on_send_imc_request, NULL,
-                       0, NULL, NULL);
+static TReturn imc_ss_forwarding_get_status(CoreObject *o, UserRequest *ur)
+{
+       struct treq_ss_forwarding *forwarding = 0;
 
-       IMC_CHECK_REQUEST_RET(ret, resp_cb_data, "Set Barring");
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
+       }
 
-       g_free(at_cmd);
+       forwarding = (struct treq_ss_forwarding *) tcore_user_request_ref_data(ur, 0);
 
-       return ret;
+       return _ss_forwarding_get(o, ur, forwarding->class, forwarding->mode, TRESP_SS_FORWARDING_GET_STATUS);
 }
 
-static TelReturn imc_ss_get_barring_status(CoreObject *co, const TelSsBarringGetInfo *get_barring_info,
-               TcoreObjectResponseCallback cb, void *cb_data)
-{
-       gchar *at_cmd = NULL;
-       guint mode;
-       guint classx;
-       gchar *facility = NULL;
-       ImcRespCbData *resp_cb_data = NULL;
-       TelReturn ret = TEL_RETURN_INVALID_PARAMETER;
-
-       mode = 2; /* query status - mode is fixed to 2 */
 
-       if (__imc_ss_convert_barring_type_to_facility(get_barring_info->type, &facility) == FALSE) {
-               err("Invalid arguments");
-               return ret;
+static TReturn _ss_waiting_set(CoreObject *o, UserRequest *ur, enum telephony_ss_opcode opco)
+{
+       struct treq_ss_waiting *waiting = 0;
+       struct ss_confirm_info *user_data = 0;
+       gboolean ret = FALSE;
+       int mode = 0, classx = 0;
+       char *cmd_str;
+       TcorePending *pending = NULL;
+       TcoreATRequest *req;
+
+       dbg("function enter ");
+       waiting = (struct treq_ss_waiting *) tcore_user_request_ref_data(ur, 0);
+       user_data = g_new0(struct ss_confirm_info, 1);
+       if (!user_data) {
+               dbg("[ error ] failed to allocate memory");
+               return TCORE_RETURN_ENOMEM;
        }
 
-       classx = __imc_ss_convert_class_to_imc_class(get_barring_info->class);
+       if (opco == SS_OPCO_ACTIVATE) {
+               user_data->resp = TRESP_SS_WAITING_ACTIVATE;
+               mode = 1; /* enable */
+       } else if (opco == SS_OPCO_DEACTIVATE) {
+               user_data->resp = TRESP_SS_WAITING_DEACTIVATE;
+               mode = 0; /* disable */
+       } else
+               dbg("[ error ] unknown ss mode (0x%x)", opco);
+
+       switch (waiting->class) {
+       case SS_CLASS_ALL_TELE:
+               classx = 7;
+               break;
+
+       case SS_CLASS_VOICE:
+               classx = 1;
+               break;
 
-       dbg("facility: [%s], classx:[%d], mode: [%d]", facility, classx, mode);
+       case SS_CLASS_ALL_DATA_TELE:
+               classx = 2;
+               break;
 
-       /* AT-Command */
-       at_cmd = g_strdup_printf("AT+CLCK=\"%s\",%d,,%d", facility, mode, classx);
+       case SS_CLASS_FAX:
+               classx = 4;
+               break;
 
-       resp_cb_data = imc_create_resp_cb_data(cb, cb_data, (void *)get_barring_info, sizeof(TelSsBarringGetInfo));
+       case SS_CLASS_SMS:
+               classx = 8;
+               break;
 
-       /* Send Request to modem */
-       ret = tcore_at_prepare_and_send_request(co,
-                       at_cmd, "+CLCK",
-                       TCORE_AT_COMMAND_TYPE_MULTILINE,
-                       TCORE_PENDING_PRIORITY_DEFAULT,
-                       NULL,
-                       on_response_imc_ss_get_barring_status, resp_cb_data,
-                       on_send_imc_request, NULL,
-                       0, NULL, NULL);
+       default:
+               classx = 1;
+               dbg("unsupported class %d. set to default : 1", waiting->class);
+               break;
+       }
+       dbg("mode = %d classxx- %d", mode, classx);
 
-       IMC_CHECK_REQUEST_RET(ret, resp_cb_data, "Get Barring Status");
+       user_data->class = waiting->class;
+       user_data->flavor_type = (int) opco;
 
-       g_free(at_cmd);
+       cmd_str = g_strdup_printf("AT+CCWA=1,%d,%d", mode, classx); /* always enable +CCWA: unsolicited cmd */
+       dbg("request command : %s", cmd_str);
 
-       return ret;
+       pending = tcore_pending_new(o, 0);
+       req = tcore_at_request_new(cmd_str, NULL, TCORE_AT_NO_RESULT);
+       if (req == NULL) {
+               tcore_pending_free(pending);
+               g_free(cmd_str);
+               return TCORE_RETURN_FAILURE;
+       }
+       dbg("cmd : %s, prefix(if any) :%s, cmd_len : %d", req->cmd, req->prefix, strlen(req->cmd));
+
+       tcore_pending_set_request_data(pending, 0, req);
+
+       ret = _ss_request_message(pending, o, ur, on_response_ss_waiting_set, user_data);
+       g_free(cmd_str);
+       if (!ret) {
+               dbg("AT request sent failed ");
+               if (user_data != NULL) {
+                       g_free(user_data);
+                       tcore_pending_free(pending);
+                       tcore_at_request_free(req);
+               }
+               return TCORE_RETURN_FAILURE;
+       }
+       return TCORE_RETURN_SUCCESS;
 }
 
-/*
- * Operation - change_barring_password
- *
- * Request -
- * AT-Command: AT+CPWD= <fac>,<oldpwd>,<newpwd>
- * where,
- * <fac>
- * Barring facility type. Ref #TelSsBarringType
- * Eg: "AB" All Barring services
- *
- * <oldpwd>
- * Old Barring Password
- *
- * <newpwd>
- * New Barring Password
- *
- * Success:
- *     OK
- *
- * Failure:
- *     +CME ERROR: <error>
- */
-static TelReturn imc_ss_change_barring_password(CoreObject *co, const TelSsBarringPwdInfo *barring_pwd_info,
-               TcoreObjectResponseCallback cb, void *cb_data)
+static TReturn _ss_waiting_get(CoreObject *o,
+          UserRequest *ur,
+          enum telephony_ss_class class,
+          enum tcore_response_command resp)
 {
-       gchar *at_cmd = NULL;
-       ImcRespCbData *resp_cb_data = NULL;
-       TelReturn ret = TEL_RETURN_INVALID_PARAMETER;
+       struct ss_confirm_info *user_data = 0;
+       gboolean ret = FALSE;
+       int classx; /* mode, */
+       char *cmd_str;
+       TcorePending *pending = NULL;
+       TcoreATRequest *req;
+
+       dbg("function  enter");
+       switch (class) {
+       case SS_CLASS_ALL_TELE:
+               classx = 7;
+       break;
+
+       case SS_CLASS_VOICE:
+               classx = 1;
+       break;
+
+       case SS_CLASS_ALL_DATA_TELE:
+               classx = 2;
+       break;
+
+       case SS_CLASS_FAX:
+               classx = 4;
+       break;
+
+       case SS_CLASS_SMS:
+               classx = 8;
+       break;
 
-       if (barring_pwd_info->old_pwd== NULL || barring_pwd_info->new_pwd == NULL) {
-               err("Invalid data");
-               return ret;
+       default:
+               classx = 7;
+               dbg("unsupported class %d. set to default : 7", class);
+       break;
        }
+       dbg("classx - %d", classx);
 
-       dbg("Old password: [%s], New password: [%s]", barring_pwd_info->old_pwd, barring_pwd_info->new_pwd);
-
-       at_cmd = g_strdup_printf("AT+CPWD=\"%s\",\"%s\",\"%s\"", "AB", barring_pwd_info->old_pwd, barring_pwd_info->new_pwd);
+       dbg("allocating user data");
+       user_data = g_new0(struct ss_confirm_info, 1);
+       if (!user_data) {
+               dbg("[ error ] failed to allocate memory");
+               return TCORE_RETURN_ENOMEM;
+       }
+       user_data->resp = resp;
+       user_data->class = class;
+
+       cmd_str = g_strdup_printf("AT+CCWA=1,2,%d", classx); /* always enable +CCWA: unsolicited cmd , mode is fixed to 2(query status) */
+       dbg("request cmd : %s", cmd_str);
+
+       pending = tcore_pending_new(o, 0);
+       req = tcore_at_request_new(cmd_str, "+CCWA", TCORE_AT_MULTILINE);
+       if (req == NULL) {
+               err("Request is NULL");
+               g_free(cmd_str);
+               tcore_pending_free(pending);
+               return TCORE_RETURN_EINVAL;
+       }
+       dbg("cmd : %s, prefix(if any) :%s, cmd_len : %d", req->cmd, req->prefix, strlen(req->cmd));
+
+       tcore_pending_set_request_data(pending, 0, req);
+
+       ret = _ss_request_message(pending, o, ur, on_response_ss_waiting_get, user_data);
+       g_free(cmd_str);
+       if (!ret) {
+               dbg("AT request sent failed ");
+               if (user_data != NULL) {
+                       g_free(user_data);
+                       tcore_pending_free(pending);
+                       tcore_at_request_free(req);
+               }
+               return TCORE_RETURN_FAILURE;
+       }
+       return TCORE_RETURN_SUCCESS;
+}
 
-       resp_cb_data = imc_create_resp_cb_data(cb, cb_data, NULL, 0);
+static TReturn imc_ss_waiting_activate(CoreObject *o, UserRequest *ur)
+{
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
+       }
+       return _ss_waiting_set(o, ur, SS_OPCO_ACTIVATE);
+}
 
-       /* Send Request to modem */
-       ret = tcore_at_prepare_and_send_request(co,
-                       at_cmd, NULL,
-                       TCORE_AT_COMMAND_TYPE_NO_RESULT,
-                       TCORE_PENDING_PRIORITY_DEFAULT,
-                       NULL,
-                       on_response_imc_ss_change_barring_password, resp_cb_data,
-                       on_send_imc_request, NULL,
-                       0, NULL, NULL);
+static TReturn imc_ss_waiting_deactivate(CoreObject *o, UserRequest *ur)
+{
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
+       }
+       return _ss_waiting_set(o, ur, SS_OPCO_DEACTIVATE);
+}
 
-       IMC_CHECK_REQUEST_RET(ret, resp_cb_data, "Change Barring Password");
+static TReturn imc_ss_waiting_get_status(CoreObject *o, UserRequest *ur)
+{
+       struct treq_ss_waiting *waiting = 0;
 
-       g_free(at_cmd);
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
+       }
+       waiting = (struct treq_ss_waiting *) tcore_user_request_ref_data(ur, 0);
 
-       return ret;
+       return _ss_waiting_get(o, ur, waiting->class, TRESP_SS_WAITING_GET_STATUS);
 }
 
-/*
- * Operation - set_forwarding/get_forwarding_status
- *
- * Request -
- * AT-Command: AT+CCFC=<reason>,<mode>[,<number>[,<type>[,<class>[,<subaddr>[,<satype>[,<time>]]]]]]
- * where,
- * <reason>
- * Forwarding Condition. Ref #TelSsForwardCondition
- *
- * <mode>
- * Forwarding Mode. Ref #TelSsForwardMode
- * 0 disable
- * 1 enable
- * 2 query status
- * 3 registration
- * 4 erasure
- *
- *
- * <number>
- * Call Forwarding Number
- *
- * <type>
- * Default 145 when available string includes "+"
- * Otherwise 129
- *
- * <subaddr>
- * Parameter String type subaddress of format specified by <satype>
- *
- * <satype>
- * Parameter type of subaddress octet in integer format
- * Default 128
- *
- * <time>
- * Parameter time in seconds to wait before call is forwarded
- * Default 20, but only when <reason>=2 (no reply) is enabled
- *
- * <class>
- * SS class. Ref #TelSsClass
- *
- * <status>
- * 0 not active
- * 1 active
- *
- * Success: when <mode>=2:
- *     OK
- *     +CCFC: <status>,<class1>[,<number>,<type>[,<subaddr>,<satype>[,<time>]]][<CR><LF>
- *     +CCFC: <status>,<class2>[,<number>,<type>[,<subaddr>,<satype>[,<time>]]][...]]
- *
- * Failure:
- *     +CME ERROR: <error>
- */
-static TelReturn imc_ss_set_forwarding(CoreObject *co, const TelSsForwardInfo *forwarding_info,
-               TcoreObjectResponseCallback cb, void *cb_data)
+static TReturn imc_ss_cli_activate(CoreObject *o, UserRequest *ur)
 {
-       gchar *at_cmd = NULL;
-       gchar *tmp_cmd = NULL;
-       guint classx;
-       guint reason;
-       guint mode;
-       guint num_type;
-       ImcRespCbData *resp_cb_data = NULL;
-       TelReturn ret = TEL_RETURN_INVALID_PARAMETER;
-
-       classx = __imc_ss_convert_class_to_imc_class(forwarding_info->class);
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
+       }
+       return TCORE_RETURN_SUCCESS;
+}
 
-       if (__imc_ss_convert_forwarding_mode_to_modem_mode(forwarding_info->mode, &mode) == FALSE) {
-               err("Invalid arguments");
-               return ret;
+static TReturn imc_ss_cli_deactivate(CoreObject *o, UserRequest *ur)
+{
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
        }
+       return TCORE_RETURN_SUCCESS;
+}
 
-       if (__imc_ss_convert_forwarding_condition_to_modem_reason(forwarding_info->condition, &reason) == FALSE) {
-               err("Invalid arguments");
-               return ret;
+static TReturn imc_ss_cli_get_status(CoreObject *o, UserRequest *ur)
+{
+       struct treq_ss_cli *cli = 0;
+       gboolean ret = FALSE;
+       char *cmd_prefix = NULL, *rsp_prefix = NULL, *cmd_str = NULL;
+       enum  telephony_ss_cli_type *user_data = 0;
+       TcorePending *pending = NULL;
+       TcoreATRequest *req;
+
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
        }
 
-       if (forwarding_info->number[0] == '+')
-               num_type = 145;
-       else
-               num_type = 129;
+       cli = (struct treq_ss_cli *) tcore_user_request_ref_data(ur, 0);
+       switch (cli->type) {
+       case SS_CLI_TYPE_CLIP:
+               cmd_prefix = "+CLIP";
+               rsp_prefix = "+CLIP";
+       break;
 
-       dbg("classx: [%d], reason:[%d], mode: [%d]", classx, reason, mode);
+       case SS_CLI_TYPE_CLIR:
+               cmd_prefix = "+CLIR";
+               rsp_prefix = "+CLIR";
+       break;
 
-       if (mode == 3)  /* TEL_SS_CF_MODE_REGISTER */
-               tmp_cmd = g_strdup_printf("AT+CCFC=%d,%d,\"%s\",%d,%d", reason, mode, forwarding_info->number, num_type, classx);
-       else
-               tmp_cmd = g_strdup_printf("AT+CCFC=%d,%d,,,%d", reason, mode, classx);
+       case SS_CLI_TYPE_COLP:
+               cmd_prefix = "+COLP";
+               rsp_prefix = "+COLP";
+       break;
 
-       if (reason == 2)        /* TEL_SS_CF_COND_CFNRY */
-               at_cmd = g_strdup_printf("%s,,,%d", tmp_cmd, forwarding_info->wait_time);
-       else
-               at_cmd = g_strdup_printf("%s", tmp_cmd);
+       case SS_CLI_TYPE_COLR:
+               cmd_prefix = "+COLR";
+               rsp_prefix = "+COLR";
+       break;
+
+       case SS_CLI_TYPE_CNAP:
+               cmd_prefix = "+CNAP";
+               rsp_prefix = "+CNAP";
+       break;
 
-       resp_cb_data = imc_create_resp_cb_data(cb, cb_data, NULL, 0);
+       case SS_CLI_TYPE_CDIP:
+       default:
+               dbg("unsupported cli_type : %d", cli->type);
+               return TCORE_RETURN_FAILURE;
+       }
+       dbg("cmd_prefix : %s", cmd_prefix);
 
-       /* Send Request to modem */
-       ret = tcore_at_prepare_and_send_request(co,
-                       at_cmd, NULL,
-                       TCORE_AT_COMMAND_TYPE_NO_RESULT,
-                       TCORE_PENDING_PRIORITY_DEFAULT,
-                       NULL,
-                       on_response_imc_ss_set_forwarding, resp_cb_data,
-                       on_send_imc_request, NULL,
-                       0, NULL, NULL);
+       cmd_str = g_strdup_printf("AT%s?", cmd_prefix);
+       dbg("request cmd : %s", cmd_str);
 
-       IMC_CHECK_REQUEST_RET(ret, resp_cb_data, "Set Forwarding");
+       user_data = g_new0(enum telephony_ss_cli_type, 1);
+       if (!user_data) {
+               dbg("[ error ] failed to allocate memory");
+               g_free(cmd_str);
+               return TCORE_RETURN_ENOMEM;
+       }
+       *user_data = cli->type;
 
-       g_free(tmp_cmd);
-       g_free(at_cmd);
+       pending = tcore_pending_new(o, 0);
 
-       return ret;
+       req = tcore_at_request_new(cmd_str, rsp_prefix, TCORE_AT_SINGLELINE);
+       if (req == NULL) {
+               tcore_pending_free(pending);
+               g_free(cmd_str);
+               return TCORE_RETURN_FAILURE;
+       }
+       dbg("cmd : %s, prefix(if any) :%s, cmd_len : %d", req->cmd, req->prefix, strlen(req->cmd));
+       tcore_pending_set_request_data(pending, 0, req);
+
+       ret = _ss_request_message(pending, o, ur, on_response_ss_cli_get, user_data);
+       g_free(cmd_str);
+       if (!ret) {
+               dbg("AT request sent failed ");
+               if (user_data != NULL) {
+                       g_free(user_data);
+                       tcore_pending_free(pending);
+                       tcore_at_request_free(req);
+               }
+               return TCORE_RETURN_FAILURE;
+       }
+       return TCORE_RETURN_SUCCESS;
 }
 
-static TelReturn imc_ss_get_forwarding_status(CoreObject *co, const TelSsForwardGetInfo *get_forwarding_info,
-               TcoreObjectResponseCallback cb, void *cb_data)
+static TReturn imc_ss_send_ussd(CoreObject *o, UserRequest *ur)
 {
-       gchar *at_cmd = NULL;
-       guint classx;
-       guint reason;
-       guint mode = 2; /* query status */
-       ImcRespCbData *resp_cb_data = NULL;
-       TelReturn ret = TEL_RETURN_INVALID_PARAMETER;
+       UssdSession *ussd_s = 0;
+       struct treq_ss_ussd *ussd = 0;
+       struct ss_confirm_info *user_data = 0;
+       gboolean ret = FALSE;
+       char *cmd_str;
+       TcorePending *pending = NULL;
+       TcoreATRequest *req;
+
+       dbg("function enter");
+
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
+       }
 
-       classx = __imc_ss_convert_class_to_imc_class(get_forwarding_info->class);
+       ussd = (struct treq_ss_ussd *) tcore_user_request_ref_data(ur, 0);
 
-       if (__imc_ss_convert_forwarding_condition_to_modem_reason(get_forwarding_info->condition, &reason) == FALSE) {
-               err("Invalid arguments");
-               return ret;
+       user_data = g_new0(struct ss_confirm_info, 1);
+       if (!user_data) {
+               dbg("[ error ] failed to allocate memory");
+               return TCORE_RETURN_ENOMEM;
        }
+       user_data->resp = TRESP_SS_SEND_USSD;
+       ussd_s = tcore_ss_ussd_get_session(o);
+       if (!ussd_s) {
+               dbg("USSD session does not  exist");
+               tcore_ss_ussd_create_session(o, (enum tcore_ss_ussd_type) ussd->type, (void *) tcore_user_request_ref(ur), 0);
+       } else {
+               if (ussd->type == SS_USSD_TYPE_USER_INITIATED) {
+                       dbg("[ error ] ussd session is already exist");
+                       g_free(user_data);
+                       return TCORE_RETURN_FAILURE;
+               }
 
-       dbg("classx: [%d], reason: [%d], mode: [%d]", classx, reason, mode);
-
-       at_cmd = g_strdup_printf("AT+CCFC=%d,%d,,,%d", reason, mode, classx);
+               tcore_ss_ussd_set_session_type(ussd_s, (enum tcore_ss_ussd_type) ussd->type);
+       }
 
-       resp_cb_data = imc_create_resp_cb_data(cb, cb_data, (void *)get_forwarding_info, sizeof(TelSsForwardGetInfo));
+       cmd_str = g_strdup_printf("AT+CUSD=1,\"%s\",%d", ussd->str, 0x0f); /* always enable +CUSD: unsolicited cmd. set to dcs to 0x0f. only supports HEX type */
+       dbg("request command : %s", cmd_str);
 
-       /* Send Request to modem */
-       ret = tcore_at_prepare_and_send_request(co,
-                       at_cmd, "+CCFC",
-                       TCORE_AT_COMMAND_TYPE_MULTILINE,
-                       TCORE_PENDING_PRIORITY_DEFAULT,
-                       NULL,
-                       on_response_imc_ss_get_forwarding_status, resp_cb_data,
-                       on_send_imc_request, NULL,
-                       0, NULL, NULL);
+       pending = tcore_pending_new(o, 0);
+       req = tcore_at_request_new(cmd_str, NULL, TCORE_AT_NO_RESULT);
+       if (req == NULL) {
+               tcore_pending_free(pending);
+               g_free(cmd_str);
+               return TCORE_RETURN_FAILURE;
+       }
+       dbg("cmd : %s, prefix(if any) :%s, cmd_len : %d", req->cmd, req->prefix, strlen(req->cmd));
 
-       IMC_CHECK_REQUEST_RET(ret, resp_cb_data, "Get Forwarding Status");
+       tcore_pending_set_request_data(pending, 0, req);
 
-       g_free(at_cmd);
+       ret = _ss_request_message(pending, o, ur, on_confirmation_ss_ussd, user_data);
+       g_free(cmd_str);
 
-       return ret;
+       if (!ret) {
+               dbg("AT request sent failed ");
+               if (user_data != NULL) {
+                       g_free(user_data);
+                       tcore_pending_free(pending);
+                       tcore_at_request_free(req);
+               }
+               return TCORE_RETURN_FAILURE;
+       }
+       return TCORE_RETURN_SUCCESS;
 }
 
-/*
- * Operation - set_waiting/get_waiting_status
- *
- * Request -
- * AT-Command: AT+CCWA=[<n>[,<mode>[,<class>]]]
- * where,
- * <n>
- * Parameter Sets/shows the result code presentation status to the TE.
- * 0 presentation status is disabled to TE(default)
- * 1 presentation status is enabled to TE
- *
- * <mode>
- * 0 Disable call waiting
- * 1 Enable call waiting
- * 2 Query status
- *
- * <class>
- * SS class. Ref #TelSsClass
- *
- * <status>
- * 0 not active
- * 1 active
- *
- * Success: when <mode>=2:
- *     OK
- *     +CCWA: <status>,<class1>
- *     +CCWA: <status>,<class2>
- *
- * Failure:
- *     +CME ERROR: <error>
- */
-static TelReturn imc_ss_set_waiting(CoreObject *co, const TelSsWaitingInfo *waiting_info,
-               TcoreObjectResponseCallback cb, void *cb_data)
+static TReturn imc_ss_set_aoc(CoreObject *o, UserRequest *ur)
 {
-       gchar *at_cmd = NULL;
-       guint classx;
-       guint mode;
-       ImcRespCbData *resp_cb_data = NULL;
-       TelReturn ret = TEL_RETURN_INVALID_PARAMETER;
-
-       if (waiting_info->enable == TRUE)
-               mode = 1;
-       else
-               mode = 0;
-
-       classx = __imc_ss_convert_class_to_imc_class(waiting_info->class);
-
-       dbg("mode: [%d], class: [%d]", mode, classx);
-
-       at_cmd = g_strdup_printf("AT+CCWA=1,%d,%d", mode, classx);
-
-       resp_cb_data = imc_create_resp_cb_data(cb, cb_data, NULL, 0);
-
-       /* Send Request to modem */
-       ret = tcore_at_prepare_and_send_request(co,
-                       at_cmd, NULL,
-                       TCORE_AT_COMMAND_TYPE_NO_RESULT,
-                       TCORE_PENDING_PRIORITY_DEFAULT,
-                       NULL,
-                       on_response_imc_ss_set_waiting, resp_cb_data,
-                       on_send_imc_request, NULL,
-                       0, NULL, NULL);
-
-       IMC_CHECK_REQUEST_RET(ret, resp_cb_data, "Set Waiting");
-
-       g_free(at_cmd);
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
+       }
 
-       return ret;
+       dbg("[ error ] unsupported function");
+       return TCORE_RETURN_SUCCESS;
 }
 
-static TelReturn imc_ss_get_waiting_status(CoreObject *co, TelSsClass ss_class,
-               TcoreObjectResponseCallback cb, void *cb_data)
+static TReturn imc_ss_get_aoc(CoreObject *o, UserRequest *ur)
 {
-       gchar *at_cmd = NULL;
-       guint classx;
-       ImcRespCbData *resp_cb_data = NULL;
-       TelReturn ret = TEL_RETURN_INVALID_PARAMETER;
+       if (FALSE == tcore_hal_get_power_state(tcore_object_get_hal(o))) {
+               dbg("cp not ready/n");
+               return TCORE_RETURN_ENOSYS;
+       }
 
-       classx = __imc_ss_convert_class_to_imc_class(ss_class);
+       dbg("[ error ] unsupported function");
+       return TCORE_RETURN_SUCCESS;
+}
 
-       dbg("class: [%d]", classx);
 
-       at_cmd = g_strdup_printf("AT+CCWA=1,2,%d", classx);
+static struct tcore_call_control_operations call_ops = {
+       .answer_hold_and_accept = imc_ss_manage_call_2_send,
+       .answer_replace = imc_ss_manage_call_1_send,
+       .answer_reject = imc_ss_manage_call_0_send,
+       .end_specific = imc_ss_manage_call_1x_send,
+       .end_all_active = imc_ss_manage_call_1_send,
+       .end_all_held = imc_ss_manage_call_0_send,
+       .active = imc_ss_manage_call_2_send,
+       .hold = imc_ss_manage_call_2_send,
+       .swap = imc_ss_manage_call_2_send,
+       .join = imc_ss_manage_call_3_send,
+       .split = imc_ss_manage_call_2x_send,
+       .transfer = imc_ss_manage_call_4_send,
+       .deflect = imc_ss_manage_call_4dn_send,
+};
 
-       resp_cb_data = imc_create_resp_cb_data(cb, cb_data, &ss_class, sizeof(TelSsClass));
+static TReturn imc_ss_manage_call_send(CoreObject *o, UserRequest *ur, const char *cmd, ConfirmCallback cb, void *user_data)
+{
+       TcorePending *pending = NULL;
+       TcoreATRequest *req;
+       gboolean ret = FALSE;
+
+       pending = tcore_pending_new(o, 0);
+       req = tcore_at_request_new(cmd, NULL, TCORE_AT_NO_RESULT);
+       if (req == NULL) {
+               tcore_pending_free(pending);
+               return TCORE_RETURN_FAILURE;
+       }
+       dbg("cmd : %s, prefix(if any) :%s, cmd_len : %d", req->cmd, req->prefix, strlen(req->cmd));
+       tcore_pending_set_request_data(pending, 0, req);
 
-       /* Send Request to modem */
-       ret = tcore_at_prepare_and_send_request(co,
-                       at_cmd, "+CCWA",
-                       TCORE_AT_COMMAND_TYPE_MULTILINE,
-                       TCORE_PENDING_PRIORITY_DEFAULT,
-                       NULL,
-                       on_response_imc_ss_get_waiting_status, resp_cb_data,
-                       on_send_imc_request, NULL,
-                       0, NULL, NULL);
+       ret = _ss_request_message(pending, o, ur, (TcorePendingResponseCallback) cb, user_data);
+       if (!ret) {
+               dbg("AT request sent failed ");
+               return TCORE_RETURN_FAILURE;
+       }
+       return TCORE_RETURN_SUCCESS;
+}
 
-       IMC_CHECK_REQUEST_RET(ret, resp_cb_data, "Get Waiting Status");
+static TReturn imc_ss_manage_call_0_send(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data)
+{
+       char *cmd_str = NULL;
+       gboolean ret = FALSE;
 
-       g_free(at_cmd);
+       dbg("function enter");
+       cmd_str = g_strdup_printf("%s", "AT+CHLD=0");
+       dbg("cmd : %s, prefix(if any) : %s, cmd_len : %d", cmd_str, "N/A", strlen(cmd_str));
 
+       ret = imc_ss_manage_call_send(o, ur, cmd_str, cb, user_data);
+       g_free(cmd_str);
        return ret;
 }
 
-/*
- * Operation - set_cli/get_cli_status
- *
- * Request -
- * AT-Command:
- * For CLIR: AT+CLIR= [<n>]
- * For CLIP: AT+CLIP= [<n>]
- * For COLP: AT+COLP= [<n>]
- * For COLR: AT+COLR= [<n>]
- * For CNAP: AT+CNAP= [<n>]
- *
- * where,
- * <n> All CLI except CLIR
- * 0 disable(default)
- * 1 enable
- *
- * <n> for CLIR
- * 0 default
- * 1 CLIR invocation
- * 2 CLIR suppression
- *
- * Success:
- *     OK
- *     +CLIR: <n>,<m>
- *
- * where,
- * <m> All CLI except CLIR
- * 0 Not provisioned
- * 1 Provisioned
- * 2 Unknown
- *
- *<m> For CLIR
- * 0 Not provisioned
- * 1 Provisioned in permanent mode
- * 2 Unknown (e.g. no network, etc.)
- * 3 Temporary mode presentation restricted
- * 4 Temporary mode presentation allowed
- *
- * Failure:
- *     +CME ERROR: <error>
- */
-static TelReturn imc_ss_set_cli(CoreObject *co, const TelSsCliInfo *cli_info,
-               TcoreObjectResponseCallback cb, void *cb_data)
+static TReturn imc_ss_manage_call_1_send(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data)
 {
-       gchar *at_cmd = NULL;
-       gchar *cmd_prefix = NULL;
-       gint status = 0;
-       ImcRespCbData *resp_cb_data = NULL;
-       TelReturn ret = TEL_RETURN_INVALID_PARAMETER;
-
-       if (__imc_ss_convert_cli_info_modem_info(&cli_info, &status, &cmd_prefix) == FALSE)
-               return ret;
+       char *cmd_str = NULL;
+       gboolean ret = FALSE;
 
-       at_cmd = g_strdup_printf("AT%s=%d", cmd_prefix, status);
+       dbg("function enter");
+       cmd_str = g_strdup_printf("%s", "AT+CHLD=1");
+       dbg("cmd : %s, prefix(if any) : %s, cmd_len : %d", cmd_str, "N/A", strlen(cmd_str));
 
-       resp_cb_data = imc_create_resp_cb_data(cb, cb_data, NULL, 0);
-
-       /* Send Request to modem */
-       ret = tcore_at_prepare_and_send_request(co,
-                       at_cmd, NULL,
-                       TCORE_AT_COMMAND_TYPE_NO_RESULT,
-                       TCORE_PENDING_PRIORITY_DEFAULT,
-                       NULL,
-                       on_response_imc_ss_set_cli, resp_cb_data,
-                       on_send_imc_request, NULL,
-                       0, NULL, NULL);
+       ret = imc_ss_manage_call_send(o, ur, cmd_str, cb, user_data);
+       g_free(cmd_str);
+       return ret;
+}
 
-       IMC_CHECK_REQUEST_RET(ret, resp_cb_data, "Set Cli");
+static TReturn imc_ss_manage_call_1x_send(CoreObject *o, UserRequest *ur, const int id, ConfirmCallback cb, void *user_data)
+{
+       char *cmd_str = NULL;
+       gboolean ret = FALSE;
 
-       g_free(at_cmd);
+       dbg("function enter");
+       cmd_str = g_strdup_printf("%s%d", "AT+CHLD=1", id);
+       dbg("cmd : %s, prefix(if any) : %s, cmd_len : %d", cmd_str, "N/A", strlen(cmd_str));
 
+       ret = imc_ss_manage_call_send(o, ur, cmd_str, cb, user_data);
+       g_free(cmd_str);
        return ret;
 }
 
-static TelReturn imc_ss_get_cli_status(CoreObject *co, TelSsCliType cli_type,
-               TcoreObjectResponseCallback cb, void *cb_data)
+static TReturn imc_ss_manage_call_2_send(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data)
 {
-       gchar *at_cmd = NULL;
-       gchar *cmd_prefix = NULL;
-       ImcRespCbData *resp_cb_data = NULL;
-       TelReturn ret = TEL_RETURN_INVALID_PARAMETER;
+       char *cmd_str = NULL;
+       gboolean ret = FALSE;
 
-       switch (cli_type) {
-       case TEL_SS_CLI_CLIR:
-               cmd_prefix = "+CLIR";
-               break;
+       dbg("function enter");
+       cmd_str = g_strdup_printf("%s", "AT+CHLD=2");
+       dbg("cmd : %s, prefix(if any) : %s, cmd_len : %d", cmd_str, "N/A", strlen(cmd_str));
 
-       case TEL_SS_CLI_CLIP:
-               cmd_prefix = "+CLIP";
-               break;
+       ret = imc_ss_manage_call_send(o, ur, cmd_str, cb, user_data);
+       g_free(cmd_str);
+       return ret;
+}
 
-       case TEL_SS_CLI_COLP:
-               cmd_prefix = "+COLP";
-               break;
+static TReturn imc_ss_manage_call_2x_send(CoreObject *o, UserRequest *ur, const int id, ConfirmCallback cb, void *user_data)
+{
+       char *cmd_str = NULL;
+       gboolean ret = FALSE;
 
-       case TEL_SS_CLI_COLR:
-               cmd_prefix = "+COLR";
-               break;
+       dbg("function enter");
+       cmd_str = g_strdup_printf("%s%d", "AT+CHLD=2", id);
+       dbg("cmd : %s, prefix(if any) : %s, cmd_len : %d", cmd_str, "N/A", strlen(cmd_str));
 
-       case TEL_SS_CLI_CNAP:
-               cmd_prefix = "+CNAP";
-               break;
+       ret = imc_ss_manage_call_send(o, ur, cmd_str, cb, user_data);
+       g_free(cmd_str);
+       return ret;
+}
 
-       case TEL_SS_CLI_CDIP:
-       default:
-               dbg("Unsupported CLI type: [%d]", cli_type);
-               return ret;
-       }
+static TReturn imc_ss_manage_call_3_send(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data)
+{
+       char *cmd_str = NULL;
+       gboolean ret = FALSE;
 
-       at_cmd = g_strdup_printf("AT%s?", cmd_prefix);
+       dbg("function enter");
+       cmd_str = g_strdup_printf("%s", "AT+CHLD=3");
 
-       resp_cb_data = imc_create_resp_cb_data(cb, cb_data, &cli_type, sizeof(TelSsCliType));
+       ret = imc_ss_manage_call_send(o, ur, cmd_str, cb, user_data);
+       g_free(cmd_str);
+       return ret;
+}
 
-       /* Send Request to modem */
-       ret = tcore_at_prepare_and_send_request(co,
-                       at_cmd, cmd_prefix,
-                       TCORE_AT_COMMAND_TYPE_SINGLELINE,
-                       TCORE_PENDING_PRIORITY_DEFAULT,
-                       NULL,
-                       on_response_imc_ss_get_cli_status, resp_cb_data,
-                       on_send_imc_request, NULL,
-                       0, NULL, NULL);
 
-       IMC_CHECK_REQUEST_RET(ret, resp_cb_data, "Get Cli Status");
+static TReturn imc_ss_manage_call_4_send(CoreObject *o, UserRequest *ur, ConfirmCallback cb, void *user_data)
+{
+       char *cmd_str = NULL;
+       gboolean ret = FALSE;
 
-       g_free(at_cmd);
+       dbg("function enter");
+       cmd_str = g_strdup_printf("%s", "AT+CHLD=4");
 
+       ret = imc_ss_manage_call_send(o, ur, cmd_str, cb, user_data);
+       g_free(cmd_str);
        return ret;
 }
 
-/*
- * Operation - send_ussd_request
- *
- * Request -
- * AT-Command: AT+CUSD = [<n> [, <str> [, <dcs>]]]
- * where,
- * <n>
- * 0 Disable the result code presentation to the TE(default)
- * 1 Enable the result code presentation to the TE
- * 2 Cancel session (not applicable to read command response)
- *
- * <str>
- * USSD string
- *
- * <dcs>
- * Cell Broadcast Data Coding Scheme. Default value is 0.
- *
- * Success:
- *     OK
- *
- * Failure:
- *     +CME ERROR: <error>
- */
-static TelReturn imc_ss_send_ussd_request(CoreObject *co, const TelSsUssdInfo *ussd_request,
-               TcoreObjectResponseCallback cb, void *cb_data)
+static TReturn imc_ss_manage_call_4dn_send(CoreObject *o, UserRequest *ur, const char *number, ConfirmCallback cb, void *user_data)
 {
-       gchar *at_cmd = NULL;
-       UssdSession *ussd_s = NULL;
-       ImcRespCbData *resp_cb_data = NULL;
-       TelReturn ret = TEL_RETURN_INVALID_PARAMETER;
-
-       ussd_s = tcore_ss_ussd_get_session(co);
-       if (!ussd_s) {
-               dbg("USSD session does not  exist");
-               tcore_ss_ussd_create_session(co, ussd_request->type, (void *)ussd_request->str, strlen((char *)ussd_request->str));
-       } else {
-               if (ussd_request->type == TEL_SS_USSD_TYPE_USER_INIT) {
-                       err("Ussd session is already exist");
-                       return TEL_RETURN_OPERATION_NOT_SUPPORTED;
-               }
-               tcore_ss_ussd_set_session_type(ussd_s, ussd_request->type);
-       }
-
-       at_cmd = g_strdup_printf("AT+CUSD=1,\"%s\",%d", ussd_request->str, 0x0f);
+       char *cmd_str = NULL;
+       gboolean ret = FALSE;
 
-       resp_cb_data = imc_create_resp_cb_data(cb, cb_data, NULL, 0);
+       dbg("function enter");
+       cmd_str = g_strdup_printf("%s%s", "AT+CHLD=4", number);
 
-       /* Send Request to modem */
-       ret = tcore_at_prepare_and_send_request(co,
-                       at_cmd, NULL,
-                       TCORE_AT_COMMAND_TYPE_NO_RESULT,
-                       TCORE_PENDING_PRIORITY_DEFAULT,
-                       NULL,
-                       on_response_imc_ss_send_ussd_request, resp_cb_data,
-                       on_send_imc_request, NULL,
-                       0, NULL, NULL);
-
-       IMC_CHECK_REQUEST_RET(ret, resp_cb_data, "Send Ussd Request");
-
-       g_free(at_cmd);
+       ret = imc_ss_manage_call_send(o, ur, cmd_str, cb, user_data);
+       g_free(cmd_str);
 
        return ret;
 }
 
-/* SS Operations */
-static TcoreSsOps imc_ss_ops = {
-       .set_barring = imc_ss_set_barring,
-       .get_barring_status = imc_ss_get_barring_status,
-       .change_barring_password = imc_ss_change_barring_password,
-       .set_forwarding = imc_ss_set_forwarding,
-       .get_forwarding_status = imc_ss_get_forwarding_status,
-       .set_waiting = imc_ss_set_waiting,
-       .get_waiting_status = imc_ss_get_waiting_status,
-       .set_cli = imc_ss_set_cli,
-       .get_cli_status = imc_ss_get_cli_status,
-       .send_ussd_request = imc_ss_send_ussd_request
-};
-
-gboolean imc_ss_init(TcorePlugin *p, CoreObject *co)
+gboolean imc_ss_init(TcorePlugin *cp, CoreObject *co_ss)
 {
-       dbg("Entry");
+       CoreObject *co_call = NULL;
 
        /* Set operations */
-       tcore_ss_set_ops(co, &imc_ss_ops);
+       tcore_ss_set_ops(co_ss, &ss_ops, TCORE_OPS_TYPE_CP);
 
-       /* Add Callbacks */
-       tcore_object_add_callback(co, "+CUSD", on_notification_imc_ss_ussd, NULL);
+       co_call = tcore_plugin_ref_core_object(cp,
+                                               CORE_OBJECT_TYPE_CALL);
+       if (co_call == NULL) {
+               err("Can't find CALL core object");
+               return FALSE;
+       }
+
+       /* Set operations */
+       tcore_call_control_set_operations(co_call, &call_ops);
+
+       tcore_object_add_callback(co_ss, "+CSSU", on_notification_ss_cssu_info, NULL);
+       tcore_object_add_callback(co_ss, "+CSSI", on_notification_ss_cssi_info, NULL);
+       tcore_object_add_callback(co_ss, "+CUSD", on_notification_ss_ussd, NULL);
 
-       dbg("Exit");
        return TRUE;
 }
 
-void imc_ss_exit(TcorePlugin *p, CoreObject *co)
+void imc_ss_exit(TcorePlugin *cp, CoreObject *co_ss)
 {
        dbg("Exit");
+
+       tcore_object_del_callback(co_ss, "+CSSU", on_notification_ss_cssu_info);
+       tcore_object_del_callback(co_ss, "+CSSI", on_notification_ss_cssi_info);
+       tcore_object_del_callback(co_ss, "+CUSD", on_notification_ss_ussd);
 }