release tizen_2.0 beta
authorKyeongchul Kim <kyeongchul.kim@samsung.com>
Tue, 21 Aug 2012 13:19:40 +0000 (22:19 +0900)
committerKyeongchul Kim <kyeongchul.kim@samsung.com>
Tue, 21 Aug 2012 13:19:40 +0000 (22:19 +0900)
70 files changed:
CMakeLists.txt
README [new file with mode: 0644]
debian/changelog
debian/control
include/common.h [deleted file]
include/modules.h [deleted file]
include/sat_mgr.h [deleted file]
include/tel_cs_conn.h [deleted file]
include/ts_common.h [deleted file]
include/ts_noti.h [deleted file]
include/ts_svr_req.h [deleted file]
include/ts_utility.h [deleted file]
introspection/call.xml [new file with mode: 0644]
introspection/convert_docbook_html.sh [new file with mode: 0755]
introspection/convert_gtkdoc.sh [new file with mode: 0755]
introspection/ex.xml [new file with mode: 0644]
introspection/gen.sh [new file with mode: 0755]
introspection/manager.xml [new file with mode: 0644]
introspection/modem.xml [new file with mode: 0644]
introspection/network.xml [new file with mode: 0644]
introspection/phonebook.xml [new file with mode: 0644]
introspection/sap.xml [new file with mode: 0644]
introspection/sat.xml [new file with mode: 0644]
introspection/sim.xml [new file with mode: 0644]
introspection/sms.xml [new file with mode: 0644]
introspection/ss.xml [new file with mode: 0644]
packaging/tel-plugin-dbus_tapi.spec
res/tapi.conf
src/call.c
src/cdmadata.c [deleted file]
src/cfg.c [deleted file]
src/common.c [new file with mode: 0644]
src/common.h [new file with mode: 0644]
src/desc-dbus.c
src/gprs.c [deleted file]
src/gps.c [deleted file]
src/misc.c [deleted file]
src/modem.c [new file with mode: 0644]
src/network.c
src/omadm.c [deleted file]
src/phonebook.c [new file with mode: 0644]
src/power.c [deleted file]
src/productivity.c [deleted file]
src/sap.c [new file with mode: 0644]
src/sat.c
src/sat_manager.c [new file with mode: 0755]
src/sat_manager.h [new file with mode: 0644]
src/sat_mgr.c [deleted file]
src/sat_ui_support/TelCall.h [new file with mode: 0644]
src/sat_ui_support/TelDefines.h [new file with mode: 0644]
src/sat_ui_support/TelErr.h [new file with mode: 0644]
src/sat_ui_support/TelSat.h [new file with mode: 0644]
src/sat_ui_support/TelSatEnvelope.h [new file with mode: 0644]
src/sat_ui_support/TelSatObj.h [new file with mode: 0644]
src/sat_ui_support/TelSatProactvCmd.h [new file with mode: 0644]
src/sat_ui_support/TelSim.h [new file with mode: 0644]
src/sat_ui_support/TelSs.h [new file with mode: 0644]
src/sat_ui_support/sat_ui_support.c [new file with mode: 0644]
src/sat_ui_support/sat_ui_support.h [new file with mode: 0644]
src/sat_util.c [new file with mode: 0644]
src/sim.c
src/sms.c
src/sound.c [deleted file]
src/ss.c
src/tapi-lib.xml [deleted file]
src/ts_noti.c [deleted file]
src/ts_svr_req.c [deleted file]
src/util.c [deleted file]
tel-plugin-dbus_tapi.manifest [new file with mode: 0644]
test/network-search.sh [new file with mode: 0755]

index d23b2c708a9dac5a68ce04a7d5a0607b88229bef..8daef55332736f6d1e5358bb18ff88edef2c1a05 100644 (file)
@@ -11,57 +11,51 @@ SET(CMAKE_INSTALL_PREFIX "${PREFIX}")
 
 # Set required packages
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED glib-2.0 dbus-1 dbus-glib-1 gthread-2.0 tcore dlog tapi aul security-server)
+pkg_check_modules(pkgs REQUIRED glib-2.0 gobject-2.0 gio-2.0 gio-unix-2.0 tcore dlog aul)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
 
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/include/ ${CMAKE_SOURCE_DIR}/cmake_tmp ${CMAKE_SOURCE_DIR}/src/sat_ui_support/)
 
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wdeclaration-after-statement -Wmissing-declarations -Wcast-align")
 
 ADD_DEFINITIONS("-DFEATURE_DLOG_DEBUG")
-ADD_DEFINITIONS("-DTCORE_LOG_TAG=\"DBUSTAPI\"")
+ADD_DEFINITIONS("-DTCORE_LOG_TAG=\"DBUS\"")
 
 MESSAGE(${CMAKE_C_FLAGS})
 MESSAGE(${CMAKE_EXE_LINKER_FLAGS})
 
 SET(SRCS
                src/desc-dbus.c
-               src/ts_noti.c
-               src/ts_svr_req.c
-               src/call.c
-               src/cfg.c
-               src/cdmadata.c
-               src/gprs.c
-               src/gps.c
-               src/misc.c
+               src/common.c
                src/network.c
-               src/omadm.c
-               src/power.c
-               src/productivity.c
-               src/sat.c
-               src/sat_mgr.c
+               src/phonebook.c
                src/sim.c
+               src/sap.c
                src/sms.c
-               src/sound.c
+               src/sat.c
+               src/sat_manager.c
+               src/sat_util.c
+               src/sat_ui_support/sat_ui_support.c
                src/ss.c
-               src/util.c
+               src/call.c
+               src/modem.c
 )
 
-
-ADD_CUSTOM_TARGET(tapi-lib-stub.h
-               COMMAND dbus-binding-tool --prefix= --mode=glib-server --output=${CMAKE_CURRENT_SOURCE_DIR}/include/tapi-lib-stub.h ${CMAKE_CURRENT_SOURCE_DIR}/src/tapi-lib.xml)
-
+ADD_CUSTOM_COMMAND(
+       OUTPUT ${CMAKE_BINARY_DIR}/generated-code.c
+       COMMAND gdbus-codegen --interface-prefix org.tizen.telephony. --generate-c-code generated-code --c-namespace Telephony --c-generate-object-manager --generate-docbook generated-docs ${CMAKE_SOURCE_DIR}/introspection/manager.xml ${CMAKE_SOURCE_DIR}/introspection/network.xml ${CMAKE_SOURCE_DIR}/introspection/sim.xml ${CMAKE_SOURCE_DIR}/introspection/phonebook.xml ${CMAKE_SOURCE_DIR}/introspection/sap.xml ${CMAKE_SOURCE_DIR}/introspection/sat.xml ${CMAKE_SOURCE_DIR}/introspection/sms.xml ${CMAKE_SOURCE_DIR}/introspection/call.xml ${CMAKE_SOURCE_DIR}/introspection/ss.xml ${CMAKE_SOURCE_DIR}/introspection/modem.xml
+       COMMENT "Generating GDBus .c/.h")
 
 # library build
-ADD_LIBRARY(dbus-tapi-plugin SHARED ${SRCS})
+ADD_LIBRARY(dbus-tapi-plugin SHARED ${SRCS}
+       ${CMAKE_BINARY_DIR}/generated-code.c)
 TARGET_LINK_LIBRARIES(dbus-tapi-plugin ${pkgs_LDFLAGS})
 SET_TARGET_PROPERTIES(dbus-tapi-plugin PROPERTIES PREFIX "" OUTPUT_NAME dbus-tapi-plugin)
-ADD_DEPENDENCIES(dbus-tapi-plugin tapi-lib-stub.h)
-
+ADD_DEPENDENCIES(dbus-tapi-plugin XXX)
 
 
 # install
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..5fbf319
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+SLP-TAPI DBus based Client-Server plugin
index 31c378219bdbee7f8119526d8123d6539a031a98..c95b6efc746c8b934b1c71dbad2a40c5f83c8404 100644 (file)
@@ -1,7 +1,87 @@
+tel-plugin-dbus-tapi (0.1.20) unstable; urgency=low
+
+  * Replace dun pin ctrl from ps to modem
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
+  * Tag: tel-plugin-dbus-tapi_0.1.20
+
+ -- DongHoo Park <donghoo.park@samsung.com>  Mon, 11 Jun 2012 15:00:33 +0900
+
+tel-plugin-dbus-tapi (0.1.19) unstable; urgency=low
+
+  * Fix OBS Build error
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
+  * Tag: tel-plugin-dbus-tapi_0.1.19
+
+ -- Youngman Park <youngman.park@samsung.com>  Fri, 25 May 2012 14:10:57 +0900
+
+tel-plugin-dbus-tapi (0.1.18) unstable; urgency=low
+
+  * Add new feature for Call & Factory and phonebook select handling
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
+  * Tag: tel-plugin-dbus-tapi_0.1.18
+
+ -- Youngman Park <youngman.park@samsung.com>  Mon, 21 May 2012 18:00:57 +0900
+
+tel-plugin-dbus-tapi (0.1.17) unstable; urgency=low
+
+  * Add lock info feature and so on
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
+  * Tag: tel-plugin-dbus-tapi_0.1.17
+
+ -- Kyeongchul Kim <kyeongchul.kim@samsung.com>  Thu, 17 May 2012 17:39:57 +0900
+
+tel-plugin-dbus-tapi (0.1.16) unstable; urgency=low
+
+  * Fix OBS Build Error
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
+  * Tag: tel-plugin-dbus-tapi_0.1.16
+
+ -- Youngman Park <youngman.park@samsung.com>  Wed, 09 Apr 2012 14:50:05 +0900
+
+tel-plugin-dbus-tapi (0.1.15) unstable; urgency=low
+
+  * Add Call New API ( call custom service )
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
+  * Tag: tel-plugin-dbus-tapi_0.1.15
+
+ -- Youngman Park <youngman.park@samsung.com>  Mon, 07 Apr 2012 16:13:05 +0900
+
+tel-plugin-dbus-tapi (0.1.14) unstable; urgency=low
+
+  * Fix build error
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
+  * Tag: tel-plugin-dbus-tapi_0.1.14
+
+ -- Inho Oh <inho48.oh@samsung.com>  Fri, 27 Apr 2012 13:43:05 +0900
+
+tel-plugin-dbus-tapi (0.1.13) unstable; urgency=low
+
+  * Add sat en/decoding functions
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
+  * Tag: tel-plugin-dbus-tapi_0.1.13
+
+ -- Kyeongchul Kim <kyeongchul.kim@samsung.com>  Tue, 17 Apr 2012 23:35:39 +0900
+
+tel-plugin-dbus-tapi (0.1.12) unstable; urgency=low
+
+  * fixed lock status update in dbus custom data
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
+  * Tag: tel-plugin-dbus-tapi_0.1.12
+
+ -- Kyeongchul Kim <kyeongchul.kim@samsung.com>  Mon, 09 Apr 2012 22:08:42 +0900
+
+tel-plugin-dbus-tapi (0.1.11) unstable; urgency=low
+
+  * version up for code sync with public binary
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
+  * Tag: tel-plugin-dbus-tapi_0.1.11
+
+ -- Kyeongchul Kim <kyeongchul.kim@samsung.com>  Mon, 02 Apr 2012 12:20:05 +0900
+
 tel-plugin-dbus-tapi (0.1.10) unstable; urgency=low
 
   * Fix prefix (TAPI_ to TCORE_)
-  * Git: pkgs/t/tel-plugin-dbus_tapi
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
   * Tag: tel-plugin-dbus-tapi_0.1.10
 
  -- Inho Oh <inho48.oh@samsung.com>  Tue, 27 Mar 2012 22:13:53 +0900
@@ -9,7 +89,7 @@ tel-plugin-dbus-tapi (0.1.10) unstable; urgency=low
 tel-plugin-dbus-tapi (0.1.9) unstable; urgency=low
 
   * Fixed capi-sim TC issue and apply SAT handling code
-  * Git: pkgs/t/tel-plugin-dbus_tapi
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
   * Tag: tel-plugin-dbus-tapi_0.1.9
 
  -- Kyeongchul Kim <kyeongchul.kim@samsung.com>  Tue, 27 Mar 2012 17:19:22 +0900
@@ -17,7 +97,7 @@ tel-plugin-dbus-tapi (0.1.9) unstable; urgency=low
 tel-plugin-dbus-tapi (0.1.8) unstable; urgency=low
 
   * Fixed emulator call issue
-  * Git: pkgs/t/tel-plugin-dbus_tapi
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
   * Tag: tel-plugin-dbus-tapi_0.1.8
 
  -- Inho Oh <inho48.oh@samsung.com>  Thu, 22 Mar 2012 17:38:20 +0900
@@ -25,7 +105,7 @@ tel-plugin-dbus-tapi (0.1.8) unstable; urgency=low
 tel-plugin-dbus-tapi (0.1.7) unstable; urgency=low
 
   * Fix obs build break
-  * Git: pkgs/t/tel-plugin-dbus_tapi
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
   * Tag: tel-plugin-dbus-tapi_0.1.7
 
  -- DongHoo Park <donghoo.park@samsung.com>  Wed, 21 Mar 2012 14:54:30 +0900
@@ -33,7 +113,7 @@ tel-plugin-dbus-tapi (0.1.7) unstable; urgency=low
 tel-plugin-dbus-tapi (0.1.6) unstable; urgency=low
 
   * Version up
-  * Git: pkgs/t/tel-plugin-dbus_tapi
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
   * Tag: tel-plugin-dbus-tapi_0.1.6
 
  -- DongHoo Park <donghoo.park@samsung.com>  Wed, 21 Mar 2012 14:11:37 +0900
@@ -41,7 +121,7 @@ tel-plugin-dbus-tapi (0.1.6) unstable; urgency=low
 tel-plugin-dbus-tapi (0.1.5) unstable; urgency=low
 
   * Remove legacy header files and update phonebook code
-  * Git: pkgs/t/tel-plugin-dbus_tapi
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
   * Tag: tel-plugin-dbus-tapi_0.1.5
 
  -- Kyeongchul Kim <kyeongchul.kim@samsung.com>  Mon, 19 Mar 2012 22:59:27 +0900
@@ -49,7 +129,7 @@ tel-plugin-dbus-tapi (0.1.5) unstable; urgency=low
 tel-plugin-dbus-tapi (0.1.4) unstable; urgency=low
 
   * Fix network selection mode get value mismatch bug
-  * Git: pkgs/t/tel-plugin-dbus_tapi
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
   * Tag: tel-plugin-dbus-tapi_0.1.4
 
  -- Inho Oh <inho48.oh@samsung.com>  Mon, 19 Mar 2012 14:13:18 +0900
@@ -57,7 +137,7 @@ tel-plugin-dbus-tapi (0.1.4) unstable; urgency=low
 tel-plugin-dbus-tapi (0.1.3) unstable; urgency=low
 
   * Add code for CF, CB, CW
-  * Git: pkgs/t/tel-plugin-dbus_tapi
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
   * Tag: tel-plugin-dbus-tapi_0.1.3
 
  -- Youngman Park <youngman.park@samsung.com>  Sat, 17 Mar 2012 18:50:25 +0900
@@ -65,7 +145,7 @@ tel-plugin-dbus-tapi (0.1.3) unstable; urgency=low
 tel-plugin-dbus-tapi (0.1.2) unstable; urgency=low
 
   * Add code for Video Call
-  * Git: pkgs/t/tel-plugin-dbus_tapi
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
   * Tag: tel-plugin-dbus-tapi_0.1.2
 
  -- Youngman Park <youngman.park@samsung.com>  Sat, 17 Mar 2012 18:20:25 +0900
@@ -73,7 +153,7 @@ tel-plugin-dbus-tapi (0.1.2) unstable; urgency=low
 tel-plugin-dbus-tapi (0.1.1) unstable; urgency=low
 
   * Fix version mismatch
-  * Git: pkgs/t/tel-plugin-dbus_tapi
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
   * Tag: tel-plugin-dbus-tapi_0.1.1
 
  -- Inho Oh <inho48.oh@samsung.com>  Fri, 16 Mar 2012 00:45:25 +0900
@@ -81,7 +161,7 @@ tel-plugin-dbus-tapi (0.1.1) unstable; urgency=low
 tel-plugin-dbus-tapi (0.1.0) unstable; urgency=low
 
   * Initial
-  * Git: pkgs/t/tel-plugin-dbus_tapi
+  * Git: slp/pkgs/t/tel-plugin-dbus_tapi
   * Tag: tel-plugin-dbus-tapi_0.1.0
 
  -- Inho Oh <inho48.oh@samsung.com>  Thu, 15 Mar 2012 23:40:55 +0900
index 0d4647b60fd52d83513f4e829b299fc61810a5db..36887ba0778e9dd7acdc0cb7e48779e3e6ee4d19 100644 (file)
@@ -4,7 +4,7 @@ Priority: extra
 Maintainer: Jongman Park <jman.park@samsung.com>
 Uploaders: Jayoung Gu <jygu@samsung.com>, Kyeongchul Kim <kyeongchul.kim@samsung.com>, Youngman Park <youngman.park@samsung.com>, Inho Oh <inho48.oh@samsung.com>,  DongHoo Park <donghoo.park@samsung.com>
 Build-Depends: debhelper (>= 5),
-               libglib2.0-dev, libtcore-dev, libaul-1-dev, dlog-dev, libslp-tapi-dev, libsecurity-server-client-dev
+               libglib2.0-dev, libtcore-dev, libaul-1-dev, dlog-dev
 Standards-Version: 0.0.0
 
 Package: tel-plugin-dbus-tapi
@@ -16,6 +16,6 @@ Description: telephony plugin library for communication with dbus based client l
 Package: tel-plugin-dbus-tapi-dbg
 Section: debug
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, tel-plugin-dbus-tapi (= ${Source-Version})
+Depends: ${shlibs:Depends}, ${misc:Depends}, tel-plugin-dbus (= ${Source-Version})
 Description: telephony plugin library for communication with dbus based client library (dbg package)
 
diff --git a/include/common.h b/include/common.h
deleted file mode 100644 (file)
index c078f77..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __COMMON_H__
-#define __COMMON_H__
-
-#include <glib-2.0/glib.h>
-#include <dbus/dbus-protocol.h>
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-bindings.h>
-#include <glib-object.h>
-#include <dbus/dbus.h>
-#include <TelSim.h>
-#include <TelSat.h>
-
-__BEGIN_DECLS
-
-struct custom_data {
-       TcorePlugin *plugin;
-       Communicator *comm;
-       Server *server;
-       Storage *strg;
-       DBusConnection *EvtDeliveryHandle;
-       gboolean b_recv_first_status;
-       TelSimPinStatus_t pin_lock;
-       TelSimPinStatus_t sim_lock;
-       gboolean fdn_lock;
-       TelSimLanguageInfo_t language;
-       TelSimIccIdInfo_t iccid;
-       TelSimEccData_t ecc;
-       int ecc_count;
-       void *plmn_list_search_result_cache;
-       TelSatSetupMenuInfo_t *pSatMainMenu;
-       GQueue sat_q;
-       gboolean help_requested;
-       TelSatAlphabetFormatType_t setup_menu_a_format;
-};
-
-__END_DECLS
-
-#endif
diff --git a/include/modules.h b/include/modules.h
deleted file mode 100644 (file)
index bd69fa7..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __MODULES_H__
-#define __MODULES_H__
-
-__BEGIN_DECLS
-
-void dbus_request_call(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function,
-               GArray* in_param1, GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1,
-               GArray** out_param2, GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_cdmadata(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function,
-               GArray* in_param1, GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1,
-               GArray** out_param2, GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_cfg(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function,
-               GArray* in_param1, GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1,
-               GArray** out_param2, GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_gprs(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_gps(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function,
-               GArray* in_param1, GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1,
-               GArray** out_param2, GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_misc(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function,
-               GArray* in_param1, GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1,
-               GArray** out_param2, GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_network(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function,
-               GArray* in_param1, GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1,
-               GArray** out_param2, GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_omadm(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function,
-               GArray* in_param1, GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1,
-               GArray** out_param2, GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_power(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function,
-               GArray* in_param1, GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1,
-               GArray** out_param2, GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_productivity(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function,
-               GArray* in_param1, GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1,
-               GArray** out_param2, GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_sat(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function,
-               GArray* in_param1, GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1,
-               GArray** out_param2, GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_sim(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_sms(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_sound(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_ss(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error);
-void dbus_request_util(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error);
-
-TReturn dbus_response_call(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_cdmadata(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_cfg(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_gprs(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_gps(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_misc(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_network(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_omadm(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_power(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_productivity(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_sat(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_sim(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_sms(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_sound(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_ss(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-TReturn dbus_response_util(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data);
-
-TReturn dbus_notification_call(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_cdmadata(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_cfg(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_gprs(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_gps(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_misc(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_network(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_omadm(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_power(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_productivity(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_sat(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_sim(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_sms(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_sound(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_ss(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-TReturn dbus_notification_util(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data);
-
-__END_DECLS
-
-#endif
diff --git a/include/sat_mgr.h b/include/sat_mgr.h
deleted file mode 100644 (file)
index eb30084..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef SAT_MGR_H_
-#define SAT_MGR_H_
-
-#include <tcore.h>
-#include "common.h"
-#include "type/sat.h"
-
-typedef union {
-       struct tel_sat_display_text_tlv displayTextInd; /**<    Parsed proactive command info from TLV to Telephony data type - display text    */
-       struct tel_sat_get_inkey_tlv getInkeyInd; /**<  Parsed proactive command info from TLV to Telephony data type - getInkey        */
-       struct tel_sat_get_input_tlv getInputInd; /**<  Parsed proactive command info from TLV to Telephony data type - getInput        */
-       struct tel_sat_setup_menu_tlv setupMenuInd; /**<        Parsed proactive command info from TLV to Telephony data type - setup menu      */
-       struct tel_sat_select_item_tlv selectItemInd; /**<      Parsed proactive command info from TLV to Telephony data type - select item     */
-} sat_mgr_proactive_cmd_data;
-
-/**
- * This structure defines the Command Queue Info.
- */
-struct sat_mgr_cmd_q {
-       TelSatCommandType_t cmd_type; /**<Type of Command*/
-       int cmd_id; /**<Command Id*/
-       sat_mgr_proactive_cmd_data cmd_data; /**<Proactive Cmd Ind Info*/
-};
-
-
-/*================================================================================================*/
-
-void sat_mgr_init_cmd_queue(struct custom_data *ctx);
-void sat_mgr_setup_menu_noti(struct custom_data *ctx, struct tel_sat_setup_menu_tlv* setup_menu_tlv);
-void sat_mgr_display_text_noti(struct custom_data *ctx, struct tel_sat_display_text_tlv* display_text_tlv);
-void sat_mgr_select_item_noti(struct custom_data *ctx, struct tel_sat_select_item_tlv* select_item_tlv);
-void sat_mgr_get_inkey_noti(struct custom_data *ctx, struct tel_sat_get_inkey_tlv* get_inkey_tlv);
-void sat_mgr_get_input_noti(struct custom_data *ctx, struct tel_sat_get_input_tlv* get_input_tlv);
-TapiResult_t sat_mgr_handle_app_exec_result(struct custom_data *ctx, TcorePlugin *p, char *conn_name, TelSatAppsRetInfo_t* app_result);
-TapiResult_t sat_mgr_handle_user_confirm(struct custom_data *ctx, TcorePlugin *p, char *conn_name,     TelSatUiUserConfirmInfo_t *cnf, unsigned char* additional_data, unsigned short ad_data_length);
-#endif /* SAT_MGR_H_ */
diff --git a/include/tel_cs_conn.h b/include/tel_cs_conn.h
deleted file mode 100644 (file)
index c741a50..0000000
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- * libslp-tapi
- *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _TEL_CS_CONN_H_
-#define _TEL_CS_CONN_H_
-
-#include <TapiCommon.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define TAPI_CS_TYPE_ASYNC                                     (0 << 24)
-#define TAPI_CS_TYPE_SYNC                                      (1 << 24)
-
-#define        TAPI_CS_SERVICE_CALL                            TAPI_EVENT_CLASS_CALL_VOICE     // TAPI_EVENT_CLASS_CALL_DATA
-#define        TAPI_CS_SERVICE_SIM                                     TAPI_EVENT_CLASS_SIM
-#define        TAPI_CS_SERVICE_NETTEXT                         TAPI_EVENT_CLASS_NETTEXT
-#define        TAPI_CS_SERVICE_NETWORK                         TAPI_EVENT_CLASS_NETWORK
-#define        TAPI_CS_SERVICE_SS                                      TAPI_EVENT_CLASS_SS
-#define        TAPI_CS_SERVICE_SIMATK                          TAPI_EVENT_CLASS_SAT
-#define        TAPI_CS_SERVICE_GPRS                            TAPI_EVENT_CLASS_DATA
-#define        TAPI_CS_SERVICE_SOUND                           TAPI_EVENT_CLASS_SOUND
-#define        TAPI_CS_SERVICE_UTIL                            TAPI_EVENT_CLASS_UTIL
-
-// Voice Call/Data Call Service
-#define        TAPI_CS_CALL_SETUP                                      TAPI_EVENT_CALL_SETUP_CNF
-#define        TAPI_CS_CALL_ANSWER                                     TAPI_EVENT_CALL_ANSWER_CNF
-#define        TAPI_CS_CALL_RELEASE                            TAPI_EVENT_CALL_RELEASE_CNF
-#define        TAPI_CS_CALL_RELEASEALL                         TAPI_EVENT_CALL_RELEASE_ALL_CNF
-#define        TAPI_CS_CALL_RELEASEALL_ACTIVE          TAPI_EVENT_CALL_RELEASE_ALL_ACTIVE_CNF
-#define        TAPI_CS_CALL_RELEASEALL_HELD            TAPI_EVENT_CALL_RELEASE_ALL_HELD_CNF
-#define        TAPI_CS_CALL_DTMF                                       TAPI_EVENT_CALL_SEND_DTMF_CNF
-#define        TAPI_CS_CALL_ACTIVATE                           TAPI_EVENT_CALL_RETRIEVE_CNF
-#define        TAPI_CS_CALL_HOLD                                       TAPI_EVENT_CALL_HOLD_CNF
-#define        TAPI_CS_CALL_SWAP                                       TAPI_EVENT_CALL_SWAP_CNF
-#define        TAPI_CS_CALL_SETUPCONFCALL                      TAPI_EVENT_CALL_SETUPCONFERENCE_CNF
-#define        TAPI_CS_CALL_SPLITCONFCALL                      TAPI_EVENT_CALL_SPLITCONFERENCE_CNF
-#define        TAPI_CS_CALL_TRANSFERCALL                       TAPI_EVENT_CALL_TRANSFER_CNF
-#define        TAPI_CS_CALL_GETACTIVELINE                      TAPI_EVENT_CALL_GET_LINEID_CNF
-#define        TAPI_CS_CALL_SETACTIVELINE                      TAPI_EVENT_CALL_SET_LINEID_CNF
-#define        TAPI_CS_CALL_GETPRIVACYMODE                     TAPI_EVENT_CALL_GET_PRIVACYMODE_CNF
-#define        TAPI_CS_CALL_SETPRIVACYMODE                     TAPI_EVENT_CALL_SET_PRIVACYMODE_CNF
-#define        TAPI_CS_CALL_FLASHINFO                          TAPI_EVENT_CALL_FLASHINFO_CNF
-#define        TAPI_CS_CALL_EXITEMERGENCYMODE          TAPI_EVENT_CALL_EXIT_EMERGENCYMODE_CNF
-#define        TAPI_CS_CALL_GETCALLTIME                        TAPI_EVENT_CALL_TIME_CNF
-
-// should be confirm event
-#define        TAPI_CS_CALL_DEFLECT                            (TAPI_EVENT_CALL_CNF_MAX + 1) // ? undefined confirm
-#define        TAPI_CS_CALL_ACTIVATECCBS                       (TAPI_EVENT_CALL_CNF_MAX + 2) // undefiend confirm - ipc_rx_gencmd.c Not supported.
-// sync API
-#define        TAPI_CS_CALL_GETSTATUS                          (TAPI_CS_TYPE_SYNC+TAPI_EVENT_CALL_CNF_MAX + 3)
-#define        TAPI_CS_CALL_GETDURATION                        (TAPI_CS_TYPE_SYNC+TAPI_EVENT_CALL_CNF_MAX + 4)
-#define        TAPI_CS_CALL_GETCONFERENCELIST          (TAPI_CS_TYPE_SYNC+TAPI_EVENT_CALL_CNF_MAX + 5)
-
-// SIM Service
-#define        TAPI_CS_SIM_EVENT_MAX                           TAPI_EVENT_SIM_AUTHENTICATION_CNF
-#define        TAPI_CS_SIM_GETINDICATIONINFO           TAPI_EVENT_SIM_GET_INDICATION_CNF
-#define        TAPI_CS_SIM_SETINDICATIONINFO           TAPI_EVENT_SIM_SET_INDICATION_CNF
-#define        TAPI_CS_SIM_GETMAILBOXINFO                      TAPI_EVENT_SIM_GET_MAILBOX_CNF
-#define        TAPI_CS_SIM_SETMAILBOXINFO                      TAPI_EVENT_SIM_SET_MAILBOX_CNF
-#define        TAPI_CS_SIM_SETLANGUAGE                         TAPI_EVENT_SIM_SET_LANGUAGE_CNF
-#define        TAPI_CS_SIM_RSIMACCESS                          TAPI_EVENT_SIM_RSIM_ACCESS_CNF
-#define        TAPI_CS_SIM_VERIFYSEC                           TAPI_EVENT_SIM_VERIFY_SEC_CNF
-#define        TAPI_CS_SIM_VERIFYPUK                           TAPI_EVENT_SIM_VERIFY_PUK_CNF
-#define        TAPI_CS_SIM_CHANGEPIN                           TAPI_EVENT_SIM_CHANGE_PINS_CNF
-#define        TAPI_CS_SIM_DISABLESEC                          TAPI_EVENT_SIM_DISABLE_SEC_CNF
-#define        TAPI_CS_SIM_ENABLESEC                           TAPI_EVENT_SIM_ENABLE_SEC_CNF
-#define        TAPI_CS_SIM_GETPERSSTATUS                       TAPI_EVENT_SIM_PERS_STATUS_CNF
-#define        TAPI_CS_SIM_DISABLEPERS                         TAPI_EVENT_SIM_DISABLE_PERS_CNF
-#define        TAPI_CS_SIM_ENABLEPERS                          TAPI_EVENT_SIM_ENABLE_PERS_CNF
-#define        TAPI_CS_SIM_DISABLEFDN                          TAPI_EVENT_SIM_DISABLE_FDNMODE_CNF
-#define        TAPI_CS_SIM_ENABLEFDN                           TAPI_EVENT_SIM_ENABLE_FDNMODE_CNF
-#define        TAPI_CS_SIM_PB_GETCOUNT                         TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF
-#define        TAPI_CS_SIM_PB_GETMETAINFO                      TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF
-#define        TAPI_CS_SIM_PB_READRECORD                       TAPI_EVENT_SIM_PB_ACCESS_READ_CNF
-#define        TAPI_CS_SIM_PB_UPDATERECORD                     TAPI_EVENT_SIM_PB_UPDATE_CNF
-#define        TAPI_CS_SIM_PB_DELETERECORD                     TAPI_EVENT_SIM_PB_DELETE_CNF
-#define        TAPI_CS_SIM_GETPBCAPABILITYINFO         TAPI_EVENT_SIM_PB_CAPABILITY_INFO_CNF
-#define        TAPI_CS_SIM_SAPCONNECTREQUEST           TAPI_EVENT_SIM_SAP_CONNECT_CNF
-#define        TAPI_CS_SIM_SAPCONNECTSTATUS            TAPI_EVENT_SIM_SAP_CONNECT_STATUS_CNF
-#define        TAPI_CS_SIM_SAPATRREQUEST                       TAPI_EVENT_SIM_SAP_TRANSFER_ATR_CNF
-#define        TAPI_CS_SIM_SAPTRANSFERAPDU                     TAPI_EVENT_SIM_SAP_TRANSFER_APDU_CNF
-#define        TAPI_CS_SIM_SAPSETPROTOCOL                      TAPI_EVENT_SIM_SAP_SET_PROTOCOL_CNF
-#define        TAPI_CS_SIM_SAPSETSIMPOWER                      TAPI_EVENT_SIM_SAP_SET_SIM_POWER_CNF
-#define        TAPI_CS_SIM_SAPCARDREADERSTATUS         TAPI_EVENT_SIM_SAP_CARD_READER_STATUS_CNF
-#define        TAPI_CS_SIM_AUTHENTICATION              TAPI_EVENT_SIM_AUTHENTICATION_CNF
-#define TAPI_CS_SIM_APDU                                       TAPI_EVENT_SIM_APDU_CNF
-#define TAPI_CS_SIM_ATR                                                TAPI_EVENT_SIM_ATR_CNF
-
-// sync API
-#define        TAPI_CS_SIM_GETIMSIINFO                         (TAPI_CS_TYPE_SYNC+TAPI_EVENT_SIM_CNF_MAX + 1)
-#define        TAPI_CS_SIM_GETFDNSTATUS                        (TAPI_CS_TYPE_SYNC+TAPI_EVENT_SIM_CNF_MAX + 2)
-#define        TAPI_CS_SIM_GETECCINFO                          (TAPI_CS_TYPE_SYNC+TAPI_EVENT_SIM_CNF_MAX + 3)
-#define        TAPI_CS_SIM_GETLANGUAGEINFO                     (TAPI_CS_TYPE_SYNC+TAPI_EVENT_SIM_CNF_MAX + 4)
-#define        TAPI_CS_SIM_GETCARDTYPE                         (TAPI_CS_TYPE_SYNC+TAPI_EVENT_SIM_CNF_MAX + 5)
-#define        TAPI_CS_SIM_GETSIMINITINFO                      (TAPI_CS_TYPE_SYNC+TAPI_EVENT_SIM_CNF_MAX + 6)
-#define        TAPI_CS_SIM_GETSECSTATUS                        (TAPI_CS_TYPE_SYNC+TAPI_EVENT_SIM_CNF_MAX + 7)
-#define        TAPI_CS_SIM_GETPBINITINFO                       (TAPI_CS_TYPE_SYNC+TAPI_EVENT_SIM_CNF_MAX + 8)
-#define        TAPI_CS_SIM_GETICCIDINFO                        (TAPI_CS_TYPE_SYNC+TAPI_EVENT_SIM_CNF_MAX + 9)
-#define        TAPI_CS_SIM_GETCFINFO                           (TAPI_CS_TYPE_SYNC+TAPI_EVENT_SIM_CNF_MAX + 10)
-#define        TAPI_CS_SIM_GETMWINFO                           (TAPI_CS_TYPE_SYNC+TAPI_EVENT_SIM_CNF_MAX + 11)
-#define        TAPI_CS_SIM_GETMBINFO                           (TAPI_CS_TYPE_SYNC+TAPI_EVENT_SIM_CNF_MAX + 12)
-#define        TAPI_CS_SIM_GETCPHSINFO                         (TAPI_CS_TYPE_SYNC+TAPI_EVENT_SIM_CNF_MAX + 13)
-
-// SMS Service
-#define        TAPI_CS_NETTEXT_EVENT_MAX                       TAPI_EVENT_NETTEXT_GET_SMSBEARER_CNF
-#define        TAPI_CS_NETTEXT_SEND                            TAPI_EVENT_NETTEXT_SENTSTATUS_CNF
-#define        TAPI_CS_NETTEXT_READ                            TAPI_EVENT_NETTEXT_READ_SMS_CNF
-#define        TAPI_CS_NETTEXT_WRITE                           TAPI_EVENT_NETTEXT_SAVE_STATUS_CNF
-#define        TAPI_CS_NETTEXT_DELETE                          TAPI_EVENT_NETTEXT_DELETE_STATUS_CNF
-#define        TAPI_CS_NETTEXT_GETCOUNT                        TAPI_EVENT_NETTEXT_GET_COUNT_CNF
-#define        TAPI_CS_NETTEXT_GETSCA                          TAPI_EVENT_NETTEXT_GET_SCA_CNF
-#define        TAPI_CS_NETTEXT_GETCBCONFIG                     TAPI_EVENT_NETTEXT_GET_CB_CONFIG_CNF
-#define        TAPI_CS_NETTEXT_GETPREFBEARER           TAPI_EVENT_NETTEXT_GET_SMSBEARER_CNF
-#define        TAPI_CS_NETTEXT_SETDELIVERREPORT        TAPI_EVENT_NETTEXT_DELIVERY_REPORT_CNF
-#define        TAPI_CS_NETTEXT_GETPARAMS                       TAPI_EVENT_NETTEXT_GET_PARAM_CNF
-#define        TAPI_CS_NETTEXT_GETPARAMCNT                     TAPI_EVENT_NETTEXT_PARAM_COUNT_IND
-#define        TAPI_CS_NETTEXT_SEND_EX                         TAPI_EVENT_NETTEXT_SENTSTATUS_EX_CNF
-
-// Same response
-#define        TAPI_CS_NETTEXT_SETSCA                          (TAPI_EVENT_NETTEXT_CNF_MAX + 1)
-#define        TAPI_CS_NETTEXT_SETCBCONFIG                     (TAPI_EVENT_NETTEXT_CNF_MAX + 2)
-#define        TAPI_CS_NETTEXT_SETMEMSTATUS            (TAPI_EVENT_NETTEXT_CNF_MAX + 3)
-#define        TAPI_CS_NETTEXT_SETPREFBEARER           (TAPI_EVENT_NETTEXT_CNF_MAX + 4)
-#define        TAPI_CS_NETTEXT_SETMSGSTATUS            (TAPI_EVENT_NETTEXT_CNF_MAX + 5)
-#define        TAPI_CS_NETTEXT_SETPARAMS                       (TAPI_EVENT_NETTEXT_CNF_MAX + 6)
-
-// Network Service
-#define        TAPI_CS_NETWORK_EVENT_MAX                       TAPI_EVENT_NETWORK_GET_CDMA_HYBRID_MODE_CNF
-#define        TAPI_CS_NETWORK_SEARCH                          TAPI_EVENT_NETWORK_SEARCH_CNF
-#define        TAPI_CS_NETWORK_GETSELECTIONMODE        TAPI_EVENT_NETWORK_GETSELECTIONMODE_CNF
-#define        TAPI_CS_NETWORK_SETNETWORKBAND          TAPI_EVENT_NETWORK_SETNWBAND_CNF
-#define        TAPI_CS_NETWORK_GETNETWORKBAND          TAPI_EVENT_NETWORK_GETNWBAND_CNF
-#define        TAPI_CS_NETWORK_SETNETWORKMODE          TAPI_EVENT_NETWORK_SETNWMODE_CNF
-#define        TAPI_CS_NETWORK_GETNETWORKMODE          TAPI_EVENT_NETWORK_GETNWMODE_CNF
-#define        TAPI_CS_NETWORK_SETPREFPLMN                     TAPI_EVENT_NETWORK_SETPREFFEREDPLMN_CNF
-#define        TAPI_CS_NETWORK_GETPREFPLMN                     TAPI_EVENT_NETWORK_GETPREFFEREDPLMN_CNF
-#define        TAPI_CS_NETWORK_SETSERVICEDOMAIN        TAPI_EVENT_NETWORK_SETSERVICEDOMAIN_CNF
-#define        TAPI_CS_NETWORK_GETSERVICEDOMAIN        TAPI_EVENT_NETWORK_GETSERVICEDOMAIN_CNF
-#define        TAPI_CS_NETWORK_SETROAMINGMODE          TAPI_EVENT_NETWORK_SET_ROAMING_MODE_CNF
-#define        TAPI_CS_NETWORK_GETROAMINGMODE          TAPI_EVENT_NETWORK_GET_ROAMING_MODE_CNF
-#define        TAPI_CS_NETWORK_SETCDMAHYBRIDMODE       TAPI_EVENT_NETWORK_SET_CDMA_HYBRID_MODE_CNF
-#define        TAPI_CS_NETWORK_GETCDMAHYBRIDMODE       TAPI_EVENT_NETWORK_GET_CDMA_HYBRID_MODE_CNF
-// Same response
-#define        TAPI_CS_NETWORK_SELECT_AUTOMATIC        (TAPI_EVENT_NETWORK_CNF_MAX + 1)
-#define        TAPI_CS_NETWORK_SELECT_MANUAL           (TAPI_EVENT_NETWORK_CNF_MAX + 2)
-
-// SS Service
-#define        TAPI_CS_SS_EVENT_MAX                            TAPI_EVENT_SS_SET_AOC_CNF
-#define        TAPI_CS_SS_BARRSETREQ                           TAPI_EVENT_SS_BARRING_CNF
-#define        TAPI_CS_SS_BARRCHANGEPWDREQ                     TAPI_EVENT_SS_BARRING_CHANGEPASS_CNF
-#define        TAPI_CS_SS_BARRQUERYSTATUSREQ           TAPI_EVENT_SS_BARRING_QUERYSTATUS_CNF
-#define        TAPI_CS_SS_FWDSETREQ                            TAPI_EVENT_SS_FORWARD_CNF
-#define        TAPI_CS_SS_FWDQUERYSTATUSREQ            TAPI_EVENT_SS_FORWARD_QUERYSTATUS_CNF
-#define        TAPI_CS_SS_WAITSETREQ                           TAPI_EVENT_SS_WAITING_CNF
-#define        TAPI_CS_SS_WAITQUERYSTATUSREQ           TAPI_EVENT_SS_WAITING_QUERYSTATUS_CNF
-#define        TAPI_CS_SS_USSDSENDSTRINGREQ            TAPI_EVENT_SS_USSD_CNF
-#define        TAPI_CS_SS_USSDCANCEL                           TAPI_EVENT_SS_USSD_CANCEL_CNF
-#define        TAPI_CS_SS_CLIQUERYSTATUSREQ            TAPI_EVENT_SS_CLI_QUERYSTATUS_CNF
-#define        TAPI_CS_SS_GETCALLCOSTREQ                       TAPI_EVENT_SS_AOC_RSP
-#define        TAPI_CS_SS_SETCALLCOSTREQ                       TAPI_EVENT_SS_SET_AOC_CNF
-#define        TAPI_CS_SS_USSDRSP                                      TAPI_EVENT_SS_USSD_RSP_CNF
-// SAT Service
-#define        TAPI_CS_SIMATK_EVENT_MAX                                        TAPI_EVENT_SAT_MENU_SELECTION_CNF
-#define        TAPI_CS_SIMATK_SEND_MENU_SELECTION_ENVELOPE     TAPI_EVENT_SAT_MENU_SELECTION_CNF
-#define        TAPI_CS_SIMATK_SEND_EVENT_DOWNLOAD                      TAPI_EVENT_SAT_EVENT_DOWNLOAD_CNF
-#define        TAPI_CS_UI_DISPLAY_STATUS                                       (TAPI_EVENT_SAT_CNF_MAX + 1)
-#define        TAPI_CS_UI_USER_CONFIRM                                         (TAPI_EVENT_SAT_CNF_MAX + 2)
-#define        TAPI_CS_SIMATK_GET_MAIN_MENU_INFO                       (TAPI_EVENT_SAT_CNF_MAX + 3)
-#define        TAPI_CS_SIMATK_SEND_APP_EXEC_RESULT                     (TAPI_EVENT_SAT_CNF_MAX + 4)
-
-// GPRS Service
-#define        TAPI_CS_GPRS_EVENT_MAX                          TAPI_EVENT_PS_PDP_GET_PORTLIST_RSP
-#define        TAPI_CS_GPRS_STARTNETWORK                       TAPI_EVENT_PS_PDP_ACT_RSP
-#define        TAPI_CS_GPRS_PDP_DEACTIVATION_SET       TAPI_EVENT_PS_PDP_DEACT_RSP
-#define        TAPI_CS_GPRS_DATA_DORMANT                       TAPI_EVENT_PS_DATA_DORMANT_RESP
-#define        TAPI_CS_GPRS_PORT_LIST_SET                      TAPI_EVENT_PS_PDP_SET_PORTLIST_RSP
-#define        TAPI_CS_GPRS_PORT_LIST_GET                      TAPI_EVENT_PS_PDP_GET_PORTLIST_RSP
-#define        TAPI_CS_GPRS_BTDUN_PINCTRL_GET          (TAPI_EVENT_PS_CNF_MAX + 1)
-
-// Sound Service
-#define        TAPI_CS_SOUND_EVENT_MAX                         TAPI_EVENT_SOUND_AUDIOSOURCECTRL_NOTI
-#define        TAPI_CS_SOUND_VOLUME_GET                        TAPI_EVENT_SOUND_VOLUMECTRL_RSP
-#define        TAPI_CS_SOUND_MIC_MUTE_GET                      TAPI_EVENT_SOUND_MICMUTECTRL_RSP
-#define        TAPI_CS_SOUND_VOLUME_SET                        (TAPI_EVENT_SOUND_CNF_MAX + 1)
-#define        TAPI_CS_SOUND_MIC_MUTE_SET          (TAPI_EVENT_SOUND_CNF_MAX + 2)
-#define        TAPI_CS_SOUND_AUDIO_PATH_CTRL           (TAPI_EVENT_SOUND_CNF_MAX + 3)
-
-#define        TAPI_CS_UTIL_TUNNEL_REQ                         (TAPI_EVENT_UTIL_TUNNEL_CNF)
-
-// Internal
-#define TAPI_CS_INTERNAL                                               (1<<30)
-
-#define        TAPI_CS_SERVICE_DATA                                    TAPI_EVENT_CLASS_CDMA_DATA      //TAPI_EVENT_CLASS_CALL_DATA
-#define        TAPI_CS_SERVICE_MISC                                    TAPI_EVENT_CLASS_MISC
-#define        TAPI_CS_SERVICE_GPS                                             TAPI_EVENT_CLASS_GPS
-#define        TAPI_CS_SERVICE_POWER                                   TAPI_EVENT_CLASS_POWER
-#define        TAPI_CS_SERVICE_CFG                                             TAPI_EVENT_CLASS_CFG
-#define        TAPI_CS_SERVICE_OMADM                                   TAPI_EVENT_CLASS_OMADM
-#define        TAPI_CS_SERVICE_SVCMODE                                 TAPI_EVENT_CLASS_SVCMODE
-#define        TAPI_CS_SERVICE_IMEI                                    TAPI_EVENT_CLASS_IMEI
-#define        TAPI_CS_SERVICE_FACTORY                                 TAPI_EVENT_CLASS_FACTORY
-
-// SMS Service
-#define        TAPI_CS_NETTEXT_DEVICEREADY                             (TAPI_CS_INTERNAL|(TAPI_EVENT_NETTEXT_CNF_MAX+ 1))
-#define        TAPI_CS_NETTEXT_DEVICESTATUS                    (TAPI_CS_INTERNAL|(TAPI_EVENT_NETTEXT_CNF_MAX+ 2))
-
-// Network Service
-#define        TAPI_CS_NETWORK_SETNETWORKORDER                 (TAPI_CS_INTERNAL|(TAPI_CS_NETWORK_SELECT_MANUAL + 1))
-#define        TAPI_CS_NETWORK_GETNETWORKORDER                 (TAPI_CS_INTERNAL|(TAPI_CS_NETWORK_SELECT_MANUAL + 2))
-#define        TAPI_CS_NETWORK_SETPOWERONATTACH                (TAPI_CS_INTERNAL|(TAPI_CS_NETWORK_SELECT_MANUAL + 3))
-#define        TAPI_CS_NETWORK_GETPOWERONATTACH                (TAPI_CS_INTERNAL|(TAPI_CS_NETWORK_SELECT_MANUAL + 4))
-#define        TAPI_CS_NETWORK_CANCELMANUALSEARCH              (TAPI_CS_INTERNAL|(TAPI_CS_NETWORK_SELECT_MANUAL + 5))
-#define        TAPI_CS_NETWORK_CANCELMANUALSELECTION   (TAPI_CS_INTERNAL|(TAPI_CS_NETWORK_SELECT_MANUAL + 6))
-
-// Sound Service
-#define        TAPI_CS_SOUND_AUDIOLOOPBACK_SET                 (TAPI_CS_INTERNAL|(TAPI_EVENT_SOUND_CNF_MAX + 1))
-#define        TAPI_CS_SOUND_AUDIO_CLOCK_CTRL                  (TAPI_CS_INTERNAL|(TAPI_EVENT_SOUND_CNF_MAX + 2))
-#define        TAPI_CS_SOUND_VOICE_RECORDING_SET               (TAPI_CS_INTERNAL|(TAPI_EVENT_SOUND_CNF_MAX + 3))
-
-// CDMA Data Service
-#define        TAPI_CS_DATA_EVENT_MAX                                  (TAPI_CS_INTERNAL|(TAPI_EVENT_DATA_NAI_SETTING_MODE_SET_CNF))
-#define        TAPI_CS_DATA_MOBILE_IP_NAI_SET                  (TAPI_CS_INTERNAL|(TAPI_EVENT_DATA_MIP_NAI_SET_CNF))
-#define        TAPI_CS_DATA_MOBILE_IP_NAI_GET                  (TAPI_CS_INTERNAL|(TAPI_EVENT_DATA_MIP_NAI_GET_CNF))
-#define        TAPI_CS_DATA_CURRENT_NAI_INDEX_GET              (TAPI_CS_INTERNAL|(TAPI_EVENT_DATA_CURRENT_NAI_INDEX_GET_CNF))
-#define        TAPI_CS_DATA_TE2_STATUS_GET                             (TAPI_CS_INTERNAL|(TAPI_EVENT_DATA_TE2_STATUS_GET_CNF))
-#define        TAPI_CS_DATA_ROAM_GUARD_SET                             (TAPI_CS_INTERNAL|(TAPI_EVENT_DATA_ROAM_GUARD_SET_CNF))
-#define        TAPI_CS_DATA_ROAM_GUARD_GET                             (TAPI_CS_INTERNAL|(TAPI_EVENT_DATA_ROAM_GUARD_GET_CNF))
-#define        TAPI_CS_DATA_EVDO_REV_CONFIG_SET                (TAPI_CS_INTERNAL|(TAPI_EVENT_DATA_EVDO_REV_CONFIG_SET_CNF))
-#define        TAPI_CS_DATA_EVDO_REV_CONFIG_GET                (TAPI_CS_INTERNAL|(TAPI_EVENT_DATA_EVDO_REV_CONFIG_GET_CNF))
-#define        TAPI_CS_DATA_RESTORE_NAI                                (TAPI_CS_INTERNAL|(TAPI_EVENT_DATA_RESTORE_NAI_SET_CNF))
-#define        TAPI_CS_DATA_DDTM_CONFIGURATION_SET             (TAPI_CS_INTERNAL|(TAPI_EVENT_DATA_DDTM_CONFIGURATION_SET_CNF))
-#define        TAPI_CS_DATA_DDTM_CONFIGURATION_GET             (TAPI_CS_INTERNAL|(TAPI_EVENT_DATA_DDTM_CONFIGURATION_GET_CNF))
-#define        TAPI_CS_DATA_MODEM_NAI_SET                              (TAPI_CS_INTERNAL|(TAPI_EVENT_DATA_NAI_SETTING_MODE_SET_CNF))
-#define        TAPI_CS_DATA_MODEM_NAI_GET                              (TAPI_CS_INTERNAL|(TAPI_EVENT_DATA_MODEM_NAI_GET_CNF)) // please check with TAPI_EVENT_DATA_NAI_SETTING_MODE_GET_CNF
-// MISC Service
-#define        TAPI_CS_MISC_EVENT_MAX                                  (TAPI_CS_INTERNAL|(TAPI_EVENT_MISC_NAM_INFO_NOTI))
-#define        TAPI_CS_MISC_TIMEZONE_GETINFO                   (TAPI_CS_INTERNAL|(TAPI_EVENT_MISC_NITZ_GETCNF))
-#define        TAPI_CS_MISC_NAM_INFO_SET                               (TAPI_CS_INTERNAL|(TAPI_EVENT_MISC_SET_NAM_INFO_CNF))
-#define        TAPI_CS_MISC_NAM_INFO_GET                               (TAPI_CS_INTERNAL|(TAPI_EVENT_MISC_GET_NAM_INFO_CNF))
-#define        TAPI_CS_MISC_TIMEZONE_SETINFO                   (TAPI_CS_INTERNAL|(TAPI_EVENT_MISC_CNF_MAX + 1))        // There is no confirm message
-#define        TAPI_CS_MISC_TIMEZONE_CONFIRMINFO               (TAPI_CS_INTERNAL|(TAPI_EVENT_MISC_CNF_MAX + 2))        // It is not used and necessary. removed.
-#define        TAPI_CS_MISC_TIMEZONE_GETMODE                   (TAPI_CS_INTERNAL|(TAPI_EVENT_MISC_CNF_MAX + 3))
-#define        TAPI_CS_MISC_SERIAL_NUMBER_GET                  (TAPI_CS_INTERNAL|(TAPI_EVENT_MISC_CNF_MAX + 4))
-#define        TAPI_CS_MISC_ME_VERSION_GET                             (TAPI_CS_INTERNAL|(TAPI_EVENT_MISC_CNF_MAX + 5))
-
-// GPS Service
-#define        TAPI_CS_GPS_INIT                                                (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_INIT_RESP))
-#define        TAPI_CS_GPS_DEINIT                                              (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_DEINIT_RESP))
-#define        TAPI_CS_GPS_FIX_REQUEST                                 (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_FIX_REQUEST_RESP))
-#define        TAPI_CS_GPS_STOP_SESSION                                (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_STOP_SESSION_RESP))
-#define        TAPI_CS_GPS_GET_PARAMETERS                              (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_PARAMETERS_GET_RESP))
-#define        TAPI_CS_GPS_SET_PARAMETERS                              (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_PARAMETERS_SET_RESP))
-#define        TAPI_CS_GPS_AGPS_PDP_CONN_CNF                   (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_PDP_CONNECTION_IND))
-#define        TAPI_CS_GPS_AGPS_DNS_LOOKUP_CNF                 (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_DNS_LOOKUP_IND))
-#define        TAPI_CS_GPS_SEND_VER_CNF                                (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_VERIFICATION_IND))
-#define        TAPI_CS_GPS_XTRA_INIT                                   (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_XTRA_INIT))
-#define        TAPI_CS_GPS_XTRA_DEINIT                                 (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_XTRA_DEINIT))
-#define        TAPI_CS_GPS_XTRA_ENABLE                                 (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_XTRA_ENABLE_SET_RESP))
-#define        TAPI_CS_GPS_XTRA_DISABLE                                (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_CNF_MAX+1))   // should be fixed
-#define        TAPI_CS_GPS_XTRA_SET_TIMEINFO                   (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_XTRA_SET_TIME_RESP))
-#define        TAPI_CS_GPS_XTRA_SET_DATA                               (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_XTRA_SET_DATA_RESP))
-#define        TAPI_CS_GPS_MEASURE_POS_CNF                             (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_MEASURE_POSITION_CNF))
-#define        TAPI_CS_GPS_SET_FREQ_AIDING                             (TAPI_CS_INTERNAL|(TAPI_EVENT_GPS_FREQ_AIDING_SET_RESP))
-
-// Power Service
-#define        TAPI_CS_POWER_EVENT_MAX                                 (TAPI_CS_INTERNAL|(TAPI_EVENT_POWER_SERVICE_READY_IND))
-#define        TAPI_CS_POWER_FLIGHT_MODE                               (TAPI_CS_INTERNAL|(TAPI_EVENT_POWER_FLIGHT_MODE_RESP))
-#define        TAPI_CS_POWER_PHONE_POWER_ON_OFF                (TAPI_CS_INTERNAL|(TAPI_CS_POWER_EVENT_MAX + 1))
-#define        TAPI_CS_POWER_REBOOT                                    (TAPI_CS_INTERNAL|(TAPI_CS_POWER_EVENT_MAX + 2))
-#define        TAPI_CS_POWER_RAMDUMP                                   (TAPI_CS_INTERNAL|(TAPI_CS_POWER_EVENT_MAX + 3))
-
-// Power Service
-#define        TAPI_CS_CFG_DEFAULTCONFGURATION_EXE             (TAPI_CS_INTERNAL|(TAPI_CFG_EVENT_DEFAULTCFG_IND))
-#define        TAPI_CS_CFG_GET_A_KEY                                   (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_GET_A_KEY_CNF))
-#define        TAPI_CS_CFG_VERIFY_A_KEY                                (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_VERIFY_A_KEY_CNF))
-#define        TAPI_CS_CFG_GET_MSL_INFO                                (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_GET_MSL_INFO_CNF))
-#define        TAPI_CS_CFG_SET_VOCODER_OPTION                  (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_SET_VOCODER_OPTION_CNF))
-#define        TAPI_CS_CFG_GET_VOCODER_OPTION                  (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_GET_VOCODER_OPTION_CNF))
-#define        TAPI_CS_CFG_SET_HIDDEN_MENU_ACCESS              (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_SET_HIDDEN_MENU_ACCESS_CNF))
-#define        TAPI_CS_CFG_GET_HIDDEN_MENU_ACCESS              (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_GET_HIDDEN_MENU_ACCESS_CNF))
-#define        TAPI_CS_CFG_SET_CURRENT_CARRIER                 (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_SET_CURRENT_CARRIER_CNF))
-#define        TAPI_CS_CFG_GET_CURRENT_CARRIER                 (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_GET_CURRENT_CARRIER_CNF))
-#define        TAPI_CS_CFG_SET_SIO_MODE                                (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_SET_SIO_MODE_CNF))
-#define        TAPI_CS_CFG_GET_SIO_MODE                                (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_GET_SIO_MODE_CNF))
-#define        TAPI_CS_CFG_GET_ACTIVATION_DATE                 (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_GET_ACTIVATION_DATE_CNF))
-#define        TAPI_CS_CFG_GET_RECONDITIONED_DATE              (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_GET_RECONDITIONED_DATE_CNF))
-#define        TAPI_CS_CFG_SET_TTY_MODE                                (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_SET_TTY_MODE_CNF))
-#define        TAPI_CS_CFG_GET_TTY_MODE                                (TAPI_CS_INTERNAL|(TAPI_EVENT_CFG_GET_TTY_MODE_CNF))
-
-// Omadm Service
-#define        TAPI_CS_OMADM_PRL_SIZE_GET                              (TAPI_CS_INTERNAL|(TAPI_EVENT_OMADM_PRL_SIZE_GET_CNF))
-#define        TAPI_CS_OMADM_MODEL_NAME_GET                    (TAPI_CS_INTERNAL|(TAPI_EVENT_OMADM_MODEL_NAME_GET_CNF))
-#define        TAPI_CS_OMADM_OEM_NAME_GET                              (TAPI_CS_INTERNAL|(TAPI_EVENT_OMADM_OEM_NAME_GET_CNF))
-#define        TAPI_CS_OMADM_SW_VER_GET                                (TAPI_CS_INTERNAL|(TAPI_EVENT_OMADM_SW_VERSION_GET_CNF))
-#define        TAPI_CS_OMADM_PRL_READ_GET                              (TAPI_CS_INTERNAL|(TAPI_EVENT_OMADM_PRL_READ_GET_CNF))
-#define        TAPI_CS_OMADM_PRL_WRITE_SET                             (TAPI_CS_INTERNAL|(TAPI_EVENT_OMADM_PRL_WRITE_SET_CNF))
-
-// Svc Service
-#define        TAPI_CS_SVCMODE_EVENT_MAX                               (TAPI_CS_INTERNAL|(TAPI_EVENT_SVCMODE_DEVICE_TEST_NOTI))
-#define        TAPI_CS_SVCMODE_ENTERSVCMODE                    (TAPI_CS_INTERNAL|(TAPI_EVENT_SVCMODE_START_NOTI))
-#define        TAPI_CS_SVCMODE_ENDSVCMODE                              (TAPI_CS_INTERNAL|(TAPI_EVENT_SVCMODE_END_NOTI))
-#define        TAPI_CS_SVCMODE_PROCESS_KEYCODE                 (TAPI_CS_INTERNAL|(TAPI_EVENT_SVCMODE_CNF_MAX + 1))
-#define        TAPI_CS_SVCMODE_DEBUG_DUMP                              (TAPI_CS_INTERNAL|(TAPI_EVENT_SVCMODE_DEBUG_DUMP_CNF))
-#define        TAPI_CS_IMEI_COMPARE_ITEM_IND                   (TAPI_CS_INTERNAL|(TAPI_EVENT_IMEI_COMPAREITEM))
-#define        TAPI_CS_IMEI_STARTFACTORYPROCESS                (TAPI_CS_INTERNAL|(TAPI_EVENT_IMEI_CMLA_IND))
-
-#define TAPI_CS_FACTORY_OMISSION_AVOIDANCE_SET (TAPI_CS_INTERNAL|(TAPI_EVENT_FACTORY_OMISSION_AVOIDANCE_SET_CNF))
-#define TAPI_CS_FACTORY_OMISSION_AVOIDANCE_GET (TAPI_CS_INTERNAL|(TAPI_EVENT_FACTORY_OMISSION_AVOIDANCE_GET_CNF))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*_TEL_CS_CONN_H_ */
diff --git a/include/ts_common.h b/include/ts_common.h
deleted file mode 100644 (file)
index be4d4f5..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __TS_COMMON_H__
-#define __TS_COMMON_H__
-
-#include <sys/ioctl.h>
-
-#include <TelDefines.h>
-#include <TapiCommon.h>
-
-#include <glib-2.0/glib.h>
-#include <dbus/dbus-protocol.h>
-#include <dbus/dbus-glib.h>
-
-#define TS_REQUEST_ID_RANGE_MAX 245            //available request id : 0 ~ 244
-#define TS_INVALID_REQUEST_ID 0xff
-#define TS_NOTI_REQUEST_ID 0xff
-
-enum ts_internal_request_id_e {
-       TS_REQID_SIM_PRE_DATA = 245,
-       TS_REQID_SIM_POST_DATA = 246,
-       TS_REQID_SIM_CPHS_DATA = 247,
-       TS_REQID_SIM_LOCK_DATA = 248,
-       TS_REQID_SIM_PB_DATA = 249,
-       TS_REQID_SIM_UPDATE_DATA = 250,
-       TS_REQID_NOTIFICATION = 251,
-       TS_REQID_INVALID = 0xff
-};
-
-
-#define TAPI_MAX_NITZ_PLMN_PAIRS               2
-
-
-/**
- * Security GID name
- */
-#define SECURITY_GID_TEL_CALL          "tel_call"
-#define SECURITY_GID_TEL_CALL_INFO     "tel_call_info"
-#define SECURITY_GID_TEL_MSG           "tel_msg"
-#define SECURITY_GID_TEL_MSG_INFO      "tel_msg_info"
-#define SECURITY_GID_TEL_NET           "tel_net"
-#define SECURITY_GID_TEL_NET_INFO      "tel_net_info"
-#define SECURITY_GID_TEL_GPRS          "tel_gprs"
-#define SECURITY_GID_TEL_GPRS_INFO     "tel_gprs_info"
-#define SECURITY_GID_TEL_SIM           "tel_sim"
-#define SECURITY_GID_TEL_SIM_INFO      "tel_sim_info"
-#define SECURITY_GID_TEL_SAP           "tel_sap"
-#define SECURITY_GID_TEL_SAT           "tel_sat"
-#define SECURITY_GID_TEL_SS                    "tel_ss"
-#define SECURITY_GID_TEL_SS_INFO       "tel_ss_info"
-
-
-/*This is part of platform provided code skeleton for client server model*/
-#define APP_FACTORY_TYPE (app_factory_get_type ())
-
-/*This is part of platform provided code skeleton for client server model*/
-typedef struct _AppFactory
-{
-       GObject object;
-       struct custom_data *data;
-} AppFactory;
-
-/*This is part of platform provided code skeleton for client server model*/
-typedef struct _AppFactoryClass
-{
-       GObjectClass object_class;
-} AppFactoryClass;
-
-
-#endif
diff --git a/include/ts_noti.h b/include/ts_noti.h
deleted file mode 100644 (file)
index e3ae3c3..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __TS_NOTI_H__
-#define __TS_NOTI_H__
-
-#include <glib.h>
-
-#include <TelDefines.h>
-#include <TapiCommon.h>
-
-void ts_init_delivery_system(struct custom_data *data);
-
-TS_BOOL ts_delivery_event(DBusConnection *EvtDeliveryHandle, int group, int type, const char *dest_name, int requestId, int Status, int data_length, void *data);
-
-#endif /* _TS_NOTI_H_ */
diff --git a/include/ts_svr_req.h b/include/ts_svr_req.h
deleted file mode 100644 (file)
index 6b00b28..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __TS_SVR_REQ_H__
-#define __TS_SVR_REQ_H__
-
-gboolean ts_register_dbus_factory(struct custom_data *data);
-
-#endif
diff --git a/include/ts_utility.h b/include/ts_utility.h
deleted file mode 100644 (file)
index 096bbee..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __TS_UTILITY_H__
-#define __TS_UTILITY_H__
-
-#include <sys/types.h>
-#include <errno.h>
-#include <glib.h>
-#include <dlog.h>
-#include <string.h>
-
-#include <TelDefines.h>
-
-#define TS_SIGNAL_OBJPATH "/org/projectx/telephony_event"
-#define TS_SIGNAL_SENDER "org.projectx.telephony_event"
-#define TS_SIGNAL_MEMBER_ARG0 "ARG0"
-#define TS_SIGNAL_MEMBER_ARG1 "ARG1"
-#define TS_SIGNAL_MEMBER_ARG2 "ARG2"
-#define TS_SIGNAL_MEMBER_ARG3 "ARG3"
-#define TS_SIGNAL_MEMBER_ARG4 "ARG4"
-#define TS_SIGNAL_MEMBER_ARG5 "ARG5"
-#define TS_SIGNAL_MEMBER_GENRESP "GENRESP"
-
-#endif
diff --git a/introspection/call.xml b/introspection/call.xml
new file mode 100644 (file)
index 0000000..ce7b867
--- /dev/null
@@ -0,0 +1,246 @@
+<node>
+
+       <interface name="org.tizen.telephony.Call">
+               <method name="Dial">
+                       <arg direction="in" type="i" name="call_type"/>
+                       <arg direction="in" type="s" name="call_number"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="Answer">
+                       <arg direction="in" type="i" name="call_id"/>
+                       <arg direction="in" type="i" name="answer_type"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="call_id"/>
+               </method>
+
+               <method name="End">
+                       <arg direction="in" type="i" name="call_id"/>
+                       <arg direction="in" type="i" name="end_type"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="call_id"/>
+                       <arg direction="out" type="i" name="end_type"/>
+               </method>
+
+               <method name="Dtmf">
+                       <arg direction="in" type="s" name="dtmf_string"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="Active">
+                       <arg direction="in" type="i" name="call_id"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="call_id"/>
+               </method>
+
+               <method name="Hold">
+                       <arg direction="in" type="i" name="call_id"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="call_id"/>
+               </method>
+
+               <method name="Swap">
+                       <arg direction="in" type="i" name="call_id"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="call_id"/>
+               </method>
+
+               <method name="Join">
+                       <arg direction="in" type="i" name="call_id"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="call_id"/>
+               </method>
+
+               <method name="Split">
+                       <arg direction="in" type="i" name="call_id"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="call_id"/>
+               </method>
+
+               <method name="Transfer">
+                       <arg direction="in" type="i" name="call_id"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="call_id"/>
+               </method>
+
+               <method name="Deflect">
+                       <arg direction="in" type="s" name="call_number"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetStatus">
+                       <arg direction="in" type="i" name="call_id"/>
+                       <arg direction="out" type="i" name="call_id"/>
+                       <arg direction="out" type="s" name="call_number"/>
+                       <arg direction="out" type="i" name="call_type"/>
+                       <arg direction="out" type="b" name="call_direction"/>
+                       <arg direction="out" type="i" name="call_state"/>
+                       <arg direction="out" type="b" name="call_multiparty_state"/>
+               </method>
+
+               <method name="GetStatusAll">
+                       <arg direction="out" type="aa{sv}" name="call_status_list"/>
+               </method>
+
+               <method name="SetSoundPath">
+                       <arg direction="in" type="i" name="sound_path"/>
+                       <arg direction="in" type="b" name="extra_volume"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetVolume">
+                       <arg direction="in" type="i" name="sound_device"/>
+                       <arg direction="in" type="i" name="sound_type"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="aa{sv}" name="list"/>
+               </method>
+
+               <method name="SetVolume">
+                       <arg direction="in" type="i" name="sound_device"/>
+                       <arg direction="in" type="i" name="sound_type"/>
+                       <arg direction="in" type="i" name="sound_volume"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetMuteStatus">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="status"/>
+               </method>
+
+               <method name="Mute">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="Unmute">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="SetSoundRecording">
+                       <arg direction="in" type="i" name="recording_state"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="SetSoundEqualization">
+                       <arg direction="in" type="i" name="eq_mode"/>
+                       <arg direction="in" type="i" name="eq_direction"/>
+                       <arg direction="in" type="s" name="eq_parameter"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="SetSoundNoiseReduction">
+                       <arg direction="in" type="i" name="nr_state"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+
+
+               <signal name="VoiceCallStatusIdle">
+                       <arg type="i" name="call_id"/>
+                       <arg type="i" name="end_cause"/>
+                       <arg type="i" name="start_time"/>
+                       <arg type="i" name="end_time"/>
+               </signal>
+
+               <signal name="VoiceCallStatusDialing">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="VoiceCallStatusAlert">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="VoiceCallStatusActive">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="VoiceCallStatusHeld">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="VoiceCallStatusIncoming">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="VideoCallStatusIdle">
+                       <arg type="i" name="call_id"/>
+                       <arg type="i" name="end_cause"/>
+                       <arg type="i" name="start_time"/>
+                       <arg type="i" name="end_time"/>
+               </signal>
+
+               <signal name="VideoCallStatusDialing">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="VideoCallStatusAlert">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="VideoCallStatusActive">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="VideoCallStatusIncoming">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="Waiting">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="Forwarded">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="BarredIncoming">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="BarredOutgoing">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="ForwardConditional">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="ForwardUnconditional">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="CallActive">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="CallHeld">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="CallJoined">
+                       <arg type="i" name="call_id"/>
+               </signal>
+
+               <signal name="CallSoundPath">
+                       <arg type="i" name="sound_path"/>
+               </signal>
+
+               <signal name="CallSoundRingbackTone">
+                       <arg type="i" name="status"/>
+               </signal>
+
+               <signal name="CallSoundWbamr">
+                       <arg type="i" name="status"/>
+               </signal>
+
+               <signal name="CallSoundEqualization">
+                       <arg type="i" name="eq_mode"/>
+                       <arg type="i" name="eq_direction"/>
+               </signal>
+
+               <signal name="CallSoundNoiseReduction">
+                       <arg type="i" name="status"/>
+               </signal>
+
+       </interface>
+
+</node>
diff --git a/introspection/convert_docbook_html.sh b/introspection/convert_docbook_html.sh
new file mode 100755 (executable)
index 0000000..2ac0c00
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+mkdir output 2>/dev/null
+
+OUTPUT=`basename $1`
+
+xsltproc -o output/$OUTPUT.html /usr/share/xml/docbook/stylesheet/docbook-xsl/html/docbook.xsl $1
diff --git a/introspection/convert_gtkdoc.sh b/introspection/convert_gtkdoc.sh
new file mode 100755 (executable)
index 0000000..91e2dc6
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+mkdir output 2>/dev/null
+
+OUTPUT=`basename $1`
+
+gtkdoc-mkhtml TEST $1
diff --git a/introspection/ex.xml b/introspection/ex.xml
new file mode 100644 (file)
index 0000000..ac9aa3c
--- /dev/null
@@ -0,0 +1,538 @@
+<node>
+       <!--
+               org.tizen.telephony.Network:
+               @short_description: Tizen Telephony Network interface
+
+               Network interface.
+
+       -->
+       <interface name="org.tizen.telephony.Network">
+               <!--
+                       Search:
+                       @result: Success(0)
+                       @list: An array of dict with network information. <para>dict key/value:</para><variablelist><varlistentry><term><literal>"plmn"</literal></term><listitem><type>string</type></listitem></varlistentry><varlistentry><term><literal>"act"</literal></term><listitem><type>int</type></listitem></varlistentry><varlistentry><term><literal>"type"</literal></term><listitem><type>int</type> Unknown(0), Home Plmn(1), Available Plmn(2), Forbidden Plmn(3)</listitem></varlistentry><varlistentry><term><literal>"name"</literal></term><listitem><type>string</type></listitem></varlistentry></variablelist>
+
+                       Request to do manual network selection to search for the available networks and provide the network list
+
+               -->
+               <method name="Search">
+                       <arg direction="out" type="aa{sv}" name="list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SearchCancel:
+                       @result: Success(0)
+
+                       Cancle the org.tizen.telephony.Network.Search() request.
+               -->
+               <method name="SearchCancel">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetSelectionMode:
+                       @mode: Selection mode. Manual(0), Automatic(1)
+                       @plmn: Plmn string.
+                       @act: Access technology. GSM(1), GPRS(2), EGPRS(3), UMTS(4), IS95A(17), IS95B(18), EHRPD(25), LTE(33)
+                       @result: Success(0)
+
+                       Set network selection mode
+               -->
+               <method name="SetSelectionMode">
+                       <arg direction="in" type="i" name="mode"/>
+                       <arg direction="in" type="s" name="plmn"/>
+                       <arg direction="in" type="i" name="act"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+               <!--
+                       GetSelectionMode:
+                       @mode: Selection mode. Manual(0), Automatic(1)
+                       @result: Success(0)
+
+                       Get network selection mode
+               -->
+               <method name="GetSelectionMode">
+                       <arg direction="out" type="i" name="mode"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetServiceDomain:
+                       @domain: Service domain. Combined(0), Circuit Service(1), Packet Service(2)
+                       @result: Success(0)
+
+                       Set network service domain
+               -->
+               <method name="SetServiceDomain">
+                       <arg direction="in" type="i" name="domain"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+               <!--
+                       GetServiceDomain:
+                       @domain: Service domain. Combined(0), Circuit Service(1), Packet Service(2)
+                       @result: Success(0)
+
+                       Get network service domain
+               -->
+               <method name="GetServiceDomain">
+                       <arg direction="out" type="i" name="domain"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetBand:
+                       @band: Network band. ANY(0), GSM850(1), GSM900_1800(2), GSM1900(3), GSM(4), WCDMA(5), WCDMA850(6), WCDMA1900(7), WCDMA2100(8), GSM900(9), GSM1800(10), GSM850_1900(11)
+                       @mode: Mode. Preferred(1), Only(2)
+                       @result: Success(0)
+
+                       Set network band
+               -->
+               <method name="SetBand">
+                       <arg direction="in" type="i" name="band"/>
+                       <arg direction="in" type="i" name="mode"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+               <!--
+                       GetBand:
+                       @band: Network band. ANY(0), GSM850(1), GSM900_1800(2), GSM1900(3), GSM(4), WCDMA(5), WCDMA850(6), WCDMA1900(7), WCDMA2100(8), GSM900(9), GSM1800(10), GSM850_1900(11)
+                       @mode: Mode. Preferred(1), Only(2)
+                       @result: Success(0)
+
+                       Get network band
+               -->
+               <method name="GetBand">
+                       <arg direction="out" type="i" name="band"/>
+                       <arg direction="out" type="i" name="mode"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetPreferredPlmn:
+                       @mode: add(1), edit(2), delete(3)
+                       @ef_index: Operator index in the EFplmnsel of the SIM
+                       @act: Access technology. GSM(1), GPRS(2), EGPRS(3), UMTS(4), IS95A(17), IS95B(18), EHRPD(25), LTE(33)
+                       @plmn: Plmn
+                       @result: Success(0)
+
+                       Set Preferred Plmn
+               -->
+               <method name="SetPreferredPlmn">
+                       <arg direction="in" type="i" name="mode"/>
+                       <arg direction="in" type="i" name="ef_index"/>
+                       <arg direction="in" type="i" name="act"/>
+                       <arg direction="in" type="s" name="plmn"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+               <!--
+                       GetPreferredPlmn:
+                       @list: A set of key/dict paris with preferred plmn list. <para>dict items are:</para><itemizedlist><listitem>"plmn" <type>string</type></listitem><listitem>"act" <type>int</type></listitem><listitem>"ef_index" <type>int</type></listitem></itemizedlist>
+                       @result: Success(0)
+
+                       Get Preferred Plmn list
+               -->
+               <method name="GetPreferredPlmn">
+                       <arg direction="out" type="aa{sv}" name="list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetOrder:
+                       @order: Acquisition Order. AUTO(1), GSM FIRST(2), WCDMA FIRST(3), LTE FIRST(4)
+                       @result: Success(0)
+
+                       Set network acquisition order
+               -->
+               <method name="SetOrder">
+                       <arg direction="in" type="i" name="order"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+               <!--
+                       GetOrder:
+                       @order: Acquisition Order. AUTO(1), GSM FIRST(2), WCDMA FIRST(3), LTE FIRST(4)
+                       @result: Success(0)
+
+                       Get network acquisition order
+               -->
+               <method name="GetOrder">
+                       <arg direction="out" type="i" name="order"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetPowerOnAttach:
+                       @enable: Power on attach configuration. Enable(TRUE), Disable(FALSE)
+                       @result: Success(0)
+
+                       Set power on attach configuration
+               -->
+               <method name="SetPowerOnAttach">
+                       <arg direction="in" type="b" name="enable"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+               <!--
+                       GetPowerOnAttach:
+                       @enable: Power on attach configuration. Enable(TRUE), Disable(FALSE)
+                       @result: Success(0)
+
+                       Get power on attach configuration
+               -->
+               <method name="GetPowerOnAttach">
+                       <arg direction="out" type="b" name="enable"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       GetServingNetwork:
+                       @act: Access technology. GSM(1), GPRS(2), EGPRS(3), UMTS(4), IS95A(17), IS95B(18), EHRPD(25), LTE(33)
+                       @plmn: Plmn string.
+                       @status: Registration status. NOT REGISTER(1), REGISTER HOME(2), SEARCHING(3), DENIED(4), UNKNOWN(5), REGISTER ROAM(6)
+                       @lac: Location Area Code.
+                       @result: Success(0)
+
+                       Set power on attach configuration
+               -->
+               <method name="GetServingNetwork">
+                       <arg direction="out" type="i" name="act"/>
+                       <arg direction="out" type="s" name="status"/>
+                       <arg direction="out" type="s" name="plmn"/>
+                       <arg direction="out" type="i" name="lac"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       RegistrationStatus:
+                       @circuit: Circuit service status.
+                       @packet: Packet service status.
+                       @type: Service type. UNKNOWN(0), NO SERVICE(1), EMERGENCY(2), SEARCH(3), 2G(4), 2.5G(5), 2.5G EDGE(6), 3G(7)
+                       @roaming: Roaming status.
+
+                       Network registration status.
+               -->
+               <signal name="RegistrationStatus">
+                       <arg type="i" name="circuit"/>
+                       <arg type="i" name="packet"/>
+                       <arg type="i" name="type"/>
+                       <arg type="b" name="roaming"/>
+               </signal>
+
+               <!--
+                       Info:
+                       @rssi: Radio Signal Strength infomation. (0 ~ 6)
+                       @battery: Battery information. (0 ~ 5)
+
+                       RSSI and Battery information.
+               -->
+               <signal name="Info">
+                       <arg type="i" name="rssi"/>
+                       <arg type="i" name="battery"/>
+               </signal>
+
+               <!--
+                       Change:
+                       @act: Access technology. GSM(1), GPRS(2), EGPRS(3), UMTS(4), IS95A(17), IS95B(18), EHRPD(25), LTE(33)
+                       @plmn: Plmn string.
+                       @lac: Location Area Code.
+
+                       Network change.
+               -->
+               <signal name="Change">
+                       <arg type="i" name="act"/>
+                       <arg type="s" name="plmn"/>
+                       <arg type="i" name="lac"/>
+               </signal>
+
+               <!--
+                       TimeInfo:
+                       @year: Year. (year - 2000). e.g. 2012 is 12
+                       @month: Month. (1 ~ 12)
+                       @day: Day (1 ~ 31)
+                       @hour: Hour (0 ~ 23)
+                       @minute: Minute (0 ~ 59)
+                       @second: Second (0 ~ 59)
+                       @wday: Day of week (0:Sunday ~ 6:Saturday)
+                       @gmtoff: GMT Offset (minutes). e.g. GMT+9 is 540
+                       @dstoff: Daylight adjust time. (hours)
+                       @isdst: Daylight flag
+                       @plmn: Plmn
+
+                       Network time information.
+               -->
+               <signal name="TimeInfo">
+                       <arg type="i" name="year"/>
+                       <arg type="i" name="month"/>
+                       <arg type="i" name="day"/>
+                       <arg type="i" name="hour"/>
+                       <arg type="i" name="minute"/>
+                       <arg type="i" name="second"/>
+                       <arg type="i" name="wday"/>
+                       <arg type="i" name="gmtoff"/>
+                       <arg type="i" name="dstoff"/>
+                       <arg type="b" name="isdst"/>
+                       <arg type="s" name="plmn"/>
+               </signal>
+
+               <!--
+                       Identity:
+                       @plmn: Plmn string.
+                       @short_name: Network name (short - 16 bytes)
+                       @full_name: Network name (full - 32 bytes)
+
+                       Network identity information.
+               -->
+               <signal name="Identity">
+                       <arg type="s" name="plmn"/>
+                       <arg type="s" name="short_name"/>
+                       <arg type="s" name="full_name"/>
+               </signal>
+
+               <!--
+                       CellInfo:
+                       @lac: Location Area Code.
+                       @cell_id: Cell ID
+
+                       Network location and cell information.
+               -->
+               <signal name="CellInfo">
+                       <arg type="i" name="lac"/>
+                       <arg type="i" name="cell_id"/>
+               </signal>
+
+       </interface>
+
+       <interface name="org.tizen.telephony.SIM">
+               <property name="Type" type="s" access="read"/>
+               <property name="Mcc" type="s" access="read"/>
+               <property name="Mnc" type="s" access="read"/>
+               <property name="Msin" type="s" access="read"/>
+               <property name="sim_init" type="i" access="read"/>
+               <property name="sim_changed" type="b" access="read"/>
+
+               <method name="GetECC">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="count"/>
+               <!-- object
+                       <arg direction="out" type="s" name="name"/>
+                       <arg direction="out" type="s" name="number"/>
+                       <arg direction="out" type="i" name="category"/>
+               -->
+               </method>
+
+               <method name="GetICCID">
+                       <arg direction="out" type="s" name="iccid"/>
+               </method>
+
+               <method name="GetLanguage">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="language"/>
+               </method>
+
+               <method name="SetLanguage">
+                       <arg direction="in" type="i" name="language"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetCallforwarding">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetMessageWaiting">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetMailbox">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetCPHSInfo">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetMSISDN">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="Authentication">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="VerifySec">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="VerifyPUK">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="ChangePIN">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="DisableFacility">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="EnableFacility">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetFacility">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="TransferAPDU">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetATR">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <signal name="SimStatus">
+                       <arg type="i" name="status"/>
+               </signal>
+
+       </interface>
+
+       <interface name="org.tizen.telephony.phonebook">
+               <property name="Status" type="i" access="read"/>
+               <property name="Support_list" type="as" access="read"/>
+
+               <method name="GetCount">
+                       <arg direction="in" type="i" name="req_type"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_type"/>
+                       <arg direction="out" type="i" name="used"/>
+                       <arg direction="out" type="i" name="total"/>
+               </method>
+
+               <method name="GetInfo">
+                       <arg direction="in" type="i" name="req_type"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_type"/>
+                       <arg direction="out" type="i" name="index_min"/>
+                       <arg direction="out" type="i" name="index_max"/>
+                       <arg direction="out" type="i" name="number_length_max"/>
+                       <arg direction="out" type="i" name="text_length_max"/>
+               </method>
+
+               <method name="ReadRecord">
+                       <arg direction="in" type="i" name="req_type"/>
+                       <arg direction="in" type="i" name="index"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_type"/>
+                       <arg direction="out" type="i" name="index"/>
+                       <arg direction="out" type="i" name="next_index"/>
+                       <arg direction="out" type="s" name="name"/>
+                       <arg direction="out" type="i" name="dcs"/>
+                       <arg direction="out" type="s" name="number"/>
+                       <arg direction="out" type="i" name="ton"/>
+                       <arg direction="out" type="s" name="number2"/>
+                       <arg direction="out" type="i" name="number2_ton"/>
+                       <arg direction="out" type="s" name="number3"/>
+                       <arg direction="out" type="i" name="number3_ton"/>
+                       <arg direction="out" type="s" name="number4"/>
+                       <arg direction="out" type="i" name="number4_ton"/>
+                       <arg direction="out" type="s" name="email1"/>
+                       <arg direction="out" type="s" name="email2"/>
+                       <arg direction="out" type="s" name="email3"/>
+                       <arg direction="out" type="s" name="email4"/>
+                       <arg direction="out" type="i" name="group_index"/>
+               </method>
+
+               <method name="UpdateRecord">
+                       <arg direction="in" type="i" name="type"/>
+                       <arg direction="in" type="i" name="index"/>
+                       <arg direction="in" type="s" name="name"/>
+                       <arg direction="in" type="i" name="dcs"/>
+                       <arg direction="in" type="s" name="number"/>
+                       <arg direction="in" type="i" name="ton"/>
+                       <arg direction="in" type="s" name="number2"/>
+                       <arg direction="in" type="i" name="number2_ton"/>
+                       <arg direction="in" type="s" name="number3"/>
+                       <arg direction="in" type="i" name="number3_ton"/>
+                       <arg direction="in" type="s" name="number4"/>
+                       <arg direction="in" type="i" name="number4_ton"/>
+                       <arg direction="in" type="s" name="email1"/>
+                       <arg direction="in" type="s" name="email2"/>
+                       <arg direction="in" type="s" name="email3"/>
+                       <arg direction="in" type="s" name="email4"/>
+                       <arg direction="in" type="i" name="group_index"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="DeleteRecord">
+                       <arg direction="in" type="i" name="type"/>
+                       <arg direction="in" type="i" name="index"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <signal name="PhonebookStatus">
+                       <arg type="i" name="status"/>
+               </signal>
+
+       </interface>
+
+       <interface name="org.tizen.telephony.SAP">
+
+               <method name="Connect">
+                       <arg direction="in" type="i" name="req_max_size"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_max_size"/>
+               </method>
+
+               <method name="Disconnect">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetStatus">
+                       <arg direction="out" type="i" name="status"/>
+               </method>
+
+               <method name="GetATR">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="y" name="atr"/>
+               </method>
+
+               <method name="TransferAPDU">
+                       <arg direction="in" type="y" name="req_apdu"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="y" name="resp_apdu"/>
+               </method>
+
+               <method name="SetProtocol">
+                       <arg direction="in" type="i" name="protocol"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="SetPower">
+                       <arg direction="in" type="i" name="mode"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetCardReaderStatus">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="status"/>
+               </method>
+
+               <signal name="status">
+                       <arg type="i" name="status"/>
+               </signal>
+
+               <signal name="disconnect">
+                       <arg type="i" name="type"/>
+               </signal>
+
+       </interface>
+
+       <interface name="org.tizen.telephony.SAT">
+               <property name="Type" type="s" access="read"/>
+       </interface>
+
+       <interface name="org.tizen.telephony.Manager">
+               <method name="GetModems">
+                       <arg direction="out" type="as" name="list"/>
+               </method>
+       </interface>
+
+</node>
diff --git a/introspection/gen.sh b/introspection/gen.sh
new file mode 100755 (executable)
index 0000000..82252f5
--- /dev/null
@@ -0,0 +1,6 @@
+gdbus-codegen --interface-prefix org.tizen.telephony. \
+       --generate-c-code generated-code                        \
+       --c-namespace Telephony                       \
+       --c-generate-object-manager                 \
+       --generate-docbook generated-docs                       \
+       manager.xml network.xml sim.xml phonebook.xml sat.xml sap.xml
diff --git a/introspection/manager.xml b/introspection/manager.xml
new file mode 100644 (file)
index 0000000..a14c937
--- /dev/null
@@ -0,0 +1,9 @@
+<node>
+
+       <interface name="org.tizen.telephony.Manager">
+               <method name="GetModems">
+                       <arg direction="out" type="as" name="list"/>
+               </method>
+       </interface>
+
+</node>
diff --git a/introspection/modem.xml b/introspection/modem.xml
new file mode 100644 (file)
index 0000000..fc63791
--- /dev/null
@@ -0,0 +1,104 @@
+<node>
+       <!--
+               org.tizen.telephony.Modem:
+
+               Modem interface.
+
+       -->
+       <interface name="org.tizen.telephony.Modem">
+
+               <!--
+                       SetPower:
+                       @result: Success(0)
+                       @mode: Off(0), On(1), Reset(2)
+
+                       Request to ...
+               -->
+               <method name="SetPower">
+                       <arg direction="in" type="i" name="mode"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetFlightMode:
+                       @result: Success(0)
+                       @enable: Flight mode Off (FLASE), Flight mode On (TRUE)
+                       @result: Flight mode On (1), Flight mode Off (2)
+
+                       Request to ...
+               -->
+               <method name="SetFlightMode">
+                       <arg direction="in" type="b" name="enable"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       GetVersion:
+                       @result: Success(0)
+                       @software: Software version
+                       @hardware: Hardware version
+
+                       Request to ...
+               -->
+               <method name="GetVersion">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="s" name="software"/>
+                       <arg direction="out" type="s" name="hardware"/>
+                       <arg direction="out" type="s" name="rf_cal_date"/>
+                       <arg direction="out" type="s" name="product_code"/>
+               </method>
+
+               <!--
+                       GetSerialNumber:
+                       @result: Success(0)
+                       @sn: serial number
+
+                       Request to ...
+               -->
+               <method name="GetSerialNumber">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="s" name="sn"/>
+               </method>
+
+               <!--
+                       GetIMEI:
+                       @result: Success(0)
+                       @imei: IMEI
+
+                       Request to ...
+               -->
+               <method name="GetIMEI">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="s" name="imei"/>
+               </method>
+
+               <method name="SetDunPinCtrl">
+                       <arg direction="in" type="i" name="signal"/>
+                       <arg direction="in" type="b" name="status"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       Power:
+                       @status: Online(0), Offline(1), Error(2)
+               -->
+               <signal name="Power">
+                       <arg type="i" name="status"/>
+               </signal>
+
+               <signal name="DunPinCtrl">
+                       <arg type="i" name="signal"/>
+                       <arg type="b" name="status"/>
+               </signal>
+
+               <signal name="DunExternalCall">
+                       <arg type="b" name="external_call"/>
+               </signal>
+
+               <!-- power: Power status -->
+               <property name="power" type="i" access="read"/>
+               <property name="imei" type="i" access="read"/>
+
+       </interface>
+
+</node>
diff --git a/introspection/network.xml b/introspection/network.xml
new file mode 100644 (file)
index 0000000..60c8a7e
--- /dev/null
@@ -0,0 +1,321 @@
+<node>
+       <!--
+               org.tizen.telephony.Network:
+               @short_description: Tizen Telephony Network interface
+
+               Network interface.
+
+       -->
+       <interface name="org.tizen.telephony.Network">
+               <!--
+                       Search:
+                       @result: Success(0)
+                       @list: An array of dict with network information. <para>dict key/value:</para><variablelist><varlistentry><term><literal>"plmn"</literal></term><listitem><type>string</type></listitem></varlistentry><varlistentry><term><literal>"act"</literal></term><listitem><type>int</type></listitem></varlistentry><varlistentry><term><literal>"type"</literal></term><listitem><type>int</type> Unknown(0), Home Plmn(1), Available Plmn(2), Forbidden Plmn(3)</listitem></varlistentry><varlistentry><term><literal>"name"</literal></term><listitem><type>string</type></listitem></varlistentry></variablelist>
+
+                       Request to do manual network selection to search for the available networks and provide the network list
+
+               -->
+               <method name="Search">
+                       <arg direction="out" type="aa{sv}" name="list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SearchCancel:
+                       @result: Success(0)
+
+                       Cancle the org.tizen.telephony.Network.Search() request.
+               -->
+               <method name="SearchCancel">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetSelectionMode:
+                       @mode: Selection mode. Automatic(0), Manual(1)
+                       @plmn: Plmn string.
+                       @act: Access technology. GSM(1), GPRS(2), EGPRS(3), UMTS(4), IS95A(17), IS95B(18), EHRPD(25), LTE(33)
+                       @result: Success(0)
+
+                       Set network selection mode
+               -->
+               <method name="SetSelectionMode">
+                       <arg direction="in" type="i" name="mode"/>
+                       <arg direction="in" type="s" name="plmn"/>
+                       <arg direction="in" type="i" name="act"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       GetSelectionMode:
+                       @mode: Selection mode. Manual(0), Automatic(1)
+                       @result: Success(0)
+
+                       Get network selection mode
+               -->
+               <method name="GetSelectionMode">
+                       <arg direction="out" type="i" name="mode"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetServiceDomain:
+                       @domain: Service domain. Combined(1), Circuit Service(2), Packet Service(3)
+                       @result: Success(0)
+
+                       Set network service domain
+               -->
+               <method name="SetServiceDomain">
+                       <arg direction="in" type="i" name="domain"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       GetServiceDomain:
+                       @domain: Service domain. Combined(1), Circuit Service(2), Packet Service(3)
+                       @result: Success(0)
+
+                       Get network service domain
+               -->
+               <method name="GetServiceDomain">
+                       <arg direction="out" type="i" name="domain"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetBand:
+                       @band: Network band. ANY(0), GSM850(1), GSM900_1800(2), GSM1900(3), GSM(4), WCDMA(5), WCDMA850(6), WCDMA1900(7), WCDMA2100(8), GSM900(9), GSM1800(10), GSM850_1900(11)
+                       @mode: Mode. Preferred(1), Only(2)
+                       @result: Success(0)
+
+                       Set network band
+               -->
+               <method name="SetBand">
+                       <arg direction="in" type="i" name="band"/>
+                       <arg direction="in" type="i" name="mode"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       GetBand:
+                       @band: Network band. ANY(0), GSM850(1), GSM900_1800(2), GSM1900(3), GSM(4), WCDMA(5), WCDMA850(6), WCDMA1900(7), WCDMA2100(8), GSM900(9), GSM1800(10), GSM850_1900(11)
+                       @mode: Mode. Preferred(1), Only(2)
+                       @result: Success(0)
+
+                       Get network band
+               -->
+               <method name="GetBand">
+                       <arg direction="out" type="i" name="band"/>
+                       <arg direction="out" type="i" name="mode"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetMode:
+                       @mode: Mode. Auto(0x0), GSM(0x1), WCDMA(0x2), CDMA(0x4), LTE(0x8)
+                       @result: Success(0)
+
+                       Set network mode
+               -->
+               <method name="SetMode">
+                       <arg direction="in" type="i" name="mode"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       GetMode:
+                       @mode: Mode. Auto(0x0), GSM(0x1), WCDMA(0x2), CDMA(0x4), LTE(0x8)
+                       @result: Success(0)
+
+                       Get network mode
+               -->
+               <method name="GetMode">
+                       <arg direction="out" type="i" name="mode"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetPreferredPlmn:
+                       @mode: add(1), edit(2), delete(3)
+                       @ef_index: Operator index in the EFplmnsel of the SIM
+                       @act: Access technology. GSM(1), GPRS(2), EGPRS(3), UMTS(4), IS95A(17), IS95B(18), EHRPD(25), LTE(33)
+                       @plmn: Plmn
+                       @result: Success(0)
+
+                       Set Preferred Plmn
+               -->
+               <method name="SetPreferredPlmn">
+                       <arg direction="in" type="i" name="mode"/>
+                       <arg direction="in" type="i" name="ef_index"/>
+                       <arg direction="in" type="i" name="act"/>
+                       <arg direction="in" type="s" name="plmn"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       GetPreferredPlmn:
+                       @list: A set of key/dict paris with preferred plmn list. <para>dict items are:</para><itemizedlist><listitem>"plmn" <type>string</type></listitem><listitem>"act" <type>int</type></listitem><listitem>"ef_index" <type>int</type></listitem></itemizedlist>
+                       @result: Success(0)
+
+                       Get Preferred Plmn list
+               -->
+               <method name="GetPreferredPlmn">
+                       <arg direction="out" type="aa{sv}" name="list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       GetServingNetwork:
+                       @act: Access technology. GSM(1), GPRS(2), EGPRS(3), UMTS(4), IS95A(17), IS95B(18), EHRPD(25), LTE(33)
+                       @plmn: Plmn string.
+                       @status: Registration status. NOT REGISTER(1), REGISTER HOME(2), SEARCHING(3), DENIED(4), UNKNOWN(5), REGISTER ROAM(6)
+                       @lac: Location Area Code.
+                       @result: Success(0)
+
+                       Set power on attach configuration
+               -->
+               <method name="GetServingNetwork">
+                       <arg direction="out" type="i" name="act"/>
+                       <!-- arg direction="out" type="i" name="status" -->
+                       <arg direction="out" type="s" name="plmn"/>
+                       <arg direction="out" type="i" name="lac"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       RegistrationStatus:
+                       @circuit: Circuit service status.
+                       @packet: Packet service status.
+                       @type: Service type. UNKNOWN(0), NO SERVICE(1), EMERGENCY(2), SEARCH(3), 2G(4), 2.5G(5), 2.5G EDGE(6), 3G(7)
+                       @roaming: Roaming status.
+
+                       Network registration status.
+               -->
+               <signal name="RegistrationStatus">
+                       <arg type="i" name="circuit"/>
+                       <arg type="i" name="packet"/>
+                       <arg type="i" name="type"/>
+                       <arg type="b" name="roaming"/>
+               </signal>
+
+               <!--
+                       Info:
+                       @rssi: Radio Signal Strength infomation. (0 ~ 6)
+                       @battery: Battery information. (0 ~ 5)
+
+                       RSSI and Battery information.
+               -->
+               <signal name="Info">
+                       <arg type="i" name="rssi"/>
+                       <arg type="i" name="battery"/>
+               </signal>
+
+               <!--
+                       Change:
+                       @act: Access technology. GSM(1), GPRS(2), EGPRS(3), UMTS(4), IS95A(17), IS95B(18), EHRPD(25), LTE(33)
+                       @plmn: Plmn string.
+                       @lac: Location Area Code.
+
+                       Network change.
+               -->
+               <signal name="Change">
+                       <arg type="i" name="act"/>
+                       <arg type="s" name="plmn"/>
+                       <arg type="i" name="lac"/>
+               </signal>
+
+               <!--
+                       TimeInfo:
+                       @year: Year. (year - 2000). e.g. 2012 is 12
+                       @month: Month. (1 ~ 12)
+                       @day: Day (1 ~ 31)
+                       @hour: Hour (0 ~ 23)
+                       @minute: Minute (0 ~ 59)
+                       @second: Second (0 ~ 59)
+                       @wday: Day of week (0:Sunday ~ 6:Saturday)
+                       @gmtoff: GMT Offset (minutes). e.g. GMT+9 is 540
+                       @dstoff: Daylight adjust time. (hours)
+                       @isdst: Daylight flag
+                       @plmn: Plmn
+
+                       Network time information.
+               -->
+               <signal name="TimeInfo">
+                       <arg type="i" name="year"/>
+                       <arg type="i" name="month"/>
+                       <arg type="i" name="day"/>
+                       <arg type="i" name="hour"/>
+                       <arg type="i" name="minute"/>
+                       <arg type="i" name="second"/>
+                       <arg type="i" name="wday"/>
+                       <arg type="i" name="gmtoff"/>
+                       <arg type="i" name="dstoff"/>
+                       <arg type="b" name="isdst"/>
+                       <arg type="s" name="plmn"/>
+               </signal>
+
+               <!--
+                       Identity:
+                       @plmn: Plmn string.
+                       @short_name: Network name (short - 16 bytes)
+                       @full_name: Network name (full - 32 bytes)
+
+                       Network identity information.
+               -->
+               <signal name="Identity">
+                       <arg type="s" name="plmn"/>
+                       <arg type="s" name="short_name"/>
+                       <arg type="s" name="full_name"/>
+               </signal>
+
+               <!--
+                       CellInfo:
+                       @lac: Location Area Code.
+                       @cell_id: Cell ID
+
+                       Network location and cell information.
+               -->
+               <signal name="CellInfo">
+                       <arg type="i" name="lac"/>
+                       <arg type="i" name="cell_id"/>
+               </signal>
+
+               <!-- rssi: 0 ~ 5 -->
+               <property name="rssi" type="i" access="read"/>
+
+               <!-- lac: Location Area Code -->
+               <property name="lac" type="i" access="read"/>
+
+               <!-- plmn: PLMN -->
+               <property name="plmn" type="s" access="read"/>
+
+               <!-- cell_id: Cell ID -->
+               <property name="cell_id" type="i" access="read"/>
+
+               <!-- network_name: Network Name -->
+               <property name="network_name" type="s" access="read"/>
+
+               <!-- service_type: Service Type -->
+               <property name="service_type" type="i" access="read"/>
+
+               <!-- network_type: Network Type (0=NONE, 1=HSDPA, 2=HSUPA, 3=HSPA) -->
+               <property name="network_type" type="i" access="read"/>
+
+               <!-- circuit_status: Circuit domain status -->
+               <property name="circuit_status" type="i" access="read"/>
+
+               <!-- packet_status: Packet domain status -->
+               <property name="packet_status" type="i" access="read"/>
+
+               <!-- roaming_status: Roaming status -->
+               <property name="roaming_status" type="b" access="read"/>
+
+               <!-- name_priority: Network name, SPN name display priority -->
+               <property name="name_priority" type="i" access="read"/>
+
+               <!-- spn_name: SPN name -->
+               <property name="spn_name" type="s" access="read"/>
+
+       </interface>
+
+</node>
diff --git a/introspection/phonebook.xml b/introspection/phonebook.xml
new file mode 100644 (file)
index 0000000..f7e239b
--- /dev/null
@@ -0,0 +1,94 @@
+<node>
+
+       <interface name="org.tizen.telephony.Phonebook">
+               <method name="GetInitStatus">
+                       <arg direction="out" type="i" name="init_status"/>
+                       <arg direction="out" type="b" name="b_fdn"/>
+                       <arg direction="out" type="b" name="b_adn"/>
+                       <arg direction="out" type="b" name="b_sdn"/>
+                       <arg direction="out" type="b" name="b_usim"/>
+                       <arg direction="out" type="b" name="b_aas"/>
+                       <arg direction="out" type="b" name="b_gas"/>
+               </method>
+
+               <method name="GetCount">
+                       <arg direction="in" type="i" name="req_type"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_type"/>
+                       <arg direction="out" type="i" name="used"/>
+                       <arg direction="out" type="i" name="total"/>
+               </method>
+
+               <method name="GetInfo">
+                       <arg direction="in" type="i" name="req_type"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_type"/>
+                       <arg direction="out" type="i" name="index_min"/>
+                       <arg direction="out" type="i" name="index_max"/>
+                       <arg direction="out" type="i" name="number_length_max"/>
+                       <arg direction="out" type="i" name="text_length_max"/>
+               </method>
+
+               <method name="GetUsimMetaInfo">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="aa{sv}" name="list"/>
+               </method>
+
+               <method name="ReadRecord">
+                       <arg direction="in" type="i" name="req_type"/>
+                       <arg direction="in" type="i" name="index"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_type"/>
+                       <arg direction="out" type="i" name="index"/>
+                       <arg direction="out" type="i" name="next_index"/>
+                       <arg direction="out" type="s" name="name"/>
+                       <arg direction="out" type="i" name="dcs"/>
+                       <arg direction="out" type="s" name="number"/>
+                       <arg direction="out" type="i" name="ton"/>
+                       <arg direction="out" type="s" name="number2"/>
+                       <arg direction="out" type="i" name="number2_ton"/>
+                       <arg direction="out" type="s" name="number3"/>
+                       <arg direction="out" type="i" name="number3_ton"/>
+                       <arg direction="out" type="s" name="number4"/>
+                       <arg direction="out" type="i" name="number4_ton"/>
+                       <arg direction="out" type="s" name="email1"/>
+                       <arg direction="out" type="s" name="email2"/>
+                       <arg direction="out" type="s" name="email3"/>
+                       <arg direction="out" type="s" name="email4"/>
+                       <arg direction="out" type="i" name="group_index"/>
+               </method>
+
+               <method name="UpdateRecord">
+                       <arg direction="in" type="i" name="type"/>
+                       <arg direction="in" type="i" name="index"/>
+                       <arg direction="in" type="s" name="name"/>
+                       <arg direction="in" type="i" name="dcs"/>
+                       <arg direction="in" type="s" name="number"/>
+                       <arg direction="in" type="i" name="ton"/>
+                       <arg direction="in" type="s" name="number2"/>
+                       <arg direction="in" type="i" name="number2_ton"/>
+                       <arg direction="in" type="s" name="number3"/>
+                       <arg direction="in" type="i" name="number3_ton"/>
+                       <arg direction="in" type="s" name="number4"/>
+                       <arg direction="in" type="i" name="number4_ton"/>
+                       <arg direction="in" type="s" name="email1"/>
+                       <arg direction="in" type="s" name="email2"/>
+                       <arg direction="in" type="s" name="email3"/>
+                       <arg direction="in" type="s" name="email4"/>
+                       <arg direction="in" type="i" name="group_index"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="DeleteRecord">
+                       <arg direction="in" type="i" name="type"/>
+                       <arg direction="in" type="i" name="index"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <signal name="Status">
+                       <arg type="i" name="status"/>
+               </signal>
+
+       </interface>
+
+</node>
diff --git a/introspection/sap.xml b/introspection/sap.xml
new file mode 100644 (file)
index 0000000..1125695
--- /dev/null
@@ -0,0 +1,55 @@
+<node>
+
+       <interface name="org.tizen.telephony.Sap">
+
+               <method name="Connect">
+                       <arg direction="in" type="i" name="req_max_size"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_max_size"/>
+               </method>
+
+               <method name="Disconnect">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetStatus">
+                       <arg direction="out" type="i" name="status"/>
+               </method>
+
+               <method name="GetATR">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="v" name="atr"/>
+               </method>
+
+               <method name="TransferAPDU">
+                       <arg direction="in" type="v" name="req_apdu"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="v" name="resp_apdu"/>
+               </method>
+
+               <method name="SetProtocol">
+                       <arg direction="in" type="i" name="protocol"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="SetPower">
+                       <arg direction="in" type="i" name="mode"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetCardReaderStatus">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="status"/>
+               </method>
+
+               <signal name="status">
+                       <arg type="i" name="status"/>
+               </signal>
+
+               <signal name="disconnect">
+                       <arg type="i" name="type"/>
+               </signal>
+
+       </interface>
+
+</node>
diff --git a/introspection/sat.xml b/introspection/sat.xml
new file mode 100644 (file)
index 0000000..c44044c
--- /dev/null
@@ -0,0 +1,265 @@
+<node>
+       <!--
+               org.tizen.telephony.SAT:
+               @short_description: Tizen Telephony SIM Application Toolkit interface
+
+               SAT interface.
+
+       -->
+       <interface name="org.tizen.telephony.SAT">
+       
+               <method name="GetMainMenuInfo">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="command_id"/>
+                       <arg direction="out" type="b" name="menu_present"/>
+                       <arg direction="out" type="s" name="main_title"/>
+                       <arg direction="out" type="v" name="menu_item"/>
+                       <arg direction="out" type="i" name="menu_count"/>
+                       <arg direction="out" type="b" name="menu_help_info"/>
+                       <arg direction="out" type="b" name="menu_updated"/>
+                       <arg direction="out" type="v" name="icon_id"/>
+                       <arg direction="out" type="v" name="icon_id_list"/>
+               </method>
+                                               
+               <method name="SendUiDisplayStatus">
+                       <arg direction="in" type="i" name="command_id"/>
+                       <arg direction="in" type="b" name="display_status"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+               
+               <method name="SendUserConfirm">
+                       <arg direction="in" type="i" name="command_id"/>
+                       <arg direction="in" type="i" name="command_type"/>
+                       <arg direction="in" type="i" name="user_confirm_type"/>
+                       <arg direction="in" type="v" name="additional_data"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>               
+                               
+               <method name="SelectMenu">
+                       <arg direction="in" type="i" name="item_identifier"/>
+                       <arg direction="in" type="b" name="help_request"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="envelop_rsp"/>
+               </method>
+               
+               <method name="DownloadEvent">
+                       <arg direction="in" type="i" name="event_download_type"/>
+                       <arg direction="in" type="i" name="src_device"/>
+                       <arg direction="in" type="i" name="dest_device"/>
+                       <arg direction="in" type="v" name="download_data"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="envelop_rsp"/>
+               </method>
+
+               <method name="SendAppExecResult">
+                       <arg direction="in" type="i" name="command_id"/>
+                       <arg direction="in" type="i" name="command_type"/>
+                       <arg direction="in" type="v" name="exec_result"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <signal name="SetupMenu">
+                       <arg type="i" name="command_id"/>
+                       <arg type="b" name="menu_present"/>
+                       <arg type="s" name="main_title"/>
+                       <arg type="v" name="menu_item"/>
+                       <arg type="i" name="menu_count"/>
+                       <arg type="b" name="menu_help_info"/>
+                       <arg type="b" name="menu_updated"/>
+               </signal>
+               
+               <signal name="DisplayText">
+                       <arg type="i" name="command_id"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+                       <arg type="i" name="duration"/>
+                       <arg type="b" name="priority_high"/>
+                       <arg type="b" name="user_rsp_required"/>
+                       <arg type="b" name="immediately_rsp"/>
+               </signal>
+               
+               <signal name="SelectItem">
+                       <arg type="i" name="command_id"/>
+                       <arg type="b" name="help_info"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+                       <arg type="i" name="default_item_index"/>
+                       <arg type="i" name="menu_count"/>
+                       <arg type="v" name="menu_item"/>
+               </signal>
+               
+               <signal name="GetInkey">
+                       <arg type="i" name="command_id"/>
+                       <arg type="i" name="key_type"/>
+                       <arg type="i" name="input_alphabet_type"/>
+                       <arg type="b" name="numeric"/>
+                       <arg type="b" name="help_info"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+                       <arg type="i" name="duration"/>
+               </signal>
+               
+               <signal name="GetInput">
+                       <arg type="i" name="command_id"/>
+                       <arg type="i" name="input_alphabet_type"/>
+                       <arg type="b" name="numeric"/>
+                       <arg type="b" name="help_info"/>
+                       <arg type="b" name="echo_input"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+                       <arg type="i" name="response_len_max"/>
+                       <arg type="i" name="response_len_min"/>
+                       <arg type="s" name="default_text"/>
+                       <arg type="i" name="default_text_len"/>
+               </signal>
+               
+               <signal name="PlayTone">
+                       <arg type="i" name="command_id"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+                       <arg type="i" name="tone_type"/>
+                       <arg type="i" name="duration"/>
+               </signal>
+                               
+               <signal name="SendSMS">
+                       <arg type="i" name="command_id"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+                       <arg type="b" name="packing_required"/>
+                       <arg type="i" name="ton"/>
+                       <arg type="i" name="npi"/>
+                       <arg type="s" name="dialling_number"/>
+                       <arg type="i" name="number_len"/>
+                       <arg type="i" name="tpdu_type"/>
+                       <arg type="v" name="tpdu_data"/>
+                       <arg type="i" name="tpdu_data_len"/>
+               </signal>
+               
+               <signal name="SendSS">
+                       <arg type="i" name="command_id"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+                       <arg type="i" name="ton"/>
+                       <arg type="i" name="npi"/>
+                       <arg type="s" name="ss_string"/>
+               </signal>
+
+               <signal name="SetupUSSD">
+                       <arg type="i" name="command_id"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+                       <arg type="s" name="ussd_string"/>
+               </signal>
+
+               <signal name="SetupCall">
+                       <arg type="i" name="command_id"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+                       <arg type="i" name="call_type"/>
+                       <arg type="s" name="call_number"/>
+                       <arg type="i" name="duration"/>
+               </signal>
+               
+               <signal name="SetupEventList">
+                       <arg type="i" name="event_cnt"/>
+                       <arg type="v" name="evt_list"/>
+               </signal>
+
+               <signal name="SetupIdleModeText">
+                       <arg type="i" name="command_id"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+               </signal>
+                               
+               <signal name="OpenChannel">
+                       <arg type="i" name="command_id"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+                       <arg type="b" name="immediate_link"/>
+                       <arg type="b" name="auto_reconnection"/>
+                       <arg type="b" name="bg_mode"/>
+                       <arg type="i" name="bearer_type"/>
+                       <arg type="v" name="bearer_param"/>
+                       <arg type="i" name="buffer_size"/>
+                       <arg type="i" name="protocol_type"/>
+                       <arg type="i" name="port_number"/>
+                       <arg type="i" name="data_dest_address_type"/>
+                       <arg type="s" name="data_dest_address"/>
+                       <arg type="v" name="bearer_detail"/>
+               </signal>
+
+               <signal name="CloseChannel">
+                       <arg type="i" name="command_id"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+                       <arg type="i" name="channel_id"/>
+               </signal>
+                               
+               <signal name="ReceiveData">
+                       <arg type="i" name="command_id"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+                       <arg type="i" name="channel_id"/>
+                       <arg type="i" name="data_len"/>
+               </signal>
+
+               <signal name="SendData">
+                       <arg type="i" name="command_id"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+                       <arg type="i" name="channel_id"/>
+                       <arg type="b" name="send_data_immediately"/>
+                       <arg type="v" name="channel_data"/>
+                       <arg type="i" name="channel_data_len"/>
+               </signal>
+
+               <signal name="GetChannelStatus">
+                       <arg type="i" name="command_id"/>
+               </signal>
+
+               <signal name="Refresh">
+                       <arg type="i" name="command_id"/>
+                       <arg type="i" name="refresh_type"/>
+                       <arg type="v" name="file_list"/>
+               </signal>
+               
+               <signal name="MoreTime">
+               </signal>
+               
+               <signal name="SendDtmf">
+                       <arg type="i" name="command_id"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+                       <arg type="s" name="dtmf_str"/>
+                       <arg type="i" name="dtmf_str_len"/>
+               </signal>
+               
+               <signal name="LaunchBrowser">
+                       <arg type="i" name="command_id"/>
+                       <arg type="i" name="browser_id"/>
+                       <arg type="s" name="url"/>
+                       <arg type="i" name="url_len"/>
+                       <arg type="s" name="gateway_proxy"/>
+                       <arg type="i" name="gateway_proxy_len"/>
+                       <arg type="s" name="text"/>
+                       <arg type="i" name="text_len"/>
+               </signal>
+               
+               <signal name="ProvideLocalInfo">
+                       <arg type="i" name="command_id"/>
+                       <arg type="i" name="info_type"/>
+               </signal>
+               
+               <signal name="LanguageNotification">
+                       <arg type="i" name="command_id"/>
+                       <arg type="i" name="language"/>
+                       <arg type="b" name="b_specified"/>
+               </signal>
+
+               <signal name="EndProactiveSession">
+                       <arg type="i" name="command_type"/>
+               </signal>
+               
+       </interface>
+       
+</node>
diff --git a/introspection/sim.xml b/introspection/sim.xml
new file mode 100644 (file)
index 0000000..f0d68f9
--- /dev/null
@@ -0,0 +1,195 @@
+<node>
+
+       <interface name="org.tizen.telephony.Sim">
+               <method name="GetInitStatus">
+                       <arg direction="out" type="i" name="init_status"/>
+                       <arg direction="out" type="b" name="sim_changed"/>
+               </method>
+
+               <method name="GetCardType">
+                       <arg direction="out" type="i" name="card_type"/>
+               </method>
+
+               <method name="GetIMSI">
+                       <arg direction="out" type="s" name="plmn"/>
+                       <arg direction="out" type="s" name="msin"/>
+               </method>               
+               
+               <method name="GetECC">
+                       <arg direction="out" type="aa{sv}" name="ecc_list"/>
+               <!-- dict
+                    "name"     STRING (emergency call code alpha id)
+                    "number" STRING (emergency call code)
+                    "category" STRING "police"/"ambulance"/"firebrigade"/"maraineguard"/"mountainrescue"
+               -->
+               </method>
+
+               <method name="GetICCID">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="s" name="iccid"/>
+               </method>
+
+               <method name="GetLanguage">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="language"/>
+               </method>
+
+               <method name="SetLanguage">
+                       <arg direction="in" type="i" name="language"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetCallforwarding">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="b" name="line1"/>
+                       <arg direction="out" type="b" name="line2"/>
+               </method>
+
+               <method name="GetMessageWaiting">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="line1"/>
+                       <arg direction="out" type="i" name="line2"/>
+                       <arg direction="out" type="i" name="fax"/>
+                       <arg direction="out" type="i" name="video"/>
+               </method>
+
+               <method name="GetMailbox">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="aa{sv}" name="list"/>
+               <!-- dict
+                    "type" STRING "voice1"/"voice2"/"fax"/"video"
+                    "name" STRING (mailbox alpha id)
+                    "number" STRING (mailbox number)
+                    "ton" INT refer {enum tel_sim_ton}
+               -->
+               </method>
+
+               <method name="GetCPHSInfo">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="phase"/>
+                       <arg direction="out" type="b" name="ons_short"/>
+                       <arg direction="out" type="b" name="mailbox_number"/>
+                       <arg direction="out" type="b" name="sst"/>
+                       <arg direction="out" type="b" name="csp"/>
+                       <arg direction="out" type="b" name="info_number"/>
+               </method>
+
+               <method name="GetMSISDN">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="aa{sv}" name="list"/>
+               <!-- dict
+                    "name" STRING (MSISDN alpha id)
+                    "number" STRING (MSISDN number)
+               -->
+               </method>
+
+               <method name="GetOplmnwact">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="aa{sv}" name="list"/>
+               <!-- dict
+                    "plmn" STRING
+                    "b_umts" BOOLEAN TRUE/FALSE 
+                    "b_gsm" BOOLEAN TRUE/FALSE
+               -->
+               </method>
+
+               <method name="GetSpn">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="y" name="display_condition"/>
+                       <arg direction="out" type="s" name="spn"/>
+               </method>               
+
+               <method name="GetCphsNetName">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="s" name="full_name"/>
+                       <arg direction="out" type="s" name="short_name"/>
+               </method>
+
+               <method name="Authentication">
+                       <arg direction="in" type="i" name="type"/>
+                       <arg direction="in" type="v" name="rand"/>
+                       <arg direction="in" type="v" name="autn"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_type"/>
+                       <arg direction="out" type="i" name="auth_result"/>
+                       <arg direction="out" type="v" name="authentication_key"/>
+                       <arg direction="out" type="v" name="cipher_data"/>
+                       <arg direction="out" type="v" name="integrity_data"/>
+                       <arg direction="out" type="v" name="resp_data"/>
+               </method>
+
+               <method name="VerifySec">
+                       <arg direction="in" type="i" name="type"/>
+                       <arg direction="in" type="s" name="password"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_type"/>
+                       <arg direction="out" type="i" name="retry_count"/>
+               </method>
+
+               <method name="VerifyPUK">
+                       <arg direction="in" type="i" name="type"/>
+                       <arg direction="in" type="s" name="puk"/>
+                       <arg direction="in" type="s" name="new_pin"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_type"/>
+                       <arg direction="out" type="i" name="retry_count"/>
+               </method>
+
+               <method name="ChangePIN">
+                       <arg direction="in" type="i" name="type"/>
+                       <arg direction="in" type="s" name="old_password"/>
+                       <arg direction="in" type="s" name="new_password"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_type"/>
+                       <arg direction="out" type="i" name="retry_count"/>
+               </method>
+
+               <method name="DisableFacility">
+                       <arg direction="in" type="i" name="type"/>
+                       <arg direction="in" type="s" name="password"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_type"/>
+                       <arg direction="out" type="i" name="retry_count"/>
+               </method>
+
+               <method name="EnableFacility">
+                       <arg direction="in" type="i" name="type"/>
+                       <arg direction="in" type="s" name="password"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_type"/>
+                       <arg direction="out" type="i" name="retry_count"/>
+               </method>
+
+               <method name="GetFacility">
+                       <arg direction="in" type="i" name="type"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_type"/>
+                       <arg direction="out" type="i" name="status"/>
+               </method>
+
+               <method name="GetLockInfo">
+                       <arg direction="in" type="i" name="type"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="resp_type"/>
+                       <arg direction="out" type="i" name="status"/>
+                       <arg direction="out" type="i" name="retry_count"/>
+               </method>
+
+               <method name="TransferAPDU">
+                       <arg direction="in" type="v" name="apdu"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="v" name="resp_apdu"/>
+               </method>
+
+               <method name="GetATR">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="v" name="atr"/>
+               </method>
+
+               <signal name="Status">
+                       <arg type="i" name="status"/>
+               </signal>
+
+       </interface>
+
+</node>
diff --git a/introspection/sms.xml b/introspection/sms.xml
new file mode 100644 (file)
index 0000000..ff4b81d
--- /dev/null
@@ -0,0 +1,400 @@
+<node>
+       <!--
+               org.tizen.telephony.sms:
+               @short_description: Tizen Telephony SMS interface
+
+               SMS interface.
+
+       -->
+       <interface name="org.tizen.telephony.sms">
+               <!--
+                       SendMsg:
+                       @sca: Service Center Address
+                       @tpdu_length: Size of the array which is actual TPDU message
+                       @tpdu_data: SMS TPDU message
+                       @moreMsg: MoreMsgToSend
+                       @result: Success(0)
+
+                       Sends an SMS message to the networ
+               -->
+               <method name="SendMsg">
+                       <arg direction="in" type="s" name="sca"/>
+                       <arg direction="in" type="i" name="tpdu_length"/>
+                       <arg direction="in" type="s" name="tpdu_data"/>
+                       <arg direction="in" type="i" name="moreMsg"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       ReadMsg:
+                       @index: Index number of the message to be read
+                       @result: Success(0)
+                       @msg_status: Message status. READ(0),UNREAD(1) SENT(2), UNSENT(3), DELIVERED(4), DELIVERY_UNCONFIRMED(5), MESSAGE_REPLACED(6), RESERVED(7)
+                       @sca: Service Center Address
+                       @tpdu_length: Size of the array which is actual TPDU message
+                       @tpdu_data: SMS TPDU message
+
+                       Reads a message from SIM card storage.
+               -->
+               <method name="ReadMsg">
+                       <arg direction="in" type="i" name="index"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="msg_status"/>
+                       <arg direction="out" type="s" name="sca"/>
+                       <arg direction="out" type="i" name="tpdu_length"/>
+                       <arg direction="out" type="s" name="tpdu_data"/>
+               </method>
+
+               <!--
+                       SaveMsg:
+                       @msg_status: Message status. READ(0),UNREAD(1) SENT(2), UNSENT(3), DELIVERED(4), DELIVERY_UNCONFIRMED(5), MESSAGE_REPLACED(6), RESERVED(7)
+                       @sca: Service Center Address
+                       @tpdu_length: Size of the array which is actual TPDU message
+                       @tpdu_data: SMS TPDU message
+                       @result: Success(0)
+                       @index: Index number of the message to be saved
+
+                       Saves a message to SIM storage area.
+               -->
+               <method name="SaveMsg">
+                       <arg direction="in" type="i" name="msg_status"/>
+                       <arg direction="in" type="s" name="sca"/>
+                       <arg direction="in" type="i" name="tpdu_length"/>
+                       <arg direction="in" type="s" name="tpdu_data"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="index"/>
+               </method>
+
+               <!--
+                       DeleteMsg:
+                       @index: Message index to delete.
+                       @result: Success(0)
+
+                       Deletes a message specified by index (SIM index used when storing the SMS)
+               -->
+               <method name="DeleteMsg">
+                       <arg direction="in" type="i" name="index"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       GetMsgCount:
+                       @result: Success(0)
+                       @totalCount: Total count of messages stored in SIM
+                       @usedCount: Stored message count in SIM
+                       @indexList: Message index list stored in SIM.
+
+                       Retrieve message count information like Total record count, used record count and the indices list for SIM Storage.
+               -->
+               <method name="GetMsgCount">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="totalCount"/>
+                       <arg direction="out" type="i" name="usedCount"/>
+                       <arg direction="out" type="s" name="indexList"/>
+               </method>
+
+               <!--
+                       GetSca:
+                       @index: The record index of the Service center address information in the EF
+                       @result: Success(0)
+                       @ton: Type of number. UNKNOWN(0), INTERNATIONAL(1), NATIONAL(2), NETWORK_SPECIFIC(3), DEDICATED_ACCESS(4), ALPHA_NUMERIC(5), ABBREVIATED_NUMBER(6), RESERVED_FOR_EXT(7).
+                       @npi: Numbering plan identification. UNKNOWN(0), ISDN_TEL(1), DATA_NUMBERING_PLAN(3), TELEX(4), SVC_CNTR_SPECIFIC_PLAN(5), SVC_CNTR_SPECIFIC_PLAN2(6), NATIONAL(8), PRIVATE(9), ERMES_NUMBERING_PLAN(10), RESERVED_FOR_EXT(0xF)
+                       @dialNumberLength: length of address. If Service center address is not set, then this will be zero
+                       @dialNumber: destination address. If Address not set, then set to 0xFF
+
+                       Get current SMS Service Centre Address information.
+               -->
+               <method name="GetSca">
+                       <arg direction="in" type="i" name="index"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="ton"/>
+                       <arg direction="out" type="i" name="npi"/>
+                       <arg direction="out" type="i" name="dialNumberLength"/>
+                       <arg direction="out" type="s" name="dialNumber"/>
+               </method>
+
+               <!--
+                       SetSca:
+                       @index: The record index of the Service center address information in the EF.
+                       @ton: Type of number. UNKNOWN(0), INTERNATIONAL(1), NATIONAL(2), NETWORK_SPECIFIC(3), DEDICATED_ACCESS(4), ALPHA_NUMERIC(5), ABBREVIATED_NUMBER(6), RESERVED_FOR_EXT(7).
+                       @npi: Numbering plan identification. UNKNOWN(0), ISDN_TEL(1), DATA_NUMBERING_PLAN(3), TELEX(4), SVC_CNTR_SPECIFIC_PLAN(5), SVC_CNTR_SPECIFIC_PLAN2(6), NATIONAL(8), PRIVATE(9), ERMES_NUMBERING_PLAN(10), RESERVED_FOR_EXT(0xF)
+                       @dialNumberLength: length of address. If Service center address is not set, then this will be zero
+                       @dialNumber: destination address. If Address not set, then set to 0xFF
+                       @result: Success(0)
+
+                       Set SMS Service Centre Address information in order to send the SMS.
+               -->
+               <method name="SetSca">
+                       <arg direction="in" type="i" name="index"/>
+                       <arg direction="in" type="i" name="ton"/>
+                       <arg direction="in" type="i" name="npi"/>
+                       <arg direction="in" type="i" name="dialNumberLength"/>
+                       <arg direction="in" type="s" name="dialNumber"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       GetCbConfig:
+                       @result: Success(0)
+                       @cbEnable: CB service state. If cb_enabled is true then cell broadcast service will be enabled 
+                       @slectedId: CBMI Identifier selected (all or some)
+                       @msgIdMaxCount: CB Channel List Max Count
+                       @msgIdCount: CB message ID count
+                       @msgId: CB message ID information
+
+                       Retrieve SMS CB configuration options from EFcbmi file in the SIM.
+               -->
+               <method name="GetCbConfig">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="cbEnable"/>
+                       <arg direction="out" type="i" name="slectedId"/>
+                       <arg direction="out" type="i" name="msgIdMaxCount"/>
+                       <arg direction="out" type="i" name="msgIdCount"/>
+                       <arg direction="out" type="s" name="msgId"/>
+               </method>
+
+               <!--
+                       SetCbConfig:
+                       @cbEnable: CB service state. If cb_enabled is true then cell broadcast service will be enabled
+                       @slectedId: CBMI Identifier selected (all or some)
+                       @msgIdMaxCount: CB Channel List Max Count
+                       @msgIdCount: CB message ID count
+                       @msgId: CB message ID information
+                       @result: Success(0)
+
+                       Set SMS CB Message Identifiers in the appropriate EF-CBMI/EF-CBMIR file in (U)SIM.
+               -->
+               <method name="SetCbConfig">
+                       <arg direction="in" type="i" name="cbEnable"/>
+                       <arg direction="in" type="i" name="slectedId"/>
+                       <arg direction="in" type="i" name="msgIdMaxCount"/>
+                       <arg direction="in" type="i" name="msgIdCount"/>
+                       <arg direction="in" type="s" name="msgId"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetMemStatus:
+                       @memoryStatus: the memory status type. PDA_MEMORY_AVAILABLE(1), PDA_MEMORY_FULL(2), PHONE_MEMORY_AVAILABLE(3), PHONE_MEMORY_FULL(4).
+                       @result: Success(0)
+
+                       This method is used by the applications to inform CP(modem) about the memory status of AP (whether FULL or AVAILABLE) so that modem can inform network.
+               -->
+               <method name="SetMemStatus">
+                       <arg direction="in" type="i" name="memoryStatus"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       GetPrefBearer:
+                       @result: Success(0)
+
+                       Get SMS preferred bearer on which SMS has to be transmitted.
+               -->
+               <method name="GetPrefBearer">
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetPrefBearer:
+                       @bearerType: the bearer type. PS_ONLY(1), CS_ONLY(2), PS_PREFERRED(3), CS_PREFERRED(4), NO_PREFERRED_BEARER(5)
+                       @result: Success(0)
+
+                       Set SMS preferred bearer on which SMS has to be transmitted.
+               -->
+               <method name="SetPrefBearer">
+                       <arg direction="in" type="i" name="bearerType"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetDeliveryReport:
+                       @sca: Service Centre address
+                        @tpdu_length: Size of the array which is actual TPDU message
+                        @tpdu_data: SMS TPDU message
+                       @rpCause: Indicates the reason for SMS-DELIVER failure
+                       @result: Success(0)
+
+                       Send a delivery report for the received incoming SMS to the network.
+               -->
+               <method name="SetDeliveryReport">
+                       <arg direction="in" type="s" name="sca"/>
+                       <arg direction="in" type="i" name="tpdu_length"/>
+                       <arg direction="in" type="s" name="tpdu_data"/>
+                       <arg direction="in" type="i" name="rpCause"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       SetMsgStatus:
+                       @index: Index of the message whose status has to be set.
+                       @msgStatus: Message status. READ(0),UNREAD(1) SENT(2), UNSENT(3), DELIVERED(4), DELIVERY_UNCONFIRMED(5), MESSAGE_REPLACED(6), RESERVED(7)
+                       @result: Success(0)
+
+                       This /method is used by the applications to set the message status in the SIM EF.
+               -->
+               <method name="SetMsgStatus">
+                       <arg direction="in" type="i" name="index"/>
+                       <arg direction="in" type="i" name="msgStatus"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       GetSmsParams:
+                       @index: SIM index where the SMS is stored
+                       @result: Success(0)
+                       @recordIndex: Index
+                       @recordLen: SMS Parameter Record length
+                       @alphaIdLen: Alpha id length
+                       @alphaId: Alpha id. It is a unique identifier for each row/record in EFsmsp
+                       @paramIndicator: SMS parameter indicator is a 1 byte value. Each bit in this value indicates the presence/absence of the sms header parameters.
+                       @destAddr_DialNumLen: TP-DA(TP-destination address). length of address. If Service center address is not set, then this will be zero
+                       @destAddr_Ton: TP-DA, Type of number
+                       @destAddr_Npi: TP-DA, Numbering plan identification
+                       @destAddr_DiallingNum: TP-DA, destination address. If Address not set, then set to 0xFF 
+                       @svcCntrAddr_DialNumLen: TP-service center address. length of address
+                       @SvcCntrAddr_Ton: TP-service center address. Type of number
+                       @svcCntrAddr_Npi: TP-service center address. Numbering plan identification
+                       @svcCntrAddr_DialNum: TP-service center address. destination address. If Address not set, then set to 0xFF
+                       @protocolId: TP-protocol Id
+                       @dataCodingScheme:  TP-data coding scheme
+                       @validityPeriod: TP-validity period
+
+                       Get the SMS parameters for a particular SMS (sent/received) based on the SIM index(EFsmsp) where it is stored.
+               -->
+               <method name="GetSmsParams">
+                       <arg direction="in" type="i" name="index"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="recordIndex"/>
+                       <arg direction="out" type="i" name="recordLen"/>
+                       <arg direction="out" type="i" name="alphaIdLen"/>
+                       <arg direction="out" type="s" name="alphaId"/>
+                       <arg direction="out" type="i" name="paramIndicator"/>
+                       <arg direction="out" type="i" name="destAddr_DialNumLen"/>
+                       <arg direction="out" type="i" name="destAddr_Ton"/>
+                       <arg direction="out" type="i" name="destAddr_Npi"/>
+                       <arg direction="out" type="s" name="destAddr_DiallingNum"/>
+                       <arg direction="out" type="i" name="svcCntrAddr_DialNumLen"/>
+                       <arg direction="out" type="i" name="SvcCntrAddr_Ton"/>
+                       <arg direction="out" type="i" name="svcCntrAddr_Npi"/>
+                       <arg direction="out" type="s" name="svcCntrAddr_DialNum"/>
+                       <arg direction="out" type="i" name="protocolId"/>
+                       <arg direction="out" type="i" name="dataCodingScheme"/>
+                       <arg direction="out" type="i" name="validityPeriod"/>
+               </method>
+
+               <!--
+                       SetSmsParams:
+                       @recordIndex: Index
+                       @recordLen: SMS Parameter Record length
+                       @alphaIdLen: Alpha id length
+                       @alphaId: Alpha id. It is a unique identifier for each row/record in EFsmsp
+                       @paramIndicator: SMS parameter indicator is a 1 byte value. Each bit in this value indicates the presence/absence of the sms header parameters.
+                       @destAddr_DialNumLen: TP-DA(TP-destination address). length of address. If Service center address is not set, then this will be zero
+                       @destAddr_Ton: TP-DA, Type of number
+                       @destAddr_Npi: TP-DA, Numbering plan identification
+                       @destAddr_DiallingNum: TP-DA, destination address. If Address not set, then set to 0xFF 
+                       @svcCntrAddr_DialNumLen: TP-service center address. length of address
+                       @SvcCntrAddr_Ton: TP-service center address. Type of number
+                       @svcCntrAddr_Npi: TP-service center address. Numbering plan identification
+                       @svcCntrAddr_DialNum: TP-service center address. destination address. If Address not set, then set to 0xFF
+                       @protocolId: TP-protocol Id
+                       @dataCodingScheme:  TP-data coding scheme
+                       @validityPeriod: TP-validity period
+                       @result: Success(0)
+
+                       Set the short message service header parameters which are used in the origination of MO messages to EFsmsp
+               -->
+               <method name="SetSmsParams">
+                       <arg direction="in" type="i" name="recordIndex"/>
+                       <arg direction="in" type="i" name="recordLen"/>
+                       <arg direction="in" type="i" name="alphaIdLen"/>
+                       <arg direction="in" type="s" name="alphaId"/>
+                       <arg direction="in" type="i" name="paramIndicator"/>
+                       <arg direction="in" type="i" name="destAddr_DialNumLen"/>
+                       <arg direction="in" type="i" name="destAddr_Ton"/>
+                       <arg direction="in" type="i" name="destAddr_Npi"/>
+                       <arg direction="in" type="s" name="destAddr_DiallingNum"/>
+                       <arg direction="in" type="i" name="svcCntrAddr_DialNumLen"/>
+                       <arg direction="in" type="i" name="SvcCntrAddr_Ton"/>
+                       <arg direction="in" type="i" name="svcCntrAddr_Npi"/>
+                       <arg direction="in" type="s" name="svcCntrAddr_DialNum"/>
+                       <arg direction="in" type="i" name="protocolId"/>
+                       <arg direction="in" type="i" name="dataCodingScheme"/>
+                       <arg direction="in" type="i" name="validityPeriod"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <!--
+                       GetSmsParamCnt:
+                       @result: Success(0)
+                       @recordCount: number of the record count in SIM EFsmsp
+
+                       Get the count of SMS parameter records stored in SIM EF.
+               -->
+               <method name="GetSmsParamCnt">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="recordCount"/>
+               </method>
+
+               <!--
+                       GetSmsReadyStatus:
+                       @readyStatus: Ready Status
+
+                       Get the sms ready status (whether ready or not) .
+               -->
+               <method name="GetSmsReadyStatus">
+                       <arg direction="out" type="b" name="readyStatus"/>
+               </method>
+
+               <!--
+                       IncommingMsg:
+                        @sca: Service Center Address
+                        @msgLength: Size of the array which is actual TPDU message
+                        @tpdu: SMS TPDU message
+
+                       This is an unsolicited Incoming SMS Event
+               -->
+               <signal name="IncommingMsg">
+                       <arg type="s" name="sca"/>
+                       <arg type="i" name="msgLength"/>
+                       <arg type="s" name="tpdu"/>
+               </signal>
+
+               <!--
+                       IncommingCbMsg:
+                        @cbMsgType: Cell Broadcast  message type. CBS(1), SCHEDULE(2), CBS41(3), INVALID(4)
+                        @msgLength: Size of the array which is actual TPDU message
+                        @tpdu: Cell broadcast message data[Refer 3GPP TS 23.041 9.4.1
+
+                       This is an unsolicited Incoming cell broadcast message
+               -->
+               <signal name="IncommingCbMsg">
+                       <arg type="i" name="cbMsgType"/>
+                       <arg type="i" name="msgLength"/>
+                       <arg type="s" name="tpdu"/>
+               </signal>
+
+               <!--
+                       MemoryStatus:
+                       @status: SIM memory status.
+
+                       This event is an unsolicited event indicating SIM memory status
+               -->
+               <signal name="MemoryStatus">
+                       <arg type="i" name="status"/>
+               </signal>
+
+               <!--
+                       SmsReady:
+                       @status: Ready indication
+
+                       SMS Ready indication 
+               -->
+               <signal name="SmsReady">
+                       <arg type="b" name="status"/>
+               </signal>
+
+       </interface>
+
+</node>
diff --git a/introspection/ss.xml b/introspection/ss.xml
new file mode 100644 (file)
index 0000000..2677ca2
--- /dev/null
@@ -0,0 +1,121 @@
+<node>
+
+       <interface name="org.tizen.telephony.Ss">
+               <method name="ActivateBarring">
+                       <arg direction="in" type="i" name="ss_class"/>
+                       <arg direction="in" type="i" name="barring_mode"/>
+                       <arg direction="in" type="s" name="barring_password"/>
+                       <arg direction="out" type="aa{sv}" name="barring_list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="DeactivateBarring">
+                       <arg direction="in" type="i" name="ss_class"/>
+                       <arg direction="in" type="i" name="barring_mode"/>
+                       <arg direction="in" type="s" name="barring_password"/>
+                       <arg direction="out" type="aa{sv}" name="barring_list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="ChangeBarringPassword">
+                       <arg direction="in" type="s" name="barring_password"/>
+                       <arg direction="in" type="s" name="barring_password_new"/>
+                       <arg direction="in" type="s" name="barring_password_confirm"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetBarringStatus">
+                       <arg direction="in" type="i" name="ss_class"/>
+                       <arg direction="in" type="i" name="barring_mode"/>
+                       <arg direction="out" type="aa{sv}" name="barring_list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="RegisterForwarding">
+                       <arg direction="in" type="i" name="ss_class"/>
+                       <arg direction="in" type="i" name="forward_mode"/>
+                       <arg direction="in" type="i" name="forward_no_reply_time"/>
+                       <arg direction="in" type="s" name="forward_number"/>
+                       <arg direction="out" type="aa{sv}" name="forward_list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="DeregisterForwarding">
+                       <arg direction="in" type="i" name="ss_class"/>
+                       <arg direction="in" type="i" name="forward_mode"/>
+                       <arg direction="in" type="i" name="forward_no_reply_time"/>
+                       <arg direction="in" type="s" name="forward_number"/>
+                       <arg direction="out" type="aa{sv}" name="forward_list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="ActivateForwarding">
+                       <arg direction="in" type="i" name="ss_class"/>
+                       <arg direction="in" type="i" name="forward_mode"/>
+                       <arg direction="in" type="i" name="forward_no_reply_time"/>
+                       <arg direction="in" type="s" name="forward_number"/>
+                       <arg direction="out" type="aa{sv}" name="forward_list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="DeactivateForwarding">
+                       <arg direction="in" type="i" name="ss_class"/>
+                       <arg direction="in" type="i" name="forward_mode"/>
+                       <arg direction="in" type="i" name="forward_no_reply_time"/>
+                       <arg direction="in" type="s" name="forward_number"/>
+                       <arg direction="out" type="aa{sv}" name="forward_list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetForwardingStatus">
+                       <arg direction="in" type="i" name="ss_class"/>
+                       <arg direction="in" type="i" name="forward_mode"/>
+                       <arg direction="out" type="aa{sv}" name="forward_list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="ActivateWaiting">
+                       <arg direction="in" type="i" name="ss_class"/>
+                       <arg direction="out" type="aa{sv}" name="waiting_list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="DeactivateWaiting">
+                       <arg direction="in" type="i" name="ss_class"/>
+                       <arg direction="out" type="aa{sv}" name="waiting_list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetWaitingStatus">
+                       <arg direction="in" type="i" name="ss_class"/>
+                       <arg direction="out" type="aa{sv}" name="waiting_list"/>
+                       <arg direction="out" type="i" name="result"/>
+               </method>
+
+               <method name="GetCLIStatus">
+                       <arg direction="in" type="i" name="cli_type"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="cli_type"/>
+                       <arg direction="out" type="i" name="cli_status"/>
+               </method>
+
+               <method name="SendUSSD">
+                       <arg direction="in" type="i" name="ussd_type"/>
+                       <arg direction="in" type="i" name="ussd_len"/>
+                       <arg direction="in" type="s" name="ussd_string"/>
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="ussd_type"/>
+                       <arg direction="out" type="i" name="ussd_status"/>
+                       <arg direction="out" type="i" name="ussd_len"/>
+                       <arg direction="out" type="s" name="ussd_string"/>
+               </method>
+
+               <signal name="NotifyUSSD">
+                       <arg type="i" name="ussd_status"/>
+                       <arg type="i" name="ussd_len"/>
+                       <arg type="s" name="ussd_string"/>
+               </signal>
+
+       </interface>
+
+</node>
index 29cd6b72ec3ea8c903459e8c222fbd9ab8db6bb8..04e493f131ec4b4808de823bd6db252c88d2a08b 100644 (file)
@@ -1,6 +1,6 @@
-Name:       tel-plugin-dbus_tapi
-Summary:    dbus-tapi plugin for telephony
-Version:    0.1.10
+Name: tel-plugin-dbus_tapi
+Summary: dbus-tapi plugin for telephony
+Version:    0.1.39
 Release:    1
 Group:      System/Libraries
 License:    Apache
@@ -9,14 +9,15 @@ Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(glib-2.0)
-BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(gobject-2.0)
+BuildRequires:  pkgconfig(gio-2.0)
+BuildRequires:  pkgconfig(gio-unix-2.0)
 BuildRequires:  pkgconfig(tcore)
-BuildRequires:  pkgconfig(dbus-1)
-BuildRequires:  pkgconfig(dbus-glib-1)
-BuildRequires:  pkgconfig(gthread-2.0)
+BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(aul)
-BuildRequires:  pkgconfig(tapi)
 BuildRequires:  pkgconfig(security-server)
+BuildRequires:  python
+BuildRequires:  python-xml
 
 %description
 dbus-tapi plugin for telephony
index bc9de9204c11495aa2768fc31f0951d923ed140b..943e73d1bdb20a41497b0b6658f24581489cec1b 100644 (file)
@@ -2,19 +2,19 @@
  "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
 <busconfig>
     <policy user="root">
-        <allow own="org.projectx.telephony"/>
-        <allow send_destination="org.projectx.telephony"/>
-        <allow send_interface="org.projectx.telephony"/>
+        <allow own="org.tizen.telephony"/>
+        <allow send_destination="org.tizen.telephony"/>
+        <allow send_interface="org.tizen.telephony"/>
     </policy>
     <policy user="app">
-        <allow own="org.projectx.telephony"/>
-        <allow send_destination="org.projectx.telephony"/>
-        <allow send_interface="org.projectx.telephony"/>
+        <allow own="org.tizen.telephony"/>
+        <allow send_destination="org.tizen.telephony"/>
+        <allow send_interface="org.tizen.telephony"/>
     </policy>
     <policy at_console="true">
-        <allow send_destination="org.projectx.telephony"/>
+        <allow send_destination="org.tizen.telephony"/>
     </policy>
     <policy context="default">
-        <deny send_destination="org.projectx.telephony"/>
+        <deny send_destination="org.tizen.telephony"/>
     </policy>
 </busconfig>
index e7ddb1784a509c5d3a592a9257d133488b166a22..91eb94b1685a57d75a25520160969a3a3c31623f 100644 (file)
@@ -1,29 +1,12 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 #include <stdio.h>
 #include <string.h>
-#include <assert.h>
+#include <pthread.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <time.h>
 #include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
 
 #include <aul.h>
 #include <bundle.h>
 #include <storage.h>
 #include <user_request.h>
 #include <core_object.h>
+#include <co_call.h>
 #include <communicator.h>
 
-#include <TapiCommon.h>
-#include <TelCall.h>
-#include <ITapiSound.h>
-
-#include "tel_cs_conn.h"
+#include "generated-code.h"
 #include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "ts_noti.h"
-#include "modules.h"
-
-void dbus_request_call(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
+
+
+static void _launch_voice_call( struct tnoti_call_status_incoming* incoming )
 {
-       int                                     api_err = TAPI_API_SUCCESS;
-       int                                     req_id = 0xff;
+       char id[2] = {0, };
+       char cli[2] = {0, };
+       char forward[2] = {0, };
+       char active_line[2] = {0, };
+       char cna[2] = {0, };
+       char number[83] = {0, };
+       char name[83] = {0, };
+       int ret = 0;
 
-       CoreObject*                     o = NULL;
-       UserRequest*            ur = NULL;
-       struct tcore_user_info  ui = { 0, 0, 0, NULL, 0, 0, NULL };
+       bundle *kb  = 0;
 
-       tapi_dbus_connection_name conn_name;
-       GSList*                         co_list = 0;
+       snprintf( id, 2, "%d", incoming->id );
+       dbg("id : [%s]", id );
+       snprintf( cli, 2, "%d", incoming->cli.mode );
+       dbg("cli : [%s]", id );
+       snprintf( number, 83, "%s", incoming->cli.number );
+       dbg("number : [%s]", number );
+       snprintf( forward, 2, "%d", incoming->forward );
+       dbg("forward : [%s]", forward );
+       snprintf( active_line, 2, "%d", incoming->active_line );
+       dbg("active_line : [%s]", active_line );
 
-       TReturn                         ret = 0;
+       if ( incoming->cna.mode == CALL_CNA_MODE_PRESENT )
+               snprintf( cna, 2, "%d", 0 );
+       else
+               snprintf( cna, 2, "%d", 1 );
 
+       dbg("cna : [%s]", cna );
+       snprintf( name, 83, "%s", incoming->cna.name );
+       dbg("name : [%s]", name );
 
-       conn_name = g_array_index(in_param4, tapi_dbus_connection_name, 0);
+       kb = bundle_create();
+       bundle_add(kb, "launch-type", "MT");
+       bundle_add(kb, "handle", id);
+       bundle_add(kb, "number", number);
+       bundle_add(kb, "name_mode", cna);
+       bundle_add(kb, "name", name);
+       bundle_add(kb, "clicause", cli);
+       bundle_add(kb, "fwded", forward);
+       bundle_add(kb, "activeline", active_line);
 
-       co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_CALL);
-       if (!co_list) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
+       ret = aul_launch_app("com.samsung.call", kb);
+       bundle_free(kb);
+
+       dbg("aul_launch_app [ voice call ] : %d", ret );
+}
+
+static void _launch_video_call( struct tnoti_call_status_incoming* incoming )
+{
+       char id[2] = {0, };
+       char cli[2] = {0, };
+       char forward[2] = {0, };
+       char number[83] = {0, };
+       int ret = 0;
+
+       bundle *kb  = 0;
+
+       dbg("Func Entrance");
+
+       snprintf( id, 2, "%d", incoming->id );
+       dbg("id : [%s]", id );
+       snprintf( number, 83, "%s", incoming->cli.number );
+       dbg("number : [%s]", number );
+       snprintf( cli, 2, "%d", incoming->cli.mode );
+       dbg("cli : [%s]", id );
+       snprintf( forward, 2, "%d", incoming->forward );
+       dbg("forward : [%s]", forward );
+
+       kb = bundle_create();
+       bundle_add(kb, "KEY_CALL_TYPE", "mt");
+       bundle_add(kb, "KEY_CALL_HANDLE", id);
+       bundle_add(kb, "KEY_CALLING_PARTY_NUMBER", number);
+       bundle_add(kb, "KEY_CLI_CAUSE", cli);
+       bundle_add(kb, "KEY_FORWARDED", forward);
+
+       ret = aul_launch_app("com.samsung.vtmain", kb);
+       bundle_free(kb);
+
+       dbg("VT AUL return %d",ret);
+}
+
+static gboolean on_call_dial(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_type, gchar* call_number, gpointer user_data)
+{
+       struct treq_call_dial req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
+
+       TReturn ret = 0;
+
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
        }
 
-       o = (CoreObject *)co_list->data;
-       g_slist_free(co_list);
+       req.type = call_type;
+
+       if ( call_number )
+               memcpy( req.number, call_number, MAX_CALL_DIAL_NUM_LEN );
 
-       if (!o) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_dial ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_DIAL );
+
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
        }
 
-       ur = tcore_user_request_new( ctx->comm, tcore_plugin_get_description(plugin)->name);
-       if (!ur) {
-               api_err = TAPI_API_SERVER_FAILURE;
-               goto OUT;
+       return TRUE;
+}
+
+static gboolean on_call_answer(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gint answer_type, gpointer user_data)
+{
+       struct treq_call_answer req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
+
+       TReturn ret = 0;
+
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
        }
 
-       ui.appname = conn_name.name;
-       tcore_user_request_set_user_info(ur, &ui);
+       req.id = call_id;
+       req.type = answer_type;
 
-       switch (tapi_service_function) {
-               case TAPI_CS_CALL_SETUP: {
-                       int tmp_handle = -1; // this is tmp code for old interface
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_answer ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_ANSWER );
 
-                       TelCallSetupParams_t in;
-                       struct treq_call_dial data;
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
 
-                       in = g_array_index( in_param1, TelCallSetupParams_t, 0 );
+       return TRUE;
+}
 
-                       data.type = in.CallType;
-                       memcpy(data.number, in.szNumber, TAPI_CALL_DIALDIGIT_LEN_MAX) ;
+static gboolean on_call_end(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gint end_type, gpointer user_data)
+{
+       struct treq_call_end req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_call_dial ), &data);
-                       tcore_user_request_set_command(ur, TREQ_CALL_DIAL);
+       TReturn ret = 0;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
 
-                       g_array_append_vals(*out_param3, &tmp_handle, sizeof(int)); // for old interface
+       req.id = call_id;
+       req.type = end_type;
 
-                       dbg("ret = 0x%x", ret);
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_end ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_END );
 
-               } break;
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
 
-               case TAPI_CS_CALL_ANSWER: {
-                       unsigned int handle = 0;
-                       TelCallAnswerType_t answer = 0;
+       return TRUE;
+}
 
-                       struct treq_call_answer data;
+static gboolean on_call_dtmf(TelephonyCall *call, GDBusMethodInvocation *invocation, gchar *dtmf_string, gpointer user_data)
+{
+       struct treq_call_dtmf req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
 
-                       handle = g_array_index( in_param1, unsigned int, 0 );
-                       answer = g_array_index( in_param2, TelCallAnswerType_t, 0 );
+       TReturn ret = 0;
 
-                       data.id         = handle;
-                       data.type       = answer;
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_call_answer ), &data);
-                       tcore_user_request_set_command(ur, TREQ_CALL_ANSWER);
+       if ( dtmf_string )
+               memcpy( req.digits, dtmf_string, MAX_CALL_DTMF_DIGITS_LEN );
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_dtmf ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_SEND_DTMF );
 
-                       dbg("ret = 0x%x", ret);
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
 
-               } break;
+       return TRUE;
+}
 
-               case TAPI_CS_CALL_RELEASE: {
-                       struct treq_call_end data;
-                       unsigned int id =0;
+static gboolean on_call_active(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data)
+{
+       struct treq_call_active req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
 
-                       id = g_array_index( in_param1, unsigned int, 0 );
-                       data.id = id;
-                       data.type = CALL_END_TYPE_DEFAULT;
+       TReturn ret = 0;
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_call_end ), &data);
-                       tcore_user_request_set_command(ur, TREQ_CALL_END);
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       req.id = call_id;
 
-                       dbg("ret = 0x%x", ret);
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_active ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_ACTIVE );
 
-               } break;
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
 
-               case TAPI_CS_CALL_RELEASEALL: {
-                       struct treq_call_end data;
-                       data.type = CALL_END_TYPE_ALL;
+       return TRUE;
+}
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_call_end ), &data);
-                       tcore_user_request_set_command(ur, TREQ_CALL_END);
+static gboolean on_call_hold(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data)
+{
+       struct treq_call_hold req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       TReturn ret = 0;
 
-                       dbg("ret = 0x%x", ret);
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
 
-               } break;
+       req.id = call_id;
+
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_hold ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_HOLD );
 
-               case TAPI_CS_CALL_RELEASEALL_ACTIVE: {
-                       struct treq_call_end data;
-                       data.type = CALL_END_TYPE_ACTIVE_ALL;
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_call_end ), &data);
-                       tcore_user_request_set_command(ur, TREQ_CALL_END);
+       return TRUE;
+}
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+static gboolean on_call_swap(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data)
+{
+       struct treq_call_swap req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
 
-                       dbg("ret = 0x%x", ret);
+       TReturn ret = 0;
 
-               } break;
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
 
-               case TAPI_CS_CALL_RELEASEALL_HELD: {
-                       struct treq_call_end data;
-                       data.type = CALL_END_TYPE_HOLD_ALL;
+       req.id = call_id;
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_call_end ), &data);
-                       tcore_user_request_set_command(ur, TREQ_CALL_END);
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_swap ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_SWAP );
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
 
-                       dbg("ret = 0x%x", ret);
+       return TRUE;
+}
 
-               } break;
+static gboolean on_call_join(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data)
+{
+       struct treq_call_join req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
+
+       TReturn ret = 0;
+
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
+
+       req.id = call_id;
+
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_join ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_JOIN );
+
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static gboolean on_call_split(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data)
+{
+       struct treq_call_split req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
+
+       TReturn ret = 0;
+
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
+
+       req.id = call_id;
+
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_split ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_SPLIT );
+
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static gboolean on_call_transfer(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data)
+{
+       struct treq_call_transfer req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
+
+       TReturn ret = 0;
+
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
+
+       req.id = call_id;
+
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_transfer ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_TRANSFER );
+
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static gboolean on_call_deflect(TelephonyCall *call, GDBusMethodInvocation *invocation, gchar *call_number, gpointer user_data)
+{
+       struct treq_call_deflect req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
+
+       TReturn ret = 0;
+
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
+
+       if ( call_number )
+               memcpy( req.number, call_number, MAX_CALL_NUMBER_LEN );
+
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_deflect ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_DEFLECT );
+
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
+
+       return TRUE;
+}
 
-               case TAPI_CS_CALL_DTMF: {
-                       struct treq_call_dtmf data;
+static gboolean on_call_get_call_status(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data )
+{
+       struct custom_data *ctx = user_data;
+       TcorePlugin *plugin = 0;
+       GSList *o_list = 0;
+       CoreObject *o = 0;
+       CallObject *co = 0;
+
+       gchar call_number[MAX_CALL_NUMBER_LEN];
+       gint call_type;
+       gboolean call_direction;
+       gint call_status;
+       gboolean call_multiparty_state;
+
+       plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
+       if ( !plugin ) {
+               dbg("[ error ] plugin : 0");
+               return FALSE;
+       }
+
+       o_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_CALL);
+       if ( !o_list ) {
+               dbg("[ error ] co_list : 0");
+               return FALSE;
+       }
+
+       o = (CoreObject *)o_list->data;
+       g_slist_free(o_list);
+
+       co = tcore_call_object_find_by_id( o, call_id );
+       if ( !co ) {
+               dbg("[ error ] co : 0");
+               return FALSE;
+       }
+
+       tcore_call_object_get_number( co, call_number );
 
-                       char *str = 0;
-                       str = &g_array_index(in_param1, char, 0);
+       call_type = tcore_call_object_get_type( co );
+       call_direction = tcore_call_object_get_direction( co );
+
+       if ( call_direction == TCORE_CALL_DIRECTION_OUTGOING ) {
+               call_direction = TRUE;
+       } else {
+               call_direction = FALSE;
+       }
        
-                       if ( str ) {
-                               strncpy( data.digits, str, MAX_CALL_DTMF_DIGITS_LEN );
-                       } else {
-                               dbg("[ error ] str : (0)");
-                               goto OUT;
-                       }
+       call_status = tcore_call_object_get_status( co );
+       call_multiparty_state = tcore_call_object_get_multiparty_state( co );
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_call_dtmf ), &data);
-                       tcore_user_request_set_command(ur, TREQ_CALL_SEND_DTMF);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       telephony_call_complete_get_status(call, invocation, 
+                       call_id, call_number, call_type, call_direction, call_status, call_multiparty_state );
+
+       return TRUE;
+}
 
-                       dbg("ret = 0x%x", ret);
+static gboolean on_call_get_call_status_all(TelephonyCall *call, GDBusMethodInvocation *invocation, gpointer user_data )
+{
+       struct custom_data *ctx = user_data;
+       TcorePlugin *plugin = 0;
+       GSList *list = 0;
+       CoreObject *o = 0;
+       CallObject *co = 0;
+
+       GVariant *gv = 0;
+       GVariantBuilder b;
+
+       gint call_id;
+       gchar call_number[MAX_CALL_NUMBER_LEN];
+       gint call_type;
+       gboolean call_direction;
+       gint call_status;
+       gboolean call_multiparty_state;
+
+       int len, i;
+
+       plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
+       if ( !plugin ) {
+               dbg("[ error ] plugin : 0");
+               return FALSE;
+       }
 
-               } break;
-               case TAPI_CS_CALL_ACTIVATE: {
-                       unsigned int id = 0;
-                       id = g_array_index( in_param1, unsigned int, 0 );
+       list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_CALL);
+       if ( !list ) {
+               dbg("[ error ] co_list : 0");
+               return FALSE;
+       }
 
-                       tcore_user_request_set_data(ur, sizeof( unsigned int ), &id);
-                       tcore_user_request_set_command(ur, TREQ_CALL_ACTIVE);
+       o = (CoreObject *)list->data;
+       g_slist_free(list);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-                       dbg("ret = 0x%x", ret);
+#define MAX_CALL_STATUS_NUM 7
+       for ( i=0; i<MAX_CALL_STATUS_NUM; i++ ) {
+               list = tcore_call_object_find_by_status( o, i );
 
-               } break;
+               if ( list ) {
 
-               case TAPI_CS_CALL_HOLD: {
-                       unsigned int id = 0;
-                       id = g_array_index( in_param1, unsigned int, 0 );
+                       GSList *tmp = 0;
+                       tmp = list;
 
-                       tcore_user_request_set_data(ur, sizeof( unsigned int ), &id);
-                       tcore_user_request_set_command(ur, TREQ_CALL_HOLD);
+                       dbg("[ check ] there is a call on state (0x%x)", i);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+                       while ( tmp ) {
 
-                       dbg("ret = 0x%x", ret);
+                               co = (CallObject*)list->data;
+                               if ( !co ) {
+                                       dbg("[ error ] call object : 0");
+                                       tmp = tmp->next;
+                                       continue;
+                               }
 
-               } break;
+                               call_id = tcore_call_object_get_id( co );
+                               len = tcore_call_object_get_number( co, call_number );
+                               if ( !len ) {
+                                       dbg("[ check ] no number : (0x%d)", call_id);
+                               }
+
+                               call_type = tcore_call_object_get_type( co );
+                               call_direction = tcore_call_object_get_direction( co );
+
+                               if ( call_direction == TCORE_CALL_DIRECTION_OUTGOING ) {
+                                       call_direction = TRUE;
+                               } else {
+                                       call_direction = FALSE;
+                               }
 
-               case TAPI_CS_CALL_SWAP: {
-                       unsigned int id = 0;
-                       id = g_array_index( in_param1, unsigned int, 0 );
+                               call_status = tcore_call_object_get_status( co );
+                               call_multiparty_state = tcore_call_object_get_multiparty_state( co );
 
-                       tcore_user_request_set_data(ur, sizeof( unsigned int ), &id);
-                       tcore_user_request_set_command(ur, TREQ_CALL_SWAP);
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "call_id", g_variant_new_int32( call_id ));
+                               g_variant_builder_add(&b, "{sv}", "call_number", g_variant_new_string( call_number ));
+                               g_variant_builder_add(&b, "{sv}", "call_type", g_variant_new_int32( call_type ));
+                               g_variant_builder_add(&b, "{sv}", "call_direction", g_variant_new_boolean( call_direction ));
+                               g_variant_builder_add(&b, "{sv}", "call_status", g_variant_new_int32( call_status ));
+                               g_variant_builder_add(&b, "{sv}", "call_multiparty_state", g_variant_new_boolean( call_multiparty_state ));
+                               g_variant_builder_close(&b);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
+                               tmp = g_slist_next( tmp );
                        }
 
-                       dbg("ret = 0x%x", ret);
+               } else {
+                       dbg("[ check ] there is no call on state (0x%x)", i);
 
-               } break;
+               }
 
-               case TAPI_CS_CALL_SETUPCONFCALL: {
-                       unsigned int id = 0;
-                       id = g_array_index( in_param1, unsigned int, 0 );
+       }
 
-                       tcore_user_request_set_data(ur, sizeof( unsigned int ), &id);
-                       tcore_user_request_set_command(ur, TREQ_CALL_JOIN);
+       gv = g_variant_builder_end(&b);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       telephony_call_complete_get_status_all(call, invocation, gv);
 
-                       dbg("ret = 0x%x", ret);
+       g_variant_unref(gv);
 
-               } break;
+       return TRUE;
+}
 
-               case TAPI_CS_CALL_SPLITCONFCALL: {
-                       int id = 0;
-                       id = g_array_index(in_param1, unsigned int, 0);
+static gboolean on_call_set_sound_path(TelephonyCall *call, GDBusMethodInvocation *invocation, gint sound_path, gboolean extra_volume_on, gpointer user_data)
+{
+       struct treq_call_sound_set_path req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
 
-                       tcore_user_request_set_data(ur, sizeof( unsigned int ), &id);
-                       tcore_user_request_set_command(ur, TREQ_CALL_SPLIT);
+       TReturn ret = 0;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
 
-                       dbg("ret = 0x%x", ret);
+       req.path = sound_path;
+       req.extra_volume_on = extra_volume_on;
 
-               } break;
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_sound_set_path ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_SET_SOUND_PATH );
 
-               case TAPI_CS_CALL_TRANSFERCALL: {
-                       int id = 0;
-                       id = g_array_index(in_param1, unsigned int, 0);
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
 
-                       tcore_user_request_set_data(ur, sizeof( unsigned int ), &id);
-                       tcore_user_request_set_command(ur, TREQ_CALL_TRANSFER);
+       return TRUE;
+}
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+static gboolean on_call_get_volume(TelephonyCall *call, GDBusMethodInvocation *invocation, gint sound_device, gint sound_type, gpointer user_data)
+{
+       struct treq_call_sound_get_volume_level req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
 
-                       dbg("ret = 0x%x", ret);
+       TReturn ret = 0;
 
-               } break;
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
 
-               case TAPI_CS_CALL_GETACTIVELINE:
-               case TAPI_CS_CALL_SETACTIVELINE:{
+       req.device = sound_device;
+       req.sound = sound_type;
 
-               } break;
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_sound_get_volume_level ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_GET_SOUND_VOLUME_LEVEL );
 
-               case TAPI_CS_CALL_DEFLECT:{
-                       TelCallDeflectDstInfo_t info;
-                       int id = 0;
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
 
-                       id = g_array_index(in_param1, unsigned int, 0);
-                       info = g_array_index(in_param2, TelCallDeflectDstInfo_t, 0);
+       return TRUE;
+}
 
-                       tcore_user_request_set_data(ur, sizeof(info.number), info.number);
-                       tcore_user_request_set_command(ur, TREQ_CALL_DEFLECT);
+static gboolean on_call_set_volume(TelephonyCall *call, GDBusMethodInvocation *invocation, gint sound_device, gint sound_type, gint sound_volume, gpointer user_data)
+{
+       struct treq_call_sound_set_volume_level req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       TReturn ret = 0;
 
-                       dbg("ret = 0x%x", ret);
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
 
-               } break;
+       req.device = sound_device;
+       req.sound = sound_type;
+       req.volume = sound_volume;
 
-               case TAPI_CS_CALL_ACTIVATECCBS:
-               case TAPI_CS_CALL_GETSTATUS:
-               case TAPI_CS_CALL_GETDURATION:
-               case TAPI_CS_CALL_GETCONFERENCELIST:
-               case TAPI_CS_CALL_GETPRIVACYMODE:
-               case TAPI_CS_CALL_SETPRIVACYMODE:
-               case TAPI_CS_CALL_FLASHINFO:
-               case TAPI_CS_CALL_EXITEMERGENCYMODE:
-               case TAPI_CS_CALL_GETCALLTIME:
-               default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_sound_set_volume_level ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_SET_SOUND_VOLUME_LEVEL );
+
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static gboolean on_call_get_mute_status(TelephonyCall *call, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
+
+       TReturn ret = 0;
+
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
+
+       tcore_user_request_set_command( ur, TREQ_CALL_GET_MUTE_STATUS );
+
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
        }
 
-OUT:
-       if (api_err != TAPI_API_SUCCESS) {
-               tcore_user_request_free(ur);
+       return TRUE;
+}
+
+static gboolean on_call_mute(TelephonyCall *call, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
+
+       TReturn ret = 0;
+
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
+
+       tcore_user_request_set_command( ur, TREQ_CALL_MUTE );
+
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
        }
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-       g_array_append_vals(*out_param2, &req_id, sizeof(int));
+
+       return TRUE;
 }
 
+static gboolean on_call_unmute(TelephonyCall *call, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
+
+       TReturn ret = 0;
 
-static int _get_call_event( enum telephony_call_type type, int event )
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
+
+       tcore_user_request_set_command( ur, TREQ_CALL_UNMUTE );
+
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static gboolean on_call_set_sound_recording(TelephonyCall *call, GDBusMethodInvocation *invocation, gint recording_state, gpointer user_data)
 {
-       if ( type == CALL_TYPE_VIDEO ) {
-               dbg("this is video call");
+       struct custom_data *ctx = user_data;
+       struct treq_call_sound_set_recording req;
 
-               if ( ( event & 0xFF0000 ) == TAPI_EVENT_TYPE_CONFIRMATION )
-                       event |= TAPI_EVENT_DATA_CALL_CONFIRMATION; 
-               else
-                       event |= TAPI_EVENT_DATA_CALL_NOTIFICATION; 
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
 
-       } else {
-               dbg("this is voice call");
+       TReturn ret = 0;
+
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
+
+       req.state = (gboolean)recording_state;
+
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_sound_set_recording ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_SET_SOUND_RECORDING );
+
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static gboolean on_call_set_sound_equalization(TelephonyCall *call, GDBusMethodInvocation *invocation, gint eq_mode, gint eq_direction, gchar* eq_parameter, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       struct treq_call_sound_set_equalization req;
+
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
+
+       TReturn ret = 0;
+
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
+
+       req.mode = (gboolean)eq_mode;
+       req.direction = (enum telephony_call_sound_direction)eq_direction;
+       memcpy( req.parameter, (const char*)eq_parameter, MAX_SOUND_EQ_PARAMETER_SIZE );
+
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_sound_set_equalization ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_SET_SOUND_EQUALIZATION );
+
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static gboolean on_call_set_sound_noise_reduction(TelephonyCall *call, GDBusMethodInvocation *invocation, gint nr_state, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       struct treq_call_sound_set_noise_reduction req;
+
+       UserRequest *ur = MAKE_UR(ctx, call, invocation);
+
+       TReturn ret = 0;
+
+       if ( !ur ) {
+               dbg("[ error ] ur : 0");
+               return FALSE;
+       }
+
+       req.status = (gboolean)nr_state;
+
+       tcore_user_request_set_data( ur, sizeof( struct treq_call_sound_set_noise_reduction ), &req );
+       tcore_user_request_set_command( ur, TREQ_CALL_SET_SOUND_NOISE_REDUCTION );
+
+       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
+       if ( ret != TCORE_RETURN_SUCCESS ) {
+               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
+               return FALSE;
        }
 
-       return event;
+       return TRUE;
 }
 
-TReturn dbus_response_call(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
+
+gboolean dbus_plugin_setup_call_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
 {
-       dbg("command = 0x%x", command);
+       TelephonyCall *call;
+
+       call = telephony_call_skeleton_new();
+       telephony_object_skeleton_set_call(object, call);
+       g_object_unref(call);
+
+       g_signal_connect (call,
+                       "handle-dial",
+                       G_CALLBACK (on_call_dial),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-answer",
+                       G_CALLBACK (on_call_answer),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-end",
+                       G_CALLBACK (on_call_end),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-dtmf",
+                       G_CALLBACK (on_call_dtmf),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-active",
+                       G_CALLBACK (on_call_active),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-hold",
+                       G_CALLBACK (on_call_hold),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-swap",
+                       G_CALLBACK (on_call_swap),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-join",
+                       G_CALLBACK (on_call_join),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-split",
+                       G_CALLBACK (on_call_split),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-transfer",
+                       G_CALLBACK (on_call_transfer),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-deflect",
+                       G_CALLBACK (on_call_deflect),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-get-call-status",
+                       G_CALLBACK (on_call_get_call_status),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-get-call-status-all",
+                       G_CALLBACK (on_call_get_call_status_all),
+                       ctx);
+
+
+       g_signal_connect (call,
+                       "handle-set-sound-path",
+                       G_CALLBACK (on_call_set_sound_path),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-get-volume",
+                       G_CALLBACK (on_call_get_volume),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-set-volume",
+                       G_CALLBACK (on_call_set_volume),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-get-mute-status",
+                       G_CALLBACK (on_call_get_mute_status),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-mute",
+                       G_CALLBACK (on_call_mute),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-unmute",
+                       G_CALLBACK (on_call_unmute),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-set-sound-recording",
+                       G_CALLBACK (on_call_set_sound_recording),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-set-sound-equalization",
+                       G_CALLBACK (on_call_set_sound_equalization),
+                       ctx);
+
+       g_signal_connect (call,
+                       "handle-set-sound-noise-reduction",
+                       G_CALLBACK (on_call_set_sound_noise_reduction),
+                       ctx);
+
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_call_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
+{
+       int i = 0;
+       GSList *co_list;
+       CoreObject *co_call;
+       char *modem_name = NULL;
+       TcorePlugin *p = NULL;
+
+       modem_name = tcore_user_request_get_modem_name(ur);
+       if (!modem_name)
+               return FALSE;
+
+       p = tcore_server_find_plugin(ctx->server, modem_name);
+       free(modem_name);
+       if (!p)
+               return FALSE;
+
+       co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_NETWORK);
+       if (!co_list) {
+               return FALSE;
+       }
+
+       co_call = (CoreObject *)co_list->data;
+       g_slist_free(co_list);
+
+       if (!co_call) {
+               return FALSE;
+       }
 
        switch (command) {
                case TRESP_CALL_DIAL: {
+                       struct tresp_call_dial *resp = (struct tresp_call_dial*)data;
 
-                       struct tresp_call_general* resp_data = 0;
-                       resp_data = (struct tresp_call_general*)data;
-
-                       if ( resp_data->err )
-                               return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                               TAPI_EVENT_CLASS_CALL_VOICE,
-                                               TAPI_EVENT_CALL_SETUP_CNF,
-                                               appname,
-                                               0xff,
-                                               resp_data->err,
-                                               sizeof( unsigned int ),
-                                               (void*)&resp_data->id );
+                       dbg("receive TRESP_CALL_DIAL");
+                       dbg("resp->err : [%d]", resp->err);
 
+                       telephony_call_complete_dial(dbus_info->interface_object, dbus_info->invocation, resp->err);
                } break;
 
                case TRESP_CALL_ANSWER: {
-                       struct tresp_call_general* resp_data = 0;
-                       resp_data = (struct tresp_call_general*)data;
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE,
-                                                                         TAPI_EVENT_CALL_ANSWER_CNF,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&resp_data->id );
+                       struct tresp_call_answer *resp = (struct tresp_call_answer*)data;
+
+                       dbg("receive TRESP_CALL_ANSWER");
+                       dbg("resp->err : [%d]", resp->err);
+                       dbg("resp->id : [%d]", resp->id);
+
+                       telephony_call_complete_answer(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id );
 
                } break;
 
                case TRESP_CALL_END: {
-                       struct tresp_call_general* resp_data = 0;
-                       resp_data = (struct tresp_call_general*)data;
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE,
-                                                                         TAPI_EVENT_CALL_RELEASE_CNF,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&resp_data->id );
+                       struct tresp_call_end *resp = (struct tresp_call_end*)data;
 
-               } break;
-               case TRESP_CALL_END_ALL: {
-                       struct tresp_call_general* resp_data = 0;
-                       resp_data = (struct tresp_call_general*)data;
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE,
-                                                                         TAPI_EVENT_CALL_RELEASE_ALL_CNF,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&resp_data->id );
+                       dbg("receive TRESP_CALL_END");
+                       dbg("resp->err : [%d]", resp->err);
+                       dbg("resp->id : [%d]", resp->err);
+                       dbg("resp->type : [%d]", resp->type);
 
-               } break;
-               case TRESP_CALL_END_ALL_ACTIVE: {
-                       struct tresp_call_general* resp_data = 0;
-                       resp_data = (struct tresp_call_general*)data;
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE,
-                                                                         TAPI_EVENT_CALL_RELEASE_ALL_ACTIVE_CNF,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&resp_data->id );
+                       telephony_call_complete_end(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id, resp->type );
 
                } break;
-               case TRESP_CALL_END_ALL_HELD: {
-                       struct tresp_call_general* resp_data = 0;
-                       resp_data = (struct tresp_call_general*)data;
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE,
-                                                                         TAPI_EVENT_CALL_RELEASE_ALL_HELD_CNF,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&resp_data->id );
 
-               } break;
                case TRESP_CALL_HOLD: {
-                       struct tresp_call_general* resp_data = 0;
-                       resp_data = (struct tresp_call_general*)data;
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE,
-                                                                         TAPI_EVENT_CALL_HOLD_CNF,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&resp_data->id );
+                       struct tresp_call_hold *resp = (struct tresp_call_hold*)data;
+
+                       dbg("receive TRESP_CALL_HOLD");
+                       dbg("resp->err : [%d]", resp->err);
+                       dbg("resp->id : [%d]", resp->id);
+
+                       telephony_call_complete_hold(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id );
 
                } break;
+
                case TRESP_CALL_ACTIVE: {
-                       struct tresp_call_general* resp_data = 0;
-                       resp_data = (struct tresp_call_general*)data;
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE,
-                                                                         TAPI_EVENT_CALL_RETRIEVE_CNF,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&resp_data->id );
+                       struct tresp_call_active *resp = (struct tresp_call_active*)data;
+
+                       dbg("receive TRESP_CALL_ACTIVE");
+                       dbg("resp->err : [%d]", resp->err);
+                       dbg("resp->id : [%d]", resp->id);
+
+                       telephony_call_complete_active(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id );
 
                } break;
+
                case TRESP_CALL_SWAP: {
-                       struct tresp_call_general* resp_data = 0;
-                       resp_data = (struct tresp_call_general*)data;
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE,
-                                                                         TAPI_EVENT_CALL_SWAP_CNF,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&resp_data->id );
+                       struct tresp_call_swap *resp = (struct tresp_call_swap*)data;
+
+                       dbg("receive TRESP_CALL_SWAP");
+                       dbg("resp->err : [%d]", resp->err);
+                       dbg("resp->id : [%d]", resp->id);
+
+                       telephony_call_complete_swap(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id );
 
                } break;
+
                case TRESP_CALL_JOIN: {
-                       struct tresp_call_general* resp_data = 0;
-                       resp_data = (struct tresp_call_general*)data;
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE,
-                                                                         TAPI_EVENT_CALL_SETUPCONFERENCE_CNF,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&resp_data->id );
+                       struct tresp_call_join *resp = (struct tresp_call_join*)data;
+
+                       dbg("receive TRESP_CALL_JOIN");
+                       dbg("resp->err : [%d]", resp->err);
+                       dbg("resp->id : [%d]", resp->id);
+
+                       telephony_call_complete_join(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id );
 
                } break;
+
+
                case TRESP_CALL_SPLIT: {
-                       struct tresp_call_general* resp_data = 0;
-                       resp_data = (struct tresp_call_general*)data;
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE,
-                                                                         TAPI_EVENT_CALL_SPLITCONFERENCE_CNF,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&resp_data->id );
+                       struct tresp_call_split *resp = (struct tresp_call_split*)data;
+
+                       dbg("receive TRESP_CALL_SPLIT");
+                       dbg("resp->err : [%d]", resp->err);
+                       dbg("resp->id : [%d]", resp->id);
+
+                       telephony_call_complete_split(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id );
 
                } break;
+
                case TRESP_CALL_DEFLECT: {
+                       struct tresp_call_deflect *resp = (struct tresp_call_deflect*)data;
+
+                       dbg("receive TRESP_CALL_DEFLECT");
+                       dbg("resp->err : [%d]", resp->err);
+                       dbg("resp->id : [%d]", resp->id);
+
+                       telephony_call_complete_deflect(dbus_info->interface_object, dbus_info->invocation, resp->err );
 
                } break;
+
                case TRESP_CALL_TRANSFER: {
-                       struct tresp_call_general* resp_data = 0;
-                       resp_data = (struct tresp_call_general*)data;
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE,
-                                                                         TAPI_EVENT_CALL_TRANSFER_CNF,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&resp_data->id );
+                       struct tresp_call_transfer *resp = (struct tresp_call_transfer*)data;
+
+                       dbg("receive TRESP_CALL_TRANSFER");
+                       dbg("resp->err : [%d]", resp->err);
+                       dbg("resp->id : [%d]", resp->id);
+
+                       telephony_call_complete_transfer(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id );
 
                } break;
+
                case TRESP_CALL_SEND_DTMF: {
-                       struct tresp_call_general* resp_data = 0;
-                       resp_data = (struct tresp_call_general*)data;
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE,
-                                                                         TAPI_EVENT_CALL_SEND_DTMF_CNF,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         0,
-                                                                         0 );
+                       struct tresp_call_dtmf *resp = (struct tresp_call_dtmf*)data;
 
+                       dbg("receive TRESP_CALL_SEND_DTMF");
+                       dbg("resp->err : [%d]", resp->err);
+
+                       telephony_call_complete_dtmf(dbus_info->interface_object, dbus_info->invocation, resp->err);
                } break;
+
                case TRESP_CALL_SET_SOUND_PATH: {
-                       struct tresp_call_sound_general* resp_data = 0;
-                       tapi_sound_error_info_t error_info = { 0 };
-
-                       resp_data = (struct tresp_call_sound_general*)data;
-                       error_info.cause = resp_data->cause;
-                       error_info.type  = 0x03;
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_SOUND,
-                                                                         TAPI_EVENT_SOUND_SUCCESS_IND,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         sizeof( tapi_sound_error_info_t ),
-                                                                         (void*)&error_info );
+                       struct tresp_call_sound_set_path *resp = (struct tresp_call_sound_set_path*)data;
+
+                       dbg("receive TRESP_CALL_SET_SOUND_PATH");
+                       dbg("resp->err : [%d]", resp->err);
 
+                       telephony_call_complete_set_sound_path(dbus_info->interface_object, dbus_info->invocation, resp->err);
                } break;
 
                case TRESP_CALL_SET_SOUND_VOLUME_LEVEL: {
-                       struct tresp_call_sound_general* resp_data = 0;
-                       tapi_sound_error_info_t error_info = { 0 };
-                       unsigned int err = 0;
+                       struct tresp_call_sound_set_volume_level *resp = (struct tresp_call_sound_set_volume_level*)data;
 
-                       resp_data = (struct tresp_call_sound_general*)data;
+                       dbg("receive TRESP_CALL_SET_SOUND_VOLUME_LEVEL");
+                       dbg("resp->err : [%d]", resp->err);
 
-                       if ( resp_data->cause )
-                               err = TAPI_EVENT_SOUND_ERROR_IND;
-                       else
-                               err = TAPI_EVENT_SOUND_SUCCESS_IND;
+                       telephony_call_complete_set_volume(dbus_info->interface_object, dbus_info->invocation, resp->err);
+               } break;
 
-                       error_info.cause = resp_data->cause;
-                       error_info.type  = 0x01;
+               case TRESP_CALL_GET_SOUND_VOLUME_LEVEL: {
+                       struct tresp_call_sound_get_volume_level *resp = (struct tresp_call_sound_get_volume_level*)data;
+                       GVariant *result = 0;
+                       GVariantBuilder b;
 
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_SOUND,
-                                                                         TAPI_EVENT_SOUND_SUCCESS_IND,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         sizeof( tapi_sound_error_info_t ),
-                                                                         (void*)&error_info );
+                       dbg("receive TRESP_CALL_GET_SOUND_VOLUME_LEVEL");
 
-               } break;
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-               case TRESP_CALL_GET_SOUND_VOLUME_LEVEL: {
+                       g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
 
-               } break;
+                       dbg("resp->err : [%d]", resp->err);
 
-               case TRESP_CALL_MUTE:
-               case TRESP_CALL_UNMUTE: {
-                       struct tresp_call_sound_general* resp_data = 0;
-                       tapi_sound_error_info_t error_info = { 0 };
-                       unsigned int err = 0;
+                       g_variant_builder_add(&b, "{sv}", "err", g_variant_new_int32(resp->err));
 
-                       resp_data = (struct tresp_call_sound_general*)data;
+                       if ( !resp->err ) {
 
-                       if ( resp_data->cause )
-                               err = TAPI_EVENT_SOUND_ERROR_IND;
-                       else
-                               err = TAPI_EVENT_SOUND_SUCCESS_IND;
+                               dbg("resp->record_num : [%d]", resp->record_num);
 
-                       error_info.cause = resp_data->cause;
-                       error_info.type  = 0x02;
+                               for ( i=0; i<resp->record_num; i++ ) {
+                                       dbg("resp->type : [%d]", resp->record[i].sound);
+                                       dbg("resp->level : [%d]", resp->record[i].volume);
 
-                       return ts_delivery_event( ctx->EvtDeliveryHandle,
-                                                                         TAPI_EVENT_CLASS_SOUND,
-                                                                         TAPI_EVENT_SOUND_SUCCESS_IND,
-                                                                         appname,
-                                                                         0xff,
-                                                                         resp_data->err,
-                                                                         sizeof( tapi_sound_error_info_t ),
-                                                                         (void*)&error_info );
+                                       g_variant_builder_add(&b, "{sv}", "type", g_variant_new_int32(resp->record[i].sound));
+                                       g_variant_builder_add(&b, "{sv}", "level", g_variant_new_int32(resp->record[i].volume));
+                               } 
 
-               } break;
+                       }
 
-               case TRESP_CALL_GET_MUTE_STATUS: {
+                       g_variant_builder_close(&b);
+
+                       result = g_variant_builder_end(&b);
+
+                       telephony_call_complete_get_volume(dbus_info->interface_object, dbus_info->invocation, resp->err, result );
+
+                       g_variant_unref(result);
 
                } break;
 
-               default:
-                       break;
-       }
+               case TRESP_CALL_MUTE: {
+                       struct tresp_call_mute *resp = (struct tresp_call_mute*)data;
 
-       return TRUE;
-}
+                       dbg("receive TRESP_CALL_MUTE");
+                       dbg("resp->err : [%d]", resp->err);
 
-static void _launch_voice_call( struct tnoti_call_status_incoming* incoming )
-{
-       char id[2] = {0, };
-       char cli[2] = {0, };
-       char forward[2] = {0, };
-       char active_line[2] = {0, };
-       char cna[2] = {0, };
-       char number[83] = {0, };
-       char name[83] = {0, };
-       int ret = 0;
+                       telephony_call_complete_mute(dbus_info->interface_object, dbus_info->invocation, resp->err);
+               } break;
 
-       bundle *kb  = 0;
+               case TRESP_CALL_UNMUTE: {
+                       struct tresp_call_unmute *resp = (struct tresp_call_unmute*)data;
 
-       snprintf( id, 2, "%d", incoming->id );
-       dbg("id : [%s]", id );
-       snprintf( cli, 2, "%d", incoming->cli.mode );
-       dbg("cli : [%s]", id );
-       snprintf( number, 83, "%s", incoming->cli.number );
-       dbg("number : [%s]", number );
-       snprintf( forward, 2, "%d", incoming->forward );
-       dbg("forward : [%s]", forward );
-       snprintf( active_line, 2, "%d", incoming->active_line );
-       dbg("active_line : [%s]", active_line );
+                       dbg("receive TRESP_CALL_UNMUTE");
+                       dbg("resp->err : [%d]", resp->err);
 
-       if ( incoming->cna.mode == CALL_CNA_MODE_PRESENT )
-               snprintf( cna, 2, "%d", TAPI_CALL_NAME_AVAIL );
-       else
-               snprintf( cna, 2, "%d", TAPI_CALL_NAME_RESTRICTED );
+                       telephony_call_complete_unmute(dbus_info->interface_object, dbus_info->invocation, resp->err);
+               } break;
 
-       dbg("cna : [%s]", cna );
-       snprintf( name, 83, "%s", incoming->cna.name );
-       dbg("name : [%s]", name );
+               case TRESP_CALL_GET_MUTE_STATUS: {
+                       struct tresp_call_get_mute_status *resp = (struct tresp_call_get_mute_status*)data;
 
-       kb = bundle_create();
-       bundle_add(kb, "launch-type", "MT");
-       bundle_add(kb, "handle", id);
-       bundle_add(kb, "number", number);
-       bundle_add(kb, "name_mode", cna);
-       bundle_add(kb, "name", name);
-       bundle_add(kb, "clicause", cli);
-       bundle_add(kb, "fwded", forward);
-       bundle_add(kb, "activeline", active_line);
+                       dbg("receive TRESP_CALL_GET_MUTE_STATUS");
+                       dbg("resp->err : [%d]", resp->err);
+                       dbg("resp->status : [%d]", resp->status);
 
-       ret = aul_launch_app("org.tizen.call", kb);
-       bundle_free(kb);
+                       telephony_call_complete_get_mute_status(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->status );
 
-       dbg("aul_launch_app [ voice call ] : %d", ret );
-}
+               } break;
 
-static void _launch_video_call( struct tnoti_call_status_incoming* incoming )
-{
-       char id[2] = {0, };
-       char cli[2] = {0, };
-       char forward[2] = {0, };
-       char number[83] = {0, };
-       int ret = 0;
+               case TRESP_CALL_SET_SOUND_RECORDING: {
+                       struct tresp_call_sound_set_recording *resp = (struct tresp_call_sound_set_recording*)data;
+                       telephony_call_complete_set_sound_recording(dbus_info->interface_object, dbus_info->invocation, resp->err );
 
-       bundle *kb  = 0;
+               } break;
 
-       dbg("Func Entrance");
+               case TRESP_CALL_SET_SOUND_EQUALIZATION: {
+                       struct tresp_call_sound_set_equalization *resp = (struct tresp_call_sound_set_equalization*)data;
+                       telephony_call_complete_set_sound_equalization(dbus_info->interface_object, dbus_info->invocation, resp->err );
 
-       snprintf( id, 2, "%d", incoming->id );
-       dbg("id : [%s]", id );
-       snprintf( number, 83, "%s", incoming->cli.number );
-       dbg("number : [%s]", number );
-       snprintf( cli, 2, "%d", incoming->cli.mode );
-       dbg("cli : [%s]", id );
-       snprintf( forward, 2, "%d", incoming->forward );
-       dbg("forward : [%s]", forward );
+               } break;
 
-       kb = bundle_create();
-       bundle_add(kb, "KEY_CALL_TYPE", "mt");
-       bundle_add(kb, "KEY_CALL_HANDLE", id);
-       bundle_add(kb, "KEY_CALLING_PARTY_NUMBER", number);
-       bundle_add(kb, "KEY_CLI_CAUSE", cli);
-       bundle_add(kb, "KEY_FORWARDED", forward);
+               case TRESP_CALL_SET_SOUND_NOISE_REDUCTION: {
+                       struct tresp_call_sound_set_noise_reduction *resp = (struct tresp_call_sound_set_noise_reduction*)data;
+                       telephony_call_complete_set_sound_noise_reduction(dbus_info->interface_object, dbus_info->invocation, resp->err );
 
-       ret = aul_launch_app("org.tizen.vtmain", kb);
-       bundle_free(kb);
+               } break;
 
-       dbg("VT AUL return %d",ret);
+               default:
+                       dbg("not handled command[%d]", command);
+               break;
+
+       }
+
+       return TRUE;
 }
 
-TReturn dbus_notification_call(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data)
+gboolean dbus_plugin_call_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
 {
-       dbg("command = 0x%x", command);
+       TelephonyCall *call;
 
-       switch (command) {
-               case TNOTI_CALL_STATUS_IDLE: {
-                       struct tnoti_call_status_idle *status;
-                       TelCallEndInfo_t resp_data;
+       if (!object) {
+               dbg("object is 0");
+               return FALSE;
+       }
 
-                       status = (struct tnoti_call_status_idle*)data;
+       call = telephony_object_peek_call(TELEPHONY_OBJECT(object));
+       dbg("call = %p", call);
 
-                       resp_data.CallEndCause  = status->cause; 
-                       resp_data.pCallHandle   = status->id;
-                       resp_data.CallStartTime = 0;
-                       resp_data.CallEndTime   = 0;
+       switch (command) {
+               case TNOTI_CALL_STATUS_IDLE: {
+                       struct tnoti_call_status_idle *idle = (struct tnoti_call_status_idle*)data;
 
-                       dbg("end noti publish");
+                       dbg("[ check ] call status : idle");
 
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE, 
-                                                                         _get_call_event(status->type, TAPI_EVENT_CALL_END_IND),
-                                                                         0,
-                                                                         0xff,
-                                                                         0,
-                                                                         sizeof( TelCallEndInfo_t ),
-                                                                         (void*)&resp_data );
+                       if ( idle->type != CALL_TYPE_VIDEO ) {
+                               dbg("[ check ] this is voice call");
+                               telephony_call_emit_voice_call_status_idle( call, idle->id, idle->cause, 0, 0 );
+                       } else {
+                               dbg("[ check ] this is video call");
+                               telephony_call_emit_video_call_status_idle( call, idle->id, idle->cause, 0, 0 );
+                       }
 
 
                } break;
-
                case TNOTI_CALL_STATUS_DIALING: {
+                       struct tnoti_call_status_dialing *dialing = (struct tnoti_call_status_dialing*)data;
 
-                       struct tnoti_call_status_dialing *status;
-                       status = (struct tnoti_call_status_dialing*)data;
+                       dbg("[ check ] call status : dialing");
+                       dbg("[ check ] call type : (%d)", dialing->type);
+                       dbg("[ check ] call id : (%d)", dialing->id);
 
-                       dbg("dialing noti publish");
+                       if ( dialing->type != CALL_TYPE_VIDEO ) {
+                               dbg("[ check ] this is voice call");
+                               telephony_call_emit_voice_call_status_dialing( call, dialing->id );
+                       } else {
+                               dbg("[ check ] this is video call");
+                               telephony_call_emit_video_call_status_dialing( call, dialing->id );
+                       }
 
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE, 
-                                                                         _get_call_event(status->type, TAPI_EVENT_CALL_SETUP_CNF),
-                                                                         0,
-                                                                         0xff,
-                                                                         0,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&status->id );
+               } break;
+               case TNOTI_CALL_STATUS_ALERT: {
+                       struct tnoti_call_status_alert *alert = (struct tnoti_call_status_alert*)data;
+
+                       dbg("[ check ] call status : alert");
 
+                       if ( alert->type != CALL_TYPE_VIDEO ) {
+                               dbg("[ check ] this is voice call");
+                               telephony_call_emit_voice_call_status_alert( call, alert->id );
+                       } else {
+                               dbg("[ check ] this is video call");
+                               telephony_call_emit_video_call_status_alert( call, alert->id );
+                       }
 
                } break;
+               case TNOTI_CALL_STATUS_ACTIVE: {
+                       struct tnoti_call_status_active *active = (struct tnoti_call_status_active*)data;
 
-               case TNOTI_CALL_STATUS_ALERT: {
+                       dbg("[ check ] call status : active");
 
-                       struct tnoti_call_status_alert *status;
-                       status = (struct tnoti_call_status_alert*)data;
+                       if ( active->type != CALL_TYPE_VIDEO ) {
+                               dbg("[ check ] this is voice call");
+                               telephony_call_emit_voice_call_status_active( call, active->id );
+                       } else {
+                               dbg("[ check ] this is video call");
+                               telephony_call_emit_video_call_status_active( call, active->id );
+                       }
 
-                       dbg("alert noti publish");
+               } break;
+               case TNOTI_CALL_STATUS_HELD: {
+                       struct tnoti_call_status_held *held = (struct tnoti_call_status_held*)data;
 
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE, 
-                                                                         _get_call_event(status->type, TAPI_EVENT_CALL_ALERT_IND),
-                                                                         0,
-                                                                         0xff,
-                                                                         0,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&status->id );
+                       dbg("[ check ] call status : held");
 
+                       telephony_call_emit_voice_call_status_held( call, held->id );
 
                } break;
+               case TNOTI_CALL_STATUS_INCOMING: {
+                       struct tnoti_call_status_incoming *incoming = (struct tnoti_call_status_incoming*)data;
 
-               case TNOTI_CALL_STATUS_ACTIVE: {
+                       dbg("[ check ] call status : incoming");
 
-                       struct tnoti_call_status_active *status = 0;
-                       status = (struct tnoti_call_status_active*)data;
+                       if ( incoming->type != CALL_TYPE_VIDEO ) {
+                               dbg("[ check ] this is voice call");
 
-                       dbg("active noti publish");
+                               telephony_call_emit_voice_call_status_incoming( call, incoming->id );
 
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE, 
-                                                                         _get_call_event(status->type, TAPI_EVENT_CALL_CONNECTED_IND),
-                                                                         0,
-                                                                         0xff,
-                                                                         0,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&status->id );
+                               _launch_voice_call( incoming );
 
-               } break;
+                       } else {
+                               dbg("[ check ] this is video call");
+                               telephony_call_emit_video_call_status_incoming( call, incoming->id );
 
-               case TNOTI_CALL_STATUS_HELD: {
+                               _launch_video_call( incoming );
+                       }
 
-                       struct tnoti_call_status_held *status;
-                       status = (struct tnoti_call_status_held*)data;
+               } break;
 
-                       dbg("held noti publish");
+               case TNOTI_CALL_SOUND_PATH: {
+
+                       struct tnoti_call_sound_path *noti = (struct tnoti_call_sound_path*)data;
+                       telephony_call_emit_call_sound_path( call, noti->path );
 
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                                                         TAPI_EVENT_CLASS_CALL_VOICE, 
-                                                                         _get_call_event(status->type, TAPI_EVENT_CALL_HOLD_IND ),
-                                                                         0,
-                                                                         0xff,
-                                                                         0,
-                                                                         sizeof( unsigned int ),
-                                                                         (void*)&status->id );
 
                } break;
 
-               case TNOTI_CALL_STATUS_INCOMING: {
+               case TNOTI_CALL_SOUND_RINGBACK_TONE: {
+                       struct tnoti_call_sound_ringback_tone *noti = (struct tnoti_call_sound_ringback_tone*)data;
+                       telephony_call_emit_call_sound_ringback_tone( call, (gint)noti->status );
+
+               } break;
 
-                       struct tnoti_call_status_incoming *incoming = 0;
-                       incoming = (struct tnoti_call_status_incoming*)data;
+               case TNOTI_CALL_SOUND_WBAMR: {
+                       struct tnoti_call_sound_wbamr *noti = (struct tnoti_call_sound_wbamr*)data;
+                       telephony_call_emit_call_sound_wbamr( call, (gint)noti->status );
 
-                       dbg("incoming noti publish");
+               } break;
 
-                       if ( incoming->type == CALL_TYPE_VOICE )
-                               _launch_voice_call( incoming );
-                       else
-                               _launch_video_call( incoming );
+               case TNOTI_CALL_SOUND_EQUALIZATION: {
+                       struct tnoti_call_sound_equalization *noti = (struct tnoti_call_sound_equalization*)data;
+                       telephony_call_emit_call_sound_equalization( call, (gint)noti->mode, (gint)noti->direction );
 
                } break;
 
-               case TNOTI_CALL_STATUS_WAITING:
-                       break;
-
-               case TNOTI_CALL_INFO_CALL_CONNECTED_LINE:
-               case TNOTI_CALL_INFO_WAITING:
-               case TNOTI_CALL_INFO_CUG:
-               case TNOTI_CALL_INFO_FORWARDED:
-               case TNOTI_CALL_INFO_BARRED_INCOMING:
-               case TNOTI_CALL_INFO_BARRED_OUTGOING:
-               case TNOTI_CALL_INFO_DEFLECTED:
-               case TNOTI_CALL_INFO_CLIR_SUPPRESSION_REJECT:
-               case TNOTI_CALL_INFO_FORWARD_UNCONDITIONAL:
-               case TNOTI_CALL_INFO_FORWARD_CONDITIONAL:
-               case TNOTI_CALL_INFO_CALL_LINE_IDENTITY:
-               case TNOTI_CALL_INFO_CALL_NAME_INFORMATION:
-               case TNOTI_CALL_INFO_FORWARDED_CALL:
-               case TNOTI_CALL_INFO_CUG_CALL:
-               case TNOTI_CALL_INFO_DEFLECTED_CALL:
-               case TNOTI_CALL_INFO_TRANSFERED_CALL:
-                       break;
-               case TNOTI_CALL_INFO_HELD: {
+               case TNOTI_CALL_SOUND_NOISE_REDUCTION: {
+                       struct tnoti_call_sound_noise_reduction *noti = (struct tnoti_call_sound_noise_reduction*)data;
+                       telephony_call_emit_call_sound_noise_reduction( call, (gint)noti->status );
+
                } break;
-               case TNOTI_CALL_INFO_ACTIVE:
-               case TNOTI_CALL_INFO_JOINED:
-               case TNOTI_CALL_INFO_RELEASED_ON_HOLD:
-               case TNOTI_CALL_INFO_TRANSFER_ALERT:
-               case TNOTI_CALL_INFO_TRANSFERED:
-               case TNOTI_CALL_INFO_CF_CHECK_MESSAGE:
+
                default:
-                       break;
+                       dbg("not handled command[%d]", command);
+               break;
        }
 
        return TRUE;
 }
+
diff --git a/src/cdmadata.c b/src/cdmadata.c
deleted file mode 100644 (file)
index 3f7633e..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <glib.h>
-
-#include <tcore.h>
-#include <plugin.h>
-#include <server.h>
-#include <storage.h>
-#include <user_request.h>
-#include <co_sim.h>
-
-#include <TapiCommon.h>
-
-#include "tel_cs_conn.h"
-#include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "modules.h"
-
-void dbus_request_cdmadata(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
-{
-       int api_err = TAPI_API_SUCCESS;
-
-       switch (tapi_service_function) {
-               case TAPI_CS_DATA_MOBILE_IP_NAI_GET:
-               case TAPI_CS_DATA_MOBILE_IP_NAI_SET:
-               case TAPI_CS_DATA_CURRENT_NAI_INDEX_GET:
-               case TAPI_CS_DATA_TE2_STATUS_GET:
-               case TAPI_CS_DATA_ROAM_GUARD_GET:
-               case TAPI_CS_DATA_ROAM_GUARD_SET:
-               case TAPI_CS_DATA_MODEM_NAI_GET:
-               case TAPI_CS_DATA_MODEM_NAI_SET:
-               case TAPI_CS_DATA_EVDO_REV_CONFIG_GET:
-               case TAPI_CS_DATA_EVDO_REV_CONFIG_SET:
-               case TAPI_CS_DATA_RESTORE_NAI:
-               case TAPI_CS_DATA_DDTM_CONFIGURATION_GET:
-               case TAPI_CS_DATA_DDTM_CONFIGURATION_SET:
-               default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
-       }
-
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-}
-
-TReturn dbus_response_cdmadata(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
-
-TReturn dbus_notification_cdmadata(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
diff --git a/src/cfg.c b/src/cfg.c
deleted file mode 100644 (file)
index 69751a6..0000000
--- a/src/cfg.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <glib.h>
-
-#include <tcore.h>
-#include <plugin.h>
-#include <server.h>
-#include <storage.h>
-#include <user_request.h>
-#include <co_sim.h>
-
-#include <TapiCommon.h>
-
-#include "tel_cs_conn.h"
-#include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "modules.h"
-
-void dbus_request_cfg(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
-{
-       int api_err = TAPI_API_SUCCESS;
-
-       switch (tapi_service_function) {
-               case TAPI_CS_CFG_DEFAULTCONFGURATION_EXE:
-               case TAPI_CS_CFG_GET_A_KEY:
-               case TAPI_CS_CFG_VERIFY_A_KEY:
-               case TAPI_CS_CFG_GET_MSL_INFO:
-               case TAPI_CS_CFG_GET_VOCODER_OPTION:
-               case TAPI_CS_CFG_SET_VOCODER_OPTION:
-               case TAPI_CS_CFG_GET_HIDDEN_MENU_ACCESS:
-               case TAPI_CS_CFG_SET_HIDDEN_MENU_ACCESS:
-               case TAPI_CS_CFG_GET_CURRENT_CARRIER:
-               case TAPI_CS_CFG_SET_CURRENT_CARRIER:
-               case TAPI_CS_CFG_GET_SIO_MODE:
-               case TAPI_CS_CFG_SET_SIO_MODE:
-               case TAPI_CS_CFG_GET_ACTIVATION_DATE:
-               case TAPI_CS_CFG_GET_RECONDITIONED_DATE:
-               case TAPI_CS_CFG_SET_TTY_MODE:
-               case TAPI_CS_CFG_GET_TTY_MODE:
-               default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
-       }
-
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-}
-
-TReturn dbus_response_cfg(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
-
-TReturn dbus_notification_cfg(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
diff --git a/src/common.c b/src/common.c
new file mode 100644 (file)
index 0000000..fa555fa
--- /dev/null
@@ -0,0 +1,62 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <glib.h>
+
+#include <tcore.h>
+#include <plugin.h>
+#include <communicator.h>
+#include <server.h>
+#include <user_request.h>
+
+#include "generated-code.h"
+#include "common.h"
+
+
+static void _free_hook(UserRequest *ur)
+{
+       const struct tcore_user_info *ui;
+
+       ui = tcore_user_request_ref_user_info(ur);
+       if (!ui)
+               return;
+
+       if (ui->user_data)
+               free(ui->user_data);
+}
+
+char *dbus_plugin_get_plugin_name_by_object_path(const char *object_path)
+{
+       if (!object_path)
+               return NULL;
+
+       if (!g_str_has_prefix(object_path, MY_DBUS_PATH)) {
+               return NULL;
+       }
+
+       return (char *)object_path + strlen(MY_DBUS_PATH) + 1;
+}
+
+UserRequest *dbus_plugin_macro_user_request_new(struct custom_data *ctx, void *object, GDBusMethodInvocation *invocation)
+{
+       UserRequest *ur = NULL;
+       char *plugin_name;
+       struct tcore_user_info ui = { 0, };
+       struct dbus_request_info *dbus_info;
+
+       plugin_name = GET_PLUGIN_NAME(invocation);
+       dbg("plugin_name = [%s]", plugin_name);
+
+       ur = tcore_user_request_new(ctx->comm, plugin_name);
+
+       dbus_info = calloc(sizeof(struct dbus_request_info), 1);
+       dbus_info->interface_object = object;
+       dbus_info->invocation = invocation;
+
+       ui.user_data = dbus_info;
+
+       tcore_user_request_set_user_info(ur, &ui);
+       tcore_user_request_set_free_hook(ur, _free_hook);
+
+       return ur;
+}
diff --git a/src/common.h b/src/common.h
new file mode 100644 (file)
index 0000000..8b38c29
--- /dev/null
@@ -0,0 +1,77 @@
+#ifndef __COMMON_H__
+#define __COMMON_H__
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
+
+#include "type/sim.h"
+
+#include "generated-code.h"
+
+#define MY_DBUS_PATH "/org/tizen/telephony"
+#define MY_DBUS_SERVICE "org.tizen.telephony"
+
+struct custom_data {
+       TcorePlugin *plugin;
+       Communicator *comm;
+       Server *server;
+
+       GHashTable *objects;
+       GDBusObjectManagerServer *manager;
+
+       GQueue queue_sat;
+       gint sat_character_format;
+       gpointer cached_sat_main_menu;
+       struct tel_sim_ecc_list cached_sim_ecc;
+       gboolean sim_recv_first_status;
+};
+
+struct dbus_request_info {
+       void *interface_object;
+       GDBusMethodInvocation *invocation;
+};
+
+#define GET_PLUGIN_NAME(invocation) dbus_plugin_get_plugin_name_by_object_path(g_dbus_method_invocation_get_object_path(invocation))
+#define MAKE_UR(ctx,object,invocation) dbus_plugin_macro_user_request_new(ctx, object, invocation)
+
+char *dbus_plugin_get_plugin_name_by_object_path(const char *object_path);
+UserRequest *dbus_plugin_macro_user_request_new(struct custom_data *ctx, void *object, GDBusMethodInvocation *invocation);
+
+gboolean dbus_plugin_setup_network_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
+gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
+gboolean dbus_plugin_network_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
+
+gboolean dbus_plugin_setup_sap_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
+gboolean dbus_plugin_sap_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
+gboolean dbus_plugin_sap_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
+
+gboolean dbus_plugin_setup_phonebook_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
+gboolean dbus_plugin_phonebook_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
+gboolean dbus_plugin_phonebook_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
+
+gboolean dbus_plugin_setup_sim_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
+gboolean dbus_plugin_sim_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
+gboolean dbus_plugin_sim_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
+
+gboolean dbus_plugin_setup_sat_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
+gboolean dbus_plugin_sat_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
+gboolean dbus_plugin_sat_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
+
+gboolean dbus_plugin_setup_sms_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
+gboolean dbus_plugin_sms_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
+gboolean dbus_plugin_sms_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
+
+gboolean dbus_plugin_setup_call_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
+gboolean dbus_plugin_call_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
+gboolean dbus_plugin_call_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
+
+gboolean dbus_plugin_setup_ss_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
+gboolean dbus_plugin_ss_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
+gboolean dbus_plugin_ss_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
+
+gboolean dbus_plugin_setup_modem_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
+gboolean dbus_plugin_modem_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
+gboolean dbus_plugin_modem_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
+
+#endif
index 4ac3dc25d3946e5f71f48afe5e86fb4af0aee1c0..5d518c045ee880a78d8729aa4a5244af5ae4c4dd 100644 (file)
@@ -25,6 +25,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
 
 #include <tcore.h>
 #include <server.h>
 #include <co_sim.h>
 #include <co_ps.h>
 
-#include <TapiCommon.h>
-#include <ITapiPS.h>
-
-#include "tel_cs_conn.h"
+#include "generated-code.h"
 #include "common.h"
-#include "ts_common.h"
-#include "ts_noti.h"
-#include "ts_svr_req.h"
-#include "modules.h"
-#include "sat_mgr.h"
+
+static void add_modem(struct custom_data *ctx, TcorePlugin *p)
+{
+       TelephonyObjectSkeleton *object;
+       char *plugin_name = NULL;
+       char *path = NULL;
+       GSList *co_list = NULL;
+
+       plugin_name = tcore_plugin_ref_plugin_name(p);
+       if (!plugin_name)
+               return;
+
+       path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plugin_name);
+       dbg("path = [%s]", path);
+
+       object = g_hash_table_lookup(ctx->objects, path);
+       if (object) {
+               dbg("dbus interface object already created. (object = %p)", object);
+               goto OUT;
+       }
+
+       object = telephony_object_skeleton_new(path);
+       dbg("new dbus object created. (object = %p)", object);
+       g_hash_table_insert(ctx->objects, g_strdup(path), object);
+
+       /* Add interfaces */
+       dbus_plugin_setup_modem_interface(object, ctx);
+
+       co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_CALL);
+       if (co_list) {
+               g_slist_free(co_list);
+               dbus_plugin_setup_call_interface(object, ctx);
+       }
+
+
+       co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_NETWORK);
+       if (co_list) {
+               g_slist_free(co_list);
+               dbus_plugin_setup_network_interface(object, ctx);
+       }
+
+       co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SS);
+       if (co_list) {
+               g_slist_free(co_list);
+               dbus_plugin_setup_ss_interface(object, ctx);
+       }
+
+       co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SMS);
+       if (co_list) {
+               g_slist_free(co_list);
+               dbus_plugin_setup_sms_interface(object, ctx);
+       }
+
+       co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SAT);
+       if (co_list) {
+               g_slist_free(co_list);
+               dbus_plugin_setup_sat_interface(object, ctx);
+       }
+
+       co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_PHONEBOOK);
+       if (co_list) {
+               g_slist_free(co_list);
+               dbus_plugin_setup_phonebook_interface(object, ctx);
+       }
+
+       co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SAP);
+       if (co_list) {
+               g_slist_free(co_list);
+               dbus_plugin_setup_sap_interface(object, ctx);
+       }
+
+       co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SIM);
+       if (co_list) {
+               g_slist_free(co_list);
+               dbus_plugin_setup_sim_interface(object, ctx);
+       }
+
+       g_dbus_object_manager_server_export (ctx->manager, G_DBUS_OBJECT_SKELETON (object));
+
+OUT:
+       if (path)
+               g_free(path);
+}
+
+static void refresh_object(struct custom_data *ctx)
+{
+       GSList *plugins;
+       GSList *cur;
+       GSList *co_list;
+       TcorePlugin *p;
+
+       if (!ctx->manager) {
+               dbg("not ready..");
+               return;
+       }
+
+       plugins = tcore_server_ref_plugins(ctx->server);
+       if (!plugins)
+               return;
+
+       cur = plugins;
+       for (cur = plugins; cur; cur = cur->next) {
+               p = cur->data;
+               if (!p)
+                       continue;
+
+               co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_MODEM);
+               if (!co_list)
+                       continue;
+
+               if (!tcore_object_get_hal(co_list->data)) {
+                       g_slist_free(co_list);
+                       continue;
+               }
+
+               g_slist_free(co_list);
+
+               add_modem(ctx, p);
+       }
+}
 
 static TReturn send_response(Communicator *comm, UserRequest *ur, enum tcore_response_command command, unsigned int data_len, const void *data)
 {
        struct custom_data *ctx = NULL;
        const struct tcore_user_info *ui;
-       enum tcore_request_command req_cmd;
+
+       dbg("Response Command = [0x%x], data_len = %d", command, data_len);
 
        ctx = tcore_communicator_ref_user_data(comm);
        if (!ctx) {
@@ -62,43 +177,51 @@ static TReturn send_response(Communicator *comm, UserRequest *ur, enum tcore_res
        }
 
        ui = tcore_user_request_ref_user_info(ur);
-       req_cmd = tcore_user_request_get_command(ur);
 
-       dbg("appname = [%s], Response Command = [0x%x], requested Command = [0x%x], data_len = %d", ui->appname, command, req_cmd, data_len);
-
-       switch(command & (TCORE_RESPONSE | 0x0FF00000))
-       {
+       switch (command & (TCORE_RESPONSE | 0x0FF00000)) {
                case TRESP_CALL:
-                       return dbus_response_call(ctx, ur, ui->appname, command, data_len, data);
+                       dbus_plugin_call_response(ctx, ur, ui->user_data, command, data_len, data);
                        break;
+
                case TRESP_SS:
-                       return dbus_response_ss(ctx, ur, ui->appname, command, data_len, data);
+                       dbus_plugin_ss_response(ctx, ur, ui->user_data, command, data_len, data);
                        break;
+
                case TRESP_PS:
-                       return dbus_response_gprs(ctx, ur, ui->appname, command, data_len, data);
                        break;
+
                case TRESP_SIM:
+                       dbus_plugin_sim_response(ctx, ur, ui->user_data, command, data_len, data);
+                       break;
+
                case TRESP_SAP:
-               case TRESP_PHONEBOOK:
-                       return dbus_response_sim(ctx, ur, ui->appname, command, data_len, data);
+                       dbus_plugin_sap_response(ctx, ur, ui->user_data, command, data_len, data);
                        break;
-               case TRESP_NETWORK:
-                       return dbus_response_network(ctx, ur, ui->appname, command, data_len, data);
+
+               case TRESP_PHONEBOOK:
+                       dbus_plugin_phonebook_response(ctx, ur, ui->user_data, command, data_len, data);
                        break;
+
                case TRESP_MODEM:
-                       return dbus_response_power(ctx, ur, ui->appname, command, data_len, data);
+                       dbus_plugin_modem_response(ctx, ur, ui->user_data, command, data_len, data);
                        break;
+
                case TRESP_SMS:
-                       return dbus_response_sms(ctx, ur, ui->appname, command, data_len, data);
+                       dbus_plugin_sms_response(ctx, ur, ui->user_data, command, data_len, data);
                        break;
+
                case TRESP_SAT:
-                       return dbus_response_sat(ctx, ur, ui->appname, command, data_len, data);
+                       dbus_plugin_sat_response(ctx, ur, ui->user_data, command, data_len, data);
                        break;
                case TRESP_CUSTOM:
-                       return dbus_response_productivity(ctx, ur, ui->appname, command, data_len, data);
                        break;
+
+               case TRESP_NETWORK:
+                       dbus_plugin_network_response(ctx, ur, ui->user_data, command, data_len, data);
+                       break;
+
                default:
-                       dbg("[ERR] Not handled this response(0x%x) in send_response()", command);
+                       warn("unknown command (0x%x)", command);
                        break;
        }
 
@@ -108,6 +231,9 @@ static TReturn send_response(Communicator *comm, UserRequest *ur, enum tcore_res
 static TReturn send_notification(Communicator *comm, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, const void *data)
 {
        struct custom_data *ctx = NULL;
+       char *plugin_name;
+       char *path;
+       TelephonyObjectSkeleton *object;
 
        dbg("notification !!! (command = 0x%x, data_len = %d)", command, data_len);
 
@@ -117,44 +243,158 @@ static TReturn send_notification(Communicator *comm, CoreObject *source, enum tc
                return FALSE;
        }
 
-       switch(command & (TCORE_NOTIFICATION | 0x0FF00000))
-       {
+       plugin_name = tcore_plugin_ref_plugin_name(tcore_object_ref_plugin(source));
+       if (plugin_name) {
+               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plugin_name);
+       }
+       else {
+               path = g_strdup_printf("%s", MY_DBUS_PATH);
+       }
+       dbg("path = [%s]", path);
+
+       object = g_hash_table_lookup(ctx->objects, path);
+       dbg("dbus inteface object = %p", object);
+
+       switch (command & (TCORE_NOTIFICATION | 0x0FF00000)) {
                case TNOTI_CALL:
-                       return dbus_notification_call(ctx, source, command, data_len, data);
+                       dbus_plugin_call_notification(ctx, plugin_name, object, command, data_len, data);
                        break;
+
+               case TNOTI_SS:
+                       dbus_plugin_ss_notification(ctx, plugin_name, object, command, data_len, data);
+                       break;
+
                case TNOTI_PS:
-                       return dbus_notification_gprs(ctx, source, command, data_len, data);
                        break;
+
                case TNOTI_SIM:
+                       dbus_plugin_sim_notification(ctx, plugin_name, object, command, data_len, data);
+                       break;
+
                case TNOTI_SAP:
-               case TNOTI_PHONEBOOK:
-                       return dbus_notification_sim(ctx, source, command, data_len, data);
+                       dbus_plugin_sap_notification(ctx, plugin_name, object, command, data_len, data);
                        break;
-               case TNOTI_NETWORK:
-                       return dbus_notification_network(ctx, source, command, data_len, data);
+
+               case TNOTI_PHONEBOOK:
+                       dbus_plugin_phonebook_notification(ctx, plugin_name, object, command, data_len, data);
                        break;
-               case TNOTI_SERVER:
-                       return TRUE;
+
                case TNOTI_MODEM:
-                       return dbus_notification_power(ctx, source, command, data_len, data);
+                       dbus_plugin_modem_notification(ctx, plugin_name, object, command, data_len, data);
                        break;
+
                case TNOTI_SMS:
-                       return dbus_notification_sms(ctx, source, command, data_len, data);
+                       dbus_plugin_sms_notification(ctx, plugin_name, object, command, data_len, data);
                        break;
+
                case TNOTI_SAT:
-                       return dbus_notification_sat(ctx, source, command, data_len, data);
+                       dbus_plugin_sat_notification(ctx, plugin_name, object, command, data_len, data);
                        break;
                case TNOTI_CUSTOM:
-                       return dbus_notification_productivity(ctx, source, command, data_len, data);
                        break;
+
+               case TNOTI_NETWORK:
+                       dbus_plugin_network_notification(ctx, plugin_name, object, command, data_len, data);
+                       break;
+
+               case TNOTI_SERVER:
+                       if (command == TNOTI_SERVER_RUN) {
+                               refresh_object(ctx);
+                       }
+                       break;
+
                default:
-                       dbg("[ERR] Not handled this notification(0x%x) in send_notification()", command);
+                       warn("unknown command (0x%x)", command);
                        break;
        }
 
        return FALSE;
 }
 
+
+static gboolean
+on_manager_getmodems (TelephonyManager *mgr,
+               GDBusMethodInvocation  *invocation,
+               gpointer                user_data)
+{
+       struct custom_data *ctx = user_data;
+       GSList *plugins;
+       GSList *cur;
+       GSList *co_list;
+       int max_count = 0;
+       int count;
+       TcorePlugin *p;
+       gchar **list;
+
+       plugins = tcore_server_ref_plugins(ctx->server);
+       if (!plugins) {
+               telephony_manager_complete_get_modems(mgr, invocation, NULL);
+               return TRUE;
+       }
+
+       max_count = g_slist_length(plugins);
+       list = calloc(sizeof(gchar *) * max_count, 1);
+       count = 0;
+
+       cur = plugins;
+       for (cur = plugins; cur; cur = cur->next) {
+               p = cur->data;
+               if (!p)
+                       continue;
+
+               co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_MODEM);
+               if (!co_list)
+                       continue;
+
+               if (!tcore_object_get_hal(co_list->data)) {
+                       g_slist_free(co_list);
+                       continue;
+               }
+               g_slist_free(co_list);
+
+               list[count] = g_strdup(tcore_plugin_get_description(p)->name);
+               count++;
+       }
+
+       telephony_manager_complete_get_modems(mgr, invocation, (const gchar **)list);
+
+       for (;count >= 0; count--) {
+               if (list[count]) {
+                       g_free(list[count]);
+               }
+       }
+       free(list);
+
+       return TRUE;
+}
+
+static void setup_dbus(struct custom_data *ctx)
+{
+       GDBusConnection *conn;
+       TelephonyManager *mgr;
+
+       conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, NULL);
+       if (!conn) {
+               dbg("g_bus_get_sync() failed.");
+               return;
+       }
+
+       ctx->manager = g_dbus_object_manager_server_new (MY_DBUS_PATH);
+
+       refresh_object(ctx);
+
+       /* Add interface to default object path */
+       mgr = telephony_manager_skeleton_new();
+       g_signal_connect (mgr,
+                       "handle-get-modems",
+                       G_CALLBACK (on_manager_getmodems),
+                       ctx); /* user_data */
+
+       g_dbus_interface_skeleton_export(G_DBUS_INTERFACE_SKELETON(mgr), conn, MY_DBUS_PATH, NULL);
+
+       g_dbus_object_manager_server_set_connection (ctx->manager, conn);
+}
+
 struct tcore_communitor_operations ops = {
        .send_response = send_response,
        .send_notification = send_notification,
@@ -178,23 +418,24 @@ static gboolean on_init(TcorePlugin *p)
        dbg("i'm init!");
 
        data = calloc(sizeof(struct custom_data), 1);
-       if (!data)
+       if (!data) {
                return FALSE;
+       }
 
        data->plugin = p;
 
-       comm = tcore_communicator_new(p, "legacy_dbus", &ops);
+       comm = tcore_communicator_new(p, "dbus", &ops);
        tcore_communicator_link_user_data(comm, data);
 
        data->comm = comm;
        data->server = tcore_plugin_ref_server(p);
-       data->strg = tcore_server_find_storage(data->server, "vconf");
 
-       sat_mgr_init_cmd_queue(data);
-       ts_init_delivery_system(data);
-       ts_register_dbus_factory(data);
+       data->objects = g_hash_table_new(g_str_hash, g_str_equal);
+       data->cached_sat_main_menu = NULL;
+
+       dbg("data = %p", data);
 
-       tcore_storage_set_int(data->strg, STORAGE_KEY_TELEPHONY_EVENT_SYSTEM_READY, STORAGE_VALUE_ON); /* event_system_ready on */
+       setup_dbus(data);
 
        return TRUE;
 }
@@ -209,7 +450,7 @@ static void on_unload(TcorePlugin *p)
 
        dbg("i'm unload");
 
-       comm = tcore_server_find_communicator(tcore_plugin_ref_server(p), "legacy_dbus");
+       comm = tcore_server_find_communicator(tcore_plugin_ref_server(p), "dbus");
        if (!comm)
                return;
 
@@ -217,12 +458,14 @@ static void on_unload(TcorePlugin *p)
        if (!data)
                return;
 
+       g_hash_table_destroy(data->objects);
+
        free(data);
 }
 
 struct tcore_plugin_define_desc plugin_define_desc =
 {
-       .name = "DBUS_COMMUNICATOR",
+       .name = "NEW_DBUS_COMMUNICATOR",
        .priority = TCORE_PLUGIN_PRIORITY_HIGH,
        .version = 1,
        .load = on_load,
diff --git a/src/gprs.c b/src/gprs.c
deleted file mode 100644 (file)
index 784146c..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <glib.h>
-
-#include <tcore.h>
-#include <plugin.h>
-#include <server.h>
-#include <storage.h>
-#include <user_request.h>
-#include <core_object.h>
-#include <communicator.h>
-
-#include <TapiCommon.h>
-#include <TelSim.h>
-#include <ITapiPS.h>
-
-#include "tel_cs_conn.h"
-#include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "ts_noti.h"
-#include "modules.h"
-
-void dbus_request_gprs(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
-{
-       /* legacy telephony */
-       int api_err = TAPI_API_SUCCESS;
-       tapi_ps_net_start_req_t info_activate;
-       tapi_ps_btdun_pincontrol info_pincontrol;
-       tapi_ps_net_stop_req_t info_deactivate;
-       tapi_dbus_connection_name conn_name;
-
-       /* new telephony */
-       struct treq_ps_pdp_activate data_activate;
-       struct treq_ps_pdp_deactivate data_deactivate;
-       struct treq_ps_set_dun_pin_control data_pincontrol;
-       TReturn ret;
-       GSList *co_pslist = NULL;
-       CoreObject *co_ps = NULL;
-       UserRequest *ur = NULL;
-       struct tcore_user_info ui = { 0, };
-
-       conn_name = g_array_index(in_param4, tapi_dbus_connection_name, 0);
-
-       co_pslist = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_PS);
-       if (!co_pslist) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
-       }
-
-       co_ps = (CoreObject *)co_pslist->data;
-       g_slist_free(co_pslist);
-
-       if (!co_ps) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
-       }
-
-       ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
-       if (!ur) {
-               api_err = TAPI_API_SERVER_FAILURE;
-               goto OUT;
-       }
-
-       ui.appname = conn_name.name;
-       tcore_user_request_set_user_info(ur, &ui);
-
-       switch (tapi_service_function) {
-               case TAPI_CS_GPRS_STARTNETWORK: /* 0x700 */
-                       info_activate = g_array_index(in_param1, tapi_ps_net_start_req_t, 0);
-
-                       memset(&data_activate, 0, sizeof(struct treq_ps_pdp_activate));
-                       data_activate.context_id = info_activate.cont_id;
-                       data_activate.secondary_context_id = 0;
-                       strncpy(data_activate.apn, info_activate.pdp_info.apn, 102);
-                       strncpy(data_activate.pdp_address, (char *)info_activate.pdp_info.pdp_address, 20);
-                       data_activate.pdp_type = info_activate.pdp_info.pdp_type;
-                       strncpy(data_activate.username, (char *)info_activate.pdp_info.username, 32);
-                       strncpy(data_activate.password, (char *)info_activate.pdp_info.password, 32);
-                       strncpy(data_activate.dns1, (char *)info_activate.pdp_info.dns1, 16);
-                       strncpy(data_activate.dns2, (char *)info_activate.pdp_info.dns2, 16);
-                       data_activate.auth_type = info_activate.pdp_info.auth_type;
-
-                       tcore_user_request_set_data(ur, sizeof(struct treq_ps_pdp_activate), &data_activate);
-                       tcore_user_request_set_command(ur, TREQ_PS_SET_PDP_ACTIVATE);
-
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-
-                       dbg("ret = 0x%x", ret);
-                       break;
-
-               case TAPI_CS_GPRS_PDP_DEACTIVATION_SET: /* 0x701 */
-                       memset(&info_deactivate, 0, sizeof(tapi_ps_net_stop_req_t));
-                       info_deactivate = g_array_index(in_param1, tapi_ps_net_stop_req_t, 0);
-
-                       memset(&data_deactivate, 0, sizeof(struct treq_ps_pdp_deactivate));
-                       data_deactivate.context_id = info_deactivate.cont_id;
-                       data_deactivate.secondary_context_id = 0;
-
-                       tcore_user_request_set_data(ur, sizeof(struct treq_ps_pdp_deactivate), &data_deactivate);
-                       tcore_user_request_set_command(ur, TREQ_PS_SET_PDP_DEACTIVATE);
-
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-
-                       dbg("ret = 0x%x", ret);
-                       break;
-
-               case TAPI_CS_GPRS_BTDUN_PINCTRL_GET: /* 0x706 */
-                       memset(&info_pincontrol, 0, sizeof(tapi_ps_btdun_pincontrol));
-                       info_pincontrol = g_array_index(in_param1, tapi_ps_btdun_pincontrol, 0);
-
-                       data_pincontrol.signal = info_pincontrol.signal;
-                       data_pincontrol.status = info_pincontrol.status;
-
-                       tcore_user_request_set_data(ur, sizeof(struct treq_ps_set_dun_pin_control), &data_pincontrol);
-                       tcore_user_request_set_command(ur, TREQ_PS_SET_DUN_PIN_CONTROL);
-
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-
-                       dbg("ret = 0x%x", ret);
-                       break;
-
-               case TAPI_CS_GPRS_DATA_DORMANT: /* 0x702 */
-               case TAPI_CS_GPRS_PORT_LIST_SET: /* 0x703 */
-               case TAPI_CS_GPRS_PORT_LIST_GET: /* 0x704 */
-               default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
-       }
-
-OUT:
-       if (api_err != TAPI_API_SUCCESS) {
-               tcore_user_request_free(ur);
-       }
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-}
-
-TReturn dbus_response_gprs(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
-{
-       const struct tresp_ps_set_pdp_activate *act_info = data;
-       const struct tresp_ps_set_pdp_deactivate *deact_info = data;
-       tapi_ps_pdp_info_t resp;
-
-       switch (command) {
-               case TRESP_PS_SET_PDP_ACTIVATE:
-                       resp.cont_id = act_info->context_id;
-                       resp.err = act_info->result;
-
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_DATA, TAPI_EVENT_PS_PDP_ACT_RSP, appname, 0,
-                                       TAPI_API_SUCCESS, sizeof(tapi_ps_pdp_info_t), (void *) &resp);
-                       break;
-
-               case TRESP_PS_SET_PDP_DEACTIVATE:
-                       /* disconnect by user */
-                       resp.cont_id = deact_info->context_id;
-                       resp.err = deact_info->result;
-
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_DATA, TAPI_EVENT_PS_PDP_DEACT_RSP, appname, 0,
-                                       TAPI_API_SUCCESS, sizeof(tapi_ps_pdp_info_t), (void *) &resp);
-                       break;
-
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
-
-TReturn dbus_notification_gprs(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data)
-{
-       const struct tnoti_ps_call_status *call_status_info = data;
-       const struct tnoti_ps_pdp_ipconfiguration *ip_info = data;
-       const struct tnoti_ps_dun_pin_control *pin_info = data;
-
-       tapi_ps_net_start_rsp_t ip_noti;
-       tapi_ps_btdun_pincontrol pin_noti;
-
-       switch (command) {
-               case TNOTI_PS_CALL_STATUS:
-                       if (call_status_info->state == 1) {
-                       }
-                       else {
-                               /* disconnect */
-                               tapi_ps_pdp_info_t resp;
-
-                               resp.cont_id = call_status_info->context_id;
-                               resp.err = call_status_info->result;
-
-                               dbg("pdp disconnected by network");
-
-                               ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_DATA, TAPI_EVENT_PS_PDP_DEACT_IND, NULL, 0,
-                                               TAPI_API_SUCCESS, sizeof(tapi_ps_pdp_info_t), (void *) &resp);
-                       }
-                       break;
-
-               case TNOTI_PS_PDP_IPCONFIGURATION:
-                       ip_noti.cont_id = ip_info->context_id;
-                       ip_noti.err = 0;
-                       ip_noti.pdp_info.field_flag = ip_info->field_flag;
-
-                       if (ip_info->field_flag & 0x0001) {
-                               memcpy(&ip_noti.pdp_info.ip_address, ip_info->ip_address, 4);
-                       }
-
-                       if (ip_info->field_flag & 0x0002) {
-                               memcpy(&ip_noti.pdp_info.primary_dns, ip_info->primary_dns, 4);
-                       }
-
-                       if (ip_info->field_flag & 0x0004) {
-                               memcpy(&ip_noti.pdp_info.secondary_dns, ip_info->secondary_dns, 4);
-                       }
-
-                       if (ip_info->field_flag & 0x0008) {
-                               memcpy(&ip_noti.pdp_info.gateway, ip_info->gateway, 4);
-                       }
-
-                       if (ip_info->field_flag & 0x0010) {
-                               memcpy(&ip_noti.pdp_info.subnet_mask, ip_info->subnet_mask, 4);
-                       }
-
-                       snprintf(ip_noti.devname, TAPI_PDP_NAME_LEN_MAX, "pdp%d", ip_noti.cont_id - 1);
-
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_DATA, TAPI_EVENT_PS_PDP_ACT_IPCONFIG_INFO, NULL, 0,
-                                       TAPI_API_SUCCESS, sizeof(tapi_ps_pdp_info_t), (void *) &ip_noti);
-                       break;
-
-               case TNOTI_PS_DUN_PIN_CONTROL:
-                       pin_noti.signal = pin_info->signal;
-                       pin_noti.status = pin_info->status;
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_DATA, TAPI_EVENT_PS_BTDUN_PINCONTROL_NOTI, NULL, 0,
-                                       TAPI_API_SUCCESS, sizeof(tapi_ps_btdun_pincontrol), &pin_noti);
-                       break;
-
-               case TNOTI_PS_EXTERNAL_CALL:
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_DATA, TAPI_EVENT_PS_EXTERNAL_CALL_IND, NULL, 0,
-                                       TAPI_API_SUCCESS, 0, NULL);
-                       break;
-
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
diff --git a/src/gps.c b/src/gps.c
deleted file mode 100644 (file)
index 2aae790..0000000
--- a/src/gps.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <glib.h>
-
-#include <tcore.h>
-#include <plugin.h>
-#include <server.h>
-#include <storage.h>
-#include <user_request.h>
-#include <co_sim.h>
-
-#include <TapiCommon.h>
-
-#include "tel_cs_conn.h"
-#include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "modules.h"
-
-void dbus_request_gps(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
-{
-       int api_err = TAPI_API_SUCCESS;
-
-       switch (tapi_service_function) {
-               case TAPI_CS_GPS_INIT:
-               case TAPI_CS_GPS_DEINIT:
-               case TAPI_CS_GPS_FIX_REQUEST:
-               case TAPI_CS_GPS_STOP_SESSION:
-               case TAPI_CS_GPS_GET_PARAMETERS:
-               case TAPI_CS_GPS_SET_PARAMETERS:
-               case TAPI_CS_GPS_AGPS_PDP_CONN_CNF:
-               case TAPI_CS_GPS_AGPS_DNS_LOOKUP_CNF:
-               case TAPI_CS_GPS_SEND_VER_CNF:
-               case TAPI_CS_GPS_XTRA_INIT:
-               case TAPI_CS_GPS_XTRA_DEINIT:
-               case TAPI_CS_GPS_XTRA_ENABLE:
-               case TAPI_CS_GPS_XTRA_DISABLE:
-               case TAPI_CS_GPS_XTRA_SET_TIMEINFO:
-               case TAPI_CS_GPS_XTRA_SET_DATA:
-               case TAPI_CS_GPS_MEASURE_POS_CNF:
-               case TAPI_CS_GPS_SET_FREQ_AIDING:
-               default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
-       }
-
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-}
-
-TReturn dbus_response_gps(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
-
-TReturn dbus_notification_gps(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
diff --git a/src/misc.c b/src/misc.c
deleted file mode 100644 (file)
index b902f1b..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <glib.h>
-
-#include <tcore.h>
-#include <plugin.h>
-#include <server.h>
-#include <storage.h>
-#include <user_request.h>
-#include <core_object.h>
-
-#include <TapiCommon.h>
-#include <TelMisc.h>
-
-#include "tel_cs_conn.h"
-#include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "modules.h"
-
-void dbus_request_misc(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
-{
-       int api_err = TAPI_API_SUCCESS;
-       TelMiscVersionInformation *version;
-       TelMiscSNInformation *imei;
-
-       switch (tapi_service_function) {
-               case TAPI_CS_MISC_TIMEZONE_SETINFO:
-                       /*
-                        * Ignore. (Purpose to time backup for model that do not have AP-side battery.)
-                        */
-                       break;
-
-               case TAPI_CS_MISC_ME_VERSION_GET:
-                       version = tcore_plugin_ref_property(plugin, "VERSION");
-                       if (!version) {
-                               api_err = TAPI_API_SERVER_FAILURE;
-                       }
-                       else {
-                               g_array_append_vals(*out_param2, version, sizeof(TelMiscVersionInformation));
-                       }
-                       break;
-
-               case TAPI_CS_MISC_SERIAL_NUMBER_GET:
-                       imei = tcore_plugin_ref_property(plugin, "IMEI");
-                       if (!imei) {
-                               api_err = TAPI_API_SERVER_FAILURE;
-                       }
-                       else {
-                               g_array_append_vals(*out_param2, imei, sizeof(TelMiscSNInformation));
-                       }
-                       break;
-
-               case TAPI_CS_MISC_TIMEZONE_GETMODE:
-               case TAPI_CS_MISC_TIMEZONE_GETINFO:
-               case TAPI_CS_MISC_TIMEZONE_CONFIRMINFO:
-               case TAPI_CS_MISC_NAM_INFO_GET:
-               case TAPI_CS_MISC_NAM_INFO_SET:
-               default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
-       }
-
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-}
-
-TReturn dbus_response_misc(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
-
-TReturn dbus_notification_misc(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
diff --git a/src/modem.c b/src/modem.c
new file mode 100644 (file)
index 0000000..0e190d4
--- /dev/null
@@ -0,0 +1,319 @@
+#include <stdio.h>
+#include <string.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <time.h>
+#include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
+
+#include <tcore.h>
+#include <server.h>
+#include <plugin.h>
+#include <hal.h>
+#include <communicator.h>
+#include <storage.h>
+#include <queue.h>
+#include <user_request.h>
+#include <co_modem.h>
+
+#include "generated-code.h"
+#include "common.h"
+
+static gboolean
+on_modem_set_power (TelephonyModem *modem,
+               GDBusMethodInvocation *invocation,
+               gint mode,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret = TCORE_RETURN_SUCCESS;
+
+       ur = MAKE_UR(ctx, modem, invocation);
+       tcore_user_request_set_data(ur, 0, NULL);
+
+       switch (mode) {
+               case 0:
+                       tcore_user_request_set_command(ur, TREQ_MODEM_POWER_OFF);
+                       break;
+               case 1:
+                       tcore_user_request_set_command(ur, TREQ_MODEM_POWER_ON);
+                       break;
+               case 2:
+                       tcore_user_request_set_command(ur, TREQ_MODEM_POWER_RESET);
+                       break;
+               default:
+                       ret = TCORE_RETURN_EINVAL;
+                       goto ERR;
+                       break;
+       }
+
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS)
+               goto ERR;
+
+       return TRUE;
+
+ERR:
+       telephony_modem_complete_set_power(modem, invocation, ret);
+
+       return TRUE;
+}
+
+static gboolean
+on_modem_set_flight_mode (TelephonyModem *modem,
+               GDBusMethodInvocation *invocation,
+               gboolean enable,
+               gpointer user_data)
+{
+       struct treq_modem_set_flightmode data;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
+
+       data.enable = enable;
+
+       ur = MAKE_UR(ctx, modem, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_modem_set_flightmode), &data);
+       tcore_user_request_set_command(ur, TREQ_MODEM_SET_FLIGHTMODE);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_modem_complete_set_flight_mode(modem, invocation, ret);
+               tcore_user_request_unref(ur);
+       }
+
+       return TRUE;
+}
+
+static gboolean
+on_modem_get_version (TelephonyModem *modem,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
+
+       ur = MAKE_UR(ctx, modem, invocation);
+       tcore_user_request_set_command(ur, TREQ_MODEM_GET_VERSION);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_modem_complete_get_version(modem, invocation,
+                               ret,
+                               NULL, NULL, NULL, NULL);
+               tcore_user_request_unref(ur);
+       }
+
+       return TRUE;
+}
+
+static gboolean
+on_modem_get_serial_number (TelephonyModem *modem,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
+
+       ur = MAKE_UR(ctx, modem, invocation);
+       tcore_user_request_set_command(ur, TREQ_MODEM_GET_SN);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_modem_complete_get_serial_number(modem, invocation, ret, NULL);
+               tcore_user_request_unref(ur);
+       }
+
+       return TRUE;
+}
+
+static gboolean
+on_modem_get_imei (TelephonyModem *modem,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
+
+       ur = MAKE_UR(ctx, modem, invocation);
+       tcore_user_request_set_command(ur, TREQ_MODEM_GET_IMEI);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_modem_complete_get_imei(modem, invocation, ret, NULL);
+               tcore_user_request_unref(ur);
+       }
+
+       return TRUE;
+}
+
+static gboolean on_modem_set_dun_pin_ctrl (TelephonyModem *modem, GDBusMethodInvocation *invocation,
+               gint arg_signal, gboolean arg_status, gpointer user_data)
+{
+       struct treq_modem_set_dun_pin_control data;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
+
+       data.signal = arg_signal;
+       data.status = arg_status;
+
+       ur = MAKE_UR(ctx, modem, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_modem_set_dun_pin_control), &data);
+       tcore_user_request_set_command(ur, TREQ_MODEM_SET_DUN_PIN_CONTROL);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_modem_complete_set_dun_pin_ctrl(modem, invocation, ret);
+               tcore_user_request_unref(ur);
+       }
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_setup_modem_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
+{
+       TelephonyModem *modem;
+
+       modem = telephony_modem_skeleton_new();
+       telephony_object_skeleton_set_modem(object, modem);
+       g_object_unref(modem);
+
+       g_signal_connect (modem,
+                       "handle-set-power",
+                       G_CALLBACK (on_modem_set_power),
+                       ctx);
+
+       g_signal_connect (modem,
+                       "handle-set-flight-mode",
+                       G_CALLBACK (on_modem_set_flight_mode),
+                       ctx);
+
+       g_signal_connect (modem,
+                       "handle-get-version",
+                       G_CALLBACK (on_modem_get_version),
+                       ctx);
+
+       g_signal_connect (modem,
+                       "handle-get-serial-number",
+                       G_CALLBACK (on_modem_get_serial_number),
+                       ctx);
+
+       g_signal_connect (modem,
+                       "handle-get-imei",
+                       G_CALLBACK (on_modem_get_imei),
+                       ctx);
+
+       g_signal_connect (modem,
+                       "handle-set-dun-pin-ctrl",
+                       G_CALLBACK (on_modem_set_dun_pin_ctrl),
+                       ctx);
+
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_modem_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
+{
+       const struct tresp_modem_set_flightmode *resp_set_flight_mode = data;
+       const struct tresp_modem_set_dun_pin_control *resp_dun_pin_ctrl = data;
+       const struct tresp_modem_get_imei *resp_get_imei = data;
+       const struct tresp_modem_get_sn *resp_get_sn = data;
+       const struct tresp_modem_get_version *resp_get_version = data;
+
+       switch (command) {
+               case TRESP_MODEM_SET_FLIGHTMODE:
+                       dbg("receive TRESP_MODEM_SET_FLIGHTMODE");
+                       dbg("resp->result = %d", resp_set_flight_mode->result);
+                       telephony_modem_complete_set_flight_mode(dbus_info->interface_object, dbus_info->invocation, resp_set_flight_mode->result);
+                       break;
+
+               case TRESP_MODEM_POWER_ON:
+                       dbg("receive TRESP_MODEM_POWER_ON");
+                       telephony_modem_complete_set_power(dbus_info->interface_object, dbus_info->invocation, 0);
+                       break;
+
+               case TRESP_MODEM_POWER_OFF:
+                       dbg("receive TRESP_MODEM_POWER_OFF");
+                       telephony_modem_complete_set_power(dbus_info->interface_object, dbus_info->invocation, 0);
+                       break;
+
+               case TRESP_MODEM_POWER_RESET:
+                       dbg("receive TRESP_MODEM_POWER_RESET");
+                       telephony_modem_complete_set_power(dbus_info->interface_object, dbus_info->invocation, 0);
+                       break;
+
+               case TRESP_MODEM_GET_IMEI:
+                       dbg("receive TRESP_MODEM_GET_IMEI");
+                       telephony_modem_complete_get_imei(dbus_info->interface_object, dbus_info->invocation, resp_get_imei->result, resp_get_imei->imei);
+                       break;
+
+               case TRESP_MODEM_GET_SN:
+                       dbg("receive TRESP_MODEM_GET_SN");
+                       telephony_modem_complete_get_serial_number(dbus_info->interface_object, dbus_info->invocation, resp_get_sn->result, resp_get_sn->sn);
+                       break;
+
+               case TRESP_MODEM_GET_VERSION:
+                       dbg("receive TRESP_MODEM_GET_VERSION");
+                       telephony_modem_complete_get_version(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_get_version->result,
+                                       resp_get_version->software,
+                                       resp_get_version->hardware,
+                                       resp_get_version->calibration,
+                                       resp_get_version->product_code);
+                       break;
+
+               case TRESP_MODEM_SET_DUN_PIN_CONTROL:
+                       dbg("receive TRESP_MODEM_SET_DUN_PIN_CONTROL");
+                       dbg("resp->result = %d", resp_dun_pin_ctrl->result);
+                       telephony_modem_complete_set_dun_pin_ctrl(dbus_info->interface_object, dbus_info->invocation, resp_dun_pin_ctrl->result);
+                       break;
+
+               default:
+                       dbg("not handled command[%d]", command);
+               break;
+       }
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_modem_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
+{
+       TelephonyModem *modem;
+       const struct tnoti_modem_power *info = data;
+       const struct tnoti_modem_dun_pin_control *pin = data;
+
+       if (!object) {
+               dbg("object is NULL");
+               return FALSE;
+       }
+
+       modem = telephony_object_peek_modem(TELEPHONY_OBJECT(object));
+       dbg("modem = %p", modem);
+
+       switch (command) {
+               case TNOTI_MODEM_POWER:
+                       dbg("modem->state = %d", info->state);
+                       telephony_modem_emit_power(modem, info->state);
+                       telephony_modem_set_power(modem, info->state);
+                       break;
+
+               case TNOTI_MODEM_DUN_PIN_CONTROL:
+                       dbg("modem dun pin ctrl noti signal(%d), status(%d)", pin->signal, pin->status);
+                       telephony_modem_emit_dun_pin_ctrl(modem, pin->signal, pin->status);
+                       break;
+
+               case TNOTI_MODEM_DUN_EXTERNAL_CALL:
+                       dbg("modem dun external call noti");
+                       telephony_modem_emit_dun_external_call(modem, TRUE);
+                       break;
+
+               default:
+                       dbg("not handled command[0x%x]", command);
+               break;
+       }
+
+       return TRUE;
+}
+
index 9d8026a16be62fb7957bfbce0adcc113bff2c26b..8a4ef5f9463404ef411725db3b0f75de3e285ed6 100644 (file)
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 #include <stdio.h>
 #include <string.h>
-#include <assert.h>
+#include <pthread.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <time.h>
 #include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
 
 #include <tcore.h>
-#include <plugin.h>
 #include <server.h>
+#include <plugin.h>
+#include <hal.h>
+#include <communicator.h>
 #include <storage.h>
+#include <queue.h>
 #include <user_request.h>
 #include <co_network.h>
-#include <communicator.h>
-
-#include <TapiCommon.h>
-#include <TelSim.h>
-#include <TelNetwork.h>
+#include <co_sim.h>
+#include <co_ps.h>
 
-#include "tel_cs_conn.h"
+#include "generated-code.h"
 #include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "ts_noti.h"
-#include "modules.h"
-
-#if 0
-typedef enum
-{
-       TAPI_NETWORK_SYSTEM_NO_SRV,                             /**< No Service available */
-       TAPI_NETWORK_SYSTEM_GSM,                                /**< Available service is GSM  */
-       TAPI_NETWORK_SYSTEM_GPRS,                               /**< Available service is GPRS */
-       TAPI_NETWORK_SYSTEM_EGPRS,                              /**< Available service is EGPRS  */
-       TAPI_NETWORK_SYSTEM_PCS1900,                    /**< Available service is PCS1900 band */
-       TAPI_NETWORK_SYSTEM_UMTS,                               /**< Available service is UMTS  */
-       TAPI_NETWORK_SYSTEM_GSM_AND_UMTS,               /**< Both GSM and UMTS systems available */
-       TAPI_NETWORK_SYSTEM_HSDPA,                              /**< Available service is hsdpa */
-       TAPI_NETWORK_SYSTEM_IS95A,                              /**< Available service is IS95A */
-       TAPI_NETWORK_SYSTEM_IS95B,                              /**< Available service is IS95B */
-       TAPI_NETWORK_SYSTEM_CDMA_1X,                    /**< Available service is CDMA 1X */
-       TAPI_NETWORK_SYSTEM_EVDO_REV_0, /**< Available service is EV-DO rev0 */
-       TAPI_NETWORK_SYSTEM_1X_EVDO_REV_0_HYBRID, /**< Available service is  1X and EV-DO rev0 */
-       TAPI_NETWORK_SYSTEM_EVDO_REV_A, /**< Available service is  EV-DO revA */
-       TAPI_NETWORK_SYSTEM_1X_EVDO_REV_A_HYBRID, /**< Available service is 1X and EV-DO revA */
-       TAPI_NETWORK_SYSTEM_EVDV,               /**< Available service is EV-DV */
-} TelNetworkSystemType_t;
-
-enum telephony_network_access_technology {
-       NETWORK_ACT_UNKNOWN = 0x0,
-       NETWORK_ACT_GSM = 0x1,
-       NETWORK_ACT_GPRS,
-       NETWORK_ACT_EGPRS,
-       NETWORK_ACT_UMTS = 0x4,
-       NETWORK_ACT_UTRAN = 0x4,
-       NETWORK_ACT_GSM_UTRAN,
-       NETWORK_ACT_IS95A = 0x11,
-       NETWORK_ACT_IS95B,
-       NETWORK_ACT_CDMA_1X,
-       NETWORK_ACT_EVDO_REV0,
-       NETWORK_ACT_CDMA_1X_EVDO_REV0,
-       NETWORK_ACT_EVDO_REVA,
-       NETWORK_ACT_CDMA_1X_EVDO_REVA,
-       NETWORK_ACT_EVDV,
-       NETWORK_ACT_LTE = 0x21,
-       NETWORK_ACT_NOT_SPECIFIED = 0xFF
-};
-#endif
 
-static TelNetworkSystemType_t _act_table[] = {
-               [NETWORK_ACT_GSM] =  TAPI_NETWORK_SYSTEM_GSM,
-               [NETWORK_ACT_GPRS] = TAPI_NETWORK_SYSTEM_GPRS,
-               [NETWORK_ACT_EGPRS] = TAPI_NETWORK_SYSTEM_EGPRS,
-               [NETWORK_ACT_UMTS] = TAPI_NETWORK_SYSTEM_UMTS,
-               [NETWORK_ACT_GSM_UTRAN] = TAPI_NETWORK_SYSTEM_GSM_AND_UMTS,
-               [NETWORK_ACT_IS95A] = TAPI_NETWORK_SYSTEM_IS95A,
-               [NETWORK_ACT_IS95B] = TAPI_NETWORK_SYSTEM_IS95B,
-               [NETWORK_ACT_CDMA_1X] = TAPI_NETWORK_SYSTEM_CDMA_1X,
-               [NETWORK_ACT_EVDO_REV0] = TAPI_NETWORK_SYSTEM_EVDO_REV_0,
-               [NETWORK_ACT_CDMA_1X_EVDO_REV0] = TAPI_NETWORK_SYSTEM_1X_EVDO_REV_0_HYBRID,
-               [NETWORK_ACT_EVDO_REVA] = TAPI_NETWORK_SYSTEM_EVDO_REV_A,
-               [NETWORK_ACT_CDMA_1X_EVDO_REVA] = TAPI_NETWORK_SYSTEM_1X_EVDO_REV_A_HYBRID,
-               [NETWORK_ACT_EVDV] = TAPI_NETWORK_SYSTEM_EVDV,
-               [NETWORK_ACT_NOT_SPECIFIED] = TAPI_NETWORK_SYSTEM_NO_SRV,
-};
 
 static char *_get_network_name_by_plmn(CoreObject *o, const char *plmn)
 {
@@ -131,366 +51,612 @@ static char *_get_network_name_by_plmn(CoreObject *o, const char *plmn)
        return NULL;
 }
 
-void dbus_request_network(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
+
+static enum tcore_hook_return on_hook_location_cellinfo(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
 {
-       int api_err = TAPI_API_SUCCESS;
-       tapi_dbus_connection_name conn_name;
-       unsigned int legacy_plmn;
-       TelNetworkServiceDomain_t info_service_domain;
-       TelNetworkPrefferedPlmnInfo_t *info_preferred_plmn_info;
-       TelNetworkPrefferedPlmnOp_t info_preferred_plmn_operation;
-       TelNetworkBandPreferred_t info_band_mode;
-       TelNetworkBand_t info_band;
-       TelNetworkMode_t *info_order;
-       TelNetworkPowerOnAttach_t info_power_on_attach;
-       int request_id = 0;
-
-       struct treq_network_set_plmn_selection_mode data_plmn_select;
-       struct treq_network_set_service_domain data_service_domain;
-       struct treq_network_set_band data_band;
-       struct treq_network_set_preferred_plmn data_preferred_plmn;
-       struct treq_network_set_order data_order;
-       struct treq_network_set_power_on_attach data_power_on_attach;
-       const struct tresp_network_search *data_network_search = NULL;
-       TReturn ret;
-       GSList *co_list = NULL;
-       CoreObject *co_network = NULL;
-       UserRequest *ur = NULL;
-       struct tcore_user_info ui = { 0, };
-       int i;
+       const struct tnoti_network_location_cellinfo *info = data;
+       TelephonyNetwork *network = user_data;
 
-       conn_name = g_array_index(in_param4, tapi_dbus_connection_name, 0);
+       if (!network)
+               return TCORE_HOOK_RETURN_CONTINUE;
 
-       co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_NETWORK);
-       if (!co_list) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
-       }
+       telephony_network_set_lac(network, info->lac);
+       telephony_network_set_cell_id(network, info->cell_id);
 
-       co_network = (CoreObject *)co_list->data;
-       g_slist_free(co_list);
+       return TCORE_HOOK_RETURN_CONTINUE;
+}
 
-       if (!co_network) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
-       }
+static enum tcore_hook_return on_hook_icon_info(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
+{
+       const struct tnoti_network_icon_info *info = data;
+       TelephonyNetwork *network = user_data;
 
-       ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
-       if (!ur) {
-               api_err = TAPI_API_SERVER_FAILURE;
-               goto OUT;
-       }
+       if (!network)
+               return TCORE_HOOK_RETURN_CONTINUE;
 
-       ui.appname = conn_name.name;
-       tcore_user_request_set_user_info(ur, &ui);
+       telephony_network_set_rssi(network, info->rssi);
 
-       switch (tapi_service_function) {
-               case TAPI_CS_NETWORK_SEARCH: /* 0x402 */
-                       tcore_user_request_set_data(ur, 0, NULL);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_SEARCH);
+       return TCORE_HOOK_RETURN_CONTINUE;
+}
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+static enum tcore_hook_return on_hook_registration_status(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
+{
+       const struct tnoti_network_registration_status *info = data;
+       TelephonyNetwork *network = user_data;
 
-                       dbg("ret = 0x%x", ret);
+       if (!network)
+               return TCORE_HOOK_RETURN_CONTINUE;
+
+       telephony_network_set_circuit_status(network, info->cs_domain_status);
+       telephony_network_set_packet_status(network, info->ps_domain_status);
+       telephony_network_set_service_type(network, info->service_type);
+       telephony_network_set_roaming_status(network, info->roaming_status);
+
+       switch (info->service_type) {
+               case NETWORK_SERVICE_TYPE_UNKNOWN:
+               case NETWORK_SERVICE_TYPE_NO_SERVICE:
+                       telephony_network_set_network_name(network, "No Service");
                        break;
 
-               case TAPI_CS_NETWORK_SELECT_AUTOMATIC: /* 0x410 */
-                       data_plmn_select.mode = NETWORK_SELECT_MODE_GSM_AUTOMATIC;
+               case NETWORK_SERVICE_TYPE_EMERGENCY:
+                       telephony_network_set_network_name(network, "EMERGENCY");
+                       break;
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_network_set_plmn_selection_mode), &data_plmn_select);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_SET_PLMN_SELECTION_MODE);
+               case NETWORK_SERVICE_TYPE_SEARCH:
+                       telephony_network_set_network_name(network, "Searching...");
+                       break;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+               default:
+                       break;
+       }
+
+       return TCORE_HOOK_RETURN_CONTINUE;
+}
+
+static enum tcore_hook_return on_hook_change(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
+{
+       const struct tnoti_network_change *info = data;
+       TelephonyNetwork *network = user_data;
+       struct tcore_network_operator_info *noi = NULL;
+       char mcc[4] = { 0, };
+       char mnc[4] = { 0, };
+       enum telephony_network_service_type svc_type;
+       enum tcore_network_name_priority network_name_priority;
+       char *tmp;
 
-                       dbg("ret = 0x%x", ret);
+       if (!network)
+               return TCORE_HOOK_RETURN_CONTINUE;
+
+       telephony_network_set_plmn(network, info->plmn);
+       telephony_network_set_lac(network, info->gsm.lac);
+
+       snprintf(mcc, 4, "%s", info->plmn);
+       snprintf(mnc, 4, "%s", info->plmn+3);
+
+       if (mnc[2] == '#')
+               mnc[2] = '\0';
+
+       tcore_network_get_network_name_priority(source, &network_name_priority);
+       telephony_network_set_name_priority(network, network_name_priority);
+
+       tmp = tcore_network_get_network_name(source, TCORE_NETWORK_NAME_TYPE_SPN);
+       if (tmp) {
+               telephony_network_set_spn_name(network, tmp);
+               free(tmp);
+       }
+
+       tcore_network_get_service_type(source, &svc_type);
+       switch(svc_type) {
+               case NETWORK_SERVICE_TYPE_UNKNOWN:
+               case NETWORK_SERVICE_TYPE_NO_SERVICE:
+                       telephony_network_set_network_name(network, "No Service");
                        break;
 
-               case TAPI_CS_NETWORK_SELECT_MANUAL: /* 0x411 */
-                       legacy_plmn = g_array_index(in_param1, unsigned int, 0);
-                       data_plmn_select.mode = NETWORK_SELECT_MODE_GSM_MANUAL;
-                       snprintf(data_plmn_select.plmn, 6, "%u", legacy_plmn);
-                       if (strlen(data_plmn_select.plmn) <= 5)
-                               data_plmn_select.plmn[5] = '#';
-
-                       data_network_search = ctx->plmn_list_search_result_cache;
-                       for (i = 0; i < data_network_search->list_count; i++) {
-                               if (!g_strcmp0(data_network_search->list[i].plmn, data_plmn_select.plmn)) {
-                                       data_plmn_select.act = data_network_search->list[i].act;
-                                       break;
+               case NETWORK_SERVICE_TYPE_EMERGENCY:
+                       telephony_network_set_network_name(network, "EMERGENCY");
+                       break;
+
+               case NETWORK_SERVICE_TYPE_SEARCH:
+                       telephony_network_set_network_name(network, "Searching...");
+                       break;
+
+               default:
+                       tmp = tcore_network_get_network_name(source, TCORE_NETWORK_NAME_TYPE_SHORT);
+                       if (tmp) {
+                               telephony_network_set_network_name(network, tmp);
+                               free(tmp);
+                       }
+                       else {
+                               /* pre-defined table */
+                               noi = tcore_network_operator_info_find(source, mcc, mnc);
+                               if (noi) {
+                                       dbg("%s-%s: country=[%s], oper=[%s]", mcc, mnc, noi->country, noi->name);
+                                       dbg("NWNAME = pre-define table[%s]", noi->name);
+                                       telephony_network_set_network_name(network, noi->name);
+                               }
+                               else {
+                                       dbg("%s-%s: no network operator name", mcc, mnc);
+                                       telephony_network_set_network_name(network, info->plmn);
                                }
                        }
+                       break;
+       }
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_network_set_plmn_selection_mode), &data_plmn_select);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_SET_PLMN_SELECTION_MODE);
+       return TCORE_HOOK_RETURN_CONTINUE;
+}
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+static enum tcore_hook_return on_hook_ps_protocol_status(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
+{
+       const struct tnoti_ps_protocol_status *info = data;
+       TelephonyNetwork *network = user_data;
 
-                       dbg("ret = 0x%x", ret);
-                       break;
+       if (!network)
+               return TCORE_HOOK_RETURN_CONTINUE;
 
-               case TAPI_CS_NETWORK_GETSELECTIONMODE: /* 0x401 */
-                       tcore_user_request_set_data(ur, 0, NULL);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_GET_PLMN_SELECTION_MODE);
+       telephony_network_set_network_type(network, info->status);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       return TCORE_HOOK_RETURN_CONTINUE;
+}
 
-                       dbg("ret = 0x%x", ret);
-                       break;
+static gboolean
+on_network_search (TelephonyNetwork *network,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+#if 1
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
 
-               case TAPI_CS_NETWORK_SETSERVICEDOMAIN: /* 0x405 */
-                       info_service_domain = g_array_index(in_param1, TelNetworkServiceDomain_t, 0);
-                       data_service_domain.domain = info_service_domain;
+       ur = MAKE_UR(ctx, network, invocation);
+       tcore_user_request_set_data(ur, 0, NULL);
+       tcore_user_request_set_command(ur, TREQ_NETWORK_SEARCH);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_network_complete_search(network, invocation, NULL, ret);
+               tcore_user_request_unref(ur);
+       }
+#else
+       /* Dummy return */
+       GVariant *result = NULL;
+       GVariantBuilder b;
+       int i;
+       char *buf;
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_network_set_service_domain), &data_service_domain);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_SET_SERVICE_DOMAIN);
+       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       for (i = 0; i < 3; i++) {
+               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
 
-                       dbg("ret = 0x%x", ret);
-                       break;
+               g_variant_builder_add(&b, "{sv}", "plmn", g_variant_new_string("45001"));
+               g_variant_builder_add(&b, "{sv}", "act", g_variant_new_int32(4));
+               g_variant_builder_add(&b, "{sv}", "type", g_variant_new_int32(2));
+               g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string("Samsung"));
 
-               case TAPI_CS_NETWORK_GETSERVICEDOMAIN: /* 0x406 */
-                       tcore_user_request_set_data(ur, 0, NULL);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_GET_SERVICE_DOMAIN);
+               g_variant_builder_close(&b);
+       }
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       result = g_variant_builder_end(&b);
 
-                       dbg("ret = 0x%x", ret);
-                       break;
+       telephony_network_complete_search(network, invocation, result, 0);
+       g_variant_unref(result);
+#endif
 
-               case TAPI_CS_NETWORK_SETNETWORKBAND: /* 0x403 */
-                       info_band_mode = g_array_index(in_param1,TelNetworkBandPreferred_t, 0);
-                       info_band = g_array_index(in_param2,TelNetworkBand_t, 0);
+       return TRUE;
+}
 
-                       data_band.mode = info_band_mode;
-                       data_band.band = info_band;
+static gboolean
+on_network_search_cancel (TelephonyNetwork *network,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_network_set_band), &data_band);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_SET_BAND);
+       ur = MAKE_UR(ctx, network, invocation);
+       tcore_user_request_set_data(ur, 0, NULL);
+       tcore_user_request_set_command(ur, TREQ_NETWORK_SET_CANCEL_MANUAL_SEARCH);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_network_complete_search_cancel(network, invocation, ret);
+               tcore_user_request_unref(ur);
+       }
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       return TRUE;
+}
 
-                       dbg("ret = 0x%x", ret);
-                       break;
+static gboolean
+on_network_get_selection_mode (TelephonyNetwork *network,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
 
-               case TAPI_CS_NETWORK_GETNETWORKBAND: /* 0x404 */
-                       tcore_user_request_set_data(ur, 0, NULL);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_GET_BAND);
+       ur = MAKE_UR(ctx, network, invocation);
+       tcore_user_request_set_data(ur, 0, NULL);
+       tcore_user_request_set_command(ur, TREQ_NETWORK_GET_PLMN_SELECTION_MODE);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_network_complete_get_selection_mode(network, invocation, -1, ret);
+               tcore_user_request_unref(ur);
+       }
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       return TRUE;
+}
 
-                       dbg("ret = 0x%x", ret);
-                       break;
+static gboolean
+on_network_set_selection_mode (TelephonyNetwork *network,
+               GDBusMethodInvocation *invocation,
+               gint mode,
+               const gchar *plmn,
+               gint act,
+               gpointer user_data)
+{
+       struct treq_network_set_plmn_selection_mode req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
 
-               case TAPI_CS_NETWORK_SETPREFPLMN: /* 0x409 */
-                       info_preferred_plmn_operation = g_array_index(in_param1,TelNetworkPrefferedPlmnOp_t, 0);
-                       info_preferred_plmn_info = &g_array_index(in_param2,TelNetworkPrefferedPlmnInfo_t, 0);
+       memset(&req, 0, sizeof(struct treq_network_set_plmn_selection_mode));
 
-                       data_preferred_plmn.operation = info_preferred_plmn_operation;
-                       memcpy(data_preferred_plmn.plmn, info_preferred_plmn_info->Plmn, 6);
+       if (mode == 0) {
+               /* Automatic */
+               req.mode = NETWORK_SELECT_MODE_GSM_AUTOMATIC;
+       }
+       else if (mode == 1) {
+               /* Manual */
+               req.mode = NETWORK_SELECT_MODE_GSM_MANUAL;
+               snprintf(req.plmn, 7, "%s", plmn);
+               if (strlen(plmn) <= 5)
+                       req.plmn[5] = '#';
+               req.act = act;
+       }
+       else {
+               telephony_network_complete_set_selection_mode(network, invocation, -1);
+               return TRUE;
+       }
 
-                       if (strlen((char *)info_preferred_plmn_info->Plmn) == 4) {
-                               data_preferred_plmn.plmn[4] = data_preferred_plmn.plmn[3];
-                               data_preferred_plmn.plmn[3] = '0';
-                       }
+       dbg("mode = %d, plmn = [%s], act = %d",
+                       req.mode, req.plmn, req.act);
 
-                       if (strlen((char *)info_preferred_plmn_info->Plmn) <= 5) {
-                               data_preferred_plmn.plmn[5] = '#';
-                       }
+       ur = MAKE_UR(ctx, network, invocation);
 
-                       data_preferred_plmn.ef_index = info_preferred_plmn_info->Index;
+       tcore_user_request_set_data(ur, sizeof(struct treq_network_set_plmn_selection_mode), &req);
+       tcore_user_request_set_command(ur, TREQ_NETWORK_SET_PLMN_SELECTION_MODE);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_network_complete_set_selection_mode(network, invocation, ret);
+               tcore_user_request_unref(ur);
+       }
 
-                       switch (info_preferred_plmn_info->SystemType) {
-                               case TAPI_NETWORK_SYSTEM_GSM:
-                                       data_preferred_plmn.act = NETWORK_ACT_GSM;
-                                       break;
+       return TRUE;
+}
 
-                               case TAPI_NETWORK_SYSTEM_UMTS:
-                                       data_preferred_plmn.act = NETWORK_ACT_UMTS;
-                                       break;
 
-                               case TAPI_NETWORK_SYSTEM_GPRS:
-                                       data_preferred_plmn.act = NETWORK_ACT_GPRS;
-                                       break;
+static gboolean
+on_network_set_service_domain (TelephonyNetwork *network,
+               GDBusMethodInvocation *invocation,
+               gint domain,
+               gpointer user_data)
+{
+       struct treq_network_set_service_domain req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
 
-                               case TAPI_NETWORK_SYSTEM_EGPRS:
-                                       data_preferred_plmn.act = NETWORK_ACT_EGPRS;
-                                       break;
+       ur = MAKE_UR(ctx, network, invocation);
 
-                               case TAPI_NETWORK_SYSTEM_GSM_AND_UMTS:
-                                       data_preferred_plmn.act = NETWORK_ACT_UMTS;
-                                       break;
+       req.domain = domain;
 
-                               default:
-                                       break;
-                       }
+       tcore_user_request_set_data(ur, sizeof(struct treq_network_set_service_domain), &req);
+       tcore_user_request_set_command(ur, TREQ_NETWORK_SET_SERVICE_DOMAIN);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_network_complete_set_service_domain(network, invocation, ret);
+               tcore_user_request_unref(ur);
+       }
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_network_set_preferred_plmn), &data_preferred_plmn);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_SET_PREFERRED_PLMN);
+       return TRUE;
+}
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+static gboolean
+on_network_get_service_domain (TelephonyNetwork *network,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
 
-                       dbg("ret = 0x%x", ret);
-                       break;
+       ur = MAKE_UR(ctx, network, invocation);
+       tcore_user_request_set_data(ur, 0, NULL);
+       tcore_user_request_set_command(ur, TREQ_NETWORK_GET_SERVICE_DOMAIN);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_network_complete_get_service_domain(network, invocation, -1, ret);
+               tcore_user_request_unref(ur);
+       }
 
-               case TAPI_CS_NETWORK_GETPREFPLMN: /* 0x40A */
-                       tcore_user_request_set_data(ur, 0, NULL);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_GET_PREFERRED_PLMN);
+       return TRUE;
+}
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+static gboolean
+on_network_set_band (TelephonyNetwork *network,
+               GDBusMethodInvocation *invocation,
+               gint band,
+               gint mode,
+               gpointer user_data)
+{
+       struct treq_network_set_band req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
 
-                       dbg("ret = 0x%x", ret);
-                       break;
+       ur = MAKE_UR(ctx, network, invocation);
 
-               case TAPI_CS_NETWORK_SETNETWORKORDER: /* 0x40000412 */
-                       info_order = &g_array_index(in_param1,TelNetworkMode_t, 0);
-                       data_order.order = *info_order;
+       req.mode = mode;
+       req.band = band;
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_network_set_order), &data_order);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_SET_ORDER);
+       tcore_user_request_set_data(ur, sizeof(struct treq_network_set_band), &req);
+       tcore_user_request_set_command(ur, TREQ_NETWORK_SET_BAND);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_network_complete_set_band(network, invocation, ret);
+               tcore_user_request_unref(ur);
+       }
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       return TRUE;
+}
 
-                       dbg("ret = 0x%x", ret);
-                       break;
+static gboolean
+on_network_get_band (TelephonyNetwork *network,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
 
-               case TAPI_CS_NETWORK_GETNETWORKORDER: /* 0x40000413 */
-                       tcore_user_request_set_data(ur, 0, NULL);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_GET_ORDER);
+       ur = MAKE_UR(ctx, network, invocation);
+       tcore_user_request_set_data(ur, 0, NULL);
+       tcore_user_request_set_command(ur, TREQ_NETWORK_GET_BAND);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_network_complete_get_band(network, invocation, -1, -1, ret);
+               tcore_user_request_unref(ur);
+       }
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       return TRUE;
+}
 
-                       dbg("ret = 0x%x", ret);
-                       break;
+static gboolean
+on_network_set_mode (TelephonyNetwork *network,
+               GDBusMethodInvocation *invocation,
+               gint mode,
+               gpointer user_data)
+{
+       struct treq_network_set_mode req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
 
-               case TAPI_CS_NETWORK_SETPOWERONATTACH: /* 0x40000414 */
-                       info_power_on_attach = g_array_index(in_param1,TelNetworkPowerOnAttach_t, 0);
-                       data_power_on_attach.enable = info_power_on_attach;
+       ur = MAKE_UR(ctx, network, invocation);
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_network_set_power_on_attach), &data_power_on_attach);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_SET_POWER_ON_ATTACH);
+       req.mode = mode;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       tcore_user_request_set_data(ur, sizeof(struct treq_network_set_mode), &req);
+       tcore_user_request_set_command(ur, TREQ_NETWORK_SET_MODE);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_network_complete_set_mode(network, invocation, ret);
+               tcore_user_request_unref(ur);
+       }
 
-                       dbg("ret = 0x%x", ret);
-                       break;
+       return TRUE;
+}
 
-               case TAPI_CS_NETWORK_GETPOWERONATTACH: /* 0x40000415 */
-                       tcore_user_request_set_data(ur, 0, NULL);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_GET_POWER_ON_ATTACH);
+static gboolean
+on_network_get_mode (TelephonyNetwork *network,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       ur = MAKE_UR(ctx, network, invocation);
+       tcore_user_request_set_data(ur, 0, NULL);
+       tcore_user_request_set_command(ur, TREQ_NETWORK_GET_MODE);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_network_complete_get_mode(network, invocation, -1, ret);
+               tcore_user_request_unref(ur);
+       }
 
-                       dbg("ret = 0x%x", ret);
-                       break;
+       return TRUE;
+}
 
-               case TAPI_CS_NETWORK_CANCELMANUALSEARCH: /* 0x4000416 */
-                       tcore_user_request_set_data(ur, 0, NULL);
-                       tcore_user_request_set_command(ur, TREQ_NETWORK_SET_CANCEL_MANUAL_SEARCH);
+static gboolean
+on_network_set_preferred_plmn (TelephonyNetwork *network,
+               GDBusMethodInvocation *invocation,
+               gint mode,
+               gint ef_index,
+               gint act,
+               const gchar *plmn,
+               gpointer user_data)
+{
+       struct treq_network_set_preferred_plmn req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       ur = MAKE_UR(ctx, network, invocation);
 
-                       dbg("ret = 0x%x", ret);
-                       break;
+       req.operation = mode;
+       req.ef_index = ef_index;
+       req.act = act;
 
-               /* Unused */
-               case TAPI_CS_NETWORK_SETNETWORKMODE:
-               case TAPI_CS_NETWORK_GETNETWORKMODE:
-               case TAPI_CS_NETWORK_SETROAMINGMODE:
-               case TAPI_CS_NETWORK_GETROAMINGMODE:
-               case TAPI_CS_NETWORK_SETCDMAHYBRIDMODE:
-               case TAPI_CS_NETWORK_GETCDMAHYBRIDMODE:
-               case TAPI_CS_NETWORK_CANCELMANUALSELECTION:
-               default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
+       memcpy(req.plmn, plmn, 6);
+
+       if (strlen(plmn) <= 5) {
+               req.plmn[5] = '#';
        }
 
-OUT:
-       if (api_err != TAPI_API_SUCCESS) {
-               tcore_user_request_free(ur);
+       tcore_user_request_set_data(ur, sizeof(struct treq_network_set_preferred_plmn), &req);
+       tcore_user_request_set_command(ur, TREQ_NETWORK_SET_PREFERRED_PLMN);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_network_complete_set_preferred_plmn(network, invocation, ret);
+               tcore_user_request_unref(ur);
        }
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-       g_array_append_vals(*out_param2, &request_id, sizeof(int));
+
+       return TRUE;
 }
 
-TReturn dbus_response_network(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
+static gboolean
+on_network_get_preferred_plmn (TelephonyNetwork *network,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
 {
-       const struct tresp_network_search *data_network_search = data;
-       const struct tresp_network_set_plmn_selection_mode *data_set_plmn_selection_mode = data;
-       const struct tresp_network_get_plmn_selection_mode *data_get_plmn_selection_mode = data;
-       const struct tresp_network_set_service_domain *data_set_service_domain = data;
-       const struct tresp_network_get_service_domain *data_get_service_domain = data;
-       const struct tresp_network_set_band *data_set_band = data;
-       const struct tresp_network_get_band *data_get_band = data;
-       const struct tresp_network_set_preferred_plmn *data_set_preferred_plmn = data;
-       const struct tresp_network_get_preferred_plmn *data_get_preferred_plmn = data;
-       const struct tresp_network_set_order *data_set_order = data;
-       const struct tresp_network_get_order *data_get_order = data;
-       const struct tresp_network_set_power_on_attach *data_set_power_on_attach = data;
-       const struct tresp_network_get_power_on_attach *data_get_power_on_attach = data;
-       const struct tresp_network_set_cancel_manual_search *data_set_cancel_manual_search = data;
-
-       TelNetworkPlmnList_t info_plmn_list;
-       TelNetworkSelectionMode_t info_selection_mode;
-       TelNetworkServiceDomain_t info_service_domain;
-       TelNetworkBand_t info_network_band;
-       TelNetworkPrefferedPlmnList_t info_preferred_plmn_list;
-       TelNetworkMode_t info_network_mode;
-       TelNetworkPowerOnAttach_t info_power_on_attach;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
+
+       ur = MAKE_UR(ctx, network, invocation);
+       tcore_user_request_set_data(ur, 0, NULL);
+       tcore_user_request_set_command(ur, TREQ_NETWORK_GET_PREFERRED_PLMN);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_network_complete_get_preferred_plmn(network, invocation, NULL, ret);
+               tcore_user_request_unref(ur);
+       }
+
+       return TRUE;
+}
+
+static gboolean
+on_network_get_serving_network (TelephonyNetwork *network,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       TReturn ret;
+
+       ur = MAKE_UR(ctx, network, invocation);
+       tcore_user_request_set_data(ur, 0, NULL);
+       tcore_user_request_set_command(ur, TREQ_NETWORK_GET_SERVING_NETWORK);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               telephony_network_complete_get_serving_network(network, invocation, 0, NULL, 0, ret);
+               tcore_user_request_unref(ur);
+       }
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_setup_network_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
+{
+       TelephonyNetwork *network;
+
+       network = telephony_network_skeleton_new();
+       telephony_object_skeleton_set_network(object, network);
+       g_object_unref(network);
+
+       g_signal_connect (network,
+                       "handle-search",
+                       G_CALLBACK (on_network_search),
+                       ctx);
+
+       g_signal_connect (network,
+                       "handle-search-cancel",
+                       G_CALLBACK (on_network_search_cancel),
+                       ctx);
+
+       g_signal_connect (network,
+                       "handle-set-selection-mode",
+                       G_CALLBACK (on_network_set_selection_mode),
+                       ctx);
+
+       g_signal_connect (network,
+                       "handle-get-selection-mode",
+                       G_CALLBACK (on_network_get_selection_mode),
+                       ctx);
+
+       g_signal_connect (network,
+                       "handle-set-service-domain",
+                       G_CALLBACK (on_network_set_service_domain),
+                       ctx);
+
+       g_signal_connect (network,
+                       "handle-get-service-domain",
+                       G_CALLBACK (on_network_get_service_domain),
+                       ctx);
+
+       g_signal_connect (network,
+                       "handle-set-band",
+                       G_CALLBACK (on_network_set_band),
+                       ctx);
+
+       g_signal_connect (network,
+                       "handle-get-band",
+                       G_CALLBACK (on_network_get_band),
+                       ctx);
+
+       g_signal_connect (network,
+                       "handle-set-mode",
+                       G_CALLBACK (on_network_set_mode),
+                       ctx);
+
+       g_signal_connect (network,
+                       "handle-get-mode",
+                       G_CALLBACK (on_network_get_mode),
+                       ctx);
+
+       g_signal_connect (network,
+                       "handle-set-preferred-plmn",
+                       G_CALLBACK (on_network_set_preferred_plmn),
+                       ctx);
+
+       g_signal_connect (network,
+                       "handle-get-preferred-plmn",
+                       G_CALLBACK (on_network_get_preferred_plmn),
+                       ctx);
+
+       g_signal_connect (network,
+                       "handle-get-serving-network",
+                       G_CALLBACK (on_network_get_serving_network),
+                       ctx);
+
+       tcore_server_add_notification_hook(ctx->server, TNOTI_NETWORK_LOCATION_CELLINFO, on_hook_location_cellinfo, network);
+       tcore_server_add_notification_hook(ctx->server, TNOTI_NETWORK_ICON_INFO, on_hook_icon_info, network);
+       tcore_server_add_notification_hook(ctx->server, TNOTI_NETWORK_REGISTRATION_STATUS, on_hook_registration_status, network);
+       tcore_server_add_notification_hook(ctx->server, TNOTI_NETWORK_CHANGE, on_hook_change, network);
+       tcore_server_add_notification_hook(ctx->server, TNOTI_PS_PROTOCOL_STATUS, on_hook_ps_protocol_status, network);
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
+{
+       const struct tresp_network_search *resp_network_search = data;
+       const struct tresp_network_get_plmn_selection_mode *resp_get_plmn_selection_mode = data;
+       const struct tresp_network_set_plmn_selection_mode *resp_set_plmn_selection_mode = data;
+       const struct tresp_network_set_service_domain *resp_set_service_domain = data;
+       const struct tresp_network_get_service_domain *resp_get_service_domain = data;
+       const struct tresp_network_set_band *resp_set_band = data;
+       const struct tresp_network_get_band *resp_get_band = data;
+       const struct tresp_network_set_preferred_plmn *resp_set_preferred_plmn = data;
+       const struct tresp_network_get_preferred_plmn *resp_get_preferred_plmn = data;
+       const struct tresp_network_get_serving_network *resp_get_serving_network = data;
+       const struct tresp_network_set_mode *resp_set_mode = data;
+       const struct tresp_network_get_mode *resp_get_mode = data;
 
        int i = 0;
-       int request_id = 0;
-       int ret = TAPI_API_SUCCESS;
-       char *buf = NULL;
+       char *buf;
 
        GSList *co_list;
        CoreObject *co_network;
@@ -519,206 +685,240 @@ TReturn dbus_response_network(struct custom_data *ctx, UserRequest *ur, const ch
        }
 
        switch (command) {
-               case TRESP_NETWORK_SEARCH:
-                       memset(&info_plmn_list, 0, sizeof(TelNetworkPlmnList_t));
-                       info_plmn_list.networks_count = data_network_search->list_count;
-
-                       dbg("size_of(TelNetworkPlmnList_t) = %d", sizeof(TelNetworkPlmnList_t));
-                       dbg("list_count = %d", info_plmn_list.networks_count);
-                       for (i=0; i<info_plmn_list.networks_count; i++) {
-                               info_plmn_list.network_list[i].plmn_id = atoi(data_network_search->list[i].plmn);
-                               info_plmn_list.network_list[i].type_of_plmn = data_network_search->list[i].status;
-                               info_plmn_list.network_list[i].access_technology = _act_table[data_network_search->list[i].act];
-
-                               buf = _get_network_name_by_plmn(co_network, data_network_search->list[i].plmn);
-                               if (buf) {
-                                       memcpy(info_plmn_list.network_list[i].network_name, buf, 40);
-                                       memcpy(info_plmn_list.network_list[i].service_provider_name, buf, 40);
+               case TRESP_NETWORK_SEARCH: {
+                       GVariant *result = NULL;
+                       GVariantBuilder b;
+
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+
+                       for (i = 0; i < resp_network_search->list_count; i++) {
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+
+                               g_variant_builder_add(&b, "{sv}", "plmn", g_variant_new_string(resp_network_search->list[i].plmn));
+                               g_variant_builder_add(&b, "{sv}", "act", g_variant_new_int32(resp_network_search->list[i].act));
+                               g_variant_builder_add(&b, "{sv}", "type", g_variant_new_int32(resp_network_search->list[i].status));
+
+                               if (strlen(resp_network_search->list[i].name) > 0) {
+                                       g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(resp_network_search->list[i].name));
                                }
                                else {
-                                       snprintf(info_plmn_list.network_list[i].network_name, 40, "%d", info_plmn_list.network_list[i].plmn_id);
-                                       snprintf(info_plmn_list.network_list[i].service_provider_name, 40, "%d", info_plmn_list.network_list[i].plmn_id);
+                                       buf = _get_network_name_by_plmn(co_network, resp_network_search->list[i].plmn);
+                                       if (buf)
+                                               g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(buf));
+                                       else
+                                               g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(resp_network_search->list[i].plmn));
                                }
 
-                               dbg("[%d] plmn_id = %d", i, info_plmn_list.network_list[i].plmn_id);
-                               dbg("[%d] type_of_plmn = %d", i, info_plmn_list.network_list[i].type_of_plmn);
-                               dbg("[%d] access_technology = %d", i, info_plmn_list.network_list[i].access_technology);
-                               dbg("[%d] network_name = %s", i, info_plmn_list.network_list[i].network_name);
-                               dbg("[%d] service_provider_name = %s", i, info_plmn_list.network_list[i].service_provider_name);
+                               g_variant_builder_close(&b);
                        }
 
-                       /* Save cache */
-                       if (!ctx->plmn_list_search_result_cache)
-                               ctx->plmn_list_search_result_cache = calloc(sizeof(struct tresp_network_search), 1);
-                       memcpy(ctx->plmn_list_search_result_cache, data_network_search, sizeof(struct tresp_network_search));
+                       result = g_variant_builder_end(&b);
+
+                       telephony_network_complete_search(dbus_info->interface_object, dbus_info->invocation, result, 0);
+               }
 
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETWORK, TAPI_EVENT_NETWORK_SEARCH_CNF,
-                                       appname, request_id, ret, sizeof(TelNetworkPlmnList_t), (void*) &info_plmn_list);
                        break;
 
                case TRESP_NETWORK_SET_PLMN_SELECTION_MODE:
-                       if (data_set_plmn_selection_mode->result != TCORE_RETURN_SUCCESS)
-                               ret = TAPI_API_OPERATION_FAILED;
-
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETWORK, TAPI_EVENT_NETWORK_SELECT_CNF,
-                                       appname, request_id, ret, 0, NULL);
+                       dbg("receive TRESP_SET_PLMN_SELECTION_MODE");
+                       dbg("resp->result = %d", resp_set_plmn_selection_mode->result);
+                       telephony_network_complete_set_selection_mode(dbus_info->interface_object, dbus_info->invocation, resp_set_plmn_selection_mode->result);
                        break;
 
                case TRESP_NETWORK_GET_PLMN_SELECTION_MODE:
-                       info_selection_mode = data_get_plmn_selection_mode->mode;
-
-                       switch (data_get_plmn_selection_mode->mode) {
+                       dbg("receive TRESP_GET_PLMN_SELECTION_MODE");
+                       dbg("resp->mode = %d", resp_get_plmn_selection_mode->mode);
+                       switch (resp_get_plmn_selection_mode->mode) {
                                case NETWORK_SELECT_MODE_GLOBAL_AUTOMATIC:
-                                       info_selection_mode = TAPI_NETWORK_SELECTIONMODE_GLOBAL_AUTOMAITIC;
-                                       break;
-
                                case NETWORK_SELECT_MODE_GSM_AUTOMATIC:
-                                       info_selection_mode = TAPI_NETWORK_SELECTIONMODE_AUTOMATIC;
+                                       telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation, 0, 0);
                                        break;
 
                                case NETWORK_SELECT_MODE_GSM_MANUAL:
-                                       info_selection_mode = TAPI_NETWORK_SELECTIONMODE_MANUAL;
-                                       break;
-
-                               case NETWORK_SELECT_MODE_CDMA:
-                                       info_selection_mode = TAPI_NETWORK_SELECTIONMODE_CDMA;
+                                       telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation, 1, 0);
                                        break;
 
                                default:
+                                       telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation, -1, -1);
                                        break;
                        }
-
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETWORK,
-                                       TAPI_EVENT_NETWORK_GETSELECTIONMODE_CNF, appname, request_id, ret,
-                                       sizeof(TelNetworkSelectionMode_t), (void*) &info_selection_mode);
-
                        break;
 
                case TRESP_NETWORK_SET_SERVICE_DOMAIN:
-                       if (data_set_service_domain->result != TCORE_RETURN_SUCCESS)
-                               ret = TAPI_API_OPERATION_FAILED;
-
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETWORK, TAPI_EVENT_NETWORK_SETSERVICEDOMAIN_CNF,
-                                       appname, request_id, ret, 0, NULL);
+                       dbg("receive TRESP_NETWORK_SET_SERVICE_DOMAIN");
+                       dbg("resp->result = %d", resp_set_service_domain->result);
+                       telephony_network_complete_set_service_domain(dbus_info->interface_object, dbus_info->invocation, resp_set_service_domain->result);
                        break;
 
                case TRESP_NETWORK_GET_SERVICE_DOMAIN:
-                       info_service_domain = data_get_service_domain->domain;
-
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETWORK,
-                                       TAPI_EVENT_NETWORK_GETSERVICEDOMAIN_CNF, appname, request_id, ret, sizeof(TelNetworkServiceDomain_t),
-                                       (void*) &info_service_domain);
+                       dbg("receive TRESP_NETWORK_GET_SERVICE_DOMAIN");
+                       dbg("resp->domain = %d", resp_get_service_domain->domain);
+                       telephony_network_complete_get_service_domain(dbus_info->interface_object, dbus_info->invocation, resp_get_service_domain->domain, 0);
                        break;
 
                case TRESP_NETWORK_SET_BAND:
-                       if (data_set_band->result != TCORE_RETURN_SUCCESS)
-                               ret = TAPI_API_OPERATION_FAILED;
-
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETWORK, TAPI_EVENT_NETWORK_SETNWBAND_CNF,
-                                       appname, request_id, ret, 0, NULL);
+                       dbg("receive TRESP_NETWORK_SET_BAND");
+                       dbg("resp->result = %d", resp_set_band->result);
+                       telephony_network_complete_set_band(dbus_info->interface_object, dbus_info->invocation, resp_set_band->result);
                        break;
 
                case TRESP_NETWORK_GET_BAND:
-                       info_network_band = data_get_band->band;
+                       dbg("receive TRESP_NETWORK_GET_BAND");
+                       dbg("resp->mode = %d", resp_get_band->mode);
+                       dbg("resp->band = %d", resp_get_band->band);
+                       telephony_network_complete_get_band(dbus_info->interface_object, dbus_info->invocation, resp_get_band->band, resp_get_band->mode, 0);
+                       break;
 
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETWORK, TAPI_EVENT_NETWORK_GETNWBAND_CNF,
-                                       appname, request_id, ret, sizeof(TelNetworkBand_t), (void*) &info_network_band);
+               case TRESP_NETWORK_SET_MODE:
+                       dbg("receive TRESP_NETWORK_SET_MODE");
+                       dbg("resp->result = %d", resp_set_mode->result);
+                       telephony_network_complete_set_mode(dbus_info->interface_object, dbus_info->invocation, resp_set_mode->result);
                        break;
 
-               case TRESP_NETWORK_SET_PREFERRED_PLMN:
-                       if (data_set_preferred_plmn->result != TCORE_RETURN_SUCCESS)
-                               ret = TAPI_API_OPERATION_FAILED;
+               case TRESP_NETWORK_GET_MODE:
+                       dbg("receive TRESP_NETWORK_GET_MODE");
+                       dbg("resp->mode = %d", resp_get_mode->mode);
+                       telephony_network_complete_get_mode(dbus_info->interface_object, dbus_info->invocation, resp_get_mode->mode, resp_get_mode->result);
+                       break;
 
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETWORK,
-                                       TAPI_EVENT_NETWORK_SETPREFFEREDPLMN_CNF, appname, request_id, ret, 0, NULL);
+               case TRESP_NETWORK_SET_PREFERRED_PLMN:
+                       dbg("receive TRESP_NETWORK_SET_PREFERRED_PLMN");
+                       dbg("resp->result = %d", resp_set_preferred_plmn->result);
+                       telephony_network_complete_set_preferred_plmn(dbus_info->interface_object, dbus_info->invocation, resp_set_preferred_plmn->result);
                        break;
 
                case TRESP_NETWORK_GET_PREFERRED_PLMN:
-                       info_preferred_plmn_list.NumOfPreffPlmns = data_get_preferred_plmn->list_count;
-
-                       for (i = 0; i < data_get_preferred_plmn->list_count; i++) {
-                               info_preferred_plmn_list.PreffPlmnRecord[i].Index = data_get_preferred_plmn->list[i].ef_index;
-                               memcpy(info_preferred_plmn_list.PreffPlmnRecord[i].Plmn, data_get_preferred_plmn->list[i].plmn, 6);
-
-                               buf = _get_network_name_by_plmn(co_network, data_network_search->list[i].plmn);
-                               if (buf) {
-                                       memcpy(info_preferred_plmn_list.PreffPlmnRecord[i].network_name, buf, 40);
-                                       memcpy(info_preferred_plmn_list.PreffPlmnRecord[i].service_provider_name, buf, 40);
-                               }
-                               else {
-                                       memcpy(info_preferred_plmn_list.PreffPlmnRecord[i].network_name,
-                                                       data_get_preferred_plmn->list[i].plmn, 6);
-                                       memcpy(info_preferred_plmn_list.PreffPlmnRecord[i].service_provider_name,
-                                                       data_get_preferred_plmn->list[i].plmn, 6);
+                       dbg("receive TRESP_NETWORK_GET_PREFERRED_PLMN");
+                       {
+                               GVariant *result = NULL;
+                               GVariantBuilder b;
+
+                               g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+
+                               for (i = 0; i < resp_get_preferred_plmn->list_count; i++) {
+                                       g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+
+                                       g_variant_builder_add(&b, "{sv}", "plmn",
+                                                       g_variant_new_string(resp_get_preferred_plmn->list[i].plmn));
+                                       g_variant_builder_add(&b, "{sv}", "act", g_variant_new_int32(resp_get_preferred_plmn->list[i].act));
+                                       g_variant_builder_add(&b, "{sv}", "index",
+                                                       g_variant_new_int32(resp_get_preferred_plmn->list[i].ef_index));
+
+                                       buf = _get_network_name_by_plmn(co_network, resp_get_preferred_plmn->list[i].plmn);
+                                       if (buf)
+                                               g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(buf));
+                                       else
+                                               g_variant_builder_add(&b, "{sv}", "name",
+                                                               g_variant_new_string(resp_get_preferred_plmn->list[i].plmn));
+
+                                       g_variant_builder_close(&b);
                                }
 
-                               info_preferred_plmn_list.PreffPlmnRecord[i].SystemType = data_get_preferred_plmn->list[i].act;
-                       }
+                               result = g_variant_builder_end(&b);
 
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETWORK,
-                                       TAPI_EVENT_NETWORK_GETPREFFEREDPLMN_CNF, appname, request_id, ret, sizeof(TelNetworkPrefferedPlmnList_t),
-                                       (void*) &info_preferred_plmn_list);
+                               telephony_network_complete_get_preferred_plmn(dbus_info->interface_object, dbus_info->invocation,
+                                               result, 0);
+                       }
                        break;
 
-               case TRESP_NETWORK_SET_ORDER:
-                       if (data_set_order->result != TCORE_RETURN_SUCCESS)
-                               ret = TAPI_API_OPERATION_FAILED;
-
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETWORK,
-                                       TAPI_EVENT_NETWORK_SETNWORDER_CNF, appname, request_id, ret, 0, NULL);
+               case TRESP_NETWORK_SET_CANCEL_MANUAL_SEARCH:
+                       dbg("receive TRESP_NETWORK_SET_CANCEL_MANUAL_SEARCH");
+                       telephony_network_complete_search_cancel(dbus_info->interface_object, dbus_info->invocation, 0);
                        break;
 
-               case TRESP_NETWORK_GET_ORDER:
-                       info_network_mode = data_get_order->order;
+               case TRESP_NETWORK_GET_SERVING_NETWORK:
+                       dbg("receive TRESP_NETWORK_GET_SERVING_NETWORK");
+                       dbg("resp->act = %d", resp_get_serving_network->act);
+                       dbg("resp->plmn = %s", resp_get_serving_network->plmn);
+                       dbg("resp->lac = %d", resp_get_serving_network->gsm.lac);
+                       telephony_network_complete_get_serving_network(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_get_serving_network->act,
+                                       resp_get_serving_network->plmn,
+                                       resp_get_serving_network->gsm.lac,
+                                       0);
+                       break;
 
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETWORK,
-                                       TAPI_EVENT_NETWORK_GETNWORDER_CNF, appname, request_id, ret, sizeof(TelNetworkMode_t),
-                                       (void*) &info_network_mode);
+               default:
+                       dbg("not handled cmd[0x%x]", command);
                        break;
+       }
 
-               case TRESP_NETWORK_SET_POWER_ON_ATTACH:
-                       if (data_set_power_on_attach->result != TCORE_RETURN_SUCCESS)
-                               ret = TAPI_API_OPERATION_FAILED;
+       return TRUE;
+}
 
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETWORK,
-                                       TAPI_EVENT_NETWORK_SETPOWERONATTACH_CNF, appname, request_id, ret, 0, NULL);
-                       break;
+gboolean dbus_plugin_network_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
+{
+       TelephonyNetwork *network;
+       const struct tnoti_network_registration_status *registration = data;
+       const struct tnoti_network_change *change = data;
+       const struct tnoti_network_icon_info *icon_info = data;
+       const struct tnoti_network_timeinfo *time_info = data;
+       const struct tnoti_network_identity *identity = data;
+       const struct tnoti_network_location_cellinfo *location = data;
+
+       if (!object) {
+               dbg("object is NULL");
+               return FALSE;
+       }
 
-               case TRESP_NETWORK_GET_POWER_ON_ATTACH:
-                       info_power_on_attach = data_get_power_on_attach->enabled;
+       network = telephony_object_peek_network(TELEPHONY_OBJECT(object));
+       dbg("network = %p", network);
 
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETWORK,
-                                       TAPI_EVENT_NETWORK_GETPOWERONATTACH_CNF, appname, request_id, ret, sizeof(TelNetworkPowerOnAttach_t),
-                                       (void*) &info_power_on_attach);
+       switch (command) {
+               case TNOTI_NETWORK_REGISTRATION_STATUS:
+                       telephony_network_emit_registration_status(network,
+                                       registration->cs_domain_status,
+                                       registration->ps_domain_status,
+                                       registration->service_type,
+                                       registration->roaming_status);
                        break;
 
-               case TRESP_NETWORK_SET_CANCEL_MANUAL_SEARCH:
-                       if (data_set_cancel_manual_search->result != TCORE_RETURN_SUCCESS)
-                               ret = TAPI_API_OPERATION_FAILED;
+               case TNOTI_NETWORK_CHANGE:
+                       telephony_network_emit_change(network,
+                                       change->act,
+                                       change->plmn,
+                                       change->gsm.lac);
+                       break;
 
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETWORK,
-                                       TAPI_EVENT_NETWORK_CANCELMANUALSEARCH_CNF, appname, request_id, ret, 0, NULL);
+               case TNOTI_NETWORK_ICON_INFO:
+                       telephony_network_emit_info(network,
+                                       icon_info->rssi,
+                                       icon_info->battery);
                        break;
 
-               case TRESP_NETWORK_GET_SERVING_NETWORK:
-                       /* not support current tapi */
+               case TNOTI_NETWORK_TIMEINFO:
+                       telephony_network_emit_time_info(network,
+                                       time_info->year,
+                                       time_info->month,
+                                       time_info->day,
+                                       time_info->hour,
+                                       time_info->minute,
+                                       time_info->second,
+                                       time_info->wday,
+                                       time_info->gmtoff,
+                                       time_info->dstoff,
+                                       time_info->isdst,
+                                       time_info->plmn);
                        break;
 
-               default:
+               case TNOTI_NETWORK_IDENTITY:
+                       telephony_network_emit_identity(network,
+                                       identity->plmn,
+                                       identity->short_name,
+                                       identity->full_name);
                        break;
-       }
-       return TRUE;
-}
 
-TReturn dbus_notification_network(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
+               case TNOTI_NETWORK_LOCATION_CELLINFO:
+                       telephony_network_emit_cell_info(network,
+                                       location->lac,
+                                       location->cell_id);
+                       break;
 
-       switch (command) {
                default:
+                       dbg("not handled cmd[0x%x]", command);
                        break;
        }
 
        return TRUE;
 }
+
diff --git a/src/omadm.c b/src/omadm.c
deleted file mode 100644 (file)
index 217bfb8..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <glib.h>
-
-#include <tcore.h>
-#include <plugin.h>
-#include <server.h>
-#include <storage.h>
-#include <user_request.h>
-#include <co_sim.h>
-
-#include <TapiCommon.h>
-
-#include "tel_cs_conn.h"
-#include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "modules.h"
-
-void dbus_request_omadm(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
-{
-       int api_err = TAPI_API_SUCCESS;
-
-       switch (tapi_service_function) {
-               case TAPI_CS_OMADM_PRL_SIZE_GET:
-               case TAPI_CS_OMADM_MODEL_NAME_GET:
-               case TAPI_CS_OMADM_OEM_NAME_GET:
-               case TAPI_CS_OMADM_SW_VER_GET:
-               case TAPI_CS_OMADM_PRL_READ_GET:
-               case TAPI_CS_OMADM_PRL_WRITE_SET:
-               default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
-       }
-
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-}
-
-TReturn dbus_response_omadm(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
-
-TReturn dbus_notification_omadm(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
diff --git a/src/phonebook.c b/src/phonebook.c
new file mode 100644 (file)
index 0000000..8acd56e
--- /dev/null
@@ -0,0 +1,391 @@
+/*
+ * tel-plugin-socket-communicator
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <glib-object.h>
+
+#include <tcore.h>
+#include <server.h>
+#include <plugin.h>
+#include <hal.h>
+#include <communicator.h>
+#include <core_object.h>
+#include <queue.h>
+#include <user_request.h>
+#include <util.h>
+#include <co_phonebook.h>
+#include <co_sim.h>
+
+#include "generated-code.h"
+#include "common.h"
+
+static gboolean on_phonebook_get_init_status(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       gboolean pb_status = FALSE;
+       struct tel_phonebook_support_list *list = NULL;
+       GSList *co_list = NULL;
+       CoreObject *co_pb = NULL;
+       TcorePlugin *plugin = NULL;
+
+       dbg("Func Entrance");
+
+       plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
+       co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
+       if (!co_list) {
+               dbg("error- co_list is NULL");
+       }
+       co_pb = (CoreObject *)co_list->data;
+       g_slist_free(co_list);
+
+       if (!co_pb) {
+               dbg("error- co_pb is NULL");
+       }
+
+       pb_status = tcore_phonebook_get_status(co_pb);
+       list = tcore_phonebook_get_support_list(co_pb);
+
+       telephony_phonebook_complete_get_init_status(phonebook, invocation,
+                       pb_status,
+                       list->b_fdn,
+                       list->b_adn,
+                       list->b_sdn,
+                       list->b_usim,
+                       list->b_aas,
+                       list->b_gas);
+
+       return TRUE;
+}
+
+static gboolean on_phonebook_get_count(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation, gint arg_req_type, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_phonebook_get_count pb_count;
+
+       ur = MAKE_UR(ctx, phonebook, invocation);
+       memset(&pb_count, 0, sizeof(struct treq_phonebook_get_count));
+
+       pb_count.phonebook_type = arg_req_type;
+
+       tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_get_count), &pb_count);
+       tcore_user_request_set_command(ur, TREQ_PHONEBOOK_GETCOUNT);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_phonebook_get_info(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation, gint arg_req_type, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_phonebook_get_info pb_info;
+
+       ur = MAKE_UR(ctx, phonebook, invocation);
+       memset(&pb_info, 0, sizeof(struct treq_phonebook_get_info));
+
+       pb_info.phonebook_type = arg_req_type;
+
+       tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_get_info), &pb_info);
+       tcore_user_request_set_command(ur, TREQ_PHONEBOOK_GETMETAINFO);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_phonebook_get_usim_info(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       ur = MAKE_UR(ctx, phonebook, invocation);
+       tcore_user_request_set_data(ur, 0, NULL);
+       tcore_user_request_set_command(ur, TREQ_PHONEBOOK_GETUSIMINFO);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+       return TRUE;
+}
+
+static gboolean on_phonebook_read_record(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation,
+               gint arg_req_type, gint arg_index, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_phonebook_read_record pb_read;
+
+       ur = MAKE_UR(ctx, phonebook, invocation);
+       memset(&pb_read, 0, sizeof(struct treq_phonebook_read_record));
+
+       pb_read.index = (unsigned short)arg_index;
+       pb_read.phonebook_type = arg_req_type;
+
+       tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_read_record), &pb_read);
+       tcore_user_request_set_command(ur, TREQ_PHONEBOOK_READRECORD);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_phonebook_update_record(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation,
+               gint arg_type, gint arg_index, const gchar *arg_name, gint arg_dcs,
+               const gchar *arg_number, gint arg_ton, const gchar *arg_number2, gint arg_number2_ton,
+               const gchar *arg_number3,gint arg_number3_ton, const gchar *arg_number4, gint arg_number4_ton,
+               const gchar *arg_email1, const gchar *arg_email2, const gchar *arg_email3, const gchar *arg_email4,
+               gint arg_group_index, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_phonebook_update_record pb_update;
+
+       ur = MAKE_UR(ctx, phonebook, invocation);
+       memset(&pb_update, 0, sizeof(struct treq_phonebook_update_record));
+
+       dbg("arg_type[%d]",arg_type);
+       dbg("arg_index[%d]",arg_index);
+       dbg("arg_name[%s]",arg_name);
+       dbg("arg_dcs[%d]",arg_dcs);
+       dbg("arg_number[%s]",arg_number);
+       dbg("arg_ton[%d]",arg_ton);
+
+       pb_update.index = (unsigned short)arg_index;
+       pb_update.phonebook_type = arg_type;
+
+       if(strlen(arg_name)){
+               snprintf((char *)pb_update.name, strlen(arg_name)+1, "%s", arg_name);
+               pb_update.dcs = arg_dcs;
+       }
+
+       if(strlen(arg_number)){
+               snprintf((char *)pb_update.number, strlen(arg_number)+1, "%s", arg_number);
+               pb_update.ton = arg_ton;
+       }
+
+       if(strlen(arg_number2)){
+               snprintf((char *)pb_update.anr1, strlen(arg_number2)+1, "%s", arg_number2);
+               pb_update.anr1_ton = arg_number2_ton;
+       }
+
+       if(strlen(arg_number3)){
+               snprintf((char *)pb_update.anr1, strlen(arg_number3)+1, "%s", arg_number3);
+               pb_update.anr1_ton = arg_number3_ton;
+       }
+
+       if(strlen(arg_number4)){
+               snprintf((char *)pb_update.anr1, strlen(arg_number4)+1, "%s", arg_number4);
+               pb_update.anr1_ton = arg_number4_ton;
+       }
+
+       pb_update.group_index = (unsigned short)arg_group_index;
+
+       tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_update_record), &pb_update);
+       tcore_user_request_set_command(ur, TREQ_PHONEBOOK_UPDATERECORD);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_phonebook_delete_record(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation,
+               gint arg_type, gint arg_index, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_phonebook_delete_record pb_delete;
+
+       ur = MAKE_UR(ctx, phonebook, invocation);
+       memset(&pb_delete, 0, sizeof(struct treq_phonebook_delete_record));
+
+       pb_delete.index = (unsigned short)arg_index;
+       pb_delete.phonebook_type = arg_type;
+
+       tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_delete_record), &pb_delete);
+       tcore_user_request_set_command(ur, TREQ_PHONEBOOK_DELETERECORD);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_setup_phonebook_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
+{
+       TelephonyPhonebook *phonebook;
+
+       phonebook = telephony_phonebook_skeleton_new();
+       telephony_object_skeleton_set_phonebook(object, phonebook);
+       g_object_unref(phonebook);
+
+       dbg("phonebook = %p", phonebook);
+
+       g_signal_connect (phonebook,
+                       "handle-get-init-status",
+                       G_CALLBACK (on_phonebook_get_init_status),
+                       ctx);
+
+       g_signal_connect (phonebook,
+                       "handle-get-count",
+                       G_CALLBACK (on_phonebook_get_count),
+                       ctx);
+
+       g_signal_connect (phonebook,
+                       "handle-get-info",
+                       G_CALLBACK (on_phonebook_get_info),
+                       ctx);
+
+       g_signal_connect (phonebook,
+                       "handle-get-usim-meta-info",
+                       G_CALLBACK (on_phonebook_get_usim_info),
+                       ctx);
+
+       g_signal_connect (phonebook,
+                       "handle-read-record",
+                       G_CALLBACK (on_phonebook_read_record),
+                       ctx);
+
+       g_signal_connect (phonebook,
+                       "handle-update-record",
+                       G_CALLBACK (on_phonebook_update_record),
+                       ctx);
+
+       g_signal_connect (phonebook,
+                       "handle-delete-record",
+                       G_CALLBACK (on_phonebook_delete_record),
+                       ctx);
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_phonebook_response(struct custom_data *ctx, UserRequest *ur,
+               struct dbus_request_info *dbus_info, enum tcore_response_command command,
+               unsigned int data_len, const void *data)
+{
+       const struct tresp_phonebook_get_count *resp_pbcnt = data;
+       const struct tresp_phonebook_get_info *resp_entry = data;
+       const struct tresp_phonebook_get_usim_info *resp_capa = data;
+       const struct tresp_phonebook_read_record *resp_pbread = data;
+       const struct tresp_phonebook_update_record *resp_pbupdate = data;
+       const struct tresp_phonebook_delete_record *resp_pbdelete = data;
+
+       dbg("application command = [0x%x], data_len = %d", command, data_len);
+
+       switch (command) {
+               case TRESP_PHONEBOOK_GETCOUNT:
+                       dbg("dbus comm - TRESP_PHONEBOOK_GETCOUNT");
+                       dbg("used[%d]total[%d]", resp_pbcnt->used_count, resp_pbcnt->total_count);
+                       telephony_phonebook_complete_get_count(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_pbcnt->result, resp_pbcnt->type, resp_pbcnt->used_count, resp_pbcnt->total_count);
+                       break;
+
+               case TRESP_PHONEBOOK_GETMETAINFO:
+                       dbg("dbus comm - TRESP_PHONEBOOK_GETMETAINFO");
+                       dbg("index min[%d]max[%d], num len max[%d] text len max[%d]", resp_entry->index_min, resp_entry->index_max, resp_entry->number_length_max, resp_entry->text_length_max);
+                       telephony_phonebook_complete_get_info(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_entry->result, resp_entry->type, resp_entry->index_min, resp_entry->index_max,
+                                       resp_entry->number_length_max, resp_entry->text_length_max);
+                       break;
+
+               case TRESP_PHONEBOOK_GETUSIMINFO:{
+                       GVariant *gv = NULL;
+                       GVariantBuilder b;
+                       int i;
+                       dbg("resp comm - TRESP_PHONEBOOK_GETUSIMINFO");
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+
+                       for(i=0;i < resp_capa->field_count; i++){
+                               g_variant_builder_open(&b,G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "filed_type", g_variant_new_int32(resp_capa->field_list[i].field));
+                               g_variant_builder_add(&b, "{sv}", "index_max", g_variant_new_int32(resp_capa->field_list[i].index_max));
+                               g_variant_builder_add(&b, "{sv}", "text_max", g_variant_new_int32(resp_capa->field_list[i].text_max));
+                               g_variant_builder_add(&b, "{sv}", "used_count", g_variant_new_int32(resp_capa->field_list[i].used_count));
+                               g_variant_builder_close(&b);
+                       }
+                       gv = g_variant_builder_end(&b);
+
+                       telephony_phonebook_complete_get_usim_meta_info (dbus_info->interface_object, dbus_info->invocation,
+                                       resp_capa->result,
+                                       gv);
+                       g_variant_unref(gv);
+               }
+                       break;
+
+               case TRESP_PHONEBOOK_READRECORD:
+                       dbg("dbus comm - TRESP_PHONEBOOK_READRECORD");
+                       dbg("resp_pbread->index[%d]",resp_pbread->index );
+                       dbg("resp_pbread->next_index[%d]",resp_pbread->next_index );
+                       dbg("resp_pbread->name[%s]",resp_pbread->name );
+                       dbg("resp_pbread->dcs[%d]",resp_pbread->dcs );
+                       dbg("resp_pbread->number[%s]",resp_pbread->number );
+                       dbg("resp_pbread->ton[%d]",resp_pbread->ton );
+
+                       telephony_phonebook_complete_read_record(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_pbread->result, resp_pbread->phonebook_type, resp_pbread->index, resp_pbread->next_index, (const gchar *)resp_pbread->name,
+                                       resp_pbread->dcs, (const gchar *)resp_pbread->number, resp_pbread->ton, (const gchar *)resp_pbread->anr1, resp_pbread->anr1_ton,
+                                       (const gchar *)resp_pbread->anr2, resp_pbread->anr2_ton, (const gchar *)resp_pbread->anr3, resp_pbread->anr3_ton,
+                                       (const gchar *)resp_pbread->email1, (const gchar *)resp_pbread->email2, (const gchar *)resp_pbread->email3, (const gchar *)resp_pbread->email4, resp_pbread->group_index);
+                       break;
+
+               case TRESP_PHONEBOOK_UPDATERECORD:
+                       dbg("dbus comm - TRESP_PHONEBOOK_UPDATERECORD");
+                       telephony_phonebook_complete_update_record(dbus_info->interface_object, dbus_info->invocation,resp_pbupdate->result);
+                       break;
+
+               case TRESP_PHONEBOOK_DELETERECORD:
+                       dbg("dbus comm - TRESP_PHONEBOOK_DELETERECORD");
+                       telephony_phonebook_complete_delete_record(dbus_info->interface_object, dbus_info->invocation, resp_pbdelete->result);
+                       break;
+
+               default:
+                       dbg("not handled cmd[0x%x]", command);
+                       break;
+       }
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_phonebook_notification(struct custom_data *ctx, const char *plugin_name,
+               TelephonyObjectSkeleton *object, enum tcore_notification_command command,
+               unsigned int data_len, const void *data)
+{
+       TelephonyPhonebook *phonebook;
+       const struct tnoti_phonebook_status *n_pb_status = data;
+
+       if (!object) {
+               dbg("object is NULL");
+               return FALSE;
+       }
+
+       phonebook = telephony_object_peek_phonebook(TELEPHONY_OBJECT(object));
+       dbg("phonebook = %p", phonebook);
+
+       switch (command) {
+               case TNOTI_PHONEBOOK_STATUS :
+                       telephony_phonebook_emit_status(phonebook, n_pb_status->b_init);
+                       break;
+
+               default:
+                       dbg("not handled cmd[0x%x]", command);
+                       break;
+       }
+
+       return TRUE;
+}
diff --git a/src/power.c b/src/power.c
deleted file mode 100644 (file)
index d813222..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <glib.h>
-
-#include <tcore.h>
-#include <plugin.h>
-#include <server.h>
-#include <storage.h>
-#include <user_request.h>
-#include <core_object.h>
-#include <communicator.h>
-
-#include <TapiCommon.h>
-#include <TelPower.h>
-
-#include "tel_cs_conn.h"
-#include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "ts_noti.h"
-#include "modules.h"
-
-void dbus_request_power(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
-{
-       int api_err = TAPI_API_SUCCESS;
-       tapi_dbus_connection_name conn_name;
-       tapi_power_flight_mode_type_t info_mode;
-
-       struct treq_modem_set_flightmode data_mode;
-       TReturn ret;
-       GSList *co_list = NULL;
-       CoreObject *co_modem = NULL;
-       UserRequest *ur = NULL;
-       struct tcore_user_info ui = { 0, };
-
-       conn_name = g_array_index(in_param4, tapi_dbus_connection_name, 0);
-
-       co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_MODEM);
-       if (!co_list) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
-       }
-
-       co_modem = (CoreObject *)co_list->data;
-       g_slist_free(co_list);
-
-       if (!co_modem) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
-       }
-
-       ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
-       if (!ur) {
-               api_err = TAPI_API_SERVER_FAILURE;
-               goto OUT;
-       }
-
-       ui.appname = conn_name.name;
-       tcore_user_request_set_user_info(ur, &ui);
-
-       switch (tapi_service_function) {
-               case TAPI_CS_POWER_PHONE_POWER_ON_OFF: {
-                       tapi_power_phone_cmd_t cmd;
-                       enum tcore_request_command request;
-
-                       cmd = g_array_index(in_param1, tapi_power_phone_cmd_t, 0);
-
-                       switch ( cmd ) {
-                               case TAPI_PHONE_POWER_OFF:
-                                       request = TREQ_MODEM_POWER_OFF;
-                                       break;
-                               case TAPI_PHONE_POWER_ON:
-                                       request = TREQ_MODEM_POWER_ON;
-                                       break;
-                               case TAPI_PHONE_POWER_RESET:
-                                       request = TREQ_MODEM_POWER_RESET;
-                                       break;
-                               default:
-                                       api_err = TAPI_API_NOT_SUPPORTED;
-                                       goto OUT;
-                       }
-
-                       tcore_user_request_set_command(ur, request);
-
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       else {
-                               api_err = TAPI_API_SUCCESS;
-                       }
-
-                       dbg("ret = 0x%x", ret);
-
-           } break;
-
-               case TAPI_CS_POWER_FLIGHT_MODE:
-                       info_mode = g_array_index(in_param1, unsigned int, 0);
-                       if (info_mode == TAPI_POWER_FLIGHT_MODE_ENTER)
-                               data_mode.enable = 1;
-                       else
-                               data_mode.enable = 0;
-
-                       tcore_user_request_set_data(ur, sizeof(struct treq_modem_set_flightmode), &data_mode);
-                       tcore_user_request_set_command(ur, TREQ_MODEM_SET_FLIGHTMODE);
-
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       else {
-                               api_err = TAPI_API_SUCCESS;
-                       }
-
-                       dbg("ret = 0x%x", ret);
-                       break;
-
-               case TAPI_CS_POWER_REBOOT:
-               case TAPI_CS_POWER_RAMDUMP:
-               default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
-       }
-
-OUT:
-       if (api_err != TAPI_API_SUCCESS) {
-               tcore_user_request_free(ur);
-       }
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-}
-
-TReturn dbus_response_power(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
-{
-       tapi_power_flight_mode_resp_type_t info_set_flight_mode;
-       const struct tresp_modem_set_flightmode *data_set_flight_mode = data;
-       int ret = TAPI_API_SUCCESS;
-       int request_id = 0;
-
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               case TRESP_MODEM_SET_FLIGHTMODE:
-                       dbg("reslut = 0x%x", data_set_flight_mode->result);
-
-                       if (data_set_flight_mode->result > 0x02) {
-                               ret = TAPI_API_OPERATION_FAILED;
-                               info_set_flight_mode = TAPI_POWER_FLIGHT_MODE_RESP_FAIL;
-                       }
-
-                       if (data_set_flight_mode->result == 0x1)
-                               info_set_flight_mode = TAPI_POWER_FLIGHT_MODE_RESP_ON;
-                       else if (data_set_flight_mode->result == 0x2)
-                               info_set_flight_mode = TAPI_POWER_FLIGHT_MODE_RESP_OFF;
-
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_POWER, TAPI_EVENT_POWER_FLIGHT_MODE_RESP,
-                                       appname, request_id, ret, sizeof(tapi_power_flight_mode_resp_type_t), &info_set_flight_mode);
-
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
-
-TReturn dbus_notification_power(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               case TNOTI_MODEM_POWER: {
-                       struct tnoti_modem_power *power = 0;
-                       int class = 0, event = 0;
-
-                       power = (struct tnoti_modem_power *)data;
-
-                       if ( power->state == MODEM_STATE_ERROR ) {
-                               class = TAPI_EVENT_CLASS_DISPLAY;
-                               event = TAPI_EVENT_DISPLAY_PHONE_FATAL_NOTI;
-
-                       } else if ( power->state == MODEM_STATE_OFFLINE ) {
-                               class = TAPI_EVENT_CLASS_POWER;
-                               event = TAPI_EVENT_POWER_PHONE_OFF;
-
-                       } else if ( power->state == MODEM_STATE_ONLINE ) {
-                               class = TAPI_EVENT_CLASS_POWER;
-                               event = TAPI_EVENT_POWER_SERVICE_READY_IND;
-
-                       } else {
-                               dbg("unsupport state : (0x%x)", power->state);
-                               return FALSE;
-                       }
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                       class, 
-                                       event,
-                                       0,
-                                       0xff,
-                                       0, 
-                                       0,
-                                       0 );
-
-               } break;
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
diff --git a/src/productivity.c b/src/productivity.c
deleted file mode 100644 (file)
index 83d49aa..0000000
+++ /dev/null
@@ -1,455 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <glib.h>
-
-#include <tcore.h>
-#include <plugin.h>
-#include <server.h>
-#include <storage.h>
-#include <user_request.h>
-#include <co_sim.h>
-#include <util.h>
-#include <communicator.h>
-
-#include <TapiCommon.h>
-#include <ITapiProductivity.h>
-
-#include "tel_cs_conn.h"
-#include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "ts_noti.h"
-#include "modules.h"
-
-#define SVCMODE_CMD_ENTER                      1
-#define SVCMODE_CMD_END                                2
-#define SVCMODE_CMD_SEND_KEYCODE       3
-#define SVCMODE_CMD_REQUEST_DUMP       4
-#define SVCMODE_CMD_DISPLAY_SCREEN     5
-#define SVCMODE_CMD_SCREEN_CONFIG   6
-#define SVCMODE_CMD_CHANGE_SVCMODE  7
-#define SVCMODE_CMD_DEVICE_TEST     8
-
-#define FACTORY_CMD_SET_OMISSION_AVOIDANCE 0x10
-#define FACTORY_CMD_GET_OMISSION_AVOIDANCE 0x11
-
-static int svcmode_convert_table[] = {
-               [TAPI_SVC_MODE_TEST_MANUAL] = 0x01,
-               [TAPI_SVC_MODE_NAM_EDIT] = 0x03,
-               [TAPI_SVC_MODE_MONITOR] = 0x04,
-               [TAPI_SVC_MODE_TEST_AUTO] = 0x02,
-               [TAPI_SVC_MODE_NAM_BASIC_EDIT] = 0x03,
-               [TAPI_SVC_MODE_PHONE_TEST] = 0x05,
-               [TAPI_SVC_MODE_OPERATOR_SPECIFIC_TEST] = 0x06,
-};
-
-static int svcmode_convert_table_r[] = {
-               [0x01] = TAPI_SVC_MODE_TEST_MANUAL,
-               [0x02] = TAPI_SVC_MODE_TEST_AUTO,
-               [0x03] = TAPI_SVC_MODE_NAM_EDIT,
-               [0x04] = TAPI_SVC_MODE_MONITOR,
-               [0x05] = TAPI_SVC_MODE_PHONE_TEST,
-               [0x06] = TAPI_SVC_MODE_OPERATOR_SPECIFIC_TEST
-};
-
-static int svcmode_convert_debug_dump_table[] = {
-               [TAPI_SVC_DBG_CP_DUMP_TARGET_ALL] = 0x00,
-               [TAPI_SVC_DBG_CP_DUMP_TARGET_MSG] = 0x01,
-               [TAPI_SVC_DBG_CP_DUMP_TARGET_LOG] = 0x02,
-               [TAPI_SVC_DBG_CP_DUMP_TARGET_LOG2] = 0x03,
-               [TAPI_SVC_DBG_CP_DUMP_TARGET_RAM_DUMP] = 0x04,
-};
-
-void dbus_request_productivity(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
-{
-       int api_err = TAPI_API_SUCCESS;
-       tapi_dbus_connection_name conn_name;
-       tapi_service_mode_t svc_mode;
-       tapi_test_mode_sub_t test_sub;
-       char key_code;
-       tapi_service_mode_debug_cp_dump_t dump_type;
-       tapi_factory_omission_avoidance_info_t *oa_info;
-       int value;
-       unsigned int i;
-       char key[10] = { 0, };
-
-       TReturn ret;
-       UserRequest *ur = NULL;
-       struct tcore_user_info ui = { 0, };
-       gchar *req_data;
-       GHashTable *req_hash;
-       GHashTable *req_sub_hash;
-       int custom_command;
-
-       conn_name = g_array_index(in_param4, tapi_dbus_connection_name, 0);
-
-       ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
-       if (!ur) {
-               api_err = TAPI_API_SERVER_FAILURE;
-               goto OUT;
-       }
-
-       ui.appname = conn_name.name;
-       tcore_user_request_set_user_info(ur, &ui);
-
-       switch (tapi_service_function) {
-               case TAPI_CS_SVCMODE_ENTERSVCMODE:
-                       svc_mode = svcmode_convert_table[g_array_index(in_param1, tapi_service_mode_t, 0)];
-                       test_sub = g_array_index(in_param2, tapi_test_mode_sub_t, 0);
-                       custom_command = SVCMODE_CMD_ENTER;
-
-                       req_hash = tcore_util_marshal_create();
-                       tcore_util_marshal_add_data(req_hash, "svc_mode", &svc_mode, TCORE_UTIL_MARSHAL_DATA_INT_TYPE);
-                       tcore_util_marshal_add_data(req_hash, "test_sub", &test_sub, TCORE_UTIL_MARSHAL_DATA_INT_TYPE);
-                       tcore_util_marshal_add_data(req_hash, "custom_command", &custom_command, TCORE_UTIL_MARSHAL_DATA_INT_TYPE);
-
-                       req_data = tcore_util_marshal_serialize(req_hash);
-                       if (!req_data) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                               break;
-                       }
-
-                       dbg("serialize data = [%s]", req_data);
-                       tcore_user_request_set_data(ur, strlen(req_data), req_data);
-                       tcore_user_request_set_command(ur, TREQ_CUSTOM);
-
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-
-                       dbg("ret = 0x%x", ret);
-                       break;
-
-               case TAPI_CS_SVCMODE_ENDSVCMODE:
-                       svc_mode = svcmode_convert_table[g_array_index(in_param1, tapi_service_mode_t, 0)];
-                       custom_command = SVCMODE_CMD_END;
-
-                       req_hash = tcore_util_marshal_create();
-                       tcore_util_marshal_add_data(req_hash, "svc_mode", &svc_mode, TCORE_UTIL_MARSHAL_DATA_INT_TYPE);
-                       tcore_util_marshal_add_data(req_hash, "custom_command", &custom_command, TCORE_UTIL_MARSHAL_DATA_INT_TYPE);
-
-                       req_data = tcore_util_marshal_serialize(req_hash);
-                       if (!req_data) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                               break;
-                       }
-
-                       dbg("serialize data = [%s]", req_data);
-                       tcore_user_request_set_data(ur, strlen(req_data), req_data);
-                       tcore_user_request_set_command(ur, TREQ_CUSTOM);
-
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-
-                       dbg("ret = 0x%x", ret);
-                       break;
-
-               case TAPI_CS_SVCMODE_PROCESS_KEYCODE:
-                       key_code = g_array_index(in_param1, char, 0);
-                       custom_command = SVCMODE_CMD_SEND_KEYCODE;
-
-                       req_hash = tcore_util_marshal_create();
-                       tcore_util_marshal_add_data(req_hash, "key_code", &key_code, TCORE_UTIL_MARSHAL_DATA_INT_TYPE);
-                       tcore_util_marshal_add_data(req_hash, "custom_command", &custom_command, TCORE_UTIL_MARSHAL_DATA_INT_TYPE);
-
-                       req_data = tcore_util_marshal_serialize(req_hash);
-                       if (!req_data) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                               break;
-                       }
-
-                       dbg("serialize data = [%s]", req_data);
-                       tcore_user_request_set_data(ur, strlen(req_data), req_data);
-                       tcore_user_request_set_command(ur, TREQ_CUSTOM);
-
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-
-                       dbg("ret = 0x%x", ret);
-                       break;
-
-               case TAPI_CS_SVCMODE_DEBUG_DUMP:
-                       dump_type = svcmode_convert_debug_dump_table[g_array_index(in_param1, tapi_service_mode_debug_cp_dump_t, 0)];
-                       custom_command = SVCMODE_CMD_REQUEST_DUMP;
-
-                       req_hash = tcore_util_marshal_create();
-                       tcore_util_marshal_add_data(req_hash, "dump_type", &dump_type, TCORE_UTIL_MARSHAL_DATA_INT_TYPE);
-                       tcore_util_marshal_add_data(req_hash, "custom_command", &custom_command, TCORE_UTIL_MARSHAL_DATA_INT_TYPE);
-
-                       req_data = tcore_util_marshal_serialize(req_hash);
-                       if (!req_data) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                               break;
-                       }
-
-                       dbg("serialize data = [%s]", req_data);
-                       tcore_user_request_set_data(ur, strlen(req_data), req_data);
-                       tcore_user_request_set_command(ur, TREQ_CUSTOM);
-
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-
-                       dbg("ret = 0x%x", ret);
-                       break;
-
-               case TAPI_CS_FACTORY_OMISSION_AVOIDANCE_SET:
-                       oa_info = &g_array_index(in_param1, tapi_factory_omission_avoidance_info_t, 0);
-                       custom_command = FACTORY_CMD_SET_OMISSION_AVOIDANCE;
-
-                       req_hash = tcore_util_marshal_create();
-                       value = oa_info->cmd.write_cmd;
-                       tcore_util_marshal_add_data(req_hash, "cmd", &value, TCORE_UTIL_MARSHAL_DATA_INT_TYPE);
-                       value = oa_info->data_cnt;
-                       tcore_util_marshal_add_data(req_hash, "count", &value, TCORE_UTIL_MARSHAL_DATA_INT_TYPE);
-                       tcore_util_marshal_add_data(req_hash, "custom_command", &custom_command, TCORE_UTIL_MARSHAL_DATA_INT_TYPE);
-
-                       for (i = 0; i < oa_info->data_cnt; i++) {
-                               dbg("i=%d [id=0x%x] [result=0x%x]", i, oa_info->data[i].test_id, oa_info->data[i].test_result);
-                               snprintf(key, 10, "%d", i);
-
-                               req_sub_hash = tcore_util_marshal_create();
-                               value = oa_info->data[i].test_id;
-                               tcore_util_marshal_add_data(req_sub_hash, "id", &value, TCORE_UTIL_MARSHAL_DATA_INT_TYPE);
-                               value = oa_info->data[i].test_result;
-                               tcore_util_marshal_add_data(req_sub_hash, "result", &value, TCORE_UTIL_MARSHAL_DATA_INT_TYPE);
-
-                               tcore_util_marshal_add_data(req_hash, key, req_sub_hash, TCORE_UTIL_MARSHAL_DATA_OBJECT_TYPE);
-                       }
-
-                       req_data = tcore_util_marshal_serialize(req_hash);
-                       if (!req_data) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                               break;
-                       }
-
-                       dbg("serialize data = [%s]", req_data);
-                       tcore_user_request_set_data(ur, strlen(req_data), req_data);
-                       tcore_user_request_set_command(ur, TREQ_CUSTOM);
-
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-
-                       dbg("ret = 0x%x", ret);
-                       break;
-
-               case TAPI_CS_IMEI_STARTFACTORYPROCESS:
-               case TAPI_CS_IMEI_COMPARE_ITEM_IND:
-               case TAPI_CS_FACTORY_OMISSION_AVOIDANCE_GET:
-               default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
-       }
-
-OUT:
-       if (api_err != TAPI_API_SUCCESS) {
-               tcore_user_request_free(ur);
-       }
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-}
-
-TReturn dbus_response_productivity(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
-{
-       GHashTable *resp_hash;
-       int custom_command;
-       tapi_service_mode_t svc_mode;
-       int status;
-       int request_id = 0;
-       int ret = TAPI_API_SUCCESS;
-
-       dbg("command = 0x%x", command);
-
-       if (command != TRESP_CUSTOM)
-               return TRUE;
-
-       resp_hash = tcore_util_marshal_deserialize_string(data);
-       if (!resp_hash) {
-               warn("hash corrupted");
-               return TCORE_RETURN_FAILURE;
-       }
-
-       custom_command = tcore_util_marshal_get_int(resp_hash, "custom_command");
-       dbg("custom_command = %d", custom_command);
-
-       switch (custom_command) {
-               case SVCMODE_CMD_ENTER:
-                       svc_mode = svcmode_convert_table_r[g_value_get_int(g_hash_table_lookup(resp_hash, "svc_mode"))];
-                       tcore_util_marshal_destory(resp_hash);
-
-                       dbg("svc_mode = %d", svc_mode);
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SVCMODE, TAPI_EVENT_SVCMODE_START_NOTI,
-                                       appname, request_id, ret, sizeof(tapi_service_mode_t), &svc_mode);
-                       break;
-
-               case SVCMODE_CMD_END:
-                       svc_mode = svcmode_convert_table_r[g_value_get_int(g_hash_table_lookup(resp_hash, "svc_mode"))];
-                       tcore_util_marshal_destory(resp_hash);
-
-                       dbg("svc_mode = %d", svc_mode);
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SVCMODE, TAPI_EVENT_SVCMODE_END_NOTI,
-                                       appname, request_id, ret, sizeof(tapi_service_mode_t), &svc_mode);
-                       break;
-
-               case SVCMODE_CMD_SEND_KEYCODE:
-                       dbg("send_keycode response. unused.");
-                       break;
-
-               case SVCMODE_CMD_REQUEST_DUMP:
-                       status = svcmode_convert_table_r[g_value_get_int(g_hash_table_lookup(resp_hash, "status"))];
-                       tcore_util_marshal_destory(resp_hash);
-
-                       dbg("status = %d", status);
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SVCMODE, TAPI_EVENT_SVCMODE_DEBUG_DUMP_CNF,
-                                       appname, request_id, ret, sizeof(int), &status);
-                       break;
-
-               case FACTORY_CMD_SET_OMISSION_AVOIDANCE:
-                       status = svcmode_convert_table_r[g_value_get_int(g_hash_table_lookup(resp_hash, "status"))];
-                       tcore_util_marshal_destory(resp_hash);
-
-                       dbg("status = %d", status);
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_FACTORY,
-                                       TAPI_EVENT_FACTORY_OMISSION_AVOIDANCE_SET_CNF, appname, request_id, ret, sizeof(int), &status);
-                       break;
-       }
-
-       return TRUE;
-}
-
-TReturn dbus_notification_productivity(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data)
-{
-       tapi_service_display_info_t noti_display_screen;
-       tapi_device_info_t noti_device_info;
-       int svc_mode;
-       tapi_screen_config_t noti_screen_config;
-
-       GHashTable *noti_hash;
-       GHashTable *noti_sub_hash;
-       int custom_command;
-       int i;
-       int count;
-       char key[10] = { 0, };
-       int line = 0;
-       int reverse = 0;
-       char *text = NULL;
-
-       dbg("command = 0x%x", command);
-
-       if (command != TNOTI_CUSTOM)
-               return TRUE;
-
-       noti_hash = tcore_util_marshal_deserialize_string(data);
-       if (!noti_hash) {
-               warn("hash corrupted");
-               return TCORE_RETURN_FAILURE;
-       }
-
-       custom_command = tcore_util_marshal_get_int(noti_hash, "custom_command");
-       dbg("custom_command = %d", custom_command);
-
-       switch (custom_command) {
-               case SVCMODE_CMD_DISPLAY_SCREEN:
-                       memset(&noti_display_screen, 0, sizeof(tapi_service_display_info_t));
-
-                       count = tcore_util_marshal_get_int(noti_hash, "count");
-                       noti_display_screen.num_of_lines = count;
-
-                       dbg("count = %d", count);
-
-                       for (i = 0; i < count; i++) {
-                               snprintf(key, 10, "%d", i);
-                               noti_sub_hash = tcore_util_marshal_get_object(noti_hash, key);
-                               if (noti_sub_hash) {
-                                       line = tcore_util_marshal_get_int(noti_sub_hash, "line");
-                                       reverse = tcore_util_marshal_get_int(noti_sub_hash, "reverse");
-                                       text = tcore_util_marshal_get_string(noti_sub_hash, "text");
-
-                                       noti_display_screen.display[i].line = line;
-                                       noti_display_screen.display[i].reverse = reverse;
-                                       snprintf(noti_display_screen.display[i].string, 30, "%s", text);
-                               }
-
-                               dbg("i = %d, [%02d][%d] [%s]", i, line, reverse, text);
-
-                               if (text)
-                                       free(text);
-
-                               if (i > 100)
-                                       break;
-                       }
-
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SVCMODE, TAPI_EVENT_SVCMODE_DISP_SCREEN_NOTI, NULL, 0,
-                                       TAPI_API_SUCCESS, sizeof(tapi_service_display_info_t), (void *) &noti_display_screen);
-                       break;
-
-               case SVCMODE_CMD_SCREEN_CONFIG:
-                       memset(&noti_screen_config, 0, sizeof(tapi_screen_config_t));
-                       noti_screen_config.line_number = tcore_util_marshal_get_int(noti_hash, "line_number");
-                       noti_screen_config.keypad = tcore_util_marshal_get_int(noti_hash, "keypad");
-
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SVCMODE, TAPI_EVENT_SVCMODE_SCREEN_CFG_NOTI,
-                                       NULL, 0, TAPI_API_SUCCESS, sizeof(tapi_screen_config_t), (void *) &noti_screen_config);
-                       break;
-
-               case SVCMODE_CMD_CHANGE_SVCMODE:
-                       svc_mode = tcore_util_marshal_get_int(noti_hash, "svc_mode");
-
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SVCMODE, TAPI_EVENT_SVCMODE_CHANGE_NOTI, NULL, 0,
-                                       TAPI_API_SUCCESS, sizeof(int), (void *) &svc_mode);
-                       break;
-
-               case SVCMODE_CMD_DEVICE_TEST:
-                       memset(&noti_device_info, 0, sizeof(tapi_device_info_t));
-                       noti_device_info.device_id = tcore_util_marshal_get_int(noti_hash, "device_id");
-                       noti_device_info.device_status = tcore_util_marshal_get_int(noti_hash, "device_status");
-
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SVCMODE, TAPI_EVENT_SVCMODE_SCREEN_CFG_NOTI,
-                                       NULL, 0, TAPI_API_SUCCESS, sizeof(tapi_device_info_t), (void *) &noti_device_info);
-                       break;
-
-               case SVCMODE_CMD_SEND_KEYCODE:
-                       dbg("keycode notification. unused.");
-                       break;
-
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
diff --git a/src/sap.c b/src/sap.c
new file mode 100644 (file)
index 0000000..65911c0
--- /dev/null
+++ b/src/sap.c
@@ -0,0 +1,396 @@
+/*
+ * tel-plugin-socket-communicator
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <glib-object.h>
+
+#include <tcore.h>
+#include <server.h>
+#include <plugin.h>
+#include <hal.h>
+#include <communicator.h>
+#include <core_object.h>
+#include <queue.h>
+#include <user_request.h>
+#include <util.h>
+#include <co_sap.h>
+#include <co_sim.h>
+
+#include "generated-code.h"
+#include "common.h"
+
+static gboolean on_sap_connect(TelephonySap *sap, GDBusMethodInvocation *invocation,
+               gint arg_req_max_size, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_sap_req_connect req_conn;
+
+       ur = MAKE_UR(ctx, sap, invocation);
+       memset(&req_conn, 0, sizeof(struct treq_sap_req_connect));
+
+       req_conn.max_msg_size = (unsigned short)arg_req_max_size;
+
+       tcore_user_request_set_data(ur, sizeof(struct treq_sap_req_connect), &req_conn);
+       tcore_user_request_set_command(ur, TREQ_SAP_REQ_CONNECT);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sap_disconnect(TelephonySap *sap, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_sap_req_disconnect req_disconn;
+
+       ur = MAKE_UR(ctx, sap, invocation);
+       memset(&req_disconn, 0, sizeof(struct treq_sap_req_disconnect));
+
+       tcore_user_request_set_data(ur, sizeof(struct treq_sap_req_disconnect), &req_disconn);
+       tcore_user_request_set_command(ur, TREQ_SAP_REQ_DISCONNECT);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sap_get_status(TelephonySap *sap, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_sap_req_status req_status;
+
+       ur = MAKE_UR(ctx, sap, invocation);
+       memset(&req_status, 0, sizeof(struct treq_sap_req_status));
+
+       tcore_user_request_set_data(ur, sizeof(struct treq_sap_req_status), &req_status);
+       tcore_user_request_set_command(ur, TREQ_SAP_REQ_STATUS);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sap_get_atr(TelephonySap *sap, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_sap_req_atr req_atr;
+
+       ur = MAKE_UR(ctx, sap, invocation);
+       memset(&req_atr, 0, sizeof(struct treq_sap_req_atr));
+
+       tcore_user_request_set_data(ur, sizeof(struct treq_sap_req_atr), &req_atr);
+       tcore_user_request_set_command(ur, TREQ_SAP_REQ_ATR);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sap_transfer_apdu(TelephonySap *sap, GDBusMethodInvocation *invocation,
+               GVariant *arg_req_apdu, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       struct treq_sap_transfer_apdu t_apdu;
+
+       GVariantIter *iter = NULL;
+       GVariant *inner_gv = NULL;
+       guchar rt_i;
+       int i =0;
+
+       dbg("Func Entrance");
+       memset(&t_apdu, 0, sizeof(struct treq_sap_transfer_apdu));
+
+       inner_gv = g_variant_get_variant(arg_req_apdu);
+
+       g_variant_get(inner_gv, "ay", &iter);
+       while ( g_variant_iter_loop (iter, "y", &rt_i)) {
+               t_apdu.apdu_data[i] = rt_i;
+               i++;
+       }
+       t_apdu.apdu_length = (unsigned int)i;
+       g_variant_iter_free(iter);
+       g_variant_unref(inner_gv);
+       g_variant_unref(arg_req_apdu);
+
+       for(i=0; i < (int)t_apdu.apdu_length; i++)
+               dbg("apdu[%d][0x%02x]",i, t_apdu.apdu_data[i]);
+
+       ur = MAKE_UR(ctx, sap, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sap_transfer_apdu), &t_apdu);
+       tcore_user_request_set_command(ur, TREQ_SAP_TRANSFER_APDU);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sap_set_protocol(TelephonySap *sap, GDBusMethodInvocation *invocation,
+               gint arg_protocol, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_sap_set_protocol set_protocol;
+
+       ur = MAKE_UR(ctx, sap, invocation);
+       memset(&set_protocol, 0, sizeof(struct treq_sap_set_protocol));
+
+       set_protocol.protocol = arg_protocol;
+
+       tcore_user_request_set_data(ur, sizeof(struct treq_sap_set_protocol), &set_protocol);
+       tcore_user_request_set_command(ur, TREQ_SAP_SET_PROTOCOL);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sap_set_power(TelephonySap *sap, GDBusMethodInvocation *invocation,
+               gint arg_mode, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_sap_set_power set_power;
+
+       ur = MAKE_UR(ctx, sap, invocation);
+       memset(&set_power, 0, sizeof(struct treq_sap_set_power));
+
+       set_power.mode = arg_mode;
+
+       tcore_user_request_set_data(ur, sizeof(struct treq_sap_set_power), &set_power);
+       tcore_user_request_set_command(ur, TREQ_SAP_SET_POWER);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sap_get_card_reader_status(TelephonySap *sap, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_sap_req_cardreaderstatus req_reader;
+
+       ur = MAKE_UR(ctx, sap, invocation);
+       memset(&req_reader, 0, sizeof(struct treq_sap_req_cardreaderstatus));
+
+       tcore_user_request_set_data(ur, sizeof(struct treq_sap_req_cardreaderstatus), &req_reader);
+       tcore_user_request_set_command(ur, TREQ_SAP_REQ_CARDREADERSTATUS);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_setup_sap_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
+{
+       TelephonySap *sap;
+
+       sap = telephony_sap_skeleton_new();
+       telephony_object_skeleton_set_sap(object, sap);
+       g_object_unref(sap);
+
+       dbg("sap = %p", sap);
+
+       g_signal_connect (sap,
+                       "handle-connect",
+                       G_CALLBACK (on_sap_connect),
+                       ctx);
+
+       g_signal_connect (sap,
+                       "handle-disconnect",
+                       G_CALLBACK (on_sap_disconnect),
+                       ctx);
+
+       g_signal_connect (sap,
+                       "handle-get-status",
+                       G_CALLBACK (on_sap_get_status),
+                       ctx);
+
+       g_signal_connect (sap,
+                       "handle-get-atr",
+                       G_CALLBACK (on_sap_get_atr),
+                       ctx);
+
+       g_signal_connect (sap,
+                       "handle-transfer-apdu",
+                       G_CALLBACK (on_sap_transfer_apdu),
+                       ctx);
+
+       g_signal_connect (sap,
+                       "handle-set-protocol",
+                       G_CALLBACK (on_sap_set_protocol),
+                       ctx);
+
+       g_signal_connect (sap,
+                       "handle-set-power",
+                       G_CALLBACK (on_sap_set_power),
+                       ctx);
+
+       g_signal_connect (sap,
+                       "handle-get-card-reader-status",
+                       G_CALLBACK (on_sap_get_card_reader_status),
+                       ctx);
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_sap_response(struct custom_data *ctx, UserRequest *ur,
+               struct dbus_request_info *dbus_info, enum tcore_response_command command,
+               unsigned int data_len, const void *data)
+{
+       const struct tresp_sap_req_connect *sap_conn = data;
+       const struct tresp_sap_req_disconnect *sap_disconn = data;
+       const struct tresp_sap_req_status *sap_status = data;
+       const struct tresp_sap_req_atr *sap_atr = data;
+       const struct tresp_sap_transfer_apdu *sap_apdu = data;
+       const struct tresp_sap_set_protocol *sap_protocol = data;
+       const struct tresp_sap_set_power *sap_power = data;
+       const struct tresp_sap_req_cardreaderstatus *sap_reader = data;
+
+       dbg("application Command = [0x%x], data_len = %d",command, data_len);
+
+       switch (command) {
+               case TRESP_SAP_REQ_CONNECT:
+                       dbg("dbus comm - TRESP_SAP_REQ_CONNECT");
+                       telephony_sap_complete_connect(dbus_info->interface_object, dbus_info->invocation,
+                                       sap_conn->status, sap_conn->max_msg_size);
+                       break;
+
+               case TRESP_SAP_REQ_DISCONNECT:
+                       dbg("dbus comm - TRESP_SAP_REQ_DISCONNECT");
+                       telephony_sap_complete_disconnect(dbus_info->interface_object, dbus_info->invocation,
+                                       sap_disconn->result);
+                       break;
+
+               case TRESP_SAP_REQ_STATUS:
+                       dbg("dbus comm - TRESP_SAP_REQ_STATUS");
+                       telephony_sap_complete_get_status(dbus_info->interface_object, dbus_info->invocation,
+                                       sap_status->status);
+                       break;
+
+               case TRESP_SAP_REQ_ATR: {
+                       GVariantBuilder *builder = NULL;
+                       GVariant * atr_gv = NULL;
+                       GVariant *inner_gv = NULL;
+                       int i =0;
+
+                       dbg("dbus comm - TRESP_SAP_REQ_ATR");
+                       builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
+                       for(i = 0; i < (int)sap_atr->atr_length; i++) {
+                               dbg("sap_atr->atr[%d][0x%02x]", i,sap_atr->atr[i]);
+                               g_variant_builder_add (builder, "y", sap_atr->atr[i]);
+                       }
+                       inner_gv = g_variant_builder_end(builder);
+/*                     g_variant_builder_unref (builder);*/
+                       atr_gv = g_variant_new("v", inner_gv);
+
+                       telephony_sap_complete_get_atr(dbus_info->interface_object, dbus_info->invocation,
+                                       sap_atr->result, atr_gv);
+               }
+                       break;
+
+               case TRESP_SAP_TRANSFER_APDU: {
+                       GVariantBuilder *builder = NULL;
+                       GVariant * apdu_gv = NULL;
+                       GVariant *inner_gv = NULL;
+                       int i =0;
+
+                       dbg("dbus comm - TRESP_SAP_TRANSFER_APDU");
+                       builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
+                       for(i = 0; i < (int)sap_apdu->resp_apdu_length; i++) {
+                               dbg("sap_apdu->resp_adpdu[%d][0x%02x]", i,sap_apdu->resp_adpdu[i]);
+                               g_variant_builder_add (builder, "y", sap_apdu->resp_adpdu[i]);
+                       }
+                       inner_gv = g_variant_builder_end(builder);
+/*                     g_variant_builder_unref (builder);*/
+                       apdu_gv = g_variant_new("v", inner_gv);
+
+                       telephony_sap_complete_transfer_apdu(dbus_info->interface_object, dbus_info->invocation,
+                                       sap_apdu->result, apdu_gv);
+               }
+                       break;
+
+               case TRESP_SAP_SET_PROTOCOL:
+                       dbg("dbus comm - TRESP_SAP_SET_PROTOCOL");
+                       telephony_sap_complete_set_protocol(dbus_info->interface_object, dbus_info->invocation,
+                                       sap_protocol->result);
+                       break;
+
+               case TRESP_SAP_SET_POWER:
+                       dbg("dbus comm - TRESP_SAP_SET_POWER");
+                       telephony_sap_complete_set_power(dbus_info->interface_object, dbus_info->invocation,
+                                       sap_power->result);
+                       break;
+
+               case TRESP_SAP_REQ_CARDREADERSTATUS:
+                       dbg("dbus comm - TRESP_SAP_REQ_CARDREADERSTATUS");
+                       telephony_sap_complete_get_card_reader_status(dbus_info->interface_object, dbus_info->invocation,
+                                       sap_reader->result, sap_reader->reader_status);
+                       break;
+
+               default:
+                       dbg("not handled command[%d]", command);
+               break;
+       }
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_sap_notification(struct custom_data *ctx, const char *plugin_name,
+               TelephonyObjectSkeleton *object, enum tcore_notification_command command,
+               unsigned int data_len, const void *data)
+{
+       TelephonySap *sap;
+       const struct tnoti_sap_status_changed *n_sap_status = data;
+       const struct tnoti_sap_disconnect *n_sap_disconn = data;
+
+       if (!object) {
+               dbg("object is NULL");
+               return FALSE;
+       }
+
+       sap = telephony_object_peek_sap(TELEPHONY_OBJECT(object));
+       dbg("sap = %p", sap);
+
+       dbg("notification !!! (command = 0x%x, data_len = %d)", command, data_len);
+
+       switch (command) {
+               case TNOTI_SAP_STATUS:
+                       dbg("notified sap_status[%d]", n_sap_status->status);
+                       telephony_sap_emit_status(sap, n_sap_status->status);
+                       break;
+               case TNOTI_SAP_DISCONNECT:
+                       dbg("notified sap_disconnect type[%d]", n_sap_disconn->type);
+                       telephony_sap_emit_disconnect(sap, n_sap_disconn->type);
+                       break;
+               default:
+                       dbg("not handled command[%d]", command);
+               break;
+       }
+
+       return TRUE;
+}
index 108ea8f1a332c917a908d13536ea7a93d95c54cb..7e0581832b6f294e09f40401594f194331bef7d8 100644 (file)
--- a/src/sat.c
+++ b/src/sat.c
@@ -1,5 +1,5 @@
 /*
- * tel-plugin-dbus-tapi
+ * tel-plugin-dbus
  *
  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
  *
 
 #include <stdio.h>
 #include <string.h>
-#include <assert.h>
-#include <unistd.h>
 #include <stdlib.h>
-#include <glib.h>
-
-#include <security-server.h>
+#include <errno.h>
+#include <glib-object.h>
 
 #include <tcore.h>
-#include <plugin.h>
 #include <server.h>
-#include <storage.h>
-#include <user_request.h>
+#include <plugin.h>
+#include <hal.h>
 #include <communicator.h>
 #include <core_object.h>
+#include <queue.h>
+#include <user_request.h>
+#include <util.h>
 #include <co_sat.h>
 
-#include <TapiCommon.h>
-#include <TelSat.h>
-
-#include "tel_cs_conn.h"
+#include "generated-code.h"
 #include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "ts_noti.h"
-#include "modules.h"
+#include "sat_manager.h"
+#include "sat_ui_support/sat_ui_support.h"
+
+static gboolean on_sat_get_main_menu_info(TelephonySAT *sat, GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       GVariant *main_menu = NULL;
+
+       gchar *title;
+       gint result = 1, command_id, item_cnt;
+       gboolean b_present, b_help_info, b_updated;
+       GVariant *items, *icon,*icon_list;
 
-#include "sat_mgr.h"
 
-void dbus_request_sat(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
+       if(!ctx->cached_sat_main_menu){
+               dbg("no main menu");
+               return FALSE;
+       }
+
+       main_menu = ctx->cached_sat_main_menu;
+
+       g_variant_get(main_menu, "(ibs@vibb@v@v)", &command_id, &b_present, &title, &items, &item_cnt,
+                       &b_help_info, &b_updated, &icon, &icon_list);
+
+       telephony_sat_complete_get_main_menu_info(sat, invocation, result, command_id, b_present, title,
+                       items, item_cnt, b_help_info, b_updated, icon, icon_list);
+
+       return TRUE;
+}
+
+static gboolean on_sat_send_display_status(TelephonySAT *sat, GDBusMethodInvocation *invocation,
+               gint arg_command_id, gboolean arg_display_status,
+               gpointer user_data)
 {
-       TReturn ret;
-       tapi_dbus_connection_name conn_name;
-       UserRequest *ur = NULL;
-       struct tcore_user_info ui = { 0, };
-       TelSatSetupMenuInfo_t satMainMenu;
-
-       int api_err = TAPI_API_SUCCESS;
-/*     int security_result  = 0;*/
-       int request_id = 0;
-
-       conn_name = g_array_index(in_param4, tapi_dbus_connection_name, 0);
-       ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
-       if (!ur) {
-               api_err = TAPI_API_SERVER_FAILURE;
-               goto OUT;
+       TcorePlugin *plg = NULL;
+       char *plugin_name;
+       struct custom_data *ctx = user_data;
+       gboolean result = FALSE;
+       gint out_param = 1;
+
+       plugin_name = GET_PLUGIN_NAME(invocation);
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               out_param = 0;
+               telephony_sat_complete_send_ui_display_status(sat, invocation, out_param);
+               return TRUE;
        }
 
-/*     security_result = security_server_check_privilege(cookie, security_server_get_gid(SECURITY_GID_TEL_SAT));
-       if (security_result < 0) {
-               TS_DEBUG(LEVEL_DEBUG, "security failed. (gid_name='%s' retval=%d)", SECURITY_GID_TEL_SAT, security_result);
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
-       }*/
-
-       ui.appname = conn_name.name;
-       tcore_user_request_set_user_info(ur, &ui);
-
-       switch (tapi_service_function) {
-               case TAPI_CS_SIMATK_SEND_MENU_SELECTION_ENVELOPE: {
-                       TelSatMenuSelectionReqInfo_t* selected_data = NULL;
-                       struct treq_sat_envelop_cmd_data envelop_data;
-                       dbg("TAPI_CS_SIMATK_SEND_MENU_SELECTION_ENVELOPE");
-                       selected_data = &g_array_index(in_param1, TelSatMenuSelectionReqInfo_t, 0);
-                       if (!selected_data) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                               break;
-                       }
-                       memset(&envelop_data, 0, sizeof(struct treq_sat_envelop_cmd_data));
-                       envelop_data.sub_cmd = ENVELOP_MENU_SELECTION;
-                       envelop_data.envelop_data.menu_select.device_identitie.src = DEVICE_ID_KEYPAD;
-                       envelop_data.envelop_data.menu_select.device_identitie.dest = DEVICE_ID_SIM;
-                       envelop_data.envelop_data.menu_select.item_identifier.item_identifier = selected_data->itemIdentifier;
-                       envelop_data.envelop_data.menu_select.help_request = ((selected_data->bIsHelpRequested == 1) ? TRUE : FALSE);
-
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sat_envelop_cmd_data), (void *) &envelop_data);
-                       tcore_user_request_set_command(ur, TREQ_SAT_REQ_ENVELOPE);
-
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS)
-                               api_err = TAPI_API_OPERATION_FAILED;
-
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       dbg("ret = 0x%x", ret);
-               }
-                       break;
+       result = sat_manager_handle_ui_display_status(ctx, plg, arg_command_id, arg_display_status);
+       if(!result){
+               dbg("fail to send exec result");
+       }
 
-               case TAPI_CS_SIMATK_SEND_EVENT_DOWNLOAD:
-                       tcore_user_request_set_data(ur, 0, NULL);
-                       tcore_user_request_set_command(ur, TREQ_SAT_REQ_ENVELOPE);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS)
-                               api_err = TAPI_API_OPERATION_FAILED;
+       out_param = (result ? 1 : 0);
+       telephony_sat_complete_send_ui_display_status(sat, invocation, out_param);
+       return TRUE;
+}
 
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       dbg("ret = 0x%x", ret);
-                       break;
+static gboolean on_sat_send_user_confirm(TelephonySAT *sat, GDBusMethodInvocation *invocation,
+               gint arg_command_id, gint arg_command_type, gint arg_user_confirm_type,
+               GVariant *arg_additional_data, gpointer user_data)
+{
+       TcorePlugin *plg = NULL;
+       char *plugin_name;
+       struct custom_data *ctx = user_data;
+
+       gboolean result = FALSE;
+       gint out_param = 1;
+       GVariant *confirm_data = NULL;
+
+       plugin_name = GET_PLUGIN_NAME(invocation);
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               out_param = 0;
+               telephony_sat_complete_send_user_confirm(sat, invocation, out_param);
+               return TRUE;
+       }
 
-               case TAPI_CS_UI_USER_CONFIRM: {
-                       TelSatUiUserConfirmInfo_t cnf;
-                       TelSatTextInfo_t* additional_data = NULL;
-
-                       memset(&cnf, 0x00, sizeof(TelSatUiUserConfirmInfo_t));
-                       cnf.commandId = g_array_index(in_param1,int, 0);
-                       cnf.commandType = g_array_index(in_param1,int, 1);
-                       cnf.keyType = g_array_index(in_param1, int, 2);
-                       cnf.dataLen = g_array_index(in_param1, int, 3);
-
-                       dbg("command_id = 0x%x", cnf.commandId);
-                       dbg("command_type = 0x%x", cnf.commandType);
-                       dbg("key_type = 0x%x", cnf.keyType);
-                       dbg("data_length = %d", cnf.dataLen);
-
-                       if (cnf.dataLen > 0) {
-                               additional_data = &g_array_index(in_param2, TelSatTextInfo_t, 0);
-                               dbg("tel_send_sat_ui_user_confirm :[%d]", additional_data->string[0]);
-                               api_err = sat_mgr_handle_user_confirm(ctx, plugin, conn_name.name, &cnf,        additional_data->string, additional_data->stringLen);
-                               if (api_err != TAPI_API_SUCCESS)
-                                       dbg("return_value = %d", api_err);
-                       }
-                       else if (cnf.dataLen == 0) {
-                               api_err = sat_mgr_handle_user_confirm(ctx, plugin, conn_name.name, &cnf, NULL, 0);
-                               if (api_err != TAPI_API_SUCCESS)
-                                       dbg("return_value = %d", api_err);
-                       }
-                       else if (cnf.dataLen < 0) {
-                               api_err = TAPI_API_SERVER_FAILURE;
-                       }
-                       if (api_err != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("api_err = 0x%x", api_err);
-               }
-                       break;
+       confirm_data = g_variant_new("(iiv)", arg_command_id, arg_user_confirm_type, arg_additional_data);
 
-               case TAPI_CS_SIMATK_SEND_APP_EXEC_RESULT: {
-                       TelSatAppsRetInfo_t* app_req_info = NULL;
-                       dbg("TAPI_CS_SIMATK_SEND_APP_EXEC_RESULT");
-                       app_req_info = &g_array_index(in_param1, TelSatAppsRetInfo_t, 0);
-                       ret = sat_mgr_handle_app_exec_result(ctx, plugin, conn_name.name, app_req_info);
-                       if (ret != TCORE_RETURN_SUCCESS)
-                               api_err = TAPI_API_OPERATION_FAILED;
+       result = sat_manager_handle_user_confirm(ctx, plg, confirm_data);
+       if(!result){
+               dbg("fail to send user confirm");
+       }
 
-                       dbg("ret = 0x%x", ret);
-               }
-                       break;
+       out_param = (result ? 1 : 0);
+       telephony_sat_complete_send_user_confirm(sat, invocation, out_param);
 
-               case TAPI_CS_SIMATK_GET_MAIN_MENU_INFO:
-                       dbg("TAPI_CS_SIMATK_GET_MAIN_MENU_INFO");
-                       if (ctx->pSatMainMenu != NULL && ctx->pSatMainMenu->satMainMenuNum > 0) {
-                               dbg("[SAT] pSatMainMenu->satMainMenuNum: [%d]", ctx->pSatMainMenu->satMainMenuNum);
-                               dbg("[SAT] pSatMainMenu->satiMainTitle [%s]", ctx->pSatMainMenu->satMainTitle);
-                               ctx->pSatMainMenu->bIsMainMenuPresent = TRUE;
-                               g_array_append_vals(*out_param2, ctx->pSatMainMenu, sizeof(TelSatSetupMenuInfo_t));
-                       }
-                       else {
-                               memset(&satMainMenu, 0x00, sizeof(TelSatSetupMenuInfo_t));
-                               satMainMenu.bIsMainMenuPresent = FALSE;
-                               g_array_append_vals(*out_param2, &satMainMenu, sizeof(TelSatSetupMenuInfo_t));
-                       }
-                       break;
+       return TRUE;
+}
 
-               case TAPI_CS_UI_DISPLAY_STATUS:
-               default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
+static gboolean on_sat_send_app_exec_result(TelephonySAT *sat, GDBusMethodInvocation *invocation,
+               gint arg_command_id, gint arg_command_type, GVariant *arg_exec_result,
+               gpointer user_data)
+{
+       TcorePlugin *plg = NULL;
+       char *plugin_name;
+       struct custom_data *ctx = user_data;
+
+       gboolean result = FALSE;
+       gint out_param = 1;
+
+       plugin_name = GET_PLUGIN_NAME(invocation);
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               out_param = 0;
+               telephony_sat_complete_send_app_exec_result(sat, invocation, out_param);
+               return TRUE;
+       }
+
+       dbg("processing app exec result");
+       result = sat_manager_handle_app_exec_result(ctx, plg, arg_command_id, arg_command_type, arg_exec_result);
+       if(!result){
+               dbg("fail to send exec result");
        }
 
-OUT:
-       if (api_err != TAPI_API_SUCCESS)
-               tcore_user_request_free(ur);
+       out_param = (result ? 1 : 0);
+       telephony_sat_complete_send_app_exec_result(sat, invocation, out_param);
+       return TRUE;
+}
+
+static gboolean on_sat_select_menu(TelephonySAT *sat, GDBusMethodInvocation *invocation,
+               guchar arg_item_identifier, gboolean arg_help_request,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_sat_envelop_cmd_data envelop_data;
+
+       ur = MAKE_UR(ctx, sat, invocation);
+       memset(&envelop_data, 0, sizeof(struct treq_sat_envelop_cmd_data));
+       envelop_data.sub_cmd = ENVELOP_MENU_SELECTION;
+       envelop_data.envelop_data.menu_select.device_identitie.src = DEVICE_ID_KEYPAD;
+       envelop_data.envelop_data.menu_select.device_identitie.dest = DEVICE_ID_SIM;
+       envelop_data.envelop_data.menu_select.item_identifier.item_identifier = arg_item_identifier;
+       envelop_data.envelop_data.menu_select.help_request = arg_help_request;
+
+       tcore_user_request_set_data(ur, sizeof(struct treq_sat_envelop_cmd_data), &envelop_data);
+       tcore_user_request_set_command(ur, TREQ_SAT_REQ_ENVELOPE);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sat_download_event(TelephonySAT *sat, GDBusMethodInvocation *invocation,
+               gint arg_event_download_type, gint arg_src_device,gint arg_dest_device,
+               GVariant *arg_download_data, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_sat_envelop_cmd_data envelop_data;
+
+       ur = MAKE_UR(ctx, sat, invocation);
+       memset(&envelop_data, 0, sizeof(struct treq_sat_envelop_cmd_data));
+       envelop_data.sub_cmd = ENVELOP_EVENT_DOWNLOAD;
+       envelop_data.envelop_data.event_download.event = arg_event_download_type;
+       sat_manager_handle_event_download_envelop(arg_event_download_type, arg_src_device, arg_dest_device,
+                       &envelop_data.envelop_data.event_download, arg_download_data);
+
+       tcore_user_request_set_data(ur, sizeof(struct treq_sat_envelop_cmd_data), &envelop_data);
+       tcore_user_request_set_command(ur, TREQ_SAT_REQ_ENVELOPE);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_setup_sat_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
+{
+       TelephonySAT *sat;
+
+       sat = telephony_sat_skeleton_new();
+       telephony_object_skeleton_set_sat(object, sat);
+       g_object_unref(sat);
+
+       dbg("sat = %p", sat);
+
+       g_signal_connect (sat,
+                       "handle-get-main-menu-info",
+                       G_CALLBACK (on_sat_get_main_menu_info),
+                       ctx);
+
+       g_signal_connect (sat,
+                       "handle-send-ui-display-status",
+                       G_CALLBACK (on_sat_send_display_status),
+                       ctx);
+
+       g_signal_connect (sat,
+                       "handle-send-user-confirm",
+                       G_CALLBACK (on_sat_send_user_confirm),
+                       ctx);
+
+       g_signal_connect (sat,
+                       "handle-send-app-exec-result",
+                       G_CALLBACK (on_sat_send_app_exec_result),
+                       ctx);
 
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-       g_array_append_vals(*out_param2, &request_id, sizeof(int));
+       g_signal_connect (sat,
+                       "handle-select-menu",
+                       G_CALLBACK (on_sat_select_menu),
+                       ctx);
+
+       g_signal_connect (sat,
+                       "handle-download-event",
+                       G_CALLBACK (on_sat_download_event),
+                       ctx);
+
+       return TRUE;
 }
 
-TReturn dbus_response_sat(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
+gboolean dbus_plugin_sat_response(struct custom_data *ctx, UserRequest *ur,
+               struct dbus_request_info *dbus_info, enum tcore_response_command command,
+               unsigned int data_len, const void *data)
 {
-       dbg("command = 0x%x", command);
+       const struct tresp_sat_envelop_data *envelop_rsp = NULL;
+
+       dbg("sat response command = [0x%x], data_len = %d", command, data_len);
 
        switch (command) {
+               case TRESP_SAT_REQ_ENVELOPE: {
+                       envelop_rsp = (struct tresp_sat_envelop_data *)data;
+
+                       dbg("envelop sub_cmd(%d) result(%d) rsp(%d)", envelop_rsp->sub_cmd, envelop_rsp->result, envelop_rsp->envelop_resp);
+
+                       if(envelop_rsp->sub_cmd == ENVELOP_MENU_SELECTION){
+                               telephony_sat_complete_select_menu(dbus_info->interface_object, dbus_info->invocation,
+                                               envelop_rsp->result, envelop_rsp->envelop_resp);
+                       }
+                       else if(envelop_rsp->sub_cmd == ENVELOP_EVENT_DOWNLOAD){
+                               telephony_sat_complete_download_event(dbus_info->interface_object, dbus_info->invocation,
+                                               envelop_rsp->result, envelop_rsp->envelop_resp);
+                       }
+               } break;
+
+               case TRESP_SAT_REQ_TERMINALRESPONSE:
+                       dbg("receive TRESP_SAT_REQ_TERMINALRESPONSE");
+               break;
+
                default:
-                       break;
+                       dbg("not handled command[%d]", command);
+               break;
        }
-       return TCORE_RETURN_SUCCESS;
+       return TRUE;
 }
 
-TReturn dbus_notification_sat(struct custom_data *ctx, CoreObject *source,
-               enum tcore_notification_command command, unsigned int data_len, const void *data)
+gboolean dbus_plugin_sat_notification(struct custom_data *ctx, const char *plugin_name,
+               TelephonyObjectSkeleton *object, enum tcore_notification_command command,
+               unsigned int data_len, const void *data)
 {
-       struct tnoti_sat_proactive_ind *ind = NULL;
-       ind = (struct tnoti_sat_proactive_ind *)data;
-       dbg("command = 0x%x", command);
-
-       if (command == TNOTI_SAT_PROACTIVE_CMD) {
-               switch (ind->cmd_type) {
-                       case SAT_PROATV_CMD_SETUP_MENU:
-                               sat_mgr_setup_menu_noti(ctx, (struct tel_sat_setup_menu_tlv*) &ind->proactive_ind_data.setup_menu);
-                               break;
-
-                       case SAT_PROATV_CMD_DISPLAY_TEXT:
-                               sat_mgr_display_text_noti(ctx, (struct tel_sat_display_text_tlv*) &ind->proactive_ind_data.display_text);
-                               break;
-
-                       case SAT_PROATV_CMD_SELECT_ITEM:
-                               sat_mgr_select_item_noti(ctx,   (struct tel_sat_select_item_tlv*) &ind->proactive_ind_data.select_item);
-                               break;
-
-                       case SAT_PROATV_CMD_GET_INKEY:
-                               sat_mgr_get_inkey_noti(ctx, (struct tel_sat_get_inkey_tlv*) &ind->proactive_ind_data.get_inkey);
-                               break;
-
-                       case SAT_PROATV_CMD_GET_INPUT:
-                               sat_mgr_get_input_noti(ctx, (struct tel_sat_get_input_tlv*) &ind->proactive_ind_data.get_input);
-                               break;
-
-                       default:
-                               dbg("not handled ind->cmd_type[0x%x]", ind->cmd_type);
-                               break;
-               }
+       TcorePlugin *plg = NULL;
+       TelephonySAT *sat;
+       struct tnoti_sat_proactive_ind *p_ind = (struct tnoti_sat_proactive_ind *)data;
+
+       if (!object) {
+               dbg("object is NULL");
+               return FALSE;
+       }
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return FALSE;
        }
 
+       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+       dbg("sat = %p", sat);
+
+       dbg("notification !!! (command = 0x%x, data_len = %d)", command, data_len);
+
        if (command == TNOTI_SAT_SESSION_END) {
-               TelSatEndProactiveSessionIndInfo_t se;
-               memset(&se, 0x00, sizeof(TelSatEndProactiveSessionIndInfo_t));
-               se.commandType = TAPI_SAT_CMD_TYPE_END_PROACTIVE_SESSION;
-
-               /*Command Queue Clear*/
-               sat_mgr_init_cmd_queue(ctx);
-
-               /*just send dummy data*/
-               ts_delivery_event(ctx->EvtDeliveryHandle,
-                                                                                       TAPI_EVENT_CLASS_SAT,
-                                                                                       TAPI_EVENT_SAT_END_PROACTIVE_SESSION_IND,
-                                                                                       NULL,
-                                                                                       0,
-                                                                                       TAPI_API_SUCCESS,
-                                                                                       sizeof(TelSatEndProactiveSessionIndInfo_t),
-                                                                                       (void *)&se);
+
+               dbg("notified sat session end evt");
+               sat_manager_init_queue(ctx);
+
+               sat_ui_support_terminate_sat_ui();
+               telephony_sat_emit_end_proactive_session(sat, SAT_PROATV_CMD_TYPE_END_PROACTIVE_SESSION);
+               return TRUE;
+       }
+
+       //Proactive Command Notification
+       dbg("notified sat proactive command(%d)", p_ind->cmd_type);
+
+       switch (p_ind->cmd_type) {
+               case SAT_PROATV_CMD_SETUP_MENU:{
+                       gboolean rv = FALSE;
+                       GVariant *menu_info = NULL;
+                       GVariant *resp = NULL;
+                       GVariant *exec_result = NULL;
+
+                       gchar *title;
+                       gint command_id, menu_cnt;
+                       gboolean b_present, b_helpinfo, b_updated;
+                       GVariant *items, *icon, *icon_list;
+
+                       menu_info = sat_manager_caching_setup_menu_info(ctx, plugin_name, (struct tel_sat_setup_menu_tlv*) &p_ind->proactive_ind_data.setup_menu);
+                       ctx->cached_sat_main_menu = menu_info;
+
+                       if(!menu_info){
+                               dbg("no main menu data");
+                               return TRUE;
+                       }
+
+                       dbg("menu_info type_format(%s)", g_variant_get_type_string(menu_info));
+                       g_variant_get(menu_info, "(ibs@vibb@v@v)", &command_id, &b_present, &title, &items,
+                                       &menu_cnt, &b_helpinfo, &b_updated, &icon, &icon_list);
+
+                       rv = sat_ui_support_create_desktop_file(title);
+                       rv = TRUE;
+                       dbg("return value (%d)", rv);
+                       if(rv)
+                               resp = g_variant_new("(i)", RESULT_SUCCESS);
+                       else
+                               resp = g_variant_new("(i)", RESULT_ME_UNABLE_TO_PROCESS_COMMAND);
+
+                       exec_result = g_variant_new_variant(resp);
+                       sat_manager_handle_app_exec_result(ctx, plg, command_id, SAT_PROATV_CMD_SETUP_MENU, exec_result);
+
+                       //sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SETUP_MENU, menu_info);
+
+                       telephony_sat_emit_setup_menu(sat, command_id, b_present, title, items, menu_cnt,
+                                       b_helpinfo, b_updated);
+               } break;
+
+               case SAT_PROATV_CMD_DISPLAY_TEXT:{
+                       GVariant *display_text = NULL;
+
+                       gint command_id, text_len, duration;
+                       gboolean high_priority, user_rsp_required, immediately_rsp;
+                       gchar text[SAT_TEXT_STRING_LEN_MAX];
+                       GVariant *icon_id = NULL;
+
+                       display_text = sat_manager_display_text_noti(ctx, plugin_name, (struct tel_sat_display_text_tlv*) &p_ind->proactive_ind_data.display_text);
+
+                       if(!display_text){
+                               dbg("no display text data");
+                               return TRUE;
+                       }
+
+                       dbg("display text type_format(%s)", g_variant_get_type_string(display_text));
+                       g_variant_get(display_text, "(isiibbb@v)", &command_id, &text, &text_len, &duration,
+                                               &high_priority, &user_rsp_required, &immediately_rsp, &icon_id);
+
+                       sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_DISPLAY_TEXT, display_text);
+
+                       telephony_sat_emit_display_text(sat, command_id, text, text_len, duration,
+                                       high_priority, user_rsp_required, immediately_rsp);
+
+               } break;
+
+               case SAT_PROATV_CMD_SELECT_ITEM:{
+                       GVariant *select_menu = NULL;
+
+                       gboolean help_info ;
+                       gchar *selected_text;
+                       gint command_id, default_item_id, menu_cnt, text_len =0;
+                       GVariant *menu_items, *icon_id, *icon_list;
+
+                       select_menu = sat_manager_select_item_noti(ctx, plugin_name, (struct tel_sat_select_item_tlv*) &p_ind->proactive_ind_data.select_item);
+
+                       if(!select_menu){
+                               dbg("no select menu data");
+                               return TRUE;
+                       }
+
+                       dbg("select menu type_format(%s)", g_variant_get_type_string(select_menu));
+                       g_variant_get(select_menu, "(ibsiii@v@v@v)", &command_id, &help_info, &selected_text,
+                                       &text_len, &default_item_id, &menu_cnt, &menu_items, &icon_id, &icon_list);
+
+                       sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SELECT_ITEM, select_menu);
+
+                       telephony_sat_emit_select_item (sat, command_id, help_info, selected_text, text_len,
+                                       default_item_id, menu_cnt, menu_items);
+               } break;
+
+               case SAT_PROATV_CMD_GET_INKEY:{
+                       GVariant *get_inkey = NULL;
+
+                       gint command_id, key_type, input_character_mode;
+                       gint text_len, duration;
+                       gboolean b_numeric, b_help_info;
+                       gchar *text;
+                       GVariant *icon_id;
+
+                       get_inkey = sat_manager_get_inkey_noti(ctx, plugin_name, (struct tel_sat_get_inkey_tlv*) &p_ind->proactive_ind_data.get_inkey);
+
+                       if(!get_inkey){
+                               dbg("no get inkey data");
+                               return TRUE;
+                       }
+
+                       dbg("get inkey type_format(%s)", g_variant_get_type_string(get_inkey));
+                       g_variant_get(get_inkey, "(iiibbsii@v)", &command_id, &key_type, &input_character_mode,
+                                       &b_numeric,&b_help_info, &text, &text_len, &duration, &icon_id);
+
+                       sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_GET_INKEY, get_inkey);
+
+                       telephony_sat_emit_get_inkey(sat, command_id, key_type, input_character_mode,
+                                       b_numeric, b_help_info, text, text_len, duration);
+               } break;
+
+               case SAT_PROATV_CMD_GET_INPUT:{
+                       GVariant *get_input = NULL;
+
+                       gint command_id, input_character_mode;
+                       gint text_len, def_text_len, rsp_len_min, rsp_len_max;
+                       gboolean b_numeric, b_help_info, b_echo_input;
+                       gchar *text, *def_text;
+                       GVariant *icon_id;
+
+                       get_input = sat_manager_get_input_noti(ctx, plugin_name, (struct tel_sat_get_input_tlv*) &p_ind->proactive_ind_data.get_input);
+
+                       if(!get_input){
+                               dbg("no get input data");
+                               return TRUE;
+                       }
+
+                       dbg("get input type_format(%s)", g_variant_get_type_string(get_input));
+                       g_variant_get(get_input, "(iibbbsiiisi@v)", &command_id, &input_character_mode, &b_numeric, &b_help_info, &b_echo_input,
+                                       &text, &text_len, &rsp_len_max, &rsp_len_min, &def_text, &def_text_len, &icon_id);
+
+                       sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_GET_INPUT, get_input);
+
+                       telephony_sat_emit_get_input(sat, command_id, input_character_mode, b_numeric, b_help_info,
+                                       b_echo_input, text, text_len, rsp_len_max, rsp_len_min, def_text, def_text_len);
+               } break;
+
+               case SAT_PROATV_CMD_PLAY_TONE:{
+                       GVariant *play_tone = NULL;
+
+                       gint command_id, tone_type, duration;
+                       gint text_len;
+                       gchar* text;
+                       GVariant *icon_id;
+
+                       play_tone = sat_manager_play_tone_noti(ctx, plugin_name, (struct tel_sat_play_tone_tlv*) &p_ind->proactive_ind_data.play_tone);
+
+                       if(!play_tone){
+                               dbg("no play tone data");
+                               return TRUE;
+                       }
+
+                       dbg("play tone type_format(%s)", g_variant_get_type_string(play_tone));
+                       g_variant_get(play_tone, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &tone_type, &duration);
+
+                       dbg("check display text : text(%s) text len(%d)", text, text_len);
+                       if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
+                               GVariant *ui_info = NULL;
+                               gboolean user_confirm = FALSE;
+                               dbg("text should be displayed by ui");
+                               dbg("play tone is pending!!!")
+
+                               ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
+                               sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
+                               return TRUE;
+                       }
+
+                       telephony_sat_emit_play_tone(sat, command_id, text, text_len, tone_type, duration);
+               } break;
+
+               case SAT_PROATV_CMD_SEND_SMS:{
+                       GVariant *send_sms = NULL;
+
+                       gint command_id, ton, npi, tpdu_type;
+                       gboolean b_packing_required;
+                       gint text_len, number_len, tpdu_data_len;
+                       gchar* text, *dialling_number;
+                       GVariant *tpdu_data, *icon_id;
+
+                       send_sms = sat_manager_send_sms_noti(ctx, plugin_name, (struct tel_sat_send_sms_tlv*) &p_ind->proactive_ind_data.send_sms);
+
+                       if(!send_sms){
+                               dbg("no send sms data");
+                               return TRUE;
+                       }
+
+                       dbg("send sms type_format(%s)", g_variant_get_type_string(send_sms));
+                       g_variant_get(send_sms, "(isi@vbiisii@vi)", &command_id, &text, &text_len, &icon_id, &b_packing_required, &ton, &npi,
+                                       &dialling_number, &number_len, &tpdu_type, &tpdu_data, &tpdu_data_len);
+
+                       dbg("check display text : text(%s) text len(%d)", text, text_len);
+                       if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
+                               GVariant *ui_info = NULL;
+                               gboolean user_confirm = FALSE;
+                               dbg("text should be displayed by ui");
+                               dbg("send sms is pending!!!")
+
+                               ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
+                               sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
+                               return TRUE;
+                       }
+
+                       telephony_sat_emit_send_sms(sat, command_id, text, text_len, b_packing_required,
+                                       ton, npi, dialling_number, number_len, tpdu_type, tpdu_data, tpdu_data_len);
+               } break;
+
+               case SAT_PROATV_CMD_SEND_SS:{
+                       GVariant *send_ss = NULL;
+
+                       gint command_id, ton, npi;
+                       gint text_len, ss_str_len;
+                       gchar* text, *ss_string;
+
+                       GVariant *icon_id;
+
+                       send_ss = sat_manager_send_ss_noti(ctx, plugin_name, (struct tel_sat_send_ss_tlv*) &p_ind->proactive_ind_data.send_ss);
+
+                       if(!send_ss){
+                               dbg("no send ss data");
+                               return TRUE;
+                       }
+
+                       dbg("send ss type_format(%s)", g_variant_get_type_string(send_ss));
+                       g_variant_get(send_ss, "(isi@viiis)", &command_id, &text, &text_len, &icon_id,
+                                       &ton, &npi, &ss_str_len, &ss_string);
+
+                       dbg("check display text : text(%s) text len(%d)", text, text_len);
+                       if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
+                               GVariant *ui_info = NULL;
+                               gboolean user_confirm = FALSE;
+                               dbg("text should be displayed by ui");
+                               dbg("send ss is pending!!!")
+
+                               ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
+                               sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
+                               return TRUE;
+                       }
+
+                       telephony_sat_emit_send_ss(sat, command_id, text, text_len, ton, npi, ss_string);
+               } break;
+
+               case SAT_PROATV_CMD_SEND_USSD:{
+                       GVariant *send_ussd = NULL;
+
+                       gint command_id;
+                       gint text_len, ussd_str_len;
+                       gchar* text, *ussd_string;
+
+                       GVariant *icon_id;
+
+                       send_ussd = sat_manager_send_ussd_noti(ctx, plugin_name, (struct tel_sat_send_ussd_tlv*) &p_ind->proactive_ind_data.send_ussd);
+
+                       if(!send_ussd){
+                               dbg("no send ussd data");
+                               return TRUE;
+                       }
+
+                       dbg("send ussd type_format(%s)", g_variant_get_type_string(send_ussd));
+                       g_variant_get(send_ussd, "(isi@vis)", &command_id, &text, &text_len, &icon_id, &ussd_str_len, &ussd_string);
+
+                       dbg("check display text : text(%s) text len(%d)", text, text_len);
+                       if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
+                               GVariant *ui_info = NULL;
+                               gboolean user_confirm = FALSE;
+                               dbg("text should be displayed by ui");
+                               dbg("send ussd is pending!!!")
+
+                               ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
+                               sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
+                               return TRUE;
+                       }
+
+                       telephony_sat_emit_setup_ussd(sat, command_id, text, text_len, ussd_string);
+               } break;
+
+               case SAT_PROATV_CMD_SETUP_CALL:{
+                       GVariant *setup_call = NULL;
+
+                       gint command_id, call_type, text_len, duration;
+                       gchar *text, *call_number;
+                       GVariant *icon_id;
+
+                       setup_call = sat_manager_setup_call_noti(ctx, plugin_name, (struct tel_sat_setup_call_tlv*) &p_ind->proactive_ind_data.setup_call);
+
+                       if(!setup_call){
+                               dbg("no setup call data");
+                               return TRUE;
+                       }
+
+                       dbg("setup call type_format(%s)", g_variant_get_type_string(setup_call));
+                       g_variant_get(setup_call, "(isi@visi)", &command_id, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
+
+                       dbg("check display text : text(%s) text len(%d)", text, text_len);
+                       if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
+                               GVariant *ui_info = NULL;
+                               gboolean user_confirm = TRUE;
+                               dbg("text should be displayed by ui");
+                               dbg("setup call is pending!!!")
+
+                               ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
+                               sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
+                               return TRUE;
+                       }
+
+                       telephony_sat_emit_setup_call(sat, command_id, text, text_len, call_type,
+                                       call_number, duration);
+               }break;
+
+               case SAT_PROATV_CMD_SETUP_EVENT_LIST:{
+                       GVariant *event_list = NULL;
+
+                       gint event_cnt;
+                       GVariant *evt_list;
+
+                       event_list = sat_manager_setup_event_list_noti(ctx, plugin_name, (struct tel_sat_setup_event_list_tlv*) &p_ind->proactive_ind_data.setup_event_list);
+
+                       if(!event_list){
+                               dbg("no setup event list data");
+                               return TRUE;
+                       }
+
+                       dbg("setup event list type_format(%s)", g_variant_get_type_string(event_list));
+                       g_variant_get(event_list, "(i@v)", &event_cnt, &evt_list);
+
+                       telephony_sat_emit_setup_event_list(sat, event_cnt, evt_list);
+               } break;
+
+               case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:{
+                       GVariant *setup_idle_mode = NULL;
+
+                       gint command_id, text_len;
+                       gchar* text;
+                       GVariant *icon_id;
+
+                       setup_idle_mode = sat_manager_setup_idle_mode_text_noti(ctx, plugin_name, (struct tel_sat_setup_idle_mode_text_tlv*) &p_ind->proactive_ind_data.setup_idle_mode_text);
+
+                       if(!setup_idle_mode){
+                               dbg("no setup idle mode text data");
+                               return TRUE;
+                       }
+
+                       dbg("setup idle mode text type_format(%s)", g_variant_get_type_string(setup_idle_mode));
+                       g_variant_get(setup_idle_mode, "(isi@v)", &command_id, &text, &text_len, &icon_id);
+
+                       if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
+                               GVariant *ui_info = NULL;
+                               gboolean user_confirm = TRUE;
+                               dbg("text should be displayed by ui");
+                               dbg("setup idle mode text is displayed!!!")
+
+                               ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
+                               sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
+                               return TRUE;
+                       }
+
+                       telephony_sat_emit_setup_idle_mode_text(sat, command_id, text, text_len);
+               } break;
+
+               case SAT_PROATV_CMD_OPEN_CHANNEL:{
+                       GVariant *open_channel = NULL;
+
+                       gint command_id, bearer_type, protocol_type, dest_addr_type;
+                       gboolean immediate_link, auto_reconnection, bg_mode;
+                       gint text_len, buffer_size, port_number;
+                       gchar *text, *dest_address;
+                       GVariant *icon_id;
+                       GVariant *bearer_param;
+                       GVariant *bearer_detail;
+
+                       open_channel = sat_manager_open_channel_noti(ctx, plugin_name, (struct tel_sat_open_channel_tlv*) &p_ind->proactive_ind_data.open_channel);
+
+                       if(!open_channel){
+                               dbg("no open channel data");
+                               return TRUE;
+                       }
+
+                       dbg("open channel type_format(%s)", g_variant_get_type_string(open_channel));
+                       g_variant_get(open_channel,"(isi@vbbbi@viiiis@v)", &command_id, &text, &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
+                                       &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
+
+                       dbg("check display text : text(%s) text len(%d)", text, text_len);
+                       if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
+                               GVariant *ui_info = NULL;
+                               gboolean user_confirm = TRUE;
+                               dbg("text should be displayed by ui");
+                               dbg("open channel text is displayed!!!")
+
+                               ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
+                               sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
+                               return TRUE;
+                       }
+
+                       telephony_sat_emit_open_channel(sat, command_id, text, text_len, immediate_link, auto_reconnection, bg_mode,
+                                               bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);
+               } break;
+
+               case SAT_PROATV_CMD_CLOSE_CHANNEL:{
+                       GVariant *close_channel = NULL;
+
+                       gint command_id, channel_id, text_len;
+                       gchar *text;
+                       GVariant *icon_id;
+
+                       close_channel = sat_manager_close_channel_noti(ctx, plugin_name, (struct tel_sat_close_channel_tlv*) &p_ind->proactive_ind_data.close_channel);
+
+                       if(!close_channel){
+                               dbg("no close channel data");
+                               return TRUE;
+                       }
+
+                       //TODO check the data for sat-ui
+
+                       dbg("close channel type_format(%s)", g_variant_get_type_string(close_channel));
+                       g_variant_get(close_channel, "(isi@vi)", &command_id, &text, &text_len, &icon_id, &channel_id);
+
+                       telephony_sat_emit_close_channel(sat, command_id, text, text_len, channel_id);
+               } break;
+
+               case SAT_PROATV_CMD_RECEIVE_DATA:{
+                       GVariant *receive_data = NULL;
+
+                       gint command_id, text_len, channel_id, channel_data_len = 0;
+                       gchar *text;
+                       GVariant *icon_id;
+
+                       receive_data = sat_manager_receive_data_noti(ctx, plugin_name, (struct tel_sat_receive_channel_tlv*) &p_ind->proactive_ind_data.receive_data);
+
+                       if(!receive_data){
+                               dbg("no receive data data");
+                               return TRUE;
+                       }
+
+                       //TODO check the data for sat-ui
+
+                       dbg("receive data type_format(%s)", g_variant_get_type_string(receive_data));
+                       g_variant_get(receive_data, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &channel_id, &channel_data_len);
+
+                       telephony_sat_emit_receive_data(sat, command_id, text, text_len, channel_id, channel_data_len);
+               } break;
+
+               case SAT_PROATV_CMD_SEND_DATA:{
+                       GVariant *send_data = NULL;
+
+                       gint command_id, channel_id, text_len, channel_data_len;
+                       gboolean send_data_immediately;
+                       gchar *text;
+                       GVariant *channel_data;
+                       GVariant *icon_id;
+
+                       send_data = sat_manager_send_data_noti(ctx, plugin_name, (struct tel_sat_send_channel_tlv*) &p_ind->proactive_ind_data.send_data);
+
+                       if(!send_data){
+                               dbg("no send data data");
+                               return TRUE;
+                       }
+
+                       //TODO check the data for sat-ui
+
+                       dbg("send data type_format(%s)", g_variant_get_type_string(send_data));
+                       g_variant_get(send_data, "(isi@vib@vi)", &command_id, &text, &text_len, &icon_id, &channel_id, &send_data_immediately, &channel_data, &channel_data_len);
+
+                       telephony_sat_emit_send_data(sat, command_id, text, text_len, channel_id, send_data_immediately, channel_data, channel_data_len);
+               } break;
+
+               case SAT_PROATV_CMD_GET_CHANNEL_STATUS:{
+                       GVariant *channel_status = NULL;
+
+                       gint command_id;
+
+                       channel_status = sat_manager_get_channel_status_noti(ctx, plugin_name, (struct tel_sat_get_channel_status_tlv*) &p_ind->proactive_ind_data.get_channel_status);
+
+                       if(!channel_status){
+                               dbg("no get channel status data");
+                               return TRUE;
+                       }
+
+                       //TODO check the data for sat-ui
+
+                       dbg("get channel status type_format(%s)", g_variant_get_type_string(channel_status));
+                       g_variant_get(channel_status, "(i)", &command_id);
+
+                       telephony_sat_emit_get_channel_status(sat, command_id);
+               } break;
+
+               case SAT_PROATV_CMD_REFRESH:{
+                       GVariant *refresh = NULL;
+                       gint command_id = 0;
+                       gint refresh_type =0;
+                       GVariant *file_list = NULL;
+
+                       GVariant *ui_info = NULL;
+                       gboolean user_confirm = FALSE;
+                       gchar info[] = "refresh from SIM TOOLKIT";
+
+                       refresh = sat_manager_refresh_noti(ctx, plugin_name, (struct tel_sat_refresh_tlv*) &p_ind->proactive_ind_data.refresh);
+
+                       if(!refresh){
+                               dbg("no refresh data");
+                               return TRUE;
+                       }
+
+                       dbg("refresh type_format(%s)", g_variant_get_type_string(refresh));
+                       g_variant_get(refresh, "(ii@v)", &command_id, &refresh_type, &file_list);
+
+                       dbg("check refresh_type(%d)", refresh_type);
+
+                       dbg("text should be displayed by ui");
+                       dbg("refresh is pending!!!")
+
+                       ui_info = g_variant_new("(isib)", command_id, info, strlen(info), user_confirm);
+                       sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
+
+                       //telephony_sat_emit_refresh(sat, command_id, refresh_type, file_list);
+               }break;
+
+               case SAT_PROATV_CMD_MORE_TIME:{
+                       sat_manager_more_time_noti(ctx, plugin_name, (struct tel_sat_more_time_tlv*) &p_ind->proactive_ind_data.more_time);
+                       telephony_sat_emit_more_time(sat);
+               }break;
+
+               case SAT_PROATV_CMD_SEND_DTMF:{
+                       GVariant *send_dtmf = NULL;
+                       gint command_id = 0;
+                       gint text_len = 0, dtmf_str_len = 0;
+                       gchar *text = NULL;
+                       gchar *dtmf_str = NULL;
+                       GVariant *icon_id = NULL;
+
+                       send_dtmf = sat_manager_send_dtmf_noti(ctx, plugin_name, (struct tel_sat_send_dtmf_tlv*) &p_ind->proactive_ind_data.send_dtmf);
+                       if(!send_dtmf){
+                               dbg("no send_dtmf data");
+                               return TRUE;
+                       }
+
+                       dbg("send_dtmf type_format(%s)", g_variant_get_type_string(send_dtmf));
+                       g_variant_get(send_dtmf, "(isi@vis)", &command_id, &text, &text_len, &icon_id, &dtmf_str, &dtmf_str_len);
+
+                       if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
+                               GVariant *ui_info = NULL;
+                               gboolean user_confirm = FALSE;
+                               dbg("text should be displayed by ui");
+                               dbg("send dtmf is displayed!!!")
+
+                               ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
+                               sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
+                               return TRUE;
+                       }
+
+                       telephony_sat_emit_send_dtmf(sat, command_id, text, text_len, dtmf_str, dtmf_str_len);
+               }break;
+
+               case SAT_PROATV_CMD_LAUNCH_BROWSER:{
+                       GVariant *launch_browser = NULL;
+                       gint command_id = 0;
+                       gint browser_id = 0;
+                       gint url_len = 0, text_len = 0, gateway_proxy_len =0;
+                       gchar *url = NULL;
+                       gchar *text = NULL;
+                       gchar *gateway_proxy = NULL;
+                       GVariant *icon_id = NULL;
+
+                       launch_browser = sat_manager_launch_browser_noti(ctx, plugin_name, (struct tel_sat_launch_browser_tlv*) &p_ind->proactive_ind_data.launch_browser);
+                       if(!launch_browser){
+                               dbg("no launch_browser data");
+                               return TRUE;
+                       }
+
+                       dbg("launch_browser type_format(%s)", g_variant_get_type_string(launch_browser));
+                       g_variant_get(launch_browser, "(iisisisi@v)", &command_id, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len, &icon_id);
+
+                       if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
+                               GVariant *ui_info = NULL;
+                               gboolean user_confirm = TRUE;
+                               dbg("text should be displayed by ui");
+                               dbg("launch browser is displayed!!!")
+
+                               ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
+                               sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
+                               return TRUE;
+                       }
+
+                       telephony_sat_emit_launch_browser(sat, command_id, browser_id, url, url_len, gateway_proxy, gateway_proxy_len, text, text_len);
+               }break;
+
+               case SAT_PROATV_CMD_PROVIDE_LOCAL_INFO:{
+                       GVariant *provide_info = NULL;
+                       gint command_id = 0;
+                       gint info_type = 0;
+
+                       provide_info = sat_manager_provide_local_info_noti(ctx, plugin_name, (struct tel_sat_provide_local_info_tlv*) &p_ind->proactive_ind_data.provide_local_info);
+                       if(!provide_info){
+                               dbg("no provide_info data");
+                               return TRUE;
+                       }
+
+                       dbg("provide_info type_format(%s)", g_variant_get_type_string(provide_info));
+                       g_variant_get(provide_info, "(ii)", &command_id, &info_type);
+
+                       telephony_sat_emit_provide_local_info(sat, command_id, info_type);
+               }break;
+
+               case SAT_PROATV_CMD_LANGUAGE_NOTIFICATION:{
+                       GVariant *language_noti = NULL;
+                       gint command_id = 0;
+                       gint language = 0;
+                       gboolean b_specified = FALSE;
+
+                       language_noti = sat_manager_language_notification_noti(ctx, plugin_name, (struct tel_sat_language_notification_tlv*) &p_ind->proactive_ind_data.language_notification);
+                       if(!language_noti){
+                               dbg("no language_noti data");
+                               return TRUE;
+                       }
+
+                       dbg("language_noti type_format(%s)", g_variant_get_type_string(language_noti));
+                       g_variant_get(language_noti, "(iib)", &command_id, &language, &b_specified);
+
+                       telephony_sat_emit_language_notification(sat, command_id, language, b_specified);
+               }break;
+
+               default:
+                       dbg("not handled ind->cmd_type[0x%x]", p_ind->cmd_type);
+                       break;
        }
-       return TCORE_RETURN_SUCCESS;
+
+       return TRUE;
 }
diff --git a/src/sat_manager.c b/src/sat_manager.c
new file mode 100755 (executable)
index 0000000..e440eee
--- /dev/null
@@ -0,0 +1,4709 @@
+/*
+ * tel-plugin-dbus-tapi
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <glib-object.h>
+
+#include <tcore.h>
+#include <server.h>
+#include <plugin.h>
+#include <hal.h>
+#include <communicator.h>
+#include <core_object.h>
+#include <queue.h>
+#include <user_request.h>
+#include <util.h>
+#include <co_sat.h>
+#include <type/call.h>
+#include <type/sim.h>
+
+#include "generated-code.h"
+#include "common.h"
+#include "sat_manager.h"
+#include "sat_ui_support/sat_ui_support.h"
+
+#define SAT_DEF_CMD_Q_MAX 10
+#define SAT_TIME_OUT 60000
+
+static unsigned int _get_time_in_ms(struct tel_sat_duration *dr)
+{
+       switch (dr->time_unit) {
+               case TIME_UNIT_MINUTES:
+                       return (unsigned int)dr->time_interval * 60000;
+                       break;
+
+               case TIME_UNIT_SECONDS:
+                       return (unsigned int)dr->time_interval * 1000;
+                       break;
+
+               case TIME_UNIT_TENTHS_OF_SECONDS:
+                       return (unsigned int)dr->time_interval * 100;
+                       break;
+
+               case TIME_UNIT_RESERVED:
+               default:
+                       return 0;       // set default
+                       break;
+       }
+
+       return 0;
+}
+
+static int _get_queue_size(struct custom_data *ctx)
+{
+       int temp;
+       temp = (int)g_queue_get_length(&ctx->queue_sat);
+       dbg("[SAT]SAT Command Queue current Size [%d], MAX SIZE [%d]\n", temp,  SAT_DEF_CMD_Q_MAX);
+       return temp;
+}
+
+static gboolean _push_data(struct custom_data *ctx, struct sat_manager_queue_data *cmd_obj)
+{
+       struct sat_manager_queue_data* item = NULL;
+       if (_get_queue_size(ctx) == (SAT_DEF_CMD_Q_MAX - 1)) {
+               dbg("[SAT] FAILED TO ENQUEUE - QUEUE FULL!\n");
+               return FALSE;
+       }
+
+       item = g_new(struct sat_manager_queue_data, 1);
+
+       if (item == NULL) {
+               dbg("[SAT] FAILED TO ALLOC QUEUE ITEM!\n");
+               return FALSE;
+       }
+
+       memcpy((void*)item, cmd_obj, sizeof(struct sat_manager_queue_data));
+       g_queue_push_tail(&ctx->queue_sat, item);
+       return TRUE;
+}
+
+static gboolean _pop_nth_data(struct custom_data *ctx, struct sat_manager_queue_data *cmd_obj, int command_id)
+{
+       struct sat_manager_queue_data *item = NULL;
+
+       if (g_queue_is_empty(&ctx->queue_sat))
+               return FALSE;
+
+       item = g_queue_pop_nth(&ctx->queue_sat, command_id);
+       memcpy((void*)cmd_obj, item, sizeof(struct sat_manager_queue_data));
+       g_free(item);
+
+       return TRUE;
+}
+
+static gboolean _peek_nth_data(struct custom_data *ctx, struct sat_manager_queue_data *cmd_obj, int command_id)
+{
+       if (g_queue_is_empty(&ctx->queue_sat))
+               return FALSE;
+
+       memcpy((void*)cmd_obj, g_queue_peek_nth(&ctx->queue_sat, command_id), sizeof(struct sat_manager_queue_data));
+       return TRUE;
+}
+
+void sat_manager_init_queue(struct custom_data *ctx)
+{
+       g_queue_init(&ctx->queue_sat);
+}
+
+static gboolean sat_manager_enqueue_cmd(struct custom_data *ctx, struct sat_manager_queue_data *cmd_obj)
+{
+       cmd_obj->cmd_id = g_queue_get_length(&ctx->queue_sat);
+       return _push_data(ctx, cmd_obj);
+}
+
+static gboolean sat_manager_dequeue_cmd_by_id(struct custom_data *ctx, struct sat_manager_queue_data *cmd_obj, int cmd_id)
+{
+       return _pop_nth_data(ctx, cmd_obj, cmd_id);
+}
+
+static gboolean sat_manager_queue_peek_data_by_id(struct custom_data *ctx, struct sat_manager_queue_data *cmd_obj, int command_id)
+{
+       return _peek_nth_data(ctx, cmd_obj, command_id);
+}
+
+static gboolean sat_manager_check_availiable_event_list(struct tel_sat_setup_event_list_tlv *event_list_tlv)
+{
+       gboolean rv = TRUE;
+       int index = 0;
+
+       for(index = 0; index < event_list_tlv->event_list.event_list_cnt; index++){
+               if(event_list_tlv->event_list.evt_list[index] == EVENT_USER_ACTIVITY){
+                       dbg("do user activity");
+               }
+               else if(event_list_tlv->event_list.evt_list[index] == EVENT_IDLE_SCREEN_AVAILABLE){
+                       dbg("do idle screen");
+               }
+               else if(event_list_tlv->event_list.evt_list[index] == EVENT_LANGUAGE_SELECTION){
+                       dbg("do language selection");
+               }
+               else if(event_list_tlv->event_list.evt_list[index] == EVENT_BROWSER_TERMINATION){
+                       dbg("do browser termination");
+               }
+               else if(event_list_tlv->event_list.evt_list[index] == EVENT_DATA_AVAILABLE){
+                       dbg("do data available (bip)");
+               }
+               else if(event_list_tlv->event_list.evt_list[index] == EVENT_CHANNEL_STATUS){
+                       dbg("do channel status (bip)");
+               }
+               else{
+                       dbg("unmanaged event (%d)", event_list_tlv->event_list.evt_list[index]);
+                       rv = FALSE;
+               }
+       }
+
+       return rv;
+}
+
+static TReturn sat_manager_send_terminal_response(Communicator *comm, TcorePlugin *target_plg, struct treq_sat_terminal_rsp_data *tr)
+{
+       TReturn rv = TCORE_RETURN_SUCCESS;
+       UserRequest *ur = NULL;
+
+       ur = tcore_user_request_new(comm, tcore_plugin_get_description(target_plg)->name);
+       if (!ur) {
+               dbg("ur is NULL");
+               return TCORE_RETURN_FAILURE;
+       }
+
+       tcore_user_request_set_command(ur, TREQ_SAT_REQ_TERMINALRESPONSE);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sat_terminal_rsp_data), (void *)tr);
+       rv = tcore_communicator_dispatch_request(comm, ur);
+       if (rv != TCORE_RETURN_SUCCESS) {
+               dbg("fail to send terminal response",rv);
+               rv = TCORE_RETURN_FAILURE;
+       }
+
+       return rv;
+}
+
+GVariant* sat_manager_caching_setup_menu_info(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_menu_tlv* setup_menu_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *setup_menu_info = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0, menu_cnt = 0, title_len =0;
+       gboolean menu_present = FALSE, help_info = FALSE, updated = FALSE;
+       gchar main_title[SAT_ALPHA_ID_LEN_MAX];
+       GVariantBuilder *v_builder = NULL;
+       GVariant *menu_items = NULL;
+       GVariant *icon_id = NULL;
+       GVariant *icon_list = NULL;
+
+       dbg("interpreting setup menu notification");
+       memset(&main_title, 0 , SAT_ALPHA_ID_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       if ((setup_menu_tlv->icon_id.is_exist)
+                       && (setup_menu_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && (!setup_menu_tlv->alpha_id.is_exist || setup_menu_tlv->alpha_id.alpha_data_len == 0)){
+
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = setup_menu_tlv->command_detail.cmd_num;
+               tr->cmd_type = setup_menu_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.setup_menu.command_detail, &setup_menu_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.setup_menu.device_id.src = setup_menu_tlv->device_id.dest;
+               tr->terminal_rsp_data.setup_menu.device_id.dest = setup_menu_tlv->device_id.src;
+               tr->terminal_rsp_data.setup_menu.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       //check menu update
+       if(ctx->cached_sat_main_menu){
+               dbg("main menu info is updated");
+               updated = TRUE;
+       }
+
+       //menu item count
+       menu_cnt = setup_menu_tlv->menu_item_cnt;
+       if(!menu_cnt){
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("no item");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = setup_menu_tlv->command_detail.cmd_num;
+               tr->cmd_type = setup_menu_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.setup_menu.command_detail, &setup_menu_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.setup_menu.device_id.src = setup_menu_tlv->device_id.dest;
+               tr->terminal_rsp_data.setup_menu.device_id.dest = setup_menu_tlv->device_id.src;
+               tr->terminal_rsp_data.setup_menu.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       //check the validation of content
+       if(setup_menu_tlv->menu_item_cnt == 1 && setup_menu_tlv->menu_item[0].text_len == 0){
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("item removed");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = setup_menu_tlv->command_detail.cmd_num;
+               tr->cmd_type = setup_menu_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.setup_menu.command_detail, &setup_menu_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.setup_menu.device_id.src = setup_menu_tlv->device_id.dest;
+               tr->terminal_rsp_data.setup_menu.device_id.dest = setup_menu_tlv->device_id.src;
+               tr->terminal_rsp_data.setup_menu.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       //get title
+       if(setup_menu_tlv->alpha_id.alpha_data_len)
+               sat_mgr_convert_string((unsigned char*)&main_title,(unsigned short *)&title_len,
+                       setup_menu_tlv->alpha_id.dcs.a_format,
+                       (unsigned char*)&setup_menu_tlv->alpha_id.alpha_data,
+                       (unsigned short)setup_menu_tlv->alpha_id.alpha_data_len);
+       dbg("sat main menu title(%s)",main_title);
+
+       v_builder = g_variant_builder_new(G_VARIANT_TYPE ("a(si)"));
+
+       //get menu items
+       if(!setup_menu_tlv->next_act_ind_list.cnt){
+               int index = 0;
+
+               dbg("setup_menu_tlv->next_act_ind_list.cnt == 0");
+
+               for(index = 0; index < menu_cnt; index++){
+                       gint item_len;
+                       gchar item_str[SAT_ITEM_TEXT_LEN_MAX + 1];
+
+                       if(!setup_menu_tlv->alpha_id.alpha_data_len)
+                               setup_menu_tlv->alpha_id.dcs.a_format = ALPHABET_FROMAT_8BIT_DATA;
+
+                       memset(&item_str, 0 , SAT_ITEM_TEXT_LEN_MAX + 1);
+                       sat_mgr_convert_string((unsigned char*)&item_str, (unsigned short *)&item_len,
+                               setup_menu_tlv->alpha_id.dcs.a_format,
+                               (unsigned char*)&setup_menu_tlv->menu_item[index].text,
+                               (unsigned short)setup_menu_tlv->menu_item[index].text_len);
+
+                       dbg( "index(%d) item_id(%d) item_string(%s)", index, setup_menu_tlv->menu_item[index].item_id, item_str);
+
+                       //g_variant_builder_add(v_builder, "(sy)", &item_str, setup_menu_tlv->menu_item[index].item_id);
+                       g_variant_builder_add(v_builder, "(si)", item_str, (gint32)(setup_menu_tlv->menu_item[index].item_id));
+               }
+       }
+       else{
+               int index = 0;
+
+               dbg("setup_menu_tlv->next_act_ind_list.cnt == 0");
+
+               for(index = 0; index < menu_cnt; index++){
+                       gint item_len;
+                       gchar item_str[SAT_ITEM_TEXT_LEN_MAX + 1];
+
+                       if(setup_menu_tlv->alpha_id.alpha_data_len == 0)
+                               setup_menu_tlv->alpha_id.dcs.a_format = ALPHABET_FROMAT_8BIT_DATA;
+
+                       memset(&item_str, '\0' , SAT_ITEM_TEXT_LEN_MAX + 1);
+                       sat_mgr_convert_string((unsigned char*)&item_str, (unsigned short *)&item_len,
+                               setup_menu_tlv->alpha_id.dcs.a_format,
+                               (unsigned char*)&setup_menu_tlv->menu_item[index].text,
+                               (unsigned short)setup_menu_tlv->menu_item[index].text_len);
+
+                       if( setup_menu_tlv->next_act_ind_list.indicator_list[index] == SAT_PROATV_CMD_SEND_SMS) {
+                               g_strlcat(item_str," [Send SMS]", 11);
+                       }
+                       else if (setup_menu_tlv->next_act_ind_list.indicator_list[index]== SAT_PROATV_CMD_SETUP_CALL) {
+                               g_strlcat(item_str," [Set Up Call]", 14);
+                       }
+                       else if (setup_menu_tlv->next_act_ind_list.indicator_list[index]== SAT_PROATV_CMD_LAUNCH_BROWSER){
+                               g_strlcat(item_str," [Launch Browser]", 17);
+                       }
+                       else if (setup_menu_tlv->next_act_ind_list.indicator_list[index]== SAT_PROATV_CMD_PROVIDE_LOCAL_INFO)   {
+                               g_strlcat(item_str," [Provide Terminal Information]", 31);
+                       }
+
+                       dbg( "index(%d) item_id(%d) item_string(%s)", index, setup_menu_tlv->menu_item[index].item_id, item_str);
+
+                       //g_variant_builder_add(v_builder, "(sy)", g_strdup(item_str), setup_menu_tlv->menu_item[index].item_id);
+                       g_variant_builder_add(v_builder, "(si)", item_str, (gint32)(setup_menu_tlv->menu_item[index].item_id));
+               }
+
+       }
+       menu_items = g_variant_builder_end(v_builder);
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_SETUP_MENU;
+       memcpy((void*)&(q_data.cmd_data.setupMenuInd), setup_menu_tlv, sizeof(struct tel_sat_setup_menu_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new_variant(menu_items);
+       icon_list = g_variant_new_variant(menu_items);
+
+       setup_menu_info = g_variant_new("(ibsvibbvv)", command_id, menu_present, main_title, menu_items,
+                       menu_cnt, help_info, updated, icon_id, icon_list);
+
+       return setup_menu_info;
+}
+
+GVariant* sat_manager_display_text_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_display_text_tlv* display_text_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *display_text = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0, text_len =0, duration= 0, tmp_duration = 0;
+       gboolean immediately_rsp = FALSE, high_priority = FALSE, user_rsp_required = FALSE;
+       gchar text[SAT_TEXT_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting display text notification");
+       memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       if ( (display_text_tlv->icon_id.is_exist && display_text_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       || !display_text_tlv->text.string_length ){
+
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = display_text_tlv->command_detail.cmd_num;
+               tr->cmd_type = display_text_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.display_text.command_detail, &display_text_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.display_text.device_id.src = DEVICE_ID_ME;
+               tr->terminal_rsp_data.display_text.device_id.dest = display_text_tlv->device_id.src;
+               tr->terminal_rsp_data.display_text.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       //user resp required & time_duration
+       if(display_text_tlv->command_detail.cmd_qualifier.display_text.text_clear_type == TEXT_WAIT_FOR_USER_TO_CLEAR_MSG){
+               user_rsp_required = TRUE;
+               duration = SAT_TIME_OUT;
+       }
+       else{
+               duration = 15000;
+       }
+
+       //immediate response requested
+       if (!display_text_tlv->immediate_response_requested)
+               immediately_rsp = TRUE;
+
+       //high priority
+       if (display_text_tlv->command_detail.cmd_qualifier.display_text.text_priority == TEXT_PRIORITY_HIGH)
+               high_priority = TRUE;
+       dbg("user rsp required(%d), immediately rsp(%d) priority(%d)",user_rsp_required, immediately_rsp, high_priority);
+
+       //get text
+       sat_mgr_convert_string((unsigned char*) &text, (unsigned short *) &text_len,
+                       display_text_tlv->text.dcs.a_format,
+                       (unsigned char*) &display_text_tlv->text.string,
+                       (unsigned short) display_text_tlv->text.string_length);
+       dbg("sat display text(%s)",text);
+
+       //duration
+       if(!display_text_tlv->duration.time_interval){
+               tmp_duration = _get_time_in_ms(&display_text_tlv->duration);
+       }
+
+       if(tmp_duration > 0)
+               duration = tmp_duration;
+
+/*      ETSI TS 102 223 6.4.1 DISPLAY TEXT
+        If help information is requested by the user, this command may be used to display help information on the screen. The
+        help information should be sent as high priority text and with the option that it should be cleared after a short delay.*/
+
+/*     if (ctx->help_requested == TRUE) {
+               ad->bIsPriorityHigh = TRUE;
+               ad->duration = 7000;
+               ctx->help_requested = FALSE;
+       }*/
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_DISPLAY_TEXT;
+       memcpy((void*)&(q_data.cmd_data.displayTextInd), display_text_tlv, sizeof(struct tel_sat_display_text_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       display_text = g_variant_new("(isiibbbv)", command_id, text, text_len, duration,
+                       high_priority, user_rsp_required, immediately_rsp, icon_id);
+
+       return display_text;
+}
+
+GVariant* sat_manager_select_item_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_select_item_tlv* select_item_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *select_item = NULL;
+       struct sat_manager_queue_data q_data;
+
+       int index = 0;
+       gint command_id = 0, default_item_id = 0, menu_cnt = 0, text_len =0;
+       gboolean help_info = FALSE;
+       gchar text[SAT_TEXT_STRING_LEN_MAX];
+       GVariantBuilder *v_builder = NULL;
+       GVariant *menu_items = NULL;
+       GVariant *icon_id = NULL;
+       GVariant *icon_list = NULL;
+
+       dbg("interpreting select item notification");
+       memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       if ((select_item_tlv->icon_id.is_exist)
+                       && (select_item_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && ( !select_item_tlv->alpha_id.is_exist || select_item_tlv->alpha_id.alpha_data_len == 0) ) {
+
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (struct treq_sat_terminal_rsp_data *) calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+
+               tr->cmd_number = select_item_tlv->command_detail.cmd_num;
+               tr->cmd_type = select_item_tlv->command_detail.cmd_type;
+
+               memcpy((void*) &tr->terminal_rsp_data.select_item.command_detail, &select_item_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.select_item.device_id.src = select_item_tlv->device_id.dest;
+               tr->terminal_rsp_data.select_item.device_id.dest = select_item_tlv->device_id.src;
+               tr->terminal_rsp_data.select_item.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       // help info
+       help_info = select_item_tlv->command_detail.cmd_qualifier.select_item.help_info;
+
+       // select item text
+       if(select_item_tlv->alpha_id.is_exist && select_item_tlv->alpha_id.alpha_data_len > 0)
+               sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                               select_item_tlv->alpha_id.dcs.a_format,
+                               (unsigned char*)&select_item_tlv->alpha_id.alpha_data,
+                               (unsigned short)select_item_tlv->alpha_id.alpha_data_len);
+       dbg("select item text(%s)",text);
+
+       //default item id
+       default_item_id = select_item_tlv->item_identifier.item_identifier;
+       dbg( "default item id(%d)", default_item_id);
+
+       //item count
+       menu_cnt = select_item_tlv->menu_item_cnt;
+       dbg( "menu item count(%d)", menu_cnt);
+
+       //items
+       v_builder = g_variant_builder_new(G_VARIANT_TYPE ("a(iis)"));
+       for(index= 0; index< menu_cnt; index++){
+               gint item_len;
+               gchar item_str[SAT_ITEM_TEXT_LEN_MAX + 1];
+
+               memset(&item_str, 0 , SAT_ITEM_TEXT_LEN_MAX + 1);
+
+               sat_mgr_convert_string((unsigned char*) &item_str, (unsigned short *) &item_len,
+                               select_item_tlv->alpha_id.dcs.a_format,
+                               (unsigned char*) &select_item_tlv->menu_item[index].text,
+                               (unsigned short) select_item_tlv->menu_item[index].text_len);
+
+               if (select_item_tlv->item_next_act_ind_list.cnt != 0) {
+                       if( select_item_tlv->item_next_act_ind_list.indicator_list[index] == SAT_PROATV_CMD_SEND_SMS) {
+                               g_strlcat(item_str," [Send SMS]", 11);
+                       }
+                       else if (select_item_tlv->item_next_act_ind_list.indicator_list[index]== SAT_PROATV_CMD_SETUP_CALL) {
+                               g_strlcat(item_str," [Set Up Call]", 14);
+                       }
+                       else if (select_item_tlv->item_next_act_ind_list.indicator_list[index]== SAT_PROATV_CMD_LAUNCH_BROWSER){
+                               g_strlcat(item_str," [Launch Browser]", 17);
+                       }
+                       else if (select_item_tlv->item_next_act_ind_list.indicator_list[index]== SAT_PROATV_CMD_PROVIDE_LOCAL_INFO)     {
+                               g_strlcat(item_str," [Provide Terminal Information]", 31);
+                       }
+               }
+
+               item_len = strlen(item_str);
+               dbg( "index(%d) item_id(%d) item_len(%d) item_string(%s)", index, select_item_tlv->menu_item[index].item_id, item_len, item_str);
+               g_variant_builder_add(v_builder, "(iis)", (gint32)(select_item_tlv->menu_item[index].item_id), item_len, item_str);
+       }
+       menu_items = g_variant_builder_end(v_builder);
+
+       // generate command id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_SELECT_ITEM;
+       memcpy((void*)&(q_data.cmd_data.selectItemInd), select_item_tlv, sizeof(struct tel_sat_select_item_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new_variant(menu_items);
+       icon_list = g_variant_new_variant(menu_items);
+
+       select_item = g_variant_new("(ibsiiivvv)", command_id, help_info, text, text_len,
+                       default_item_id, menu_cnt, menu_items, icon_id, icon_list);
+
+       return select_item;
+}
+
+GVariant* sat_manager_get_inkey_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_inkey_tlv* get_inkey_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *get_inkey = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0, key_type = 0, input_character_mode = 0;
+       gint text_len = 0, duration = 0, tmp_duration = 0;
+       gboolean b_numeric = FALSE, b_help_info = FALSE;
+       gchar text[SAT_TEXT_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting get inkey notification");
+       memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       if (get_inkey_tlv->icon_id.is_exist && !get_inkey_tlv->text.string_length
+                       && (get_inkey_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)){
+
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = get_inkey_tlv->command_detail.cmd_num;
+               tr->cmd_type = get_inkey_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.get_inkey.command_detail, &get_inkey_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.get_inkey.device_id.src = get_inkey_tlv->device_id.dest;
+               tr->terminal_rsp_data.get_inkey.device_id.dest = get_inkey_tlv->device_id.src;
+               tr->terminal_rsp_data.get_inkey.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       //key type
+       key_type = get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.inkey_type;
+
+       //time duration
+       duration = SAT_TIME_OUT;
+       tmp_duration = _get_time_in_ms(&get_inkey_tlv->duration);
+       if (tmp_duration > 0)
+               duration = tmp_duration;
+
+       //input mode
+       input_character_mode = get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.alphabet_type;
+
+       //numeric
+       b_numeric = !get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.alphabet_set;
+
+       //help info
+       b_help_info = get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.help_info;
+
+       //text & text len
+       sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                                                               get_inkey_tlv->text.dcs.a_format ,
+                                                               (unsigned char*)&get_inkey_tlv->text.string,
+                                                               (unsigned short)get_inkey_tlv->text.string_length);
+
+       dbg("get inkey text(%s)",text);
+
+       if (get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.immediate_rsp_required) {
+               dbg("get_inkey immediate_rsp_require is TRUE");
+               //Send TR if UI display success
+       }
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_GET_INKEY;
+       memcpy((void*)&(q_data.cmd_data.getInkeyInd), get_inkey_tlv, sizeof(struct tel_sat_get_inkey_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       get_inkey = g_variant_new("(iiibbsiiv)", command_id, key_type, input_character_mode, b_numeric,
+                       b_help_info, text, text_len, duration, icon_id);
+
+       return get_inkey;
+}
+
+GVariant* sat_manager_get_input_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_input_tlv* get_input_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *get_input = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0, input_character_mode = 0;
+       gint text_len = 0, def_text_len = 0, rsp_len_min = 0, rsp_len_max = 0;
+       gboolean b_numeric = FALSE, b_help_info = FALSE, b_echo_input = FALSE;
+       gchar text[SAT_TEXT_STRING_LEN_MAX], def_text[SAT_TEXT_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting get input notification");
+       memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       if( (get_input_tlv->icon_id.is_exist && get_input_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       || !get_input_tlv->text.string_length ){
+
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = get_input_tlv->command_detail.cmd_num;
+               tr->cmd_type = get_input_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.get_input.command_detail, &get_input_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.get_input.device_id.src = get_input_tlv->device_id.dest;
+               tr->terminal_rsp_data.get_input.device_id.dest = get_input_tlv->device_id.src;
+               tr->terminal_rsp_data.get_input.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       dbg( "[SAT]  is SMS7 packing required [%d]",get_input_tlv->command_detail.cmd_qualifier.get_input.user_input_unpacked_format);
+
+       //input mode
+       input_character_mode =  get_input_tlv->command_detail.cmd_qualifier.get_input.alphabet_type;
+
+       //numeric
+       b_numeric = !get_input_tlv->command_detail.cmd_qualifier.get_input.alphabet_set;
+
+       //help info
+       b_help_info = get_input_tlv->command_detail.cmd_qualifier.get_input.help_info;
+
+       //echo input
+       b_echo_input = get_input_tlv->command_detail.cmd_qualifier.get_input.me_echo_user_input;
+       dbg("numeric (%d), help info(%d), echo input(%d)", b_numeric, b_help_info, b_echo_input);
+
+       //text & text len
+       sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                       get_input_tlv->text.dcs.a_format ,
+                       (unsigned char*)&get_input_tlv->text.string,
+                       (unsigned short)get_input_tlv->text.string_length);
+       dbg("get input text(%s)",text);
+
+       //response length min & max
+       rsp_len_min = get_input_tlv->rsp_len.min;
+       rsp_len_max = get_input_tlv->rsp_len.max;
+
+       //default text & default text len
+       if(get_input_tlv->default_text.string_length){
+               sat_mgr_convert_string((unsigned char*)&def_text,(unsigned short *)&def_text_len,
+                               get_input_tlv->text.dcs.a_format ,
+                               (unsigned char*)&get_input_tlv->default_text.string,
+                               (unsigned short)get_input_tlv->default_text.string_length);
+               dbg("get input default text(%s)",text);
+       }
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_GET_INPUT;
+       memcpy((void*)&(q_data.cmd_data.getInputInd), get_input_tlv, sizeof(struct tel_sat_get_input_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       get_input = g_variant_new("(iibbbsiiisiv)", command_id, input_character_mode, b_numeric, b_help_info,
+                       b_echo_input, text, text_len, rsp_len_max, rsp_len_min, def_text, def_text_len, icon_id);
+
+       return get_input;
+}
+
+GVariant* sat_manager_play_tone_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_play_tone_tlv* play_tone_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *play_tone = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0, tone_type = 0, duration = 0, tmp_duration = 0;
+       gint text_len = 0;
+       gchar text[SAT_TEXT_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting play tone notification");
+       memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       if( (play_tone_tlv->icon_id.is_exist) && ( play_tone_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && (!play_tone_tlv->alpha_id.is_exist || !play_tone_tlv->alpha_id.alpha_data_len))
+       {
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = play_tone_tlv->command_detail.cmd_num;
+               tr->cmd_type = play_tone_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.play_tone.command_detail, &play_tone_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.play_tone.device_id.src = play_tone_tlv->device_id.dest;
+               tr->terminal_rsp_data.play_tone.device_id.dest = play_tone_tlv->device_id.src;
+               tr->terminal_rsp_data.play_tone.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       //text and text len
+       if( play_tone_tlv->alpha_id.is_exist && play_tone_tlv->alpha_id.alpha_data_len){
+               sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                               play_tone_tlv->alpha_id.dcs.a_format,
+                               (unsigned char*)&play_tone_tlv->alpha_id.alpha_data,
+                               (unsigned short)play_tone_tlv->alpha_id.alpha_data_len);
+               dbg("play tone ui display text (%s)",text);
+       }
+
+       //tone type
+       tone_type = play_tone_tlv->tone.tone_type;
+
+       //time duration
+       duration = SAT_TIME_OUT;
+       tmp_duration = _get_time_in_ms(&play_tone_tlv->duration);
+       if (tmp_duration > 0)
+               duration = tmp_duration;
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_PLAY_TONE;
+       memcpy((void*)&(q_data.cmd_data.play_tone), play_tone_tlv, sizeof(struct tel_sat_play_tone_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       play_tone = g_variant_new("(isivii)", command_id, text, text_len, icon_id, tone_type, duration);
+
+       return play_tone;
+}
+
+GVariant* sat_manager_send_sms_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_sms_tlv* send_sms_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *send_sms = NULL;
+       struct sat_manager_queue_data q_data;
+
+       int index = 0;
+       gint command_id = 0, ton = 0, npi = 0, tpdu_type = 0;
+       gboolean b_packing_required = FALSE;
+       gint text_len = 0, number_len = 0, tpdu_data_len= 0;
+       gchar text[SAT_TEXT_STRING_LEN_MAX], dialling_number[SAT_DIALING_NUMBER_LEN_MAX];
+       GVariantBuilder *builder = NULL;
+       GVariant *tpdu_data = NULL;
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting send sms notification");
+       memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
+       memset(&dialling_number, 0 , SAT_DIALING_NUMBER_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       if( (send_sms_tlv->icon_id.is_exist) && ( send_sms_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && (!send_sms_tlv->alpha_id.is_exist || !send_sms_tlv->alpha_id.alpha_data_len))
+       {
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = send_sms_tlv->command_detail.cmd_num;
+               tr->cmd_type = send_sms_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.send_sms.command_detail, &send_sms_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.send_sms.device_id.src = send_sms_tlv->device_id.dest;
+               tr->terminal_rsp_data.send_sms.device_id.dest = send_sms_tlv->device_id.src;
+               tr->terminal_rsp_data.send_sms.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       //text and text len
+       if( send_sms_tlv->alpha_id.is_exist && send_sms_tlv->alpha_id.alpha_data_len){
+               sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                               send_sms_tlv->alpha_id.dcs.a_format,
+                               (unsigned char*)&send_sms_tlv->alpha_id.alpha_data,
+                               (unsigned short)send_sms_tlv->alpha_id.alpha_data_len);
+               dbg("send sms ui display text (%s)",text);
+       }
+
+       //packing required
+       b_packing_required = send_sms_tlv->command_detail.cmd_qualifier.send_sms.packing_by_me_required;
+
+       //address : ton, npi, dialling number, number len
+       ton = send_sms_tlv->address.ton;
+       npi = send_sms_tlv->address.npi;
+       number_len = send_sms_tlv->address.dialing_number_len;
+       memcpy(dialling_number, send_sms_tlv->address.dialing_number, SAT_DIALING_NUMBER_LEN_MAX);
+
+       //tpdu data : type, data, data len
+       tpdu_type = send_sms_tlv->sms_tpdu.tpdu_type;
+       tpdu_data_len = send_sms_tlv->sms_tpdu.data_len;
+       builder = g_variant_builder_new(G_VARIANT_TYPE ("ay"));
+       for (index = 0; index < tpdu_data_len; index++) {
+               g_variant_builder_add(builder, "y", send_sms_tlv->sms_tpdu.data[index]);
+       }
+       tpdu_data = g_variant_builder_end(builder);
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_SEND_SMS;
+       memcpy((void*)&(q_data.cmd_data.sendSMSInd), send_sms_tlv, sizeof(struct tel_sat_send_sms_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       send_sms = g_variant_new("(isivbiisiivi)", command_id, text, text_len, icon_id, b_packing_required,
+                       ton, npi, dialling_number, number_len, tpdu_type, tpdu_data, tpdu_data_len);
+
+       return send_sms;
+}
+
+GVariant* sat_manager_send_ss_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_ss_tlv* send_ss_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *send_ss = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0, ton = 0, npi = 0;
+       gint text_len, ss_str_len;
+       gchar text[SAT_TEXT_STRING_LEN_MAX], ss_string[SAT_SS_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting send ss notification");
+       memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
+       memset(&ss_string, 0 , SAT_SS_STRING_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       if( (send_ss_tlv->icon_id.is_exist) && ( send_ss_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && (!send_ss_tlv->alpha_id.is_exist || !send_ss_tlv->alpha_id.alpha_data_len))
+       {
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = send_ss_tlv->command_detail.cmd_num;
+               tr->cmd_type = send_ss_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.send_ss.command_detail, &send_ss_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.send_ss.device_id.src = send_ss_tlv->device_id.dest;
+               tr->terminal_rsp_data.send_ss.device_id.dest = send_ss_tlv->device_id.src;
+               tr->terminal_rsp_data.send_ss.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       //text and text len
+       if( send_ss_tlv->alpha_id.is_exist && send_ss_tlv->alpha_id.alpha_data_len){
+               sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                               send_ss_tlv->alpha_id.dcs.a_format,
+                               (unsigned char*)&send_ss_tlv->alpha_id.alpha_data,
+                               (unsigned short)send_ss_tlv->alpha_id.alpha_data_len);
+               dbg("send ss ui display text (%s)",text);
+       }
+
+       //ss string: ton, npi, ss string len, ss string
+       ton = send_ss_tlv->ss_string.ton;
+       npi = send_ss_tlv->ss_string.npi;
+       ss_str_len = send_ss_tlv->ss_string.string_len;
+       memcpy(ss_string, send_ss_tlv->ss_string.ss_string, SAT_SS_STRING_LEN_MAX);
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_SEND_SS;
+       memcpy((void*)&(q_data.cmd_data.send_ss), send_ss_tlv, sizeof(struct tel_sat_send_ss_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       send_ss = g_variant_new("(isiviiis)", command_id, text, text_len, icon_id,
+                       ton, npi, ss_str_len, ss_string);
+
+       return send_ss;
+}
+
+GVariant* sat_manager_send_ussd_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_ussd_tlv* send_ussd_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *send_ussd = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0;
+       gint text_len, ussd_str_len;
+       gchar text[SAT_TEXT_STRING_LEN_MAX], ussd_string[SAT_USSD_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting send ussd notification");
+       memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
+       memset(&ussd_string, 0 , SAT_USSD_STRING_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       if( (send_ussd_tlv->icon_id.is_exist) && ( send_ussd_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && (!send_ussd_tlv->alpha_id.is_exist || !send_ussd_tlv->alpha_id.alpha_data_len))
+       {
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = send_ussd_tlv->command_detail.cmd_num;
+               tr->cmd_type = send_ussd_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.send_ussd.command_detail, &send_ussd_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.send_ussd.device_id.src = send_ussd_tlv->device_id.dest;
+               tr->terminal_rsp_data.send_ussd.device_id.dest = send_ussd_tlv->device_id.src;
+               tr->terminal_rsp_data.send_ussd.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       //text and text len
+       if( send_ussd_tlv->alpha_id.is_exist && send_ussd_tlv->alpha_id.alpha_data_len){
+               sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                               send_ussd_tlv->alpha_id.dcs.a_format,
+                               (unsigned char*)&send_ussd_tlv->alpha_id.alpha_data,
+                               (unsigned short)send_ussd_tlv->alpha_id.alpha_data_len);
+               dbg("send ussd ui display text (%s)",text);
+       }
+
+       //ussd string
+       sat_mgr_convert_string((unsigned char*)&ussd_string,(unsigned short *)&ussd_str_len,
+                               send_ussd_tlv->ussd_string.dsc.a_format,
+                               (unsigned char*)&send_ussd_tlv->ussd_string.ussd_string,
+                               (unsigned short)send_ussd_tlv->ussd_string.string_len);
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_SEND_USSD;
+       memcpy((void*)&(q_data.cmd_data.send_ussd), send_ussd_tlv, sizeof(struct tel_sat_send_ussd_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       send_ussd = g_variant_new("(isivis)", command_id, text, text_len, icon_id, ussd_str_len, ussd_string);
+
+       return send_ussd;
+}
+
+GVariant* sat_manager_setup_call_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_call_tlv* setup_call_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *setup_call = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0, call_type = 0, text_len = 0, duration = 0;
+       gchar text[SAT_TEXT_STRING_LEN_MAX], call_number[SAT_DIALING_NUMBER_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting setup call notification");
+       memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
+       memset(&call_number, 0 , SAT_DIALING_NUMBER_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       if(setup_call_tlv->duration.time_interval > 0)
+       {
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT] redial is not supported.\n");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = setup_call_tlv->command_detail.cmd_num;
+               tr->cmd_type = setup_call_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.setup_call.command_detail, &setup_call_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.setup_call.device_id.src = setup_call_tlv->device_id.dest;
+               tr->terminal_rsp_data.setup_call.device_id.dest = setup_call_tlv->device_id.src;
+               tr->terminal_rsp_data.setup_call.result_type = RESULT_BEYOND_ME_CAPABILITIES;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       //check for subaddress field
+       if(setup_call_tlv->subaddress.subaddress_len > 0)
+       {
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT] Sub address is not supported > 0)");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = setup_call_tlv->command_detail.cmd_num;
+               tr->cmd_type = setup_call_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.setup_call.command_detail, &setup_call_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.setup_call.device_id.src = setup_call_tlv->device_id.dest;
+               tr->terminal_rsp_data.setup_call.device_id.dest = setup_call_tlv->device_id.src;
+               tr->terminal_rsp_data.setup_call.result_type = RESULT_BEYOND_ME_CAPABILITIES;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       //call type
+       call_type = setup_call_tlv->command_detail.cmd_qualifier.setup_call.setup_call;
+
+       //call display data
+       if(setup_call_tlv->call_setup_alpha_id.alpha_data_len != 0){
+               sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                               setup_call_tlv->call_setup_alpha_id.dcs.a_format,
+                               (unsigned char*)&setup_call_tlv->call_setup_alpha_id.alpha_data,
+                               (unsigned short)setup_call_tlv->call_setup_alpha_id.alpha_data_len);
+       }
+       else{
+               if(setup_call_tlv->user_confirm_alpha_id.alpha_data_len != 0){
+                       sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                                       setup_call_tlv->user_confirm_alpha_id.dcs.a_format,
+                                       (unsigned char*)&setup_call_tlv->user_confirm_alpha_id.alpha_data,
+                                       (unsigned short)setup_call_tlv->user_confirm_alpha_id.alpha_data_len);
+               }
+               else{
+                       memcpy(text, setup_call_tlv->address.dialing_number, setup_call_tlv->address.dialing_number_len);
+                       text_len = setup_call_tlv->address.dialing_number_len;
+               }
+       }
+       dbg("setup call display text (%s)",text);
+
+       //call number
+       if(setup_call_tlv->address.ton == TON_INTERNATIONAL){
+               call_number[0] = '+';
+               memcpy(&call_number[1],setup_call_tlv->address.dialing_number, setup_call_tlv->address.dialing_number_len);
+       }
+       else{
+               memcpy(call_number,setup_call_tlv->address.dialing_number, setup_call_tlv->address.dialing_number_len);
+       }
+       dbg("setup call call number(%s)",setup_call_tlv->address.dialing_number);
+
+       //duration
+       if(setup_call_tlv->duration.time_interval > 0)
+               duration = _get_time_in_ms(&setup_call_tlv->duration);
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_SETUP_CALL;
+       memcpy((void*)&(q_data.cmd_data.setup_call), setup_call_tlv, sizeof(struct tel_sat_setup_call_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       setup_call = g_variant_new("(isivisi)", command_id, text, text_len, icon_id, call_type, call_number, duration);
+
+       return setup_call;
+}
+
+GVariant* sat_manager_setup_event_list_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_event_list_tlv *event_list_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *event_list = NULL;
+
+       int index = 0;
+       gboolean rv = FALSE;
+       gint event_cnt = 0;
+       GVariantBuilder *builder = NULL;
+       GVariant *evt_list = NULL;
+       struct treq_sat_terminal_rsp_data *tr = NULL;
+
+       dbg("interpreting event list notification");
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       //event cnt
+       event_cnt = event_list_tlv->event_list.event_list_cnt;
+       dbg("event cnt(%d)", event_cnt);
+
+       //get event
+       builder = g_variant_builder_new(G_VARIANT_TYPE ("ai"));
+       for (index = 0; index < event_cnt; index++) {
+               g_variant_builder_add(builder, "i", event_list_tlv->event_list.evt_list[index]);
+       }
+       evt_list = g_variant_builder_end(builder);
+
+       event_list = g_variant_new("(iv)", event_cnt, evt_list);
+
+       //send TR - does not need from application's response
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       tr->cmd_number = event_list_tlv->command_detail.cmd_num;
+       tr->cmd_type = event_list_tlv->command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.setup_event_list.command_detail, &event_list_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.setup_event_list.device_id.src = event_list_tlv->device_id.dest;
+       tr->terminal_rsp_data.setup_event_list.device_id.dest = event_list_tlv->device_id.src;
+       tr->terminal_rsp_data.setup_event_list.result_type = RESULT_SUCCESS;
+       tr->terminal_rsp_data.setup_event_list.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+
+       rv = sat_manager_check_availiable_event_list(event_list_tlv);
+       if(!rv){
+               tr->terminal_rsp_data.setup_event_list.result_type = RESULT_SUCCESS_WITH_MISSING_INFO;
+       }
+
+       sat_manager_send_terminal_response(ctx->comm, plg, tr);
+
+       return event_list;
+}
+
+GVariant* sat_manager_setup_idle_mode_text_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_idle_mode_text_tlv *idle_mode_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *idle_mode = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0;
+       gint text_len;
+       gchar text[SAT_TEXT_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting setup idle mode text notification");
+       memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       if( ((idle_mode_tlv->icon_id.is_exist) && ( idle_mode_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY))
+                       || idle_mode_tlv->text.string_length == 0 )
+       {
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = idle_mode_tlv->command_detail.cmd_num;
+               tr->cmd_type = idle_mode_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.setup_idle_mode_text.command_detail, &idle_mode_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.setup_idle_mode_text.device_id.src = idle_mode_tlv->device_id.dest;
+               tr->terminal_rsp_data.setup_idle_mode_text.device_id.dest = idle_mode_tlv->device_id.src;
+               tr->terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                       idle_mode_tlv->text.dcs.a_format,
+                       (unsigned char*)&idle_mode_tlv->text.string,
+                       (unsigned short)idle_mode_tlv->text.string_length);
+
+       dbg("setup idle mode text display text (%s)",text);
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT;
+       memcpy((void*)&(q_data.cmd_data.idle_mode), idle_mode_tlv, sizeof(struct tel_sat_setup_idle_mode_text_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       idle_mode = g_variant_new("(isiv)", command_id, text, text_len, icon_id);
+
+       return idle_mode;
+}
+
+GVariant* sat_manager_open_channel_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_open_channel_tlv *open_channel_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *open_channel = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0, bearer_type = 0, protocol_type = 0, dest_addr_type = 0;
+       gboolean immediate_link = FALSE, auto_reconnection = FALSE, bg_mode = FALSE;
+       gint text_len = 0, buffer_size = 0, port_number = 0;
+       gchar text[SAT_ALPHA_ID_LEN_MAX], dest_address[SAT_OTHER_ADDR_LEN_MAX];
+       GVariant *icon_id = NULL;
+       GVariant *bearer_param = NULL;
+       GVariant *bearer_detail = NULL;
+
+       dbg("interpreting open channel notification");
+       memset(&text, 0 , SAT_ALPHA_ID_LEN_MAX);
+       memset(&dest_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       //immediate link
+       immediate_link = open_channel_tlv->command_detail.cmd_qualifier.open_channel.immediate_link;
+
+       //auto reconnection
+       auto_reconnection = open_channel_tlv->command_detail.cmd_qualifier.open_channel.automatic_reconnection;
+
+       //back ground mode
+       bg_mode = open_channel_tlv->command_detail.cmd_qualifier.open_channel.background_mode;
+
+       //open channel text
+       if(open_channel_tlv->alpha_id.is_exist && open_channel_tlv->alpha_id.alpha_data_len > 0)
+               sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                               open_channel_tlv->alpha_id.dcs.a_format,
+                               (unsigned char*)&open_channel_tlv->alpha_id.alpha_data,
+                               (unsigned short)open_channel_tlv->alpha_id.alpha_data_len);
+       dbg("open channel text(%s)",text);
+
+       //buffer size
+       buffer_size = open_channel_tlv->buffer_size.size[0];
+       buffer_size = buffer_size << 8;
+       buffer_size += open_channel_tlv->buffer_size.size[1];
+       //memcpy(&buffer_size, open_channel_tlv->buffer_size.size, sizeof(unsigned char)*2);
+       dbg("buffer size(%d)", buffer_size);
+
+       //interface transport level
+       protocol_type = open_channel_tlv->interface_transport_level.protocol_type;
+       port_number = open_channel_tlv->interface_transport_level.port_number;
+
+       //data destination address
+       dest_addr_type = open_channel_tlv->data_destination_address.address_type;
+       memcpy(dest_address, open_channel_tlv->data_destination_address.address, open_channel_tlv->data_destination_address.address_len);
+       dbg("destination IP address (%s)", dest_address);
+
+       //bearer type
+       bearer_type = open_channel_tlv->bearer_desc.bearer_type;
+
+       //bearer param & bearer detail
+       switch(bearer_type){
+               case BEARER_CSD:{
+                       //bearer param
+                       gint data_rate = 0, service_type = 0, conn_element_type = 0;
+
+                       //bearer detail
+                       gint ton = 0, npi = 0, time_duration1 = 0, time_duration2 = 0, other_addr_type = 0;
+                       gint login_len = 0, pwd_len = 0;
+                       gchar dialling_number[SAT_DIALING_NUMBER_LEN_MAX], sub_addr[SAT_SUB_ADDR_LEN_MAX];
+                       gchar other_address[SAT_OTHER_ADDR_LEN_MAX];
+                       gchar login[SAT_TEXT_STRING_LEN_MAX], pwd[SAT_TEXT_STRING_LEN_MAX];
+
+                       memset(&dialling_number, 0 , SAT_DIALING_NUMBER_LEN_MAX);
+                       memset(&sub_addr, 0 , SAT_SUB_ADDR_LEN_MAX);
+                       memset(&other_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
+                       memset(&login, 0 , SAT_TEXT_STRING_LEN_MAX);
+                       memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+                       //bearer parameter
+                       data_rate = open_channel_tlv->bearer_desc.bearer_parameter.cs_bearer_param.data_rate;
+                       service_type = open_channel_tlv->bearer_desc.bearer_parameter.cs_bearer_param.service_type;
+                       conn_element_type = open_channel_tlv->bearer_desc.bearer_parameter.cs_bearer_param.connection_element_type;
+
+                       bearer_param = g_variant_new("(iii)", data_rate, service_type, conn_element_type);
+
+                       //bearer detail
+                       ton = open_channel_tlv->bearer_detail.cs_bearer.address.ton;
+                       npi = open_channel_tlv->bearer_detail.cs_bearer.address.npi;
+                       memcpy(dialling_number, open_channel_tlv->bearer_detail.cs_bearer.address.dialing_number, open_channel_tlv->bearer_detail.cs_bearer.address.dialing_number_len);
+
+                       memcpy(sub_addr, open_channel_tlv->bearer_detail.cs_bearer.subaddress.subaddress, open_channel_tlv->bearer_detail.cs_bearer.subaddress.subaddress_len);
+
+                       time_duration1 = _get_time_in_ms(&open_channel_tlv->bearer_detail.cs_bearer.duration1);
+                       time_duration2 = _get_time_in_ms(&open_channel_tlv->bearer_detail.cs_bearer.duration2);
+
+                       other_addr_type = open_channel_tlv->bearer_detail.cs_bearer.other_address.address_type;
+                       memcpy(other_address, open_channel_tlv->bearer_detail.cs_bearer.other_address.address, open_channel_tlv->bearer_detail.cs_bearer.other_address.address_len);
+
+                       sat_mgr_convert_string((unsigned char*) &login, (unsigned short *) &login_len,
+                                       open_channel_tlv->bearer_detail.cs_bearer.text_user_login.dcs.a_format,
+                                       (unsigned char*) &open_channel_tlv->bearer_detail.cs_bearer.text_user_login.string,
+                                       (unsigned short) open_channel_tlv->bearer_detail.cs_bearer.text_user_login.string_length);
+
+                       sat_mgr_convert_string((unsigned char*) &pwd, (unsigned short *) &pwd_len,
+                                       open_channel_tlv->bearer_detail.cs_bearer.text_user_pwd.dcs.a_format,
+                                       (unsigned char*) &open_channel_tlv->bearer_detail.cs_bearer.text_user_pwd.string,
+                                       (unsigned short) open_channel_tlv->bearer_detail.cs_bearer.text_user_pwd.string_length);
+
+                       bearer_detail= g_variant_new("(iissiiisss)", ton, npi, dialling_number, sub_addr, time_duration1, time_duration2,
+                                       other_addr_type, other_address, login, pwd);
+               } break;
+               case BEARER_GPRS:{
+                       //bearer param
+                       gint precedence_class = 0, delay_class = 0, reliability_class = 0;
+                       gint peak_class = 0, mean_class = 0, pdp_type = 0;
+
+                       //bearer detail
+                       gint other_addr_type = 0;
+                       gint login_len = 0, pwd_len = 0;
+                       gchar network_access_name[SAT_NET_ACC_NAM_LEN_MAX];
+                       gchar other_address[SAT_OTHER_ADDR_LEN_MAX];
+                       gchar login[SAT_TEXT_STRING_LEN_MAX], pwd[SAT_TEXT_STRING_LEN_MAX];
+
+                       memset(&network_access_name, 0 , SAT_NET_ACC_NAM_LEN_MAX);
+                       memset(&other_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
+                       memset(&login, 0 , SAT_TEXT_STRING_LEN_MAX);
+                       memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+                       //bearer parameter
+                       precedence_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.precedence_class;
+                       delay_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.delay_class;
+                       reliability_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.reliability_class;
+                       peak_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.peak_throughput_class;
+                       mean_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.mean_throughput_class;
+                       pdp_type = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.pdp_type;
+
+                       bearer_param = g_variant_new("(iiiiii)", precedence_class, delay_class, reliability_class, peak_class, mean_class, pdp_type);
+
+                       memcpy(network_access_name, open_channel_tlv->bearer_detail.ps_bearer.network_access_name.network_access_name, open_channel_tlv->bearer_detail.ps_bearer.network_access_name.length);
+
+                       other_addr_type = open_channel_tlv->bearer_detail.ps_bearer.other_address.address_type;
+                       memcpy(other_address, open_channel_tlv->bearer_detail.ps_bearer.other_address.address, open_channel_tlv->bearer_detail.ps_bearer.other_address.address_len);
+
+                       sat_mgr_convert_string((unsigned char*) &login, (unsigned short *) &login_len,
+                                       open_channel_tlv->bearer_detail.ps_bearer.text_user_login.dcs.a_format,
+                                       (unsigned char*) &open_channel_tlv->bearer_detail.ps_bearer.text_user_login.string,
+                                       (unsigned short) open_channel_tlv->bearer_detail.ps_bearer.text_user_login.string_length);
+
+                       sat_mgr_convert_string((unsigned char*) &pwd, (unsigned short *) &pwd_len,
+                                       open_channel_tlv->bearer_detail.ps_bearer.text_user_pwd.dcs.a_format,
+                                       (unsigned char*) &open_channel_tlv->bearer_detail.ps_bearer.text_user_pwd.string,
+                                       (unsigned short) open_channel_tlv->bearer_detail.ps_bearer.text_user_pwd.string_length);
+
+                       bearer_detail= g_variant_new("(sisss)", network_access_name, other_addr_type, other_address, login, pwd);
+
+               } break;
+               case BEARER_DEFAULT_BEARER_FROM_TRANSPORT_LAYER:{
+                       //bearer param
+
+                       //bearer detail
+                       gint other_addr_type = 0;
+                       gint login_len = 0, pwd_len = 0;
+                       gchar other_address[SAT_OTHER_ADDR_LEN_MAX];
+                       gchar login[SAT_TEXT_STRING_LEN_MAX], pwd[SAT_TEXT_STRING_LEN_MAX];
+
+                       memset(&other_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
+                       memset(&login, 0 , SAT_TEXT_STRING_LEN_MAX);
+                       memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+                       //bearer parameter
+                       bearer_param = g_variant_new("()");
+
+                       other_addr_type = open_channel_tlv->bearer_detail.default_bearer.other_address.address_type;
+                       memcpy(other_address, open_channel_tlv->bearer_detail.default_bearer.other_address.address, open_channel_tlv->bearer_detail.default_bearer.other_address.address_len);
+
+                       sat_mgr_convert_string((unsigned char*) &login, (unsigned short *) &login_len,
+                                       open_channel_tlv->bearer_detail.default_bearer.text_user_login.dcs.a_format,
+                                       (unsigned char*) &open_channel_tlv->bearer_detail.default_bearer.text_user_login.string,
+                                       (unsigned short) open_channel_tlv->bearer_detail.default_bearer.text_user_login.string_length);
+
+                       sat_mgr_convert_string((unsigned char*) &pwd, (unsigned short *) &pwd_len,
+                                       open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.dcs.a_format,
+                                       (unsigned char*) &open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string,
+                                       (unsigned short) open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string_length);
+
+                       bearer_detail= g_variant_new("(isss)", other_addr_type, other_address, login, pwd);
+
+               } break;
+               case BEARER_LOCAL_LINK_TECHNOLOGY_INDEPENDENT:{
+                       //bearer param
+
+                       //bearer detail
+                       gint pwd_len = 0;
+                       gint remote_address_type =0, time_duration1 = 0, time_duration2 = 0;
+                       gchar remote_address[SAT_REMOTE_ENTITY_ADDR_LEN_MAX];
+                       gchar pwd[SAT_TEXT_STRING_LEN_MAX];
+
+                       memset(&remote_address, 0 , SAT_REMOTE_ENTITY_ADDR_LEN_MAX);
+                       memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+                       //bearer parameter
+                       bearer_param = g_variant_new("()");
+
+                       time_duration1 = _get_time_in_ms(&open_channel_tlv->bearer_detail.local_bearer.duration1);
+                       time_duration2 = _get_time_in_ms(&open_channel_tlv->bearer_detail.local_bearer.duration2);
+
+                       sat_mgr_convert_string((unsigned char*) &pwd, (unsigned short *) &pwd_len,
+                                                                                       open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.dcs.a_format,
+                                                                                       (unsigned char*) &open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string,
+                                                                                       (unsigned short) open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string_length);
+
+                       remote_address_type = open_channel_tlv->bearer_detail.local_bearer.remote_entity_address.coding_type;
+                       memcpy(remote_address, open_channel_tlv->bearer_detail.local_bearer.remote_entity_address.remote_entity_address, open_channel_tlv->bearer_detail.local_bearer.remote_entity_address.length);
+
+                       bearer_detail= g_variant_new("(iisis)", time_duration1, time_duration2, pwd, remote_address_type, remote_address);
+
+               } break;
+               default:
+                       dbg("invalid bearer data");
+                       return NULL;
+       }//end of switch
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_OPEN_CHANNEL;
+       memcpy((void*)&(q_data.cmd_data.open_channel), open_channel_tlv, sizeof(struct tel_sat_open_channel_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       open_channel = g_variant_new("(isivbbbiviiiisv)", command_id, text, text_len, icon_id, immediate_link, auto_reconnection, bg_mode,
+                       bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);
+
+       return open_channel;
+}
+
+GVariant* sat_manager_close_channel_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_close_channel_tlv *close_channel_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *close_channel = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0, channel_id = 0;
+       gint text_len = 0;
+       gchar text[SAT_ALPHA_ID_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting close channel notification");
+       memset(&text, 0 , SAT_ALPHA_ID_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       //channel id
+       channel_id = close_channel_tlv->device_id.dest;
+
+       //close channel text
+       if(close_channel_tlv->alpha_id.is_exist && close_channel_tlv->alpha_id.alpha_data_len > 0)
+               sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                               close_channel_tlv->alpha_id.dcs.a_format,
+                               (unsigned char*)&close_channel_tlv->alpha_id.alpha_data,
+                               (unsigned short)close_channel_tlv->alpha_id.alpha_data_len);
+       dbg("close channel text(%s)",text);
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_CLOSE_CHANNEL;
+       memcpy((void*)&(q_data.cmd_data.close_channel), close_channel_tlv, sizeof(struct tel_sat_close_channel_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       close_channel = g_variant_new("(isivi)", command_id, text, text_len, icon_id, channel_id);
+
+       return close_channel;
+}
+
+GVariant* sat_manager_receive_data_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_receive_channel_tlv *receive_data_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *receive_data = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0, channel_id = 0;
+       gint text_len = 0, channel_data_len = 0;
+       gchar text[SAT_ALPHA_ID_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting receive data notification");
+       memset(&text, 0 , SAT_ALPHA_ID_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       //channel id
+       channel_id = receive_data_tlv->device_id.dest;
+
+       //receive data text
+       if(receive_data_tlv->alpha_id.is_exist && receive_data_tlv->alpha_id.alpha_data_len > 0)
+               sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                               receive_data_tlv->alpha_id.dcs.a_format,
+                               (unsigned char*)&receive_data_tlv->alpha_id.alpha_data,
+                               (unsigned short)receive_data_tlv->alpha_id.alpha_data_len);
+       dbg("receive data text(%s)",text);
+
+       channel_data_len = receive_data_tlv->channel_data_len.data_len;
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_RECEIVE_DATA;
+       memcpy((void*)&(q_data.cmd_data.receive_data), receive_data_tlv, sizeof(struct tel_sat_receive_channel_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       receive_data = g_variant_new("(isivii)", command_id, text, text_len, icon_id, channel_id, channel_data_len);
+
+       return receive_data;
+}
+
+GVariant* sat_manager_send_data_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_channel_tlv *send_data_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *send_data = NULL;
+       struct sat_manager_queue_data q_data;
+
+       int index = 0;
+       gint command_id = 0, channel_id = 0, data_len = 0;
+       gboolean send_data_immediately = FALSE;
+       gint text_len = 0;
+       gchar text[SAT_ALPHA_ID_LEN_MAX];
+       GVariantBuilder *builder = NULL;
+       GVariant *channel_data = NULL;
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting send data notification");
+       memset(&text, 0 , SAT_ALPHA_ID_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       //send data immediately
+       send_data_immediately = send_data_tlv->command_detail.cmd_qualifier.send_data.send_data_immediately;
+
+       //channel id
+       channel_id = send_data_tlv->device_id.dest;
+
+       //send data text
+       if(send_data_tlv->alpha_id.is_exist && send_data_tlv->alpha_id.alpha_data_len > 0)
+               sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                               send_data_tlv->alpha_id.dcs.a_format,
+                               (unsigned char*)&send_data_tlv->alpha_id.alpha_data,
+                               (unsigned short)send_data_tlv->alpha_id.alpha_data_len);
+       dbg("send data text(%s)",text);
+
+       //channel data, data len
+       data_len = send_data_tlv->channel_data.data_string_len;
+       builder = g_variant_builder_new(G_VARIANT_TYPE ("ay"));
+       for (index = 0; index < data_len; index++) {
+               dbg("send data index(%d) data(0x%x)",index, send_data_tlv->channel_data.data_string[index]);
+               g_variant_builder_add(builder, "y", send_data_tlv->channel_data.data_string[index]);
+       }
+       channel_data = g_variant_builder_end(builder);
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_SEND_DATA;
+       memcpy((void*)&(q_data.cmd_data.send_data), send_data_tlv, sizeof(struct tel_sat_send_channel_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       send_data = g_variant_new("(isivibvi)", command_id, text, text_len, icon_id, channel_id, send_data_immediately, channel_data, data_len);
+
+       return send_data;
+}
+
+GVariant* sat_manager_get_channel_status_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_channel_status_tlv *get_channel_status_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *get_channel_status = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0;
+
+       dbg("interpreting get channel status notification");
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_GET_CHANNEL_STATUS;
+       memcpy((void*)&(q_data.cmd_data.get_channel_status), get_channel_status_tlv, sizeof(struct tel_sat_get_channel_status_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       get_channel_status = g_variant_new("(i)", command_id);
+
+       return get_channel_status;
+}
+
+GVariant* sat_manager_refresh_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_refresh_tlv *refresh_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *refresh = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0;
+       gint refresh_type =0;
+       GVariantBuilder *builder = NULL;
+       GVariant *file_list = NULL;
+       int index = 0;
+
+       dbg("interpreting refresh notification");
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       refresh_type = refresh_tlv->command_detail.cmd_qualifier.refresh.refresh;
+
+       builder = g_variant_builder_new(G_VARIANT_TYPE ("ai"));
+       for (index = 0; index < refresh_tlv->file_list.file_count; index++) {
+               g_variant_builder_add(builder, "i", refresh_tlv->file_list.file_id[index]);
+       }
+       file_list = g_variant_builder_end(builder);
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_REFRESH;
+       memcpy((void*)&(q_data.cmd_data.refresh), refresh_tlv, sizeof(struct tel_sat_refresh_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       refresh = g_variant_new("(iiv)", command_id, refresh_type, file_list);
+
+       return refresh;
+}
+
+void sat_manager_more_time_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_more_time_tlv *more_time_tlv)
+{
+       TcorePlugin *plg = NULL;
+       struct treq_sat_terminal_rsp_data *tr = NULL;
+
+       dbg("interpreting more time notification");
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return;
+       }
+       //send TR - does not need from application's response
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       tr->cmd_number = more_time_tlv->command_detail.cmd_num;
+       tr->cmd_type = more_time_tlv->command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.more_time.command_detail, &more_time_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.more_time.device_id.src = more_time_tlv->device_id.dest;
+       tr->terminal_rsp_data.more_time.device_id.dest = more_time_tlv->device_id.src;
+       tr->terminal_rsp_data.more_time.result_type = RESULT_SUCCESS;
+       tr->terminal_rsp_data.more_time.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+
+       sat_manager_send_terminal_response(ctx->comm, plg, tr);
+}
+
+GVariant* sat_manager_send_dtmf_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_dtmf_tlv *send_dtmf_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *send_dtmf = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0;
+       gint text_len =0, dtmf_str_len =0;
+       gchar text[SAT_TEXT_STRING_LEN_MAX], dtmf_str[SAT_DTMF_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting send dtmf notification");
+       memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
+       memset(&dtmf_str, 0 , SAT_DTMF_STRING_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       if( (send_dtmf_tlv->icon_id.is_exist) && ( send_dtmf_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && (!send_dtmf_tlv->alpha_id.is_exist || !send_dtmf_tlv->alpha_id.alpha_data_len))
+       {
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = send_dtmf_tlv->command_detail.cmd_num;
+               tr->cmd_type = send_dtmf_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.send_dtmf.command_detail, &send_dtmf_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.send_dtmf.device_id.src = send_dtmf_tlv->device_id.dest;
+               tr->terminal_rsp_data.send_dtmf.device_id.dest = send_dtmf_tlv->device_id.src;
+               tr->terminal_rsp_data.send_dtmf.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       //text and text len
+       if( send_dtmf_tlv->alpha_id.is_exist && send_dtmf_tlv->alpha_id.alpha_data_len){
+               sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                               send_dtmf_tlv->alpha_id.dcs.a_format,
+                               (unsigned char*)&send_dtmf_tlv->alpha_id.alpha_data,
+                               (unsigned short)send_dtmf_tlv->alpha_id.alpha_data_len);
+               dbg("send dtmf ui display text (%s)",text);
+       }
+
+       //dtmf string len, dtmf string
+       dtmf_str_len = send_dtmf_tlv->dtmf_string.dtmf_length;
+       memcpy(dtmf_str, send_dtmf_tlv->dtmf_string.dtmf_string, SAT_DTMF_STRING_LEN_MAX);
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_SEND_DTMF;
+       memcpy((void*)&(q_data.cmd_data.send_dtmf), send_dtmf_tlv, sizeof(struct tel_sat_send_dtmf_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       send_dtmf = g_variant_new("(isivis)", command_id, text, text_len, icon_id,
+                       dtmf_str_len, dtmf_str);
+
+       return send_dtmf;
+}
+
+GVariant* sat_manager_launch_browser_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_launch_browser_tlv *launch_browser_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *launch_browser = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0;
+       gint browser_id = 0;
+       gint url_len =0, text_len =0, gateway_proxy_len =0;
+       gchar url[SAT_URL_LEN_MAX], text[SAT_TEXT_STRING_LEN_MAX], gateway_proxy[SAT_TEXT_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting launch browser notification");
+       memset(&url, 0 , SAT_URL_LEN_MAX);
+       memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
+       memset(&gateway_proxy, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       if( (launch_browser_tlv->user_confirm_icon_id.is_exist) && ( launch_browser_tlv->user_confirm_icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && (!launch_browser_tlv->user_confirm_alpha_id.is_exist || !launch_browser_tlv->user_confirm_alpha_id.alpha_data_len))
+       {
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+               tr->cmd_number = launch_browser_tlv->command_detail.cmd_num;
+               tr->cmd_type = launch_browser_tlv->command_detail.cmd_type;
+
+               memcpy((void*)&tr->terminal_rsp_data.launch_browser.command_detail, &launch_browser_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
+               tr->terminal_rsp_data.launch_browser.device_id.src = launch_browser_tlv->device_id.dest;
+               tr->terminal_rsp_data.launch_browser.device_id.dest = launch_browser_tlv->device_id.src;
+               tr->terminal_rsp_data.launch_browser.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return NULL;
+       }
+
+       //browser id
+       browser_id = launch_browser_tlv->browser_id;
+
+       //url and url len
+       if( launch_browser_tlv->url.url_length){
+               url_len = launch_browser_tlv->url.url_length;
+               memcpy(url, launch_browser_tlv->url.url, launch_browser_tlv->url.url_length);
+               dbg("launch browser url (%s)",url);
+       }
+
+       //gateway_proxy_text
+       if(launch_browser_tlv->gateway_proxy_text.is_digit_only) {
+               memcpy(gateway_proxy, launch_browser_tlv->gateway_proxy_text.string, launch_browser_tlv->gateway_proxy_text.string_length);
+               dbg("launch browser gateway_proxy digit type string (%s)",gateway_proxy);
+       } else {
+               if( launch_browser_tlv->gateway_proxy_text.string_length){
+                       sat_mgr_convert_string((unsigned char*)&gateway_proxy,(unsigned short *)&gateway_proxy_len,
+                                       launch_browser_tlv->gateway_proxy_text.dcs.a_format,
+                                       (unsigned char*)&launch_browser_tlv->gateway_proxy_text.string,
+                                       (unsigned short)launch_browser_tlv->gateway_proxy_text.string_length);
+                       dbg("launch browser gateway_proxy_text (%s)",gateway_proxy);
+               }
+       }
+
+       //user confirm text and user confirm text len
+       if( launch_browser_tlv->user_confirm_alpha_id.is_exist && launch_browser_tlv->user_confirm_alpha_id.alpha_data_len){
+               sat_mgr_convert_string((unsigned char*)&text,(unsigned short *)&text_len,
+                               launch_browser_tlv->user_confirm_alpha_id.dcs.a_format,
+                               (unsigned char*)&launch_browser_tlv->user_confirm_alpha_id.alpha_data,
+                               (unsigned short)launch_browser_tlv->user_confirm_alpha_id.alpha_data_len);
+               dbg("launch browser user confirm text (%s)",text);
+       }
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_LAUNCH_BROWSER;
+       memcpy((void*)&(q_data.cmd_data.launch_browser), launch_browser_tlv, sizeof(struct tel_sat_launch_browser_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       launch_browser = g_variant_new("(iisisisiv)",
+                       command_id, browser_id, url, url_len, gateway_proxy, gateway_proxy_len, text, text_len, icon_id);
+
+       return launch_browser;
+}
+
+GVariant* sat_manager_provide_local_info_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_provide_local_info_tlv *provide_local_info_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *provide_info = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0;
+       gint info_type =0;
+
+       dbg("interpreting provide local info notification");
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       info_type = provide_local_info_tlv->command_detail.cmd_qualifier.provide_local_info.provide_local_info;
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_PROVIDE_LOCAL_INFO;
+       memcpy((void*)&(q_data.cmd_data.provide_local_info), provide_local_info_tlv, sizeof(struct tel_sat_provide_local_info_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       provide_info = g_variant_new("(ii)", command_id, info_type);
+
+       return provide_info;
+}
+
+GVariant* sat_manager_language_notification_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_language_notification_tlv *language_notification_tlv)
+{
+       TcorePlugin *plg = NULL;
+       GVariant *language_noti = NULL;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id = 0;
+       gint language =0;
+       gboolean b_specified = FALSE;
+
+       dbg("interpreting langauge notification");
+
+       plg = tcore_server_find_plugin(ctx->server, plugin_name);
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return NULL;
+       }
+
+       if (language_notification_tlv->command_detail.cmd_qualifier.language_notification.specific_language == TRUE){
+               b_specified = TRUE;
+               language = language_notification_tlv->language;
+       } else {
+               b_specified = FALSE;
+               language =SIM_LANG_UNSPECIFIED;
+       }
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
+       q_data.cmd_type = SAT_PROATV_CMD_LANGUAGE_NOTIFICATION;
+       memcpy((void*)&(q_data.cmd_data.language_notification), language_notification_tlv, sizeof(struct tel_sat_language_notification_tlv));
+       sat_manager_enqueue_cmd(ctx, &q_data);
+       command_id = q_data.cmd_id;
+
+       language_noti = g_variant_new("(iib)", command_id, language, b_specified);
+
+       return language_noti;
+}
+
+static gboolean _sat_manager_handle_setup_menu_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint resp;
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] setup menu result data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
+       g_variant_get(exec_result, "(i)", &resp);
+
+       tr->cmd_number = q_data.cmd_data.setupMenuInd.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.setupMenuInd.command_detail.cmd_type;
+
+       memcpy((void*)&tr->terminal_rsp_data.setup_menu.command_detail,
+               &q_data.cmd_data.setupMenuInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+
+       tr->terminal_rsp_data.setup_menu.device_id.src = q_data.cmd_data.setupMenuInd.device_id.dest;
+       tr->terminal_rsp_data.setup_menu.device_id.dest = q_data.cmd_data.setupMenuInd.device_id.src;
+
+       dbg("[SAT] resp(%d)", resp);
+
+       switch(resp){
+               case RESULT_SUCCESS:
+                       tr->terminal_rsp_data.setup_menu.result_type = RESULT_SUCCESS;
+                       if (q_data.cmd_data.setupMenuInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.setup_menu.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+                       tr->terminal_rsp_data.setup_menu.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.setup_menu.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.setup_menu.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               default:
+                       //check the default case
+                       tr->terminal_rsp_data.setup_menu.result_type = resp;
+                       tr->terminal_rsp_data.setup_menu.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       dbg("[SAT] wrong result from app exec resp(%d)", resp);
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_display_text_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint resp, me_problem;
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] display text result data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
+       g_variant_get(exec_result, "(ii)",&resp, &me_problem);
+
+       tr->cmd_number = q_data.cmd_data.displayTextInd.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.displayTextInd.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.display_text.command_detail, &q_data.cmd_data.displayTextInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.display_text.device_id.src = q_data.cmd_data.displayTextInd.device_id.dest;
+       tr->terminal_rsp_data.display_text.device_id.dest = q_data.cmd_data.displayTextInd.device_id.src;
+
+       switch (resp) {
+               case RESULT_SUCCESS:
+                       tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
+                       tr->terminal_rsp_data.display_text.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.display_text.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.display_text.me_problem_type = me_problem;
+                       break;
+
+               default:
+                       tr->terminal_rsp_data.display_text.result_type = resp;
+                       tr->terminal_rsp_data.display_text.me_problem_type = me_problem;
+                       dbg("[SAT] wrong result from app exec resp(%d) me_problem(%d)", resp, me_problem);
+                       break;
+       }
+
+       if (q_data.cmd_data.displayTextInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
+               tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_play_tone_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint resp, me_problem;
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] display text result data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
+       g_variant_get(exec_result, "(ii)",&resp, &me_problem);
+
+       tr->cmd_number = q_data.cmd_data.play_tone.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.play_tone.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.play_tone.command_detail, &q_data.cmd_data.play_tone.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.play_tone.device_id.src = q_data.cmd_data.play_tone.device_id.dest;
+       tr->terminal_rsp_data.play_tone.device_id.dest = q_data.cmd_data.play_tone.device_id.src;
+
+       switch (resp) {
+               case RESULT_SUCCESS:
+                       tr->terminal_rsp_data.play_tone.result_type = RESULT_SUCCESS;
+                       if (q_data.cmd_data.play_tone.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.play_tone.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       tr->terminal_rsp_data.play_tone.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.play_tone.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.play_tone.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER:
+                       tr->terminal_rsp_data.play_tone.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+                       tr->terminal_rsp_data.play_tone.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               default:
+                       tr->terminal_rsp_data.play_tone.result_type = resp;
+                       tr->terminal_rsp_data.play_tone.me_problem_type = me_problem;
+                       dbg("[SAT] wrong result from app exec resp(%d) me_problem(%d)", resp, me_problem);
+                       break;
+       }
+
+       if (q_data.cmd_data.displayTextInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
+               tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_send_sms_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint resp;
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] send sms data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
+       g_variant_get(exec_result, "(i)",&resp);
+
+       tr->cmd_number = q_data.cmd_data.sendSMSInd.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.sendSMSInd.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.send_sms.command_detail, &q_data.cmd_data.sendSMSInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.send_sms.device_id.src = q_data.cmd_data.sendSMSInd.device_id.dest;
+       tr->terminal_rsp_data.send_sms.device_id.dest = q_data.cmd_data.sendSMSInd.device_id.src;
+
+       switch (resp) {
+               case RESULT_SUCCESS:
+                       tr->terminal_rsp_data.send_sms.result_type = RESULT_SUCCESS;
+                       if (q_data.cmd_data.sendSMSInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.send_sms.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       break;
+
+               case RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM:
+                       tr->terminal_rsp_data.send_sms.result_type = RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM;
+                       tr->terminal_rsp_data.send_sms.cc_problem_type = CC_PROBLEM_ACTION_NOT_ALLOWED;
+                       break;
+
+               case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.send_sms.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case RESULT_BEYOND_ME_CAPABILITIES:
+                       tr->terminal_rsp_data.send_sms.result_type = RESULT_BEYOND_ME_CAPABILITIES;
+                       tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case RESULT_COMMAND_TYPE_NOT_UNDERSTOOD_BY_ME:
+                       tr->terminal_rsp_data.send_sms.result_type = RESULT_COMMAND_TYPE_NOT_UNDERSTOOD_BY_ME;
+                       tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME:
+                       tr->terminal_rsp_data.send_sms.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+                       tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case RESULT_SMS_RP_ERROR:
+                       tr->terminal_rsp_data.send_sms.result_type = RESULT_SMS_RP_ERROR;
+                       tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               default:
+                       tr->terminal_rsp_data.send_sms.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+/*     if( q_data.cmd_data.sendSMSInd.alpha_id.alpha_data_len && q_data.cmd_data.sendSMSInd.alpha_id.is_exist)
+               sat_ui_support_terminate_sat_ui();*/
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_send_ss_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint resp, ss_problem;
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+       //call ctrl action, result data object, text
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] send ss data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
+       g_variant_get(exec_result, "(ii)",&resp, &ss_problem);
+
+       tr->cmd_number = q_data.cmd_data.send_ss.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.send_ss.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.send_ss.command_detail, &q_data.cmd_data.send_ss.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.send_ss.device_id.src = q_data.cmd_data.send_ss.device_id.dest;
+       tr->terminal_rsp_data.send_ss.device_id.dest = q_data.cmd_data.send_ss.device_id.src;
+
+       switch (resp) {
+               case RESULT_SUCCESS:
+                       tr->terminal_rsp_data.send_ss.result_type = RESULT_SUCCESS;
+                       if (q_data.cmd_data.send_ss.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.send_ss.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       break;
+
+               case RESULT_SS_RETURN_ERROR:
+                       tr->terminal_rsp_data.send_ss.result_type = RESULT_SS_RETURN_ERROR;
+                       tr->terminal_rsp_data.send_ss.ss_problem = ss_problem;
+                       break;
+
+               case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.send_ss.result_type = RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.send_ss.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               default:
+                       tr->terminal_rsp_data.send_ss.result_type = RESULT_SS_RETURN_ERROR;
+                       tr->terminal_rsp_data.send_ss.ss_problem = SATK_SS_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       if( q_data.cmd_data.send_ss.alpha_id.alpha_data_len && q_data.cmd_data.send_ss.alpha_id.is_exist )
+               sat_ui_support_terminate_sat_ui();
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_send_ussd_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint resp, ussd_problem;
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+       //call ctrl action, result data object, text, result2, text2
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] send ss data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
+       g_variant_get(exec_result, "(ii)",&resp, &ussd_problem);
+
+       tr->cmd_number = q_data.cmd_data.send_ussd.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.send_ussd.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.send_ussd.command_detail, &q_data.cmd_data.send_ussd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.send_ussd.device_id.src = q_data.cmd_data.send_ussd.device_id.dest;
+       tr->terminal_rsp_data.send_ussd.device_id.dest = q_data.cmd_data.send_ussd.device_id.src;
+
+       switch (resp) {
+               case RESULT_SUCCESS:
+                       tr->terminal_rsp_data.send_ussd.result_type = RESULT_SUCCESS;
+                       if (q_data.cmd_data.send_ussd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.send_ussd.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       break;
+
+               case RESULT_SS_RETURN_ERROR:
+               case RESULT_USSD_RETURN_ERROR:
+                       tr->terminal_rsp_data.send_ussd.result_type = RESULT_USSD_RETURN_ERROR;
+                       tr->terminal_rsp_data.send_ussd.ussd_problem = ussd_problem;
+                       break;
+
+               case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.send_ussd.result_type = RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.send_ussd.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.send_ussd.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.send_ussd.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               default:
+                       tr->terminal_rsp_data.send_ussd.result_type = RESULT_USSD_RETURN_ERROR;
+                       tr->terminal_rsp_data.send_ussd.ussd_problem = SATK_SS_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       if( q_data.cmd_data.send_ussd.alpha_id.alpha_data_len && q_data.cmd_data.send_ussd.alpha_id.is_exist )
+               sat_ui_support_terminate_sat_ui();
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_setup_call_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint resp, me_problem, cc_problem, call_cause;
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] setup call data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
+       g_variant_get(exec_result, "(iiii)",&resp, &me_problem, &cc_problem, &call_cause);
+
+       tr->cmd_number = q_data.cmd_data.setup_call.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.setup_call.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.setup_call.command_detail, &q_data.cmd_data.setup_call.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.setup_call.device_id.src = q_data.cmd_data.setup_call.device_id.dest;
+       tr->terminal_rsp_data.setup_call.device_id.dest = q_data.cmd_data.setup_call.device_id.src;
+
+       switch (resp) {
+               case RESULT_SUCCESS:
+                       tr->terminal_rsp_data.setup_call.result_type = RESULT_SUCCESS;
+                       if (q_data.cmd_data.setup_call.call_setup_icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR ||
+                                       q_data.cmd_data.setup_call.call_setup_icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR )
+                               tr->terminal_rsp_data.setup_call.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+                       tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.setup_call.cc_problem_type = CC_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.setup_call.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.send_sms.me_problem_type = me_problem;
+                       break;
+
+               case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:{
+                       tr->terminal_rsp_data.setup_call.result_type = RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
+                       switch(call_cause){
+                               case CALL_CAUSE_BUSY:
+                                       tr->terminal_rsp_data.setup_call.network_problem_type = NETWORK_PROBLEM_USER_BUSY;
+                               break;
+                               default :
+                                       tr->terminal_rsp_data.setup_call.network_problem_type = NETWORK_PROBLEM_NO_SPECIFIC_CAUSE;
+                               break;
+                       }
+               }break;
+
+               case RESULT_USER_CLEAR_DOWN_CALL_BEFORE_CONN:
+                       tr->terminal_rsp_data.setup_call.result_type = RESULT_USER_CLEAR_DOWN_CALL_BEFORE_CONN;
+                       tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.setup_call.cc_problem_type = CC_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case RESULT_BEYOND_ME_CAPABILITIES:
+                       tr->terminal_rsp_data.setup_call.result_type = RESULT_BEYOND_ME_CAPABILITIES;
+                       tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.setup_call.cc_problem_type = CC_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM:
+                       tr->terminal_rsp_data.setup_call.result_type = RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM;
+                       tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.setup_call.cc_problem_type = cc_problem;
+                       break;
+
+
+               default:
+                       break;
+       }
+
+       //TODO Other infomation set - not supported
+       tr->terminal_rsp_data.setup_call.other_info = FALSE;
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_setup_idle_mode_text_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint resp, me_problem;
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] send ss data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
+       g_variant_get(exec_result, "(ii)",&resp, &me_problem);
+
+       tr->cmd_number = q_data.cmd_data.idle_mode.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.idle_mode.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.setup_idle_mode_text.command_detail, &q_data.cmd_data.idle_mode.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.setup_idle_mode_text.device_id.src = q_data.cmd_data.idle_mode.device_id.dest;
+       tr->terminal_rsp_data.setup_idle_mode_text.device_id.dest = q_data.cmd_data.idle_mode.device_id.src;
+
+       switch (resp) {
+               case RESULT_SUCCESS:
+                       tr->terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_SUCCESS;
+                       if (q_data.cmd_data.idle_mode.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       break;
+               default:
+                       tr->terminal_rsp_data.setup_idle_mode_text.result_type = resp;
+                       tr->terminal_rsp_data.setup_idle_mode_text.me_problem_type = me_problem;
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       sat_ui_support_terminate_sat_ui();
+
+       return result;
+}
+
+static gboolean sat_manager_handle_open_channel_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint resp, me_problem, bip_problem;
+       gint bearer_type, channel_id, channel_status, channel_status_info, buffer_size;
+       gboolean other_info;
+       GVariant *desc_tmp, *bearer_desc;
+
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] open channel data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
+       g_variant_get(exec_result, "(iiiiiiiibv)",&resp, &me_problem, &bip_problem,
+                       &bearer_type, &channel_id, &channel_status, &channel_status_info, &buffer_size,
+                       &other_info, &desc_tmp);
+
+       bearer_desc = g_variant_get_variant(desc_tmp);
+
+       tr->cmd_number = q_data.cmd_data.open_channel.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.open_channel.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.open_channel.command_detail, &q_data.cmd_data.open_channel.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+
+       tr->terminal_rsp_data.open_channel.device_id.src = q_data.cmd_data.open_channel.device_id.dest;
+       tr->terminal_rsp_data.open_channel.device_id.dest = q_data.cmd_data.open_channel.device_id.src;
+
+       tr->terminal_rsp_data.open_channel.result_type = resp;
+       switch (resp) {
+               case RESULT_SUCCESS:
+               case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+               case RESULT_SUCCESS_WITH_MISSING_INFO:
+                       //channel status
+                       break;
+
+               case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+               case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.open_channel.me_problem_type = me_problem;
+                       break;
+
+               case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
+                       tr->terminal_rsp_data.open_channel.bip_problem_type = bip_problem;
+                       break;
+
+               default:
+                       break;
+       }
+
+       tr->terminal_rsp_data.open_channel.channel_status.channel_id = channel_id;
+       tr->terminal_rsp_data.open_channel.channel_status.status = channel_status;
+       tr->terminal_rsp_data.open_channel.channel_status.status_info = channel_status_info;
+
+       dbg("check channel id(%d) channel status(%d) channel info(%d)", channel_id, channel_status, channel_status_info);
+
+       //memcpy(tr->terminal_rsp_data.open_channel.buffer_size.size, &buffer_size, sizeof(unsigned char)*2);
+       tr->terminal_rsp_data.open_channel.buffer_size.size[0] = buffer_size >> 8;
+       tr->terminal_rsp_data.open_channel.buffer_size.size[1] = buffer_size & 0xFF;
+       dbg("check buffer size[0](0x%x) size[1](0x%x)", tr->terminal_rsp_data.open_channel.buffer_size.size[0], tr->terminal_rsp_data.open_channel.buffer_size.size[1]);
+
+       tr->terminal_rsp_data.open_channel.bearer_desc.bearer_type = bearer_type;
+       switch(bearer_type){
+               case BEARER_CSD:{
+                       gint data_rate, service_type, conn_element_type;
+
+                       dbg("bearer_desc cs bearer type_format(%s)", g_variant_get_type_string(bearer_desc));
+                       g_variant_get(bearer_desc, "(iii)",&data_rate, &service_type, &conn_element_type);
+                       dbg("check cs bearer data_rade(%d), service_type(%d), conn_element_type(%d)", data_rate, service_type, conn_element_type);
+
+                       tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.cs_bearer_param.data_rate = data_rate;
+                       tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.cs_bearer_param.service_type = service_type;
+                       tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.cs_bearer_param.connection_element_type = conn_element_type;
+               }break;
+               case BEARER_GPRS:{
+                       gint precedence_class, delay_class, reliability_class;
+                       gint peak_class, mean_class, pdp_type;
+
+                       dbg("bearer_desc ps bearer type_format(%s)", g_variant_get_type_string(bearer_desc));
+                       g_variant_get(bearer_desc, "(iiiiii)",&precedence_class, &delay_class, &reliability_class,
+                                       &peak_class, &mean_class, &pdp_type);
+                       dbg("check ps bearer precedence class(%d), delay class(%d), reliability class(%d) peak class(%d) mean class(%d) pdp_type(%d)",
+                                       precedence_class, delay_class, reliability_class, peak_class, mean_class, pdp_type);
+
+                       tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.precedence_class = precedence_class;
+                       tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.delay_class = delay_class;
+                       tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.reliability_class = reliability_class;
+                       tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.peak_throughput_class = peak_class;
+                       tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.mean_throughput_class = mean_class;
+                       tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.pdp_type = pdp_type;
+               }break;
+               case BEARER_LOCAL_LINK_TECHNOLOGY_INDEPENDENT:{
+                       gint service_type;
+                       gchar *service_record = NULL;
+
+                       dbg("bearer_desc link local type_format(%s)", g_variant_get_type_string(bearer_desc));
+                       g_variant_get(bearer_desc, "(is)",&service_type, &service_record);
+                       dbg("check link local service_type(%d), service_record(%d)", service_type, service_record);
+
+                       tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.local_link_bearer_param.service_type = service_type;
+
+                       if(!service_record)
+                               memcpy(tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.local_link_bearer_param.service_record, service_record, strlen(service_record));
+
+               }break;
+               default:
+               break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean sat_manager_handle_close_channel_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint resp, me_problem, bip_problem;
+
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] close channel data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
+       g_variant_get(exec_result, "(iii)",&resp, &me_problem, &bip_problem);
+
+       tr->cmd_number = q_data.cmd_data.close_channel.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.close_channel.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.close_channel.command_detail, &q_data.cmd_data.close_channel.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+
+       tr->terminal_rsp_data.close_channel.device_id.src = DEVICE_ID_ME;
+       tr->terminal_rsp_data.close_channel.device_id.dest = q_data.cmd_data.close_channel.device_id.src;
+
+       tr->terminal_rsp_data.close_channel.result_type = resp;
+       switch (resp) {
+               case RESULT_SUCCESS:
+               case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+               case RESULT_SUCCESS_WITH_MISSING_INFO:
+                       //channel status
+                       break;
+
+               case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+               case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.close_channel.me_problem_type = me_problem;
+                       break;
+
+               case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
+                       tr->terminal_rsp_data.close_channel.bip_problem_type = bip_problem;
+                       break;
+
+               default:
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean sat_manager_handle_receive_data_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint resp, me_problem, bip_problem;
+       gint data_str_len, data_len;
+       gboolean other_info;
+       GVariant *received_data;
+
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] receive data data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
+       g_variant_get(exec_result, "(iiiiibv)",&resp, &me_problem, &bip_problem, &data_str_len, &data_len, &other_info, &received_data);
+
+       tr->cmd_number = q_data.cmd_data.receive_data.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.receive_data.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.receive_data.command_detail, &q_data.cmd_data.receive_data.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+
+       tr->terminal_rsp_data.receive_data.device_id.src = DEVICE_ID_ME;
+       tr->terminal_rsp_data.receive_data.device_id.dest = q_data.cmd_data.receive_data.device_id.src;
+
+       tr->terminal_rsp_data.receive_data.result_type = resp;
+       switch (resp) {
+               case RESULT_SUCCESS:
+               case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+               case RESULT_SUCCESS_WITH_MISSING_INFO:
+                       //channel status
+                       break;
+
+               case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+               case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.receive_data.me_problem_type = me_problem;
+                       break;
+
+               case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
+                       tr->terminal_rsp_data.receive_data.bip_problem_type = bip_problem;
+                       break;
+
+               default:
+                       break;
+       }
+
+       tr->terminal_rsp_data.receive_data.channel_data_len.data_len = data_len;
+       tr->terminal_rsp_data.receive_data.channel_data.data_string_len = data_str_len;
+
+       if(received_data){
+               int index = 0;
+               guchar data;
+               GVariantIter *iter = NULL;
+
+               dbg("additional data exist type_format(%s)", g_variant_get_type_string(received_data));
+
+               g_variant_get(received_data, "ay", &iter);
+               while( g_variant_iter_loop (iter, "y", &data)){
+                       dbg("index(%d) data(%d)", index, data);
+                       tr->terminal_rsp_data.receive_data.channel_data.data_string[index] = data;
+                       index++;
+               }
+               g_variant_iter_free(iter);
+
+               dbg("the last index data(%d), data_total_len(%d)", index, data_str_len);
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean sat_manager_handle_send_data_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint resp, me_problem, bip_problem;
+       gint data_len;
+
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] send data data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
+       g_variant_get(exec_result, "(iiii)",&resp, &me_problem, &bip_problem, &data_len);
+
+       tr->cmd_number = q_data.cmd_data.send_data.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.send_data.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.send_data.command_detail, &q_data.cmd_data.send_data.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+
+       tr->terminal_rsp_data.send_data.device_id.src = DEVICE_ID_ME;
+       tr->terminal_rsp_data.send_data.device_id.dest = q_data.cmd_data.send_data.device_id.src;
+
+       tr->terminal_rsp_data.send_data.result_type = resp;
+       switch (resp) {
+               case RESULT_SUCCESS:
+               case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+               case RESULT_SUCCESS_WITH_MISSING_INFO:
+                       //channel status
+                       break;
+
+               case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+               case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.send_data.me_problem_type = me_problem;
+                       break;
+
+               case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
+                       tr->terminal_rsp_data.send_data.bip_problem_type = bip_problem;
+                       break;
+
+               default:
+                       break;
+       }
+
+       tr->terminal_rsp_data.send_data.channel_data_len.data_len = data_len;
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean sat_manager_handle_get_channel_status_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint resp, me_problem, bip_problem;
+       gint channel_id, channel_status, channel_status_info;
+
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] get channel status data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
+       g_variant_get(exec_result, "(iiiiii)",&resp, &me_problem, &bip_problem,
+                       &channel_id, &channel_status, &channel_status_info);
+
+       tr->cmd_number = q_data.cmd_data.get_channel_status.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.get_channel_status.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.get_channel_status.command_detail, &q_data.cmd_data.get_channel_status.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+
+       tr->terminal_rsp_data.get_channel_status.device_id.src = q_data.cmd_data.get_channel_status.device_id.dest;
+       tr->terminal_rsp_data.get_channel_status.device_id.dest = q_data.cmd_data.get_channel_status.device_id.src;
+
+       tr->terminal_rsp_data.get_channel_status.result_type = resp;
+       switch (resp) {
+               case RESULT_SUCCESS:
+               case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+               case RESULT_SUCCESS_WITH_MISSING_INFO:
+                       //channel status
+                       break;
+
+               case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+               case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.get_channel_status.me_problem_type = me_problem;
+                       break;
+
+               case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
+                       tr->terminal_rsp_data.get_channel_status.bip_problem_type = bip_problem;
+                       break;
+
+               default:
+                       break;
+       }
+
+       tr->terminal_rsp_data.get_channel_status.channel_status.channel_id = channel_id;
+       tr->terminal_rsp_data.get_channel_status.channel_status.status = channel_status;
+       tr->terminal_rsp_data.get_channel_status.channel_status.status_info = channel_status_info;
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean sat_manager_handle_send_dtmf_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] get channel status data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean sat_manager_handle_launch_browser_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] get channel status data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean sat_manager_handle_provide_local_info_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] get channel status data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean sat_manager_handle_language_notification_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if(!exec_result){
+               dbg("[SAT] get channel status data is null");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+gboolean sat_manager_handle_app_exec_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint command_type, GVariant *exec_result)
+{
+       gboolean result = FALSE;
+       GVariant *resp = NULL;
+       dbg("[SAT] app exec result command id(%d) command type(%d)", command_id, command_type);
+
+       dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
+       g_variant_get(exec_result, "v", &resp);
+
+       switch (command_type) {
+               case SAT_PROATV_CMD_SETUP_MENU:
+                       result = _sat_manager_handle_setup_menu_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_DISPLAY_TEXT:
+                       result = _sat_manager_handle_display_text_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_PLAY_TONE:
+                       result = _sat_manager_handle_play_tone_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_SEND_SMS:
+                       result = _sat_manager_handle_send_sms_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_SEND_SS:
+                       result = _sat_manager_handle_send_ss_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_SEND_USSD:
+                       result = _sat_manager_handle_send_ussd_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_SETUP_CALL:
+                       result = _sat_manager_handle_setup_call_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
+                       result = _sat_manager_handle_setup_idle_mode_text_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_OPEN_CHANNEL:
+                       result = sat_manager_handle_open_channel_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_CLOSE_CHANNEL:
+                       result = sat_manager_handle_close_channel_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_RECEIVE_DATA:
+                       result = sat_manager_handle_receive_data_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_SEND_DATA:
+                       result = sat_manager_handle_send_data_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_GET_CHANNEL_STATUS:
+                       result = sat_manager_handle_get_channel_status_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_SEND_DTMF:
+                       result = sat_manager_handle_send_dtmf_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_LAUNCH_BROWSER:
+                       result = sat_manager_handle_launch_browser_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_PROVIDE_LOCAL_INFO:
+                       result = sat_manager_handle_provide_local_info_result(ctx, plg, command_id, resp);
+                       break;
+
+               case SAT_PROATV_CMD_LANGUAGE_NOTIFICATION:
+                       result = sat_manager_handle_language_notification_result(ctx, plg, command_id, resp);
+                       break;
+
+               default:
+                       dbg("[SAT] invalid command type(%d)", command_type);
+                       break;
+       }
+
+       sat_ui_support_terminate_sat_ui();
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_menu_select_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint item_id;
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       if(addtional_data){
+               int index = 0;
+               guchar data;
+               GVariantIter *iter = NULL;
+               GVariant *inner_gv = NULL;
+
+               inner_gv = g_variant_get_variant(addtional_data);
+               dbg("additional data exist type_format(%s)", g_variant_get_type_string(inner_gv));
+
+               g_variant_get(inner_gv, "ay", &iter);
+               while( g_variant_iter_loop (iter, "y", &data)){
+                       dbg("index(%d) data(%d)", index, data);
+                       item_id = data;
+                       index++;
+               }
+               g_variant_iter_free(iter);
+               g_variant_unref(inner_gv);
+       }
+
+       tr->cmd_number = q_data.cmd_data.selectItemInd.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.selectItemInd.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.select_item.command_detail, &q_data.cmd_data.selectItemInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.select_item.device_id.src = DEVICE_ID_ME;
+       tr->terminal_rsp_data.select_item.device_id.dest = DEVICE_ID_SIM;
+
+       switch (confirm_type) {
+               case USER_CONFIRM_YES:
+                       tr->terminal_rsp_data.select_item.item_identifier.item_identifier = item_id;
+                       tr->terminal_rsp_data.select_item.other_info = FALSE;
+                       tr->terminal_rsp_data.select_item.result_type = RESULT_SUCCESS;
+                       tr->terminal_rsp_data.select_item.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+
+                       if (q_data.cmd_data.selectItemInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.select_item.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       break;
+
+               case USER_CONFIRM_HELP_INFO:
+                       tr->terminal_rsp_data.select_item.item_identifier.item_identifier = item_id;
+                       tr->terminal_rsp_data.select_item.other_info = FALSE;
+                       tr->terminal_rsp_data.select_item.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
+                       tr->terminal_rsp_data.select_item.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       //TODO ctx->help_requested = TRUE;
+                       break;
+
+               case USER_CONFIRM_END:
+                       tr->terminal_rsp_data.select_item.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+                       break;
+
+               case USER_CONFIRM_NO_OR_CANCEL:
+                       tr->terminal_rsp_data.select_item.result_type = RESULT_BACKWARD_MOVE_BY_USER;
+                       break;
+
+               case USER_CONFIRM_TIMEOUT:
+                       tr->terminal_rsp_data.select_item.result_type = RESULT_NO_RESPONSE_FROM_USER;
+                       break;
+
+               default:
+                       dbg("not handled value[%d] here", confirm_type);
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_display_text_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       if (q_data.cmd_data.displayTextInd.immediate_response_requested){
+               return TRUE;
+       }
+
+       tr->cmd_number = q_data.cmd_data.displayTextInd.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.displayTextInd.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.display_text.command_detail, &q_data.cmd_data.displayTextInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.display_text.device_id.src = DEVICE_ID_ME;
+       tr->terminal_rsp_data.display_text.device_id.dest = DEVICE_ID_SIM;
+
+       switch (confirm_type){
+               case USER_CONFIRM_YES: {
+                       tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
+                       tr->terminal_rsp_data.display_text.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+
+                       if (q_data.cmd_data.displayTextInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+               } break;
+
+               case USER_CONFIRM_NO_OR_CANCEL:
+                       tr->terminal_rsp_data.display_text.result_type = RESULT_BACKWARD_MOVE_BY_USER;
+                       break;
+
+               case USER_CONFIRM_TIMEOUT:
+                       tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
+
+                       if (q_data.cmd_data.displayTextInd.command_detail.cmd_qualifier.display_text.text_clear_type == TEXT_WAIT_FOR_USER_TO_CLEAR_MSG )
+                               tr->terminal_rsp_data.display_text.result_type = RESULT_NO_RESPONSE_FROM_USER;
+
+                       break;
+
+               case USER_CONFIRM_END:
+                       tr->terminal_rsp_data.display_text.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+                       break;
+
+               case USER_CONFIRM_HELP_INFO:
+               default:
+                       dbg("not handled value[%d] here", confirm_type);
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_get_inkey_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint inkey_data_len = 0;
+       gchar inkey_data[SAT_TEXT_STRING_LEN_MAX];
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+       memset(inkey_data, 0, SAT_TEXT_STRING_LEN_MAX);
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       if(addtional_data){
+               int index = 0;
+               guchar data;
+               GVariantIter *iter = NULL;
+               GVariant *inner_gv = NULL;
+
+               inner_gv = g_variant_get_variant(addtional_data);
+               dbg("additional data exist type_format(%s)", g_variant_get_type_string(inner_gv));
+
+               g_variant_get(inner_gv, "ay", &iter);
+               while( g_variant_iter_loop (iter, "y", &data)){
+                       dbg("index(%d) data(%d)", index, data);
+                       inkey_data[index] = data;
+                       index++;
+               }
+               g_variant_iter_free(iter);
+               g_variant_unref(inner_gv);
+               inkey_data_len = index;
+       }
+
+       tr->cmd_number = q_data.cmd_data.getInkeyInd.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.getInkeyInd.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.get_inkey.command_detail, &q_data.cmd_data.getInkeyInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.get_inkey.device_id.src = DEVICE_ID_ME;
+       tr->terminal_rsp_data.get_inkey.device_id.dest = DEVICE_ID_SIM;
+
+       switch (confirm_type){
+               case USER_CONFIRM_YES:
+                       tr->terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS;
+
+                       if (q_data.cmd_data.getInkeyInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.inkey_type == INKEY_TYPE_YES_NO_REQUESTED) {
+                               tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
+                               tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FROMAT_8BIT_DATA;
+                               tr->terminal_rsp_data.get_inkey.text.string_length = 1;
+                               tr->terminal_rsp_data.get_inkey.text.string[0] = 0x01;
+                       }
+                       else if(inkey_data_len > 0)
+                       {
+                               tr->terminal_rsp_data.get_inkey.text.string_length = inkey_data_len;
+
+                               if (!q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_set){
+                                       tr->terminal_rsp_data.get_inkey.text.is_digit_only = TRUE;
+                                       tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FROMAT_8BIT_DATA;
+                                       tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
+
+                                       memcpy((void*)tr->terminal_rsp_data.get_inkey.text.string, inkey_data, inkey_data_len);
+                               }
+                               else
+                               {
+                                       tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
+
+                                       if(q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_type == INPUT_ALPHABET_TYPE_SMS_DEFAULT )
+                                       {
+                                               int tmp_len;
+                                               char tmp_str[SAT_TEXT_STRING_LEN_MAX + 1], *packed_data;
+
+                                               dbg("sat gsm7 encoding");
+                                               sat_mgr_convert_utf8_to_gsm((unsigned char*) tmp_str, &tmp_len, (unsigned char*)inkey_data, inkey_data_len);
+                                               packed_data = (char*) tcore_util_pack_gsm7bit((const unsigned char *)tmp_str, tmp_len);
+
+                                               tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FROMAT_8BIT_DATA;
+                                               tr->terminal_rsp_data.get_inkey.text.string_length = strlen(packed_data);
+                                               memcpy((void*) tr->terminal_rsp_data.get_inkey.text.string, packed_data, strlen(packed_data));
+
+                                               if (packed_data) g_free(packed_data);
+                                       }
+                                       else if(q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_type == INPUT_ALPHABET_TYPE_UCS2 )
+                                       {
+                                               dbg("UCS2 DATA");
+
+                                               tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FROMAT_UCS2;
+                                               sat_mgr_convert_utf8_to_ucs2((unsigned char*)tr->terminal_rsp_data.get_inkey.text.string,
+                                                               &tr->terminal_rsp_data.get_inkey.text.string_length, (unsigned char*)inkey_data, inkey_data_len);
+                                       }
+                                       else
+                                       {
+                                               tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FROMAT_RESERVED;
+                                               dbg("[SAT] invalid DCS[%d]",tr->terminal_rsp_data.get_inkey.text.dcs.a_format);
+                                       }
+                               }
+                       }
+                       break;
+
+               case USER_CONFIRM_HELP_INFO:
+                       tr->terminal_rsp_data.get_inkey.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
+                       //TODO ctx->help_requested = TRUE;
+                       break;
+
+               case USER_CONFIRM_NO_OR_CANCEL:
+                       tr->terminal_rsp_data.get_inkey.result_type = RESULT_BACKWARD_MOVE_BY_USER;
+
+                       if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.inkey_type == INKEY_TYPE_YES_NO_REQUESTED) {
+                               tr->terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS;
+                               tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
+                               tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FROMAT_8BIT_DATA;
+                               tr->terminal_rsp_data.get_inkey.text.string_length = 1;
+                               tr->terminal_rsp_data.get_inkey.text.string[0] = 0x00;
+                       }
+                       break;
+
+               case USER_CONFIRM_TIMEOUT:
+                       tr->terminal_rsp_data.get_inkey.result_type = RESULT_NO_RESPONSE_FROM_USER;
+                       if (q_data.cmd_data.getInkeyInd.duration.time_interval > 0){
+                               tr->terminal_rsp_data.get_inkey.duration.time_interval = q_data.cmd_data.getInkeyInd.duration.time_interval;
+                               tr->terminal_rsp_data.get_inkey.duration.time_unit = q_data.cmd_data.getInkeyInd.duration.time_unit;
+                       }
+                       break;
+
+               case USER_CONFIRM_END:
+                       tr->terminal_rsp_data.get_inkey.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+                       break;
+
+               default:
+                       dbg("not handled value[%d] here", confirm_type);
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_get_input_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint input_data_len = 0;
+       gchar input_data[SAT_TEXT_STRING_LEN_MAX];
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+       memset(input_data, 0, SAT_TEXT_STRING_LEN_MAX);
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               g_free(tr);
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               g_free(tr);
+               return result;
+       }
+
+       if(addtional_data){
+               int index = 0;
+               guchar data;
+               GVariantIter *iter = NULL;
+               GVariant *inner_gv = NULL;
+
+               inner_gv = g_variant_get_variant(addtional_data);
+               dbg("additional data exist type_format(%s)", g_variant_get_type_string(inner_gv));
+
+               g_variant_get(inner_gv, "ay", &iter);
+               while( g_variant_iter_loop (iter, "y", &data)){
+                       dbg("index(%d) data(%d)", index, data);
+                       input_data[index] = data;
+                       index++;
+               }
+               g_variant_iter_free(iter);
+               g_variant_unref(inner_gv);
+               input_data_len = index;
+       }
+
+       tr->cmd_number = q_data.cmd_data.getInputInd.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.getInputInd.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.get_input.command_detail, &q_data.cmd_data.getInputInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.get_input.device_id.src = DEVICE_ID_ME;
+       tr->terminal_rsp_data.get_input.device_id.dest = DEVICE_ID_SIM;
+
+       switch (confirm_type){
+               case USER_CONFIRM_YES:
+                       tr->terminal_rsp_data.get_input.result_type = RESULT_SUCCESS;
+                       tr->terminal_rsp_data.get_input.text.dcs.m_class = MSG_CLASS_RESERVED;
+
+                       if(!q_data.cmd_data.getInputInd.command_detail.cmd_qualifier.get_input.alphabet_set){
+                               tr->terminal_rsp_data.get_input.text.is_digit_only = TRUE;
+                       }
+
+                       if (q_data.cmd_data.getInputInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.get_input.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       if(!q_data.cmd_data.getInputInd.command_detail.cmd_qualifier.get_input.user_input_unpacked_format){
+                               dbg("[SAT] packing to SMS7 default");
+
+                               tr->terminal_rsp_data.get_input.text.string_length = 0;
+                               tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FROMAT_SMS_DEFAULT;
+
+                               if (input_data_len > 0){
+                                       int tmp_len;
+                                       char tmp_str[SAT_TEXT_STRING_LEN_MAX + 1], *packed_data;
+
+                                       dbg("sat gsm7 encoding");
+                                       sat_mgr_convert_utf8_to_gsm((unsigned char*)tmp_str, &tmp_len, (unsigned char*)input_data, input_data_len);
+                                       packed_data = (char*) tcore_util_pack_gsm7bit((const unsigned char *)tmp_str, tmp_len);
+
+                                       memcpy((void*)tr->terminal_rsp_data.get_input.text.string, packed_data, strlen(packed_data));
+                                       tr->terminal_rsp_data.get_input.text.string_length = strlen(packed_data);
+
+                                       if (packed_data) g_free(packed_data);
+                               }
+
+                       }
+                       else
+                       {
+                               dbg("[SAT] packing not required");
+
+                               if(q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_input.alphabet_type == INPUT_ALPHABET_TYPE_SMS_DEFAULT){
+
+                                       tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FROMAT_8BIT_DATA;
+                                       sat_mgr_convert_utf8_to_gsm((unsigned char*)tr->terminal_rsp_data.get_input.text.string,
+                                                       &tr->terminal_rsp_data.get_input.text.string_length, (unsigned char*)input_data, input_data_len);
+
+                               }
+                               else if(q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_input.alphabet_type == INPUT_ALPHABET_TYPE_UCS2 ){
+
+                                       tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FROMAT_UCS2;
+                                       sat_mgr_convert_utf8_to_ucs2((unsigned char*)tr->terminal_rsp_data.get_input.text.string,
+                                                       &tr->terminal_rsp_data.get_input.text.string_length, (unsigned char*)input_data, input_data_len);
+
+                               }
+                               else{
+                                       tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FROMAT_RESERVED;
+                                       dbg("[SAT] invalid DCS[%d]",tr->terminal_rsp_data.get_input.text.dcs.a_format);
+                               }
+                       } break;
+
+               case USER_CONFIRM_HELP_INFO:
+                       tr->terminal_rsp_data.get_input.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
+                       //TODO ctx->help_requested = TRUE;
+                       break;
+
+               case USER_CONFIRM_NO_OR_CANCEL:
+                       tr->terminal_rsp_data.get_input.result_type = RESULT_BACKWARD_MOVE_BY_USER;
+                       break;
+
+               case USER_CONFIRM_TIMEOUT:
+                       tr->terminal_rsp_data.get_input.result_type = RESULT_NO_RESPONSE_FROM_USER;
+                       break;
+
+               case USER_CONFIRM_END:
+                       tr->terminal_rsp_data.get_input.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+                       break;
+               default:
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_setup_call_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       gint input_data_len = 0;
+       gchar input_data[SAT_TEXT_STRING_LEN_MAX];
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+       memset(input_data, 0, SAT_TEXT_STRING_LEN_MAX);
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               g_free(tr);
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               g_free(tr);
+               return result;
+       }
+
+       if(addtional_data){
+               int index = 0;
+               guchar data;
+               GVariantIter *iter = NULL;
+               GVariant *inner_gv = NULL;
+
+               inner_gv = g_variant_get_variant(addtional_data);
+               dbg("additional data exist type_format(%s)", g_variant_get_type_string(inner_gv));
+
+               g_variant_get(inner_gv, "ay", &iter);
+               while( g_variant_iter_loop (iter, "y", &data)){
+                       dbg("index(%d) data(%d)", index, data);
+                       input_data[index] = data;
+                       index++;
+               }
+               g_variant_iter_free(iter);
+               g_variant_unref(inner_gv);
+               input_data_len = index;
+       }
+
+       tr->cmd_number = q_data.cmd_data.setup_call.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.setup_call.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.setup_call.command_detail, &q_data.cmd_data.setup_call.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.setup_call.device_id.src = q_data.cmd_data.setup_call.device_id.dest;
+       tr->terminal_rsp_data.setup_call.device_id.dest = q_data.cmd_data.setup_call.device_id.src;
+
+       switch(confirm_type){
+               case USER_CONFIRM_YES:{
+                       char *path;
+                       TelephonySAT *sat;
+                       TelephonyObjectSkeleton *object;
+
+                       gchar *plg_name = NULL;
+                       GVariant *setup_call = NULL;
+
+                       gint command_id, call_type, text_len, duration;
+                       gchar *text, *call_number;
+                       GVariant *icon_id;
+
+                       plg_name = tcore_plugin_ref_plugin_name(plg);
+                       if (plg_name) {
+                               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+                       }
+                       else {
+                               path = g_strdup_printf("%s", MY_DBUS_PATH);
+                       }
+                       dbg("path = [%s]", path);
+
+                       object = g_hash_table_lookup(ctx->objects, path);
+                       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+
+                       setup_call = sat_manager_setup_call_noti(ctx, plg_name, &q_data.cmd_data.setup_call);
+
+                       dbg("setup call type_format(%s)", g_variant_get_type_string(setup_call));
+                       g_variant_get(setup_call, "(isi@visi)", &command_id, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
+
+                       telephony_sat_emit_setup_call(sat, command_id, text, text_len, call_type,
+                                       call_number, duration);
+
+                       sat_ui_support_launch_call_application(q_data.cmd_data.setup_call.command_detail.cmd_type, setup_call);
+                       return TRUE;
+               }break;
+
+               case USER_CONFIRM_NO_OR_CANCEL:{
+                       tr->terminal_rsp_data.setup_call.result_type = RESULT_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ;
+                       tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.setup_call.cc_problem_type = CC_PROBLEM_NO_SPECIFIC_CAUSE;
+               }break;
+
+               case USER_CONFIRM_END:{
+                       tr->terminal_rsp_data.setup_call.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+               }break;
+
+               case USER_CONFIRM_HELP_INFO:
+               default:
+                       tr->terminal_rsp_data.setup_call.result_type = RESULT_NO_RESPONSE_FROM_USER;
+               break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_send_dtmf_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               g_free(tr);
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               g_free(tr);
+               return result;
+       }
+
+       tr->cmd_number = q_data.cmd_data.send_dtmf.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.send_dtmf.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.send_dtmf.command_detail, &q_data.cmd_data.send_dtmf.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.send_dtmf.device_id.src = q_data.cmd_data.send_dtmf.device_id.dest;
+       tr->terminal_rsp_data.send_dtmf.device_id.dest = q_data.cmd_data.send_dtmf.device_id.src;
+
+       dbg("confirm_type[%d]", confirm_type);
+
+       switch(confirm_type){
+               case USER_CONFIRM_NO_OR_CANCEL:
+               case USER_CONFIRM_END:
+                       tr->terminal_rsp_data.send_dtmf.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+                       tr->terminal_rsp_data.send_dtmf.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+               default:
+                       tr->terminal_rsp_data.send_dtmf.result_type = RESULT_NO_RESPONSE_FROM_USER;
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_launch_browser_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               g_free(tr);
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               g_free(tr);
+               return result;
+       }
+
+       tr->cmd_number = q_data.cmd_data.launch_browser.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.launch_browser.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.launch_browser.command_detail, &q_data.cmd_data.launch_browser.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.launch_browser.device_id.src = q_data.cmd_data.launch_browser.device_id.dest;
+       tr->terminal_rsp_data.launch_browser.device_id.dest = q_data.cmd_data.launch_browser.device_id.src;
+
+       dbg("confirm_type[%d]", confirm_type);
+
+       switch(confirm_type){
+               case USER_CONFIRM_YES:{
+                       char *path;
+                       TelephonySAT *sat;
+                       TelephonyObjectSkeleton *object;
+
+                       gchar *plg_name = NULL;
+                       GVariant *launch_browser = NULL;
+
+                       gint command_id = 0;
+                       gint browser_id = 0;
+                       gint url_len = 0, text_len = 0, gateway_proxy_len =0;
+                       gchar *url = NULL;
+                       gchar *text = NULL;
+                       gchar *gateway_proxy = NULL;
+                       GVariant *icon_id = NULL;
+
+                       plg_name = tcore_plugin_ref_plugin_name(plg);
+                       if (plg_name) {
+                               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+                       } else {
+                               path = g_strdup_printf("%s", MY_DBUS_PATH);
+                       }
+                       dbg("path = [%s]", path);
+
+                       object = g_hash_table_lookup(ctx->objects, path);
+                       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+
+                       launch_browser = sat_manager_launch_browser_noti(ctx, plg_name, &q_data.cmd_data.launch_browser);
+
+                       dbg("launch_browser type_format(%s)", g_variant_get_type_string(launch_browser));
+                       g_variant_get(launch_browser, "(iisisisi@v)", &command_id, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len, &icon_id);
+
+                       telephony_sat_emit_launch_browser(sat, command_id, browser_id, url, url_len, gateway_proxy, gateway_proxy_len, text, text_len);
+
+                       sat_ui_support_launch_browser_application(q_data.cmd_data.launch_browser.command_detail.cmd_type, launch_browser);
+                       return TRUE;
+               }break;
+
+               case USER_CONFIRM_NO_OR_CANCEL:
+               case USER_CONFIRM_END:
+                       tr->terminal_rsp_data.launch_browser.result_type = RESULT_BACKWARD_MOVE_BY_USER;
+                       tr->terminal_rsp_data.launch_browser.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.launch_browser.browser_problem_type = BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               default:
+                       tr->terminal_rsp_data.launch_browser.result_type = RESULT_NO_RESPONSE_FROM_USER;
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_open_channel_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       struct treq_sat_terminal_rsp_data *tr;
+       struct sat_manager_queue_data q_data;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               g_free(tr);
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               g_free(tr);
+               return result;
+       }
+
+       tr->cmd_number = q_data.cmd_data.open_channel.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.open_channel.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.open_channel.command_detail, &q_data.cmd_data.open_channel.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.open_channel.device_id.src = q_data.cmd_data.send_dtmf.device_id.dest;
+       tr->terminal_rsp_data.open_channel.device_id.dest = q_data.cmd_data.send_dtmf.device_id.src;
+
+       dbg("confirm_type[%d]", confirm_type);
+
+       switch(confirm_type){
+               case USER_CONFIRM_YES:{
+                       char *path;
+                       TelephonySAT *sat;
+                       TelephonyObjectSkeleton *object;
+
+                       gchar *plg_name = NULL;
+
+                       GVariant *open_channel = NULL;
+
+                       gint command_id, bearer_type, protocol_type, dest_addr_type;
+                       gboolean immediate_link, auto_reconnection, bg_mode;
+                       gint text_len, buffer_size, port_number;
+                       gchar *text, *dest_address;
+                       GVariant *icon_id;
+                       GVariant *bearer_param;
+                       GVariant *bearer_detail;
+
+                       //emit send_dtmf signal
+                       plg_name = tcore_plugin_ref_plugin_name(plg);
+                       if (plg_name) {
+                               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+                       } else {
+                               path = g_strdup_printf("%s", MY_DBUS_PATH);
+                       }
+                       dbg("path = [%s]", path);
+
+                       object = g_hash_table_lookup(ctx->objects, path);
+                       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+
+                       open_channel = sat_manager_open_channel_noti(ctx, plg_name, &q_data.cmd_data.open_channel);
+
+                       dbg("open channel type_format(%s)", g_variant_get_type_string(open_channel));
+                       g_variant_get(open_channel,"(isi@vbbbi@viiiis@v)", &command_id, &text, &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
+                                       &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
+
+                       telephony_sat_emit_open_channel(sat, command_id, text, text_len, immediate_link, auto_reconnection, bg_mode,
+                                       bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);
+
+                       return TRUE;
+               }break;
+
+               case USER_CONFIRM_NO_OR_CANCEL:
+               case USER_CONFIRM_END:
+                       tr->terminal_rsp_data.open_channel.result_type = RESULT_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ;
+                       break;
+               default:
+                       tr->terminal_rsp_data.open_channel.result_type = RESULT_NO_RESPONSE_FROM_USER;
+                       break;
+       }
+
+       memcpy((void*)&tr->terminal_rsp_data.open_channel.bearer_desc, &q_data.cmd_data.open_channel.bearer_desc, sizeof(struct tel_sat_bearer_description));
+       memcpy((void*)&tr->terminal_rsp_data.open_channel.buffer_size, &q_data.cmd_data.open_channel.buffer_size, sizeof(struct tel_sat_buffer_size));
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       return result;
+}
+
+gboolean sat_manager_handle_user_confirm(struct custom_data *ctx, TcorePlugin *plg, GVariant *user_confirm_data)
+{
+       gboolean rv = FALSE;
+       gboolean result = FALSE;
+       struct sat_manager_queue_data q_data;
+
+       gint command_id, command_type, confirm_type;
+       GVariant *additional_data = NULL;
+
+       dbg("user_confirm_data type_format(%s)", g_variant_get_type_string(user_confirm_data));
+       g_variant_get(user_confirm_data, "(iiv)", &command_id, &confirm_type, &additional_data);
+
+       dbg("[SAT] user confirm data command id(%d), confirm_type(%d)", command_id, confirm_type);
+
+       rv = sat_manager_queue_peek_data_by_id(ctx, &q_data, command_id);
+       if(!rv){
+               dbg("[SAT] no commands in queue");
+               return result;
+       }
+
+       command_type = (gint)q_data.cmd_type;
+       dbg("[SAT] command type(%d)", command_type);
+
+       switch(command_type){
+               case SAT_PROATV_CMD_SELECT_ITEM:
+                       result = _sat_manager_handle_menu_select_confirm(ctx, plg, command_id, confirm_type, additional_data);
+                       break;
+               case SAT_PROATV_CMD_DISPLAY_TEXT:
+                       result = _sat_manager_handle_display_text_confirm(ctx, plg, command_id, confirm_type, additional_data);
+                       break;
+               case SAT_PROATV_CMD_GET_INKEY:
+                       result = _sat_manager_handle_get_inkey_confirm(ctx, plg, command_id, confirm_type, additional_data);
+                       break;
+               case SAT_PROATV_CMD_GET_INPUT:
+                       result = _sat_manager_handle_get_input_confirm(ctx, plg, command_id, confirm_type, additional_data);
+                       break;
+               case SAT_PROATV_CMD_SETUP_CALL:
+                       result = _sat_manager_handle_setup_call_confirm(ctx, plg, command_id, confirm_type, additional_data);
+                       break;
+               case SAT_PROATV_CMD_SEND_DTMF:
+                       result = _sat_manager_handle_send_dtmf_confirm(ctx, plg, command_id, confirm_type, additional_data);
+                       break;
+               case SAT_PROATV_CMD_LAUNCH_BROWSER:
+                       result = _sat_manager_handle_launch_browser_confirm(ctx, plg, command_id, confirm_type, additional_data);
+                       break;
+               case SAT_PROATV_CMD_OPEN_CHANNEL:
+                       result = _sat_manager_handle_open_channel_confirm(ctx, plg, command_id, confirm_type, additional_data);
+                       break;
+               default:
+                       dbg("[SAT] cannot handle user confirm command(0x%x)", command_type);
+                       break;
+       }
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_play_tone_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+{
+       char *path;
+       TelephonySAT *sat;
+       TelephonyObjectSkeleton *object;
+
+       gchar *plg_name = NULL;
+       GVariant *play_tone = NULL;
+
+
+       gint command_id, tone_type, duration;
+       gint text_len;
+       gchar* text;
+       GVariant *icon_id;
+
+       if(!display_status){
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT] fail to show ui display for play tone");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+
+               tr->cmd_number = q_data->cmd_data.play_tone.command_detail.cmd_num;
+               tr->cmd_type = q_data->cmd_data.play_tone.command_detail.cmd_type;
+               memcpy((void*)&tr->terminal_rsp_data.play_tone.command_detail, &q_data->cmd_data.play_tone.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+
+               tr->terminal_rsp_data.play_tone.device_id.src = q_data->cmd_data.play_tone.device_id.dest;
+               tr->terminal_rsp_data.play_tone.device_id.dest = q_data->cmd_data.play_tone.device_id.src;
+               tr->terminal_rsp_data.play_tone.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return TRUE;
+       }
+
+       //emit play tone signal
+       plg_name = tcore_plugin_ref_plugin_name(plg);
+       if (plg_name) {
+               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+       }
+       else {
+               path = g_strdup_printf("%s", MY_DBUS_PATH);
+       }
+       dbg("path = [%s]", path);
+
+       object = g_hash_table_lookup(ctx->objects, path);
+       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+
+       play_tone = sat_manager_play_tone_noti(ctx, plg_name, &q_data->cmd_data.play_tone);
+
+       dbg("play tone type_format(%s)", g_variant_get_type_string(play_tone));
+       g_variant_get(play_tone, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &tone_type, &duration);
+
+       telephony_sat_emit_play_tone(sat, command_id, text, text_len, tone_type, duration);
+
+       return TRUE;
+}
+
+static gboolean _sat_manager_handle_send_sms_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+{
+       char *path;
+       TelephonySAT *sat;
+       TelephonyObjectSkeleton *object;
+
+       gchar *plg_name = NULL;
+       GVariant *send_sms = NULL;
+
+
+       gint command_id, ton, npi, tpdu_type;
+       gboolean b_packing_required;
+       gint text_len, number_len, tpdu_data_len;
+       gchar* text, *dialling_number;
+       GVariant *tpdu_data, *icon_id;
+
+       if(!display_status){
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT] fail to show ui display for send sms");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+
+               tr->cmd_number = q_data->cmd_data.sendSMSInd.command_detail.cmd_num;
+               tr->cmd_type = q_data->cmd_data.sendSMSInd.command_detail.cmd_type;
+               memcpy((void*)&tr->terminal_rsp_data.send_sms.command_detail, &q_data->cmd_data.sendSMSInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+
+               tr->terminal_rsp_data.send_sms.device_id.src = q_data->cmd_data.sendSMSInd.device_id.dest;
+               tr->terminal_rsp_data.send_sms.device_id.dest = q_data->cmd_data.sendSMSInd.device_id.src;
+               tr->terminal_rsp_data.send_sms.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return TRUE;
+       }
+
+       //emit send sms signal
+       plg_name = tcore_plugin_ref_plugin_name(plg);
+       if (plg_name) {
+               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+       }
+       else {
+               path = g_strdup_printf("%s", MY_DBUS_PATH);
+       }
+       dbg("path = [%s]", path);
+
+       object = g_hash_table_lookup(ctx->objects, path);
+       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+
+       send_sms = sat_manager_send_sms_noti(ctx, plg_name, &q_data->cmd_data.sendSMSInd);
+
+       dbg("send sms type_format(%s)", g_variant_get_type_string(send_sms));
+       g_variant_get(send_sms, "(isi@vbiisii@vi)", &command_id, &text, &text_len, &icon_id, &b_packing_required, &ton, &npi,
+                       &dialling_number, &number_len, &tpdu_type, &tpdu_data, &tpdu_data_len);
+
+       telephony_sat_emit_send_sms(sat, command_id, text, text_len, b_packing_required,
+                       ton, npi, dialling_number, number_len, tpdu_type, tpdu_data, tpdu_data_len);
+
+       return TRUE;
+}
+
+static gboolean _sat_manager_handle_send_ss_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+{
+       char *path;
+       TelephonySAT *sat;
+       TelephonyObjectSkeleton *object;
+
+       gchar *plg_name = NULL;
+       GVariant *send_ss = NULL;
+
+
+       gint command_id, ton, npi;
+       gint text_len, ss_str_len;
+       gchar* text, *ss_string;
+       GVariant *icon_id;
+
+       if(!display_status){
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT] fail to show ui display for send ss");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+
+               tr->cmd_number = q_data->cmd_data.send_ss.command_detail.cmd_num;
+               tr->cmd_type = q_data->cmd_data.send_ss.command_detail.cmd_type;
+               memcpy((void*)&tr->terminal_rsp_data.send_ss.command_detail, &q_data->cmd_data.send_ss.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+
+               tr->terminal_rsp_data.send_ss.device_id.src = q_data->cmd_data.send_ss.device_id.dest;
+               tr->terminal_rsp_data.send_ss.device_id.dest = q_data->cmd_data.send_ss.device_id.src;
+               tr->terminal_rsp_data.send_ss.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return TRUE;
+       }
+
+       //emit send ss signal
+       plg_name = tcore_plugin_ref_plugin_name(plg);
+       if (plg_name) {
+               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+       }
+       else {
+               path = g_strdup_printf("%s", MY_DBUS_PATH);
+       }
+       dbg("path = [%s]", path);
+
+       object = g_hash_table_lookup(ctx->objects, path);
+       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+
+       send_ss = sat_manager_send_ss_noti(ctx, plg_name, &q_data->cmd_data.send_ss);
+
+       dbg("send ss type_format(%s)", g_variant_get_type_string(send_ss));
+       g_variant_get(send_ss, "(isi@viiis)", &command_id, &text, &text_len, &icon_id,
+                       &ton, &npi, &ss_str_len, &ss_string);
+
+       telephony_sat_emit_send_ss(sat, command_id, text, text_len, ton, npi, ss_string);
+
+       return TRUE;
+}
+
+static gboolean _sat_manager_handle_send_ussd_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+{
+       char *path;
+       TelephonySAT *sat;
+       TelephonyObjectSkeleton *object;
+
+       gchar *plg_name = NULL;
+       GVariant *send_ussd = NULL;
+
+       gint command_id;
+       gint text_len, ussd_str_len;
+       gchar* text, *ussd_string;
+       GVariant *icon_id;
+
+       if(!display_status){
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT] fail to show ui display for send ussd");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+
+               tr->cmd_number = q_data->cmd_data.send_ussd.command_detail.cmd_num;
+               tr->cmd_type = q_data->cmd_data.send_ussd.command_detail.cmd_type;
+               memcpy((void*)&tr->terminal_rsp_data.send_ussd.command_detail, &q_data->cmd_data.send_ussd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+
+               tr->terminal_rsp_data.send_ussd.device_id.src = q_data->cmd_data.send_ussd.device_id.dest;
+               tr->terminal_rsp_data.send_ussd.device_id.dest = q_data->cmd_data.send_ussd.device_id.src;
+               tr->terminal_rsp_data.send_ussd.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return TRUE;
+       }
+
+       //emit send ussd signal
+       plg_name = tcore_plugin_ref_plugin_name(plg);
+       if (plg_name) {
+               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+       }
+       else {
+               path = g_strdup_printf("%s", MY_DBUS_PATH);
+       }
+       dbg("path = [%s]", path);
+
+       object = g_hash_table_lookup(ctx->objects, path);
+       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+
+       send_ussd = sat_manager_send_ussd_noti(ctx, plg_name, &q_data->cmd_data.send_ussd);
+
+       dbg("send ussd type_format(%s)", g_variant_get_type_string(send_ussd));
+       g_variant_get(send_ussd, "(isi@vis)", &command_id, &text, &text_len, &icon_id, &ussd_str_len, &ussd_string);
+
+       telephony_sat_emit_setup_ussd(sat, command_id, text, text_len, ussd_string);
+
+       return TRUE;
+}
+
+static gboolean _sat_manager_handle_setup_idle_mode_text_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+{
+       TReturn rv = TCORE_RETURN_FAILURE;
+       gboolean result = FALSE;
+
+       struct treq_sat_terminal_rsp_data *tr;
+
+       tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       tr->cmd_number = q_data->cmd_data.idle_mode.command_detail.cmd_num;
+       tr->cmd_type = q_data->cmd_data.idle_mode.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.setup_idle_mode_text.command_detail, &q_data->cmd_data.idle_mode.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+       tr->terminal_rsp_data.setup_idle_mode_text.device_id.src = q_data->cmd_data.idle_mode.device_id.dest;
+       tr->terminal_rsp_data.setup_idle_mode_text.device_id.dest = q_data->cmd_data.idle_mode.device_id.src;
+
+       tr->terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_SUCCESS;
+               if (q_data->cmd_data.idle_mode.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+       //fail to display text
+       if(!display_status){
+               dbg("[SAT] fail to show ui display for setup_idle_mode_text");
+               tr->terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
+       if(rv != TCORE_RETURN_SUCCESS){
+               dbg("fail to send terminal response");
+               result = FALSE;
+       }
+
+       sat_ui_support_terminate_sat_ui();
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_refresh_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+{
+       char *path;
+       TelephonySAT *sat;
+       TelephonyObjectSkeleton *object;
+
+       gchar *plg_name = NULL;
+
+       GVariant *refresh = NULL;
+       gint command_id = 0;
+       gint refresh_type =0;
+       GVariant *file_list = NULL;
+
+       if(!display_status){
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT] fail to show ui display for refresh");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+
+               tr->cmd_number = q_data->cmd_data.refresh.command_detail.cmd_num;
+               tr->cmd_type = q_data->cmd_data.refresh.command_detail.cmd_type;
+               memcpy((void*)&tr->terminal_rsp_data.refresh.command_detail, &q_data->cmd_data.refresh.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+
+               tr->terminal_rsp_data.refresh.device_id.src = q_data->cmd_data.refresh.device_id.dest;
+               tr->terminal_rsp_data.refresh.device_id.dest = q_data->cmd_data.refresh.device_id.src;
+               tr->terminal_rsp_data.refresh.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return TRUE;
+       }
+
+       //emit send_dtmf signal
+       plg_name = tcore_plugin_ref_plugin_name(plg);
+       if (plg_name) {
+               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+       } else {
+               path = g_strdup_printf("%s", MY_DBUS_PATH);
+       }
+       dbg("path = [%s]", path);
+
+       object = g_hash_table_lookup(ctx->objects, path);
+       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+
+       refresh = sat_manager_refresh_noti(ctx, plg_name, &q_data->cmd_data.refresh);
+       dbg("refresh type_format(%s)", g_variant_get_type_string(refresh));
+       g_variant_get(refresh, "(ii@v)", &command_id, &refresh_type, &file_list);
+
+       telephony_sat_emit_refresh(sat, command_id, refresh_type, file_list);
+
+       return TRUE;
+}
+
+static gboolean _sat_manager_handle_send_dtmf_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+{
+       char *path;
+       TelephonySAT *sat;
+       TelephonyObjectSkeleton *object;
+
+       gchar *plg_name = NULL;
+
+       GVariant *send_dtmf = NULL;
+       gint command_id = 0;
+       gint text_len = 0, dtmf_str_len = 0;
+       gchar *text = NULL;
+       gchar *dtmf_str = NULL;
+       GVariant *icon_id = NULL;
+
+       if(!display_status){
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT] fail to show ui display for send_dtmf");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+
+               tr->cmd_number = q_data->cmd_data.send_dtmf.command_detail.cmd_num;
+               tr->cmd_type = q_data->cmd_data.send_dtmf.command_detail.cmd_type;
+               memcpy((void*)&tr->terminal_rsp_data.send_dtmf.command_detail, &q_data->cmd_data.send_dtmf.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+
+               tr->terminal_rsp_data.send_dtmf.device_id.src = q_data->cmd_data.send_dtmf.device_id.dest;
+               tr->terminal_rsp_data.send_dtmf.device_id.dest = q_data->cmd_data.send_dtmf.device_id.src;
+               tr->terminal_rsp_data.send_dtmf.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return TRUE;
+       }
+
+       //emit send_dtmf signal
+       plg_name = tcore_plugin_ref_plugin_name(plg);
+       if (plg_name) {
+               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+       } else {
+               path = g_strdup_printf("%s", MY_DBUS_PATH);
+       }
+       dbg("path = [%s]", path);
+
+       object = g_hash_table_lookup(ctx->objects, path);
+       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+
+       send_dtmf = sat_manager_send_dtmf_noti(ctx, plg_name, &q_data->cmd_data.send_dtmf);
+
+       dbg("send_dtmf type_format(%s)", g_variant_get_type_string(send_dtmf));
+       g_variant_get(send_dtmf, "(isi@vis)", &command_id, &text, &text_len, &icon_id, &dtmf_str, &dtmf_str_len);
+
+       telephony_sat_emit_send_dtmf(sat, command_id, text, text_len, dtmf_str, dtmf_str_len);
+
+       return TRUE;
+}
+
+static gboolean _sat_manager_handle_open_channel_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+{
+       char *path;
+       TelephonySAT *sat;
+       TelephonyObjectSkeleton *object;
+
+       gchar *plg_name = NULL;
+
+       GVariant *open_channel = NULL;
+
+       gint command_id, bearer_type, protocol_type, dest_addr_type;
+       gboolean immediate_link, auto_reconnection, bg_mode;
+       gint text_len, buffer_size, port_number;
+       gchar *text, *dest_address;
+       GVariant *icon_id;
+       GVariant *bearer_param;
+       GVariant *bearer_detail;
+
+       if(!display_status){
+               struct treq_sat_terminal_rsp_data *tr = NULL;
+               dbg("[SAT] fail to show ui display for open channel");
+
+               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
+
+               tr->cmd_number = q_data->cmd_data.open_channel.command_detail.cmd_num;
+               tr->cmd_type = q_data->cmd_data.open_channel.command_detail.cmd_type;
+               memcpy((void*)&tr->terminal_rsp_data.open_channel.command_detail, &q_data->cmd_data.open_channel.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+
+               tr->terminal_rsp_data.open_channel.device_id.src = q_data->cmd_data.send_dtmf.device_id.dest;
+               tr->terminal_rsp_data.open_channel.device_id.dest = q_data->cmd_data.send_dtmf.device_id.src;
+               tr->terminal_rsp_data.open_channel.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+
+               sat_manager_send_terminal_response(ctx->comm, plg, tr);
+               return TRUE;
+       }
+
+       //emit send_dtmf signal
+       plg_name = tcore_plugin_ref_plugin_name(plg);
+       if (plg_name) {
+               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+       } else {
+               path = g_strdup_printf("%s", MY_DBUS_PATH);
+       }
+       dbg("path = [%s]", path);
+
+       object = g_hash_table_lookup(ctx->objects, path);
+       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+
+       open_channel = sat_manager_open_channel_noti(ctx, plg_name, &q_data->cmd_data.open_channel);
+
+       dbg("open channel type_format(%s)", g_variant_get_type_string(open_channel));
+       g_variant_get(open_channel,"(isi@vbbbi@viiiis@v)", &command_id, &text, &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
+                       &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
+
+       telephony_sat_emit_open_channel(sat, command_id, text, text_len, immediate_link, auto_reconnection, bg_mode,
+                       bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);
+
+       return TRUE;
+}
+
+gboolean sat_manager_handle_ui_display_status(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gboolean display_status)
+{
+       gboolean result = FALSE;
+       struct sat_manager_queue_data q_data;
+
+       dbg("[SAT] ui display status : command id(%d) display status(%d)", command_id, display_status);
+       memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
+
+       if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
+               dbg("[SAT] command peek data from queue is failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!plg){
+               dbg("there is no valid plugin at this point");
+               return result;
+       }
+
+       switch(q_data.cmd_type){
+               case SAT_PROATV_CMD_PLAY_TONE:
+                       result = _sat_manager_handle_play_tone_ui_display_status(ctx, plg, &q_data, display_status);
+                       break;
+               case SAT_PROATV_CMD_SEND_SMS:
+                       result = _sat_manager_handle_send_sms_ui_display_status(ctx, plg, &q_data, display_status);
+                       break;
+               case SAT_PROATV_CMD_SEND_SS:
+                       result = _sat_manager_handle_send_ss_ui_display_status(ctx, plg, &q_data, display_status);
+                       break;
+               case SAT_PROATV_CMD_SEND_USSD:
+                       result = _sat_manager_handle_send_ussd_ui_display_status(ctx, plg, &q_data, display_status);
+                       break;
+               case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
+                       result = _sat_manager_handle_setup_idle_mode_text_ui_display_status(ctx, plg, &q_data, display_status);
+                       break;
+               case SAT_PROATV_CMD_REFRESH:
+                       result = _sat_manager_handle_refresh_ui_display_status(ctx, plg, &q_data, display_status);
+                       break;
+               case SAT_PROATV_CMD_SEND_DTMF:
+                       result = _sat_manager_handle_send_dtmf_ui_display_status(ctx, plg, &q_data, display_status);
+                       break;
+               case SAT_PROATV_CMD_OPEN_CHANNEL:
+                       result = _sat_manager_handle_open_channel_ui_display_status(ctx, plg, &q_data, display_status);
+                       break;
+               default:
+                       dbg("[SAT] cannot handle ui display status command(0x%x)", q_data.cmd_type);
+                       break;
+       }
+
+       return result;
+}
+
+gboolean sat_manager_handle_event_download_envelop(int event_type,  int src_dev, int dest_dev, struct tel_sat_envelop_event_download_tlv *evt_download, GVariant *download_data)
+{
+       GVariant *data = NULL;
+
+       dbg("download data type_format(%s)", g_variant_get_type_string(download_data));
+       g_variant_get(download_data, "v", &data);
+
+       switch(event_type)
+       {
+               case EVENT_IDLE_SCREEN_AVAILABLE:
+                       dbg("data type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(b)", &evt_download->idle_screen);
+                       evt_download->device_identitie.src = DEVICE_ID_DISPLAY;
+                       evt_download->device_identitie.dest = dest_dev;
+                       dbg("idle screen available (%d)", evt_download->idle_screen);
+                       break;
+               case EVENT_LANGUAGE_SELECTION:
+                       dbg("data type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(i)", &evt_download->language);
+                       evt_download->device_identitie.src = src_dev;
+                       evt_download->device_identitie.dest = dest_dev;
+                       dbg("selected language (%d)", evt_download->language);
+                       break;
+               case EVENT_BROWSER_TERMINATION:{
+                       dbg("data type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(i)", &evt_download->browser_termination);
+                       evt_download->device_identitie.src = src_dev;
+                       evt_download->device_identitie.dest = dest_dev;
+                       dbg("browser termination cause(%d)", evt_download->browser_termination);
+               } break;
+               case EVENT_DATA_AVAILABLE:{
+                       gint channel_id, channel_status, channel_info, channel_data_len;
+
+                       dbg("data type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(iiii)", &channel_id, &channel_status, &channel_info, &channel_data_len);
+                       evt_download->device_identitie.src = src_dev;
+                       evt_download->device_identitie.dest = dest_dev;
+                       evt_download->channel_status.channel_id = channel_id;
+                       evt_download->channel_status.status = channel_status;
+                       evt_download->channel_status.status_info = channel_info;
+                       evt_download->channel_data_len.data_len = channel_data_len;
+                       dbg("data available channel id (%d)", evt_download->channel_status.channel_id);
+               } break;
+               case EVENT_CHANNEL_STATUS:{
+                       gint channel_id, channel_status, channel_info;
+
+                       dbg("data type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(iii)", &channel_id, &channel_status, &channel_info);
+                       evt_download->device_identitie.src = src_dev;
+                       evt_download->device_identitie.dest = dest_dev;
+                       evt_download->channel_status.channel_id = channel_id;
+                       evt_download->channel_status.status = channel_status;
+                       evt_download->channel_status.status_info = channel_info;
+
+               } break;
+               default :
+                       dbg("not support download event (%d)", event_type);
+                       break;
+       }
+
+       return TRUE;
+}
diff --git a/src/sat_manager.h b/src/sat_manager.h
new file mode 100644 (file)
index 0000000..54620c7
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef SAT_MANAGER_H_
+#define SAT_MANAGER_H_
+
+#include <tcore.h>
+#include <type/sat.h>
+#include "common.h"
+
+
+typedef union {
+       struct tel_sat_display_text_tlv displayTextInd; /**<    Parsed proactive command info from TLV to Telephony data type - display text    */
+       struct tel_sat_get_inkey_tlv getInkeyInd; /**<  Parsed proactive command info from TLV to Telephony data type - getInkey        */
+       struct tel_sat_get_input_tlv getInputInd; /**<  Parsed proactive command info from TLV to Telephony data type - getInput        */
+       struct tel_sat_play_tone_tlv play_tone;
+       struct tel_sat_setup_menu_tlv setupMenuInd; /**<        Parsed proactive command info from TLV to Telephony data type - setup menu      */
+       struct tel_sat_select_item_tlv selectItemInd; /**<      Parsed proactive command info from TLV to Telephony data type - select item     */
+       struct tel_sat_send_sms_tlv sendSMSInd;
+       struct tel_sat_send_ss_tlv send_ss;
+       struct tel_sat_send_ussd_tlv send_ussd;
+       struct tel_sat_setup_call_tlv setup_call;
+       struct tel_sat_refresh_tlv refresh;
+       struct tel_sat_provide_local_info_tlv provide_local_info;
+       struct tel_sat_setup_idle_mode_text_tlv idle_mode;
+       struct tel_sat_send_dtmf_tlv send_dtmf;
+       struct tel_sat_language_notification_tlv language_notification;
+       struct tel_sat_launch_browser_tlv launch_browser;
+       struct tel_sat_open_channel_tlv open_channel;
+       struct tel_sat_close_channel_tlv close_channel;
+       struct tel_sat_receive_channel_tlv receive_data;
+       struct tel_sat_send_channel_tlv send_data;
+       struct tel_sat_get_channel_status_tlv get_channel_status;
+} sat_manager_proactive_data;
+
+/**
+ * This structure defines the Command Queue Info.
+ */
+struct sat_manager_queue_data {
+       enum tel_sat_proactive_cmd_type cmd_type; /**<Type of Command*/
+       int cmd_id; /**<Command Id*/
+       sat_manager_proactive_data cmd_data; /**<Proactive Cmd Ind Info*/
+};
+
+
+/*================================================================================================*/
+
+void sat_manager_init_queue(struct custom_data *ctx);
+
+//application request handling
+gboolean sat_manager_handle_user_confirm(struct custom_data *ctx, TcorePlugin *plg, GVariant *user_confirm_data);
+gboolean sat_manager_handle_app_exec_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint command_type, GVariant *exec_result);
+gboolean sat_manager_handle_ui_display_status(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gboolean display_status);
+gboolean sat_manager_handle_event_download_envelop(int event_type, int src_dev, int dest_dev, struct tel_sat_envelop_event_download_tlv *evt_download, GVariant *download_data);
+
+//proactive command processing
+GVariant* sat_manager_caching_setup_menu_info(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_menu_tlv* setup_menu_tlv);
+GVariant* sat_manager_display_text_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_display_text_tlv* display_text_tlv);
+GVariant* sat_manager_select_item_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_select_item_tlv* select_item_tlv);
+GVariant* sat_manager_get_inkey_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_inkey_tlv* get_inkey_tlv);
+GVariant* sat_manager_get_input_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_input_tlv* get_input_tlv);
+GVariant* sat_manager_play_tone_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_play_tone_tlv* play_tone_tlv);
+GVariant* sat_manager_send_sms_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_sms_tlv* send_sms_tlv);
+GVariant* sat_manager_send_ss_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_ss_tlv* send_ss_tlv);
+GVariant* sat_manager_send_ussd_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_ussd_tlv* send_ussd_tlv);
+GVariant* sat_manager_setup_call_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_call_tlv* setup_call_tlv);
+GVariant* sat_manager_setup_event_list_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_event_list_tlv *event_list_tlv);
+GVariant* sat_manager_setup_idle_mode_text_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_idle_mode_text_tlv *idle_mode_tlv);
+GVariant* sat_manager_open_channel_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_open_channel_tlv *open_channel_tlv);
+GVariant* sat_manager_close_channel_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_close_channel_tlv *close_channel_tlv);
+GVariant* sat_manager_receive_data_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_receive_channel_tlv *receive_data_tlv);
+GVariant* sat_manager_send_data_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_channel_tlv *send_data_tlv);
+GVariant* sat_manager_get_channel_status_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_channel_status_tlv *get_channel_status_tlv);
+GVariant* sat_manager_refresh_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_refresh_tlv *refresh_tlv);
+void sat_manager_more_time_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_more_time_tlv *more_time_tlv);
+GVariant* sat_manager_send_dtmf_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_dtmf_tlv *send_dtmf_tlv);
+GVariant* sat_manager_launch_browser_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_launch_browser_tlv *launch_browser_tlv);
+GVariant* sat_manager_provide_local_info_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_provide_local_info_tlv *provide_local_info_tlv);
+GVariant* sat_manager_language_notification_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_language_notification_tlv *language_notification_tlv);
+
+void sat_mgr_convert_utf8_to_gsm(unsigned char *dest, int *dest_len, unsigned char* src, unsigned int src_len);
+void sat_mgr_convert_utf8_to_ucs2(unsigned char* dest, int* dest_len,  unsigned char* src, int src_len);
+void sat_mgr_convert_string(unsigned char *dest, unsigned short *dest_len,
+               enum alphabet_format dcs, unsigned char *src, unsigned short src_len);
+
+#endif /* SAT_MANAGER_H_ */
diff --git a/src/sat_mgr.c b/src/sat_mgr.c
deleted file mode 100755 (executable)
index d7cbf09..0000000
+++ /dev/null
@@ -1,1272 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <glib.h>
-
-#include <tcore.h>
-#include <plugin.h>
-#include <server.h>
-#include <storage.h>
-#include <user_request.h>
-#include <communicator.h>
-#include <core_object.h>
-#include <co_sat.h>
-#include <type/sat.h>
-
-#include <TapiCommon.h>
-#include <TelSat.h>
-
-#include "tel_cs_conn.h"
-#include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "ts_noti.h"
-#include "modules.h"
-#include "sat_mgr.h"
-
-#define SAT_DEF_CMD_Q_MAX 10
-#define SAT_TIME_OUT 60000
-
-static int _get_queue_size(struct custom_data *ctx)
-{
-       int temp;
-       temp = (int)g_queue_get_length(&ctx->sat_q);
-       dbg("[SAT]SAT Command Queue current Size [%d], MAX SIZE [%d]\n", temp,  SAT_DEF_CMD_Q_MAX);
-       return temp;
-}
-
-static gboolean _enqueue_cmd(struct custom_data *ctx, struct sat_mgr_cmd_q *cmd_obj)
-{
-       struct sat_mgr_cmd_q* item = NULL;
-       if (_get_queue_size(ctx) == (SAT_DEF_CMD_Q_MAX - 1)) {
-               dbg("[SAT] FAILED TO ENQUEUE - QUEUE FULL!\n");
-               return FALSE;
-       }
-
-       item = g_new(struct sat_mgr_cmd_q, 1);
-
-       if (item == NULL) {
-               dbg("[SAT] FAILED TO ALLOC QUEUE ITEM!\n");
-               return FALSE;
-       }
-
-       memcpy((void*)item, cmd_obj, sizeof(struct sat_mgr_cmd_q));
-       g_queue_push_tail(&ctx->sat_q, item);
-       return TRUE;
-}
-
-static gboolean _dequeue_cmd_front(struct custom_data *ctx, struct sat_mgr_cmd_q *cmd_obj)
-{
-       struct sat_mgr_cmd_q *item = NULL;
-       if (g_queue_is_empty(&ctx->sat_q))
-               return FALSE;
-       item = g_queue_pop_head(&ctx->sat_q);
-       memcpy((void*)cmd_obj, item, sizeof(struct sat_mgr_cmd_q));
-       g_free(item);
-       return TRUE;
-}
-
-static gboolean _dequeue_cmd_front_by_id(struct custom_data *ctx, struct sat_mgr_cmd_q *cmd_obj)
-{
-       if (g_queue_is_empty(&ctx->sat_q))
-               return FALSE;
-       memcpy((void*)cmd_obj, g_queue_peek_head(&ctx->sat_q), sizeof(struct sat_mgr_cmd_q));
-       return TRUE;
-}
-
-void sat_mgr_init_cmd_queue(struct custom_data *ctx)
-{
-       g_queue_init(&ctx->sat_q);
-}
-
-static gboolean sat_mgr_enqueue_cmd(struct custom_data *ctx, struct sat_mgr_cmd_q *cmd_obj)
-{
-       cmd_obj->cmd_id = g_queue_get_length(&ctx->sat_q);
-       return _enqueue_cmd(ctx, cmd_obj);
-}
-
-static gboolean sat_mgr_dequeue_cmd(struct custom_data *ctx, struct sat_mgr_cmd_q *cmd_obj, unsigned short cmd_id)
-{
-       struct sat_mgr_cmd_q cmd_q_entry;
-       int i;
-
-       for (i = 0; i < _get_queue_size(ctx); i++) {
-               if(FALSE == _dequeue_cmd_front_by_id(ctx, &cmd_q_entry))
-                       return FALSE;
-
-               dbg("[SAT] command ID from Q [ %d], in param command id [%d]", cmd_q_entry.cmd_id, cmd_id);
-               if (cmd_q_entry.cmd_id == cmd_id) {
-                       if(FALSE == _dequeue_cmd_front(ctx, cmd_obj))
-                               return FALSE;
-
-                       return TRUE;
-               }
-               else {
-                       if(FALSE == _dequeue_cmd_front(ctx, &cmd_q_entry))
-                               return FALSE;
-
-                       if(FALSE == _enqueue_cmd(ctx, &cmd_q_entry))
-                               return FALSE;
-               }
-       }
-       return FALSE;
-}
-
-static gboolean sat_mgr_dequeue_cmd_front_by_id(struct custom_data *ctx, struct sat_mgr_cmd_q *cmd_obj)
-{
-       return _dequeue_cmd_front_by_id(ctx, cmd_obj);
-}
-
-static int _get_string_length(unsigned char *in, unsigned short in_max)
-{
-       int i = 0;
-       if (in == NULL)
-               return 0;
-       /* 0xFF is the end of string */
-       while (in[i] != 0xFF && i < in_max) {
-               i++;
-       }
-       /* last space character must be deleted */
-       while (in[i - 1] == 0x20 && i > 0) {
-               i--;
-       }
-       return i;
-}
-
-static unsigned int _get_time_in_ms(struct tel_sat_duration *dr)
-{
-       switch (dr->time_unit) {
-               case TIME_UNIT_MINUTES:
-                       return (unsigned int)dr->time_interval * 60000;
-                       break;
-
-               case TIME_UNIT_SECONDS:
-                       return (unsigned int)dr->time_interval * 1000;
-                       break;
-
-               case TIME_UNIT_TENTHS_OF_SECONDS:
-                       return (unsigned int)dr->time_interval * 100;
-                       break;
-
-               case TIME_UNIT_RESERVED:
-               default:
-                       return 0;       // set default
-                       break;
-       }
-}
-
-static enum tel_sat_me_problem_type _get_tcore_me_problem_type(TelSatMeProblemType_t mp)
-{
-       switch (mp) {
-               case TAPI_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE:
-                       return ME_PROBLEM_NO_SPECIFIC_CAUSE;
-                       break;
-               case TAPI_SAT_ME_PROBLEM_SCREEN_BUSY:
-                       return ME_PROBLEM_SCREEN_BUSY;
-                       break;
-               case TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_CALL:
-                       return ME_PROBLEM_ME_BUSY_ON_CALL;
-                       break;
-               case TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_SS:
-                       return ME_PROBLEM_ME_BUSY_ON_SS;
-                       break;
-               case TAPI_SAT_ME_PROBLEM_NO_SERVICE:
-                       return ME_PROBLEM_NO_SERVICE;
-                       break;
-               case TAPI_SAT_ME_PROBLEM_ACCESS_CONTROL_CLASS_BAR:
-                       return ME_PROBLEM_ACCESS_CONTROL_CLASS_BAR;
-                       break;
-               case TAPI_SAT_ME_PROBLEM_RADIO_RES_NOT_GRANTED:
-                       return ME_PROBLEM_RADIO_RES_NOT_GRANTED;
-                       break;
-               case TAPI_SAT_ME_PROBLEM_NOT_IN_SPEECH_CALL:
-                       return ME_PROBLEM_NOT_IN_SPEECH_CALL;
-                       break;
-               case TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_USSD:
-                       return ME_PROBLEM_ME_BUSY_ON_USSD;
-                       break;
-               case TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_SEND_DTMF_CMD:
-                       return ME_PROBLEM_ME_BUSY_ON_SEND_DTMF_CMD;
-                       break;
-               case TAPI_SAT_ME_PROBLEM_NO_USIM_ACTIVE:
-                       return ME_PROBLEM_NO_USIM_ACTIVE;
-                       break;
-               default :
-                       dbg("not handled ME problem value[0x%x]", mp);
-                       return ME_PROBLEM_INVALID;
-       }
-}
-
-static TapiResult_t sat_mgr_send_terminal_response(struct custom_data *ctx, TcorePlugin *p, char* conn_name, struct treq_sat_terminal_rsp_data *tr)
-{
-       struct tcore_user_info ui = { 0, };
-       UserRequest *ur = NULL;
-       TcorePlugin *np = NULL;
-       TReturn rt = TCORE_RETURN_SUCCESS;
-
-       if(!np)
-               np = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
-       else
-               np = p;
-
-       dbg("plugin address[0x%x], modem name[%s]", np, tcore_plugin_get_description(np)->name);
-       ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(np)->name);
-       if (!ur) {
-               rt = TAPI_API_SERVER_FAILURE;
-               return rt;
-       }
-
-       if(conn_name)
-               ui.appname = conn_name;
-
-       tcore_user_request_set_user_info(ur, &ui);
-       tcore_user_request_set_command(ur, TREQ_SAT_REQ_TERMINALRESPONSE);
-       tcore_user_request_set_data(ur, sizeof(struct treq_sat_terminal_rsp_data), (void *)tr);
-       rt = tcore_communicator_dispatch_request(ctx->comm, ur);
-       if (rt != TCORE_RETURN_SUCCESS) {
-               dbg("error rt[0x%x]",rt);
-               rt = TAPI_API_OPERATION_FAILED;
-       }
-       else {
-               rt = TAPI_API_SUCCESS;
-       }
-       return rt;
-}
-
-void sat_mgr_setup_menu_noti(struct custom_data *ctx, struct tel_sat_setup_menu_tlv* setup_menu_tlv)
-{
-       Server *s = NULL;
-       Storage *strg = NULL;
-       TcorePlugin *p = NULL;
-       int i = 0;
-       struct sat_mgr_cmd_q cmd_q;
-       struct treq_sat_terminal_rsp_data *tr = NULL;
-
-       p = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
-       if (!p){
-               dbg("there is no valid plugin at this point");
-               return;
-       }
-
-       s = tcore_plugin_ref_server(p);
-       if(!s){
-               dbg("there is no valid server at this point");
-               return;
-       }
-
-       strg = (Storage*)tcore_server_find_storage(s, "vconf");
-       if(!strg){
-               dbg("there is no valid storage plugin");
-               return;
-       }
-
-       /*Initialize Data*/
-       dbg("[SAT]  Set up Main Menu");
-       if((setup_menu_tlv->icon_id.is_exist) &&( setup_menu_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
-                       &&((setup_menu_tlv->alpha_id.is_exist == FALSE)||setup_menu_tlv->alpha_id.alpha_data_len == 0)) {
-               dbg( "[SAT]  exceptional case to fix gcf case 2.4 command not understood");
-               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
-               tr->cmd_number = setup_menu_tlv->command_detail.cmd_num;
-               tr->cmd_type = setup_menu_tlv->command_detail.cmd_type;
-               memcpy((void*)&tr->terminal_rsp_data.setup_menu.command_detail, &setup_menu_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
-               tr->terminal_rsp_data.setup_menu.device_id.src = setup_menu_tlv->device_id.dest;
-               tr->terminal_rsp_data.setup_menu.device_id.dest = setup_menu_tlv->device_id.src;
-               tr->terminal_rsp_data.setup_menu.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-               sat_mgr_send_terminal_response(ctx, NULL, NULL, tr);
-               if (tr)
-                       free(tr);
-               return;
-       }
-
-       if(ctx->pSatMainMenu != NULL) {
-               dbg( "[SAT]  updated SETUP MENU");
-               ctx->pSatMainMenu->bIsUpdatedSatMainMenu = TRUE;
-       }
-       else {
-               dbg( "[SAT]  first SETUP MENU");
-               ctx->pSatMainMenu = (TelSatSetupMenuInfo_t*)calloc(1, sizeof(TelSatSetupMenuInfo_t));
-               if(ctx->pSatMainMenu == NULL)
-                       dbg("[SAT]  Memory Allocation for SAT Main Menu Information Variable Failed");
-       }
-
-       ctx->pSatMainMenu->satMainMenuNum = setup_menu_tlv->menu_item_cnt;
-
-       /*One Item is mandatory*/
-       if( ctx->pSatMainMenu->satMainMenuNum == 1 && setup_menu_tlv->menu_item[0].text_len == 0 ) {/* remove the sat menu */
-               dbg("[SAT]  sat menu removed");
-               ctx->pSatMainMenu->satMainMenuNum = 0;
-       }
-       else {
-               switch (setup_menu_tlv->alpha_id.dcs.a_format) {
-                       case ALPHABET_FROMAT_SMS_DEFAULT :
-                               ctx->setup_menu_a_format = TAPI_SAT_ALPHABET_FORMAT_SMS_DEFAULT;
-                               break;
-
-                       case ALPHABET_FROMAT_8BIT_DATA :
-                               ctx->setup_menu_a_format = TAPI_SAT_ALPHABET_FORMAT_8BIT_DATA;
-                               break;
-
-                       case ALPHABET_FROMAT_UCS2 :
-                               ctx->setup_menu_a_format = TAPI_SAT_ALPHABET_FORMAT_UCS2;
-                               break;
-
-                       default :
-                               ctx->setup_menu_a_format = TAPI_SAT_ALPHABET_FORMAT_RESERVED;
-                               break;
-               }
-
-               if(ctx->pSatMainMenu->satMainMenuNum !=0) {
-                       if(setup_menu_tlv->alpha_id.alpha_data_len == 0) {
-                               /*Temporary Using*/
-                               dbg("error - NO MENU STRING");
-                       }
-                       else {
-                               /*      TODO DCS handling*/
-                               memcpy((void*)&ctx->pSatMainMenu->satMainTitle, setup_menu_tlv->alpha_id.alpha_data, setup_menu_tlv->alpha_id.alpha_data_len);
-                       }
-                       dbg("[SAT] satMainMenu.satMainTitle[%s]", ctx->pSatMainMenu->satMainTitle);
-
-                       if(setup_menu_tlv->next_act_ind_list.cnt == 0) {
-                               dbg( "[SAT]setup_menu_tlv->next_act_ind_list.cnt == 0");
-
-                               for(i = 0; i < ctx->pSatMainMenu->satMainMenuNum; i++) {
-                                       dbg( "[SAT] ctx->pSatMainMenu->satMainMenuItem[i].itemId[%d]", setup_menu_tlv->menu_item[i].item_id);
-                                       memset(ctx->pSatMainMenu->satMainMenuItem[i].itemString, 0x00, TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6);
-
-                                       if(setup_menu_tlv->alpha_id.alpha_data_len == 0)
-                                               setup_menu_tlv->alpha_id.dcs.a_format = ALPHABET_FROMAT_8BIT_DATA;
-                                       /*      TODO DCS handling*/
-                                       memcpy((void*)&ctx->pSatMainMenu->satMainMenuItem[i].itemString, setup_menu_tlv->menu_item[i].text, setup_menu_tlv->menu_item[i].text_len);
-
-                                       ctx->pSatMainMenu->satMainMenuItem[i].itemId = setup_menu_tlv->menu_item[i].item_id;
-                                       dbg("[SAT] item id[%d] satMainMenu.satMainMenuItem[i].itemString [%i] : [%s]",
-                                                       ctx->pSatMainMenu->satMainMenuItem[i].itemId , i,ctx->pSatMainMenu->satMainMenuItem[i].itemString);
-                               }
-                       }
-                       else {
-                               for(i = 0; i < ctx->pSatMainMenu->satMainMenuNum; i++) {
-                                       memset(ctx->pSatMainMenu->satMainMenuItem[i].itemString, 0x00, TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6);
-
-                                       if(setup_menu_tlv->alpha_id.alpha_data_len == 0)
-                                               setup_menu_tlv->alpha_id.dcs.a_format = ALPHABET_FROMAT_8BIT_DATA;
-                                       /*      TODO DCS handling*/
-                                       memcpy((void*)&ctx->pSatMainMenu->satMainMenuItem[i].itemString, setup_menu_tlv->menu_item[i].text, setup_menu_tlv->menu_item[i].text_len);
-
-                                       ctx->pSatMainMenu->satMainMenuItem[i].itemId = setup_menu_tlv->menu_item[i].item_id;
-                                       dbg("[SAT] satMainMenu.satMainMenuItem[i].itemString %i : %s\n", i,ctx->pSatMainMenu->satMainMenuItem[i].itemString);
-
-                                       if( setup_menu_tlv->next_act_ind_list.indicator_list[i]== TAPI_SAT_CMD_TYPE_SEND_SMS) {
-                                               strncat((char *)ctx->pSatMainMenu->satMainMenuItem[i].itemString," [Send SMS]", 11);
-                                       }
-                                       else if (setup_menu_tlv->next_act_ind_list.indicator_list[i]== TAPI_SAT_CMD_TYPE_SETUP_CALL) {
-                                               strncat((char *)ctx->pSatMainMenu->satMainMenuItem[i].itemString," [Set Up Call]", 14);
-                                       }
-                                       else if (setup_menu_tlv->next_act_ind_list.indicator_list[i]== TAPI_SAT_CMD_TYPE_LAUNCH_BROWSER){
-                                               strncat((char *)ctx->pSatMainMenu->satMainMenuItem[i].itemString," [Launch Browser]", 17);
-                                       }
-                                       else if (setup_menu_tlv->next_act_ind_list.indicator_list[i]== TAPI_SAT_CMD_TYPE_PROVIDE_LOCAL_INFO)    {
-                                               strncat((char *)ctx->pSatMainMenu->satMainMenuItem[i].itemString," [Provide Terminal Information]", 31);
-                                       }
-                                       else {
-                                               dbg("ItemNxtAction Ind=0x%x",setup_menu_tlv->next_act_ind_list.indicator_list[i]);
-                                       }
-                               }
-                       }
-                       ctx->pSatMainMenu->bIsSatMainMenuHelpInfo = setup_menu_tlv->command_detail.cmd_qualifier.setup_menu.help_info;
-               }
-               else {
-                       dbg("error - there is no menu item");
-                       return ;
-               }
-       }
-
-       /*Enqueue Data and Generate cmd_id*/
-       memset(&cmd_q, 0x00, sizeof(struct sat_mgr_cmd_q));
-       cmd_q.cmd_type = TAPI_SAT_CMD_TYPE_SETUP_MENU;
-       memcpy((void*)&(cmd_q.cmd_data.setupMenuInd), setup_menu_tlv, sizeof(struct tel_sat_setup_menu_tlv));
-       sat_mgr_enqueue_cmd(ctx, &cmd_q);
-       ctx->pSatMainMenu->commandId = cmd_q.cmd_id;
-
-/*
-       setup menu proactive cmd can occur after boot time.
-       so in that case, sat-ui should refresh about sat main menu list. for that, we publish event with main menu data.
-*/
-       ts_delivery_event(ctx->EvtDeliveryHandle,
-                                                                               TAPI_EVENT_CLASS_SAT,
-                                                                               TAPI_EVENT_SAT_SETUP_MENU_IND,
-                                                                               NULL,
-                                                                               0,
-                                                                               TAPI_API_SUCCESS,
-                                                                               sizeof(TelSatSetupMenuInfo_t),
-                                                                               (void *)ctx->pSatMainMenu);
-
-       tcore_storage_set_int(strg, STORAGE_KEY_TELEPHONY_SAT_STATE, STORAGE_VALUE_ON);
-}
-
-void sat_mgr_display_text_noti(struct custom_data *ctx,        struct tel_sat_display_text_tlv* display_text_tlv)
-{
-       TelSatDisplayTextInd_t* ad = NULL;
-       struct sat_mgr_cmd_q cmd_q;
-       unsigned int timer_duration = 0;
-       struct treq_sat_terminal_rsp_data *tr = NULL;
-
-       if ((display_text_tlv->icon_id.is_exist) && (display_text_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
-                       && (display_text_tlv->text.string_length == 0)) {
-               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
-               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
-               tr->cmd_number = display_text_tlv->command_detail.cmd_num;
-               tr->cmd_type = display_text_tlv->command_detail.cmd_type;
-               memcpy((void*)&tr->terminal_rsp_data.display_text.command_detail, &display_text_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
-               tr->terminal_rsp_data.display_text.device_id.src = display_text_tlv->device_id.dest;
-               tr->terminal_rsp_data.display_text.device_id.dest = display_text_tlv->device_id.src;
-               tr->terminal_rsp_data.display_text.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-               sat_mgr_send_terminal_response(ctx, NULL, NULL, tr);
-               if (tr)
-                       free(tr);
-               return;
-       }
-
-       ad = calloc(1, sizeof(TelSatDisplayTextInd_t));
-       if (!ad) {
-               dbg( "[SAT] ad malloc failed");
-               return;
-       }
-
-       dbg( "[SAT] immediate response requested is [%d]", display_text_tlv->immediate_response_requested);
-
-       if (display_text_tlv->immediate_response_requested == FALSE)
-               ad->bIsUserRespRequired = TRUE;
-
-       ad->bIsPriorityHigh = FALSE;
-       if (display_text_tlv->command_detail.cmd_qualifier.display_text.text_priority == TEXT_PRIORITY_HIGH)
-               ad->bIsPriorityHigh = TRUE;
-
-       /*1.Text Data*/
-       /*      TODO DCS handling*/
-       ad->text.stringLen = display_text_tlv->text.string_length;
-       memcpy((void*)&ad->text.string, display_text_tlv->text.string, ad->text.stringLen);
-       ad->text.string[ad->text.stringLen] = '\0';
-
-       /*2.Icon*/
-       /*      TODO icon handling*/
-
-       /*3.Display Duration*/
-       /*default duration value is zero - sustain the text*/
-       timer_duration = _get_time_in_ms(&display_text_tlv->duration);
-       if (display_text_tlv->command_detail.cmd_qualifier.display_text.text_clear_type == TEXT_AUTO_CLEAR_MSG_AFTER_A_DELAY) {
-               if (timer_duration > 0)
-                       ad->duration = timer_duration;
-               else
-                       ad->duration = 15000; // 15 sec - default.
-       }
-       else {
-               if (display_text_tlv->immediate_response_requested == FALSE) {
-                       if (timer_duration > 0)
-                               ad->duration = timer_duration;
-                       else
-                               ad->duration = SAT_TIME_OUT; // 1 min   - default no resp time.
-               }
-       }
-
-       /* ETSI TS 102 223 6.4.1 DISPLAY TEXT
-        If help information is requested by the user, this command may be used to display help information on the screen. The
-        help information should be sent as high priority text and with the option that it should be cleared after a short delay.
-        */
-       if (ctx->help_requested == TRUE) {
-               ad->bIsPriorityHigh = TRUE;
-               ad->duration = 7000;
-               ctx->help_requested = FALSE;
-       }
-
-       /*Enqueue Data and Generate commandId*/
-       memset(&cmd_q, 0x00, sizeof(struct sat_mgr_cmd_q));
-       cmd_q.cmd_type = TAPI_SAT_CMD_TYPE_DISPLAY_TEXT;
-       memcpy((void*)&(cmd_q.cmd_data.displayTextInd), display_text_tlv, sizeof(struct tel_sat_display_text_tlv));
-       sat_mgr_enqueue_cmd(ctx, &cmd_q);
-       ad->commandId = cmd_q.cmd_id;
-
-       ts_delivery_event(ctx->EvtDeliveryHandle,
-                                                                               TAPI_EVENT_CLASS_SAT,
-                                                                               TAPI_EVENT_SAT_DISPLAY_TEXT_IND,
-                                                                               NULL,
-                                                                               0,
-                                                                               TAPI_API_SUCCESS,
-                                                                               sizeof(TelSatDisplayTextInd_t),
-                                                                               (void *)ad);
-       if (ad)
-               free(ad);
-}
-
-void sat_mgr_select_item_noti(struct custom_data *ctx, struct tel_sat_select_item_tlv* select_item_tlv)
-{
-       TelSatSelectItemInd_t* ad = NULL;
-       struct sat_mgr_cmd_q cmd_q;
-       struct treq_sat_terminal_rsp_data *tr = NULL;
-       int i = 0, tmp_len = 0;
-
-       if ((select_item_tlv->icon_id.is_exist) && (select_item_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
-                       && ((select_item_tlv->alpha_id.is_exist == FALSE) || select_item_tlv->alpha_id.alpha_data_len == 0)) {
-               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
-               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
-               tr->cmd_number = select_item_tlv->command_detail.cmd_num;
-               tr->cmd_type = select_item_tlv->command_detail.cmd_type;
-               memcpy((void*)&tr->terminal_rsp_data.select_item.command_detail, &select_item_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
-               tr->terminal_rsp_data.select_item.device_id.src = select_item_tlv->device_id.dest;
-               tr->terminal_rsp_data.select_item.device_id.dest = select_item_tlv->device_id.src;
-               tr->terminal_rsp_data.select_item.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-               sat_mgr_send_terminal_response(ctx, NULL, NULL, tr);
-               if (tr)
-                       free(tr);
-               return;
-       }
-
-       ad = calloc(1, sizeof(TelSatSelectItemInd_t));
-       if (!ad) {
-               dbg( "[SAT]  ad malloc failed");
-               return;
-       }
-
-       /*Enqueue Data and Generate commandId*/
-       memset(&cmd_q, 0x00, sizeof(struct sat_mgr_cmd_q));
-       cmd_q.cmd_type = TAPI_SAT_CMD_TYPE_SELECT_ITEM;
-       memcpy((void*)&(cmd_q.cmd_data.selectItemInd), select_item_tlv, sizeof(struct tel_sat_select_item_tlv));
-       sat_mgr_enqueue_cmd(ctx, &cmd_q);
-       ad->commandId = cmd_q.cmd_id;
-
-       dbg( "[SAT]  commandId in Queue[%d]", cmd_q.cmd_id);
-
-       /*Help Info*/
-       ad->bIsHelpInfoAvailable = select_item_tlv->command_detail.cmd_qualifier.select_item.help_info;
-
-       if (select_item_tlv->alpha_id.is_exist == TRUE) {
-               /*      TODO DCS handling*/
-               ad->text.stringLen = select_item_tlv->alpha_id.alpha_data_len;
-               memcpy((void*) ad->text.string, select_item_tlv->alpha_id.alpha_data, ad->text.stringLen);
-       }
-
-       for (i = 0; i < select_item_tlv->menu_item_cnt; i++) {
-               ad->menuItem[i].itemId = select_item_tlv->menu_item[i].item_id;
-               if (ctx->setup_menu_a_format == TAPI_SAT_ALPHABET_FORMAT_UCS2) {
-                       dbg("DCS is UCS2");
-                       /*      TODO DCS handling*/
-               }
-               else {
-                       /*      TODO DCS handling*/
-                       ad->menuItem[i].textLen = _get_string_length(select_item_tlv->menu_item[i].text, TAPI_SAT_ITEM_TEXT_LEN_MAX);
-                       memcpy((void*)ad->menuItem[i].text, select_item_tlv->menu_item[i].text, ad->menuItem[i].textLen);
-               }
-               dbg( "[SAT] Item[%d],text[%s]", i, ad->menuItem[i].text);
-       }
-
-       if (select_item_tlv->item_next_act_ind_list.cnt == 0) {
-               for (i = 0; i < select_item_tlv->menu_item_cnt; i++) {
-                       ad->menuItem[i].itemId = select_item_tlv->menu_item[i].item_id;
-                       ad->menuItem[i].textLen = _get_string_length(select_item_tlv->menu_item[i].text, TAPI_SAT_ITEM_TEXT_LEN_MAX);
-                       dbg( "[SAT] Item [%d]:text=[%s]", i, ad->menuItem[i].text);
-               }
-       }
-       else {
-               for (i = 0; i < select_item_tlv->menu_item_cnt; i++) {
-                       ad->menuItem[i].itemId = select_item_tlv->menu_item[i].item_id;
-                       memset(ad->menuItem[i].text, 0x00, (TAPI_SAT_ITEM_TEXT_LEN_MAX + 1));
-                       tmp_len = _get_string_length(select_item_tlv->menu_item[i].text, (TAPI_SAT_ITEM_TEXT_LEN_MAX + 1));
-                       memcpy((void*)ad->menuItem[i].text, select_item_tlv->menu_item[i].text, tmp_len);
-
-                       if (select_item_tlv->item_next_act_ind_list.indicator_list[i] == TAPI_SAT_CMD_TYPE_SEND_SMS) {
-                               strncat((char *) ad->menuItem[i].text, " [Send SMS]", 11);
-                       }
-                       else if (select_item_tlv->item_next_act_ind_list.indicator_list[i] == TAPI_SAT_CMD_TYPE_SETUP_CALL) {
-                               strncat((char *) ad->menuItem[i].text, " [Set Up Call]", 14);
-                       }
-                       else if (select_item_tlv->item_next_act_ind_list.indicator_list[i] == TAPI_SAT_CMD_TYPE_LAUNCH_BROWSER) {
-                               strncat((char *) ad->menuItem[i].text, " [Launch Browser]", 17);
-                       }
-                       else if (select_item_tlv->item_next_act_ind_list.indicator_list[i] == TAPI_SAT_CMD_TYPE_PROVIDE_LOCAL_INFO) {
-                               strncat((char *) ad->menuItem[i].text, " [Provide Terminal Information]", 31);
-                       }
-                       else {
-                               dbg( "ItemNxtAction Ind=[0x%x]",        select_item_tlv->item_next_act_ind_list.indicator_list[i]);
-                       }
-                       ad->menuItem[i].textLen = strlen((char *) ad->menuItem[i].text);
-               }
-       }
-
-       ad->menuItemCount = select_item_tlv->menu_item_cnt;
-       dbg( "[SAT] ad->menuItemCount[%d]", ad->menuItemCount);
-
-       /*Default item*/
-       ad->defaultItemIndex = select_item_tlv->item_identifier.item_identifier;
-       dbg( "[SAT] ad->defaultItemIndex[%d]", ad->defaultItemIndex);
-
-       ts_delivery_event(ctx->EvtDeliveryHandle,
-                                                                               TAPI_EVENT_CLASS_SAT,
-                                                                               TAPI_EVENT_SAT_SELECT_ITEM_IND,
-                                                                               NULL,
-                                                                               0,
-                                                                               TAPI_API_SUCCESS,
-                                                                               sizeof(TelSatSelectItemInd_t),
-                                                                               (void *)ad);
-       if (ad)
-               free(ad);
-}
-
-void sat_mgr_get_inkey_noti(struct custom_data *ctx, struct tel_sat_get_inkey_tlv* get_inkey_tlv)
-{
-       TelSatGetInkeyInd_t* ad = NULL;
-       struct sat_mgr_cmd_q cmd_q;
-       unsigned int timer_duration = 0;
-       struct treq_sat_terminal_rsp_data *tr = NULL;
-
-       if ((get_inkey_tlv->icon_id.is_exist)
-                       && (get_inkey_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
-                       && (get_inkey_tlv->text.string_length == 0)) {
-               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
-               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
-               tr->cmd_number = get_inkey_tlv->command_detail.cmd_num;
-               tr->cmd_type = get_inkey_tlv->command_detail.cmd_type;
-               memcpy((void*)&tr->terminal_rsp_data.get_inkey.command_detail, &get_inkey_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
-               tr->terminal_rsp_data.get_inkey.device_id.src = get_inkey_tlv->device_id.dest;
-               tr->terminal_rsp_data.get_inkey.device_id.dest = get_inkey_tlv->device_id.src;
-               tr->terminal_rsp_data.get_inkey.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-               sat_mgr_send_terminal_response(ctx, NULL, NULL, tr);
-       }
-
-       ad = calloc(1, sizeof(TelSatGetInkeyInd_t));
-       if (!ad) {
-               dbg( "[SAT]  ad malloc failed");
-               return;
-       }
-       /*       icon */
-       /*      TODO icon handling*/
-
-       /* duration*/
-       timer_duration = _get_time_in_ms(&get_inkey_tlv->duration);
-       if (timer_duration > 0)
-               ad->duration = timer_duration;
-       else
-               ad->duration = SAT_TIME_OUT; // 15 sec  - default.
-
-       /*key type*/
-       if (get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.inkey_type == INKEY_TYPE_CHARACTER_SET_ENABLED)
-               ad->keyType = TAPI_SAT_INKEY_TYPE_CHARACTER_SET_ENABLED;
-       else
-               ad->keyType = TAPI_SAT_INKEY_TYPE_YES_NO_REQUESTED;
-
-       /*input mode -if input char is numeric, no need to check input mode*/
-       if (get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.alphabet_type == INPUT_ALPHABET_TYPE_SMS_DEFAULT)
-               ad->inputCharMode = TAPI_SAT_USER_INPUT_ALPHABET_TYPE_SMS_DEFAULT;
-       else
-               ad->inputCharMode = TAPI_SAT_USER_INPUT_ALPHABET_TYPE_UCS2;
-
-       /*Numeric*/
-       ad->bIsNumeric = (!get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.alphabet_set);
-       /*help information*/
-       ad->bIsHelpInfoAvailable =get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.help_info;
-       /*text*/
-       /*      TODO DCS handling*/
-       ad->text.stringLen = get_inkey_tlv->text.string_length;
-       memcpy((void*)ad->text.string, get_inkey_tlv->text.string, ad->text.stringLen);
-       ad->text.string[ad->text.stringLen] = '\0';
-       dbg("[SAT] ad->text.string[%s]", ad->text.string);
-
-       if (get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.immediate_rsp_required) {
-               dbg("get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.immediate_rsp_require is TRUE");
-               //Send TR if UI display success
-       }
-
-       /*Enqueue Data and Generate commandId*/
-       memset(&cmd_q, 0x00, sizeof(struct sat_mgr_cmd_q));
-       cmd_q.cmd_type = TAPI_SAT_CMD_TYPE_GET_INKEY;
-       memcpy((void*)&(cmd_q.cmd_data.getInkeyInd), get_inkey_tlv, sizeof(struct tel_sat_get_inkey_tlv));
-       sat_mgr_enqueue_cmd(ctx, &cmd_q);
-       ad->commandId = cmd_q.cmd_id;
-
-       ts_delivery_event(ctx->EvtDeliveryHandle,
-                                                                               TAPI_EVENT_CLASS_SAT,
-                                                                               TAPI_EVENT_SAT_GET_INKEY_IND,
-                                                                               NULL,
-                                                                               0,
-                                                                               TAPI_API_SUCCESS,
-                                                                               sizeof(TelSatGetInkeyInd_t),
-                                                                               (void *)ad);
-       if (ad)
-               free(ad);
-}
-
-void sat_mgr_get_input_noti(struct custom_data *ctx, struct tel_sat_get_input_tlv* get_input_tlv)
-{
-       TelSatGetInputInd_t* ad = NULL;
-       struct sat_mgr_cmd_q cmd_q;
-       struct treq_sat_terminal_rsp_data *tr = NULL;
-
-       if ((get_input_tlv->icon_id.is_exist)
-                       && (get_input_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
-                       && (get_input_tlv->text.string_length == 0)) {
-               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
-               tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
-               tr->cmd_number = get_input_tlv->command_detail.cmd_num;
-               tr->cmd_type = get_input_tlv->command_detail.cmd_type;
-               memcpy((void*)&tr->terminal_rsp_data.get_input.command_detail, &get_input_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
-               tr->terminal_rsp_data.get_input.device_id.src = get_input_tlv->device_id.dest;
-               tr->terminal_rsp_data.get_input.device_id.dest = get_input_tlv->device_id.src;
-               tr->terminal_rsp_data.get_input.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-               sat_mgr_send_terminal_response(ctx, NULL, NULL, tr);
-       }
-
-       ad = calloc(1, sizeof(TelSatGetInputInd_t));
-       if (!ad) {
-               dbg( "[SAT]  ad malloc failed");
-               return;
-       }
-
-       dbg( "[SAT]  is SMS7 packing required [%d]",get_input_tlv->command_detail.cmd_qualifier.get_input.user_input_unpacked_format);
-
-       /* icon*/
-
-       /*input mode*/
-       if (get_input_tlv->command_detail.cmd_qualifier.get_input.alphabet_type == INPUT_ALPHABET_TYPE_SMS_DEFAULT)
-               ad->inputCharMode = TAPI_SAT_USER_INPUT_ALPHABET_TYPE_SMS_DEFAULT;
-       else
-               ad->inputCharMode = TAPI_SAT_USER_INPUT_ALPHABET_TYPE_UCS2;
-       /*Is input Numeric?*/
-       ad->bIsNumeric = (!get_input_tlv->command_detail.cmd_qualifier.get_input.alphabet_set);
-       /*help information*/
-       ad->bIsHelpInfoAvailable = get_input_tlv->command_detail.cmd_qualifier.get_input.help_info;
-       /*echo input*/
-       ad->bIsEchoInput = get_input_tlv->command_detail.cmd_qualifier.get_input.me_echo_user_input;
-
-       /*text*/
-       /*      TODO DCS handling*/
-       ad->text.stringLen = get_input_tlv->text.string_length;
-       memcpy((void*)ad->text.string, get_input_tlv->text.string, ad->text.stringLen);
-       ad->text.string[ad->text.stringLen] = '\0';
-
-       /*default text*/
-       /*      TODO DCS handling*/
-       ad->defaultText.stringLen = get_input_tlv->default_text.string_length;
-       memcpy((void*)ad->defaultText.string, get_input_tlv->default_text.string, ad->defaultText.stringLen);
-       ad->defaultText.string[ad->defaultText.stringLen] = '\0';
-
-       /*min, max value*/
-       ad->respLen.max = get_input_tlv->rsp_len.max;
-       ad->respLen.min = get_input_tlv->rsp_len.min;
-
-       /*Enqueue Data and Generate commandId*/
-       memset(&cmd_q, 0x00, sizeof(struct sat_mgr_cmd_q));
-       cmd_q.cmd_type = TAPI_SAT_CMD_TYPE_GET_INPUT;
-       memcpy((void*)&(cmd_q.cmd_data.getInputInd), get_input_tlv, sizeof(struct tel_sat_get_input_tlv));
-       sat_mgr_enqueue_cmd(ctx, &cmd_q);
-       ad->commandId = cmd_q.cmd_id;
-
-       ts_delivery_event(ctx->EvtDeliveryHandle,
-                                                                               TAPI_EVENT_CLASS_SAT,
-                                                                               TAPI_EVENT_SAT_GET_INPUT_IND,
-                                                                               NULL,
-                                                                               0,
-                                                                               TAPI_API_SUCCESS,
-                                                                               sizeof(TelSatGetInputInd_t),
-                                                                               (void *)ad);
-       if (ad)
-               free(ad);
-}
-
-static TapiResult_t _sat_mgr_app_exec_result_display_text(struct custom_data *ctx, TcorePlugin *p, char *conn_name, TelSatDiplayTextRetInfo_t* ret_status, int cmd_id)
-{
-       struct treq_sat_terminal_rsp_data tr;
-       struct sat_mgr_cmd_q cmd_q;
-
-       memset(&tr, 0x00, sizeof(struct treq_sat_terminal_rsp_data));
-       memset(&cmd_q, 0x00, sizeof(struct sat_mgr_cmd_q));
-
-       if (sat_mgr_dequeue_cmd(ctx, &cmd_q, cmd_id) == FALSE) {
-               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
-               return TAPI_API_SAT_INVALID_COMMAND_ID;
-       }
-
-       tr.cmd_number = cmd_q.cmd_data.displayTextInd.command_detail.cmd_num;
-       tr.cmd_type = cmd_q.cmd_data.displayTextInd.command_detail.cmd_type;
-       memcpy((void*)&tr.terminal_rsp_data.display_text.command_detail, &cmd_q.cmd_data.displayTextInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-       tr.terminal_rsp_data.display_text.device_id.src = cmd_q.cmd_data.displayTextInd.device_id.dest;
-       tr.terminal_rsp_data.display_text.device_id.dest = cmd_q.cmd_data.displayTextInd.device_id.src;
-
-       switch (ret_status->resp) {
-               case TAPI_SAT_R_SUCCESS:
-                       if (cmd_q.cmd_data.displayTextInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
-                               tr.terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-                       else
-                               tr.terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
-
-                       tr.terminal_rsp_data.display_text.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
-                       break;
-
-               case TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND:
-                       tr.terminal_rsp_data.display_text.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
-                       tr.terminal_rsp_data.display_text.me_problem_type = _get_tcore_me_problem_type(ret_status->meProblem);
-                       break;
-
-               default:
-                       dbg("[SAT] Wrong result from  app ret_status->resp[%d]", ret_status->resp);
-                       break;
-       }
-       return sat_mgr_send_terminal_response(ctx, p, conn_name, &tr);
-}
-
-static TapiResult_t _sat_mgr_app_exec_result_setup_menu(struct custom_data *ctx, TcorePlugin *p, char *conn_name, TelSatSetupMenuRetInfo_t* ret_status, int cmd_id)
-{
-       struct treq_sat_terminal_rsp_data tr;
-       struct sat_mgr_cmd_q cmd_q;
-
-       dbg("[SAT]cmd_id[%d]", cmd_id);
-
-       memset(&tr, 0x00, sizeof(struct treq_sat_terminal_rsp_data));
-       memset(&cmd_q, 0x00, sizeof(struct sat_mgr_cmd_q));
-
-       if (sat_mgr_dequeue_cmd(ctx, &cmd_q, cmd_id) == FALSE) {
-               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
-               return TAPI_API_SAT_INVALID_COMMAND_ID;
-       }
-
-       tr.cmd_number = cmd_q.cmd_data.setupMenuInd.command_detail.cmd_num;
-       tr.cmd_type = cmd_q.cmd_data.setupMenuInd.command_detail.cmd_type;
-       memcpy((void*)&tr.terminal_rsp_data.setup_menu.command_detail, &cmd_q.cmd_data.setupMenuInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-       tr.terminal_rsp_data.setup_menu.device_id.src = cmd_q.cmd_data.setupMenuInd.device_id.dest;
-       tr.terminal_rsp_data.setup_menu.device_id.dest = cmd_q.cmd_data.setupMenuInd.device_id.src;
-
-       switch (ret_status->resp) {
-               case TAPI_SAT_R_SUCCESS:
-                       if (cmd_q.cmd_data.setupMenuInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
-                               tr.terminal_rsp_data.setup_menu.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-                       else
-                               tr.terminal_rsp_data.setup_menu.result_type = RESULT_SUCCESS;
-
-                       tr.terminal_rsp_data.setup_menu.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
-                       break;
-
-               case TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND:
-                       tr.terminal_rsp_data.setup_menu.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
-                       tr.terminal_rsp_data.setup_menu.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
-                       break;
-
-               default:
-                       dbg("[SAT] Wrong result from app ret_status->resp=[%d]", ret_status->resp);
-                       break;
-       }
-       return sat_mgr_send_terminal_response(ctx, p, conn_name, &tr);
-}
-
-TapiResult_t sat_mgr_handle_app_exec_result(struct custom_data *ctx, TcorePlugin *p, char *conn_name, TelSatAppsRetInfo_t* app_result)
-{
-       TapiResult_t rt = TAPI_API_SUCCESS;
-       dbg("[SAT] Enter app_result->Command Type =[0x%x] ID=[0x%x]", app_result->commandType, app_result->commandId);
-
-       switch (app_result->commandType) {
-               case TAPI_SAT_CMD_TYPE_SETUP_MENU:
-                       rt = _sat_mgr_app_exec_result_setup_menu(ctx, p, conn_name, &(app_result->appsRet.setupMenu), app_result->commandId);
-                       break;
-
-               case TAPI_SAT_CMD_TYPE_DISPLAY_TEXT:
-                       rt = _sat_mgr_app_exec_result_display_text(ctx, p, conn_name, &(app_result->appsRet.displayText), app_result->commandId);
-                       break;
-
-               default:
-                       dbg("[SAT] Invalid app_result->commandType =[%d]", app_result->commandType);
-                       rt = TAPI_API_SERVER_FAILURE;
-                       break;
-       }
-       return rt;
-}
-
-static TapiResult_t _user_confirm_menu_select(struct custom_data *ctx, TcorePlugin *p, char *conn_name, TelSatUiUserConfirmInfo_t *cnf, unsigned char*additional_data, unsigned short ad_data_length)
-{
-       struct sat_mgr_cmd_q cmd_q;
-       struct treq_sat_terminal_rsp_data tr;
-
-       memset(&cmd_q, 0x00, sizeof(struct sat_mgr_cmd_q));
-       memset(&tr, 0x00, sizeof(struct treq_sat_terminal_rsp_data));
-
-       if (!sat_mgr_dequeue_cmd(ctx, &cmd_q, cnf->commandId)) {
-               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
-               return TAPI_API_SAT_INVALID_COMMAND_ID;
-       }
-
-       tr.cmd_number = cmd_q.cmd_data.selectItemInd.command_detail.cmd_num;
-       tr.cmd_type = cmd_q.cmd_data.selectItemInd.command_detail.cmd_type;
-       memcpy((void*)&tr.terminal_rsp_data.select_item.command_detail, &cmd_q.cmd_data.selectItemInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-       tr.terminal_rsp_data.select_item.device_id.src = DEVICE_ID_ME;
-       tr.terminal_rsp_data.select_item.device_id.dest = DEVICE_ID_SIM;
-
-       switch (cnf->keyType) {
-               case TAPI_SAT_USER_CONFIRM_YES:
-                       tr.terminal_rsp_data.select_item.item_identifier.item_identifier = additional_data[0];
-                       dbg("[SAT] additional_data[0]= %d", additional_data[0]);
-                       tr.terminal_rsp_data.select_item.other_info = FALSE;
-
-                       if (cmd_q.cmd_data.selectItemInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
-                               tr.terminal_rsp_data.select_item.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-                       else
-                               tr.terminal_rsp_data.select_item.result_type = RESULT_SUCCESS;
-
-                       tr.terminal_rsp_data.select_item.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_HELP_INFO:
-                       tr.terminal_rsp_data.select_item.item_identifier.item_identifier = additional_data[0];
-                       tr.terminal_rsp_data.select_item.other_info = FALSE;
-                       tr.terminal_rsp_data.select_item.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
-                       tr.terminal_rsp_data.select_item.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
-                       ctx->help_requested = TRUE;
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_END:
-                       tr.terminal_rsp_data.select_item.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_NO_OR_CANCEL:
-                       tr.terminal_rsp_data.select_item.result_type = RESULT_BACKWARD_MOVE_BY_USER;
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_TIMEOUT:
-                       tr.terminal_rsp_data.select_item.result_type = RESULT_NO_RESPONSE_FROM_USER;
-                       break;
-
-               default:
-                       dbg("not handled value[%d] here", cnf->keyType);
-                       break;
-       }
-       dbg("[SAT] generalResult = [x%x]", tr.terminal_rsp_data.select_item.result_type);
-       dbg("tr.terminal_rsp_data.select_item.item_identifier.item_identifier=%d",tr.terminal_rsp_data.select_item.item_identifier.item_identifier);
-       return sat_mgr_send_terminal_response(ctx, p, conn_name, &tr);
-}
-
-static TapiResult_t _user_confirm_display_text(struct custom_data *ctx, TcorePlugin *p, char *conn_name, TelSatUiUserConfirmInfo_t *cnf, unsigned char*additional_data, unsigned short ad_data_length)
-{
-       struct sat_mgr_cmd_q cmd_q;
-       struct treq_sat_terminal_rsp_data tr;
-
-       memset(&cmd_q, 0x00, sizeof(struct sat_mgr_cmd_q));
-       memset(&tr, 0x00, sizeof(struct treq_sat_terminal_rsp_data));
-
-       if (sat_mgr_dequeue_cmd(ctx, &cmd_q, cnf->commandId) == FALSE) {
-               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
-               return TAPI_API_SAT_INVALID_COMMAND_ID;
-       }
-
-       if (cmd_q.cmd_data.displayTextInd.immediate_response_requested == TRUE)
-               return TAPI_API_SUCCESS;
-
-       tr.cmd_number = cmd_q.cmd_data.displayTextInd.command_detail.cmd_num;
-       tr.cmd_type = cmd_q.cmd_data.displayTextInd.command_detail.cmd_type;
-       memcpy((void*)&tr.terminal_rsp_data.display_text.command_detail, &cmd_q.cmd_data.displayTextInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-       tr.terminal_rsp_data.select_item.device_id.src = DEVICE_ID_ME;
-       tr.terminal_rsp_data.select_item.device_id.dest = DEVICE_ID_SIM;
-
-       switch (cnf->keyType) {
-               case TAPI_SAT_USER_CONFIRM_YES: {
-                       dbg("[SAT] cmd_q.cmd_data.displayTextInd.immediate_response_requested[%d]", cmd_q.cmd_data.displayTextInd.immediate_response_requested);
-
-                       if (cmd_q.cmd_data.displayTextInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
-                               tr.terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-                       else
-                               tr.terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
-
-                       tr.terminal_rsp_data.display_text.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
-               }break;
-
-               case TAPI_SAT_USER_CONFIRM_NO_OR_CANCEL:
-                       tr.terminal_rsp_data.display_text.result_type = TAPI_SAT_R_BACKWARD_MOVE_BY_USER;
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_TIMEOUT:
-                       if (cmd_q.cmd_data.displayTextInd.command_detail.cmd_qualifier.display_text.text_clear_type == TEXT_WAIT_FOR_USER_TO_CLEAR_MSG )
-                               tr.terminal_rsp_data.display_text.result_type = RESULT_NO_RESPONSE_FROM_USER;
-                       tr.terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_END:
-                       tr.terminal_rsp_data.display_text.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_HELP_INFO:
-               default:
-                       dbg("not handled value[%d] here", cnf->keyType);
-                       break;
-       }
-       return sat_mgr_send_terminal_response(ctx, p, conn_name, &tr);
-}
-
-static TapiResult_t _user_confirm_get_inkey(struct custom_data *ctx, TcorePlugin *p, char *conn_name, TelSatUiUserConfirmInfo_t *cnf, unsigned char*additional_data, unsigned short ad_data_length)
-{
-       TapiResult_t rt = TAPI_API_SUCCESS;
-       struct sat_mgr_cmd_q cmd_q;
-       struct treq_sat_terminal_rsp_data tr;
-
-       memset(&cmd_q, 0x00, sizeof(struct sat_mgr_cmd_q));
-       memset(&tr, 0x00, sizeof(struct treq_sat_terminal_rsp_data));
-
-       if (sat_mgr_dequeue_cmd(ctx, &cmd_q, cnf->commandId) == FALSE) {
-               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
-               return TAPI_API_SAT_INVALID_COMMAND_ID;
-       }
-
-       tr.cmd_number = cmd_q.cmd_data.getInkeyInd.command_detail.cmd_num;
-       tr.cmd_type = cmd_q.cmd_data.getInkeyInd.command_detail.cmd_type;
-       memcpy((void*)&tr.terminal_rsp_data.get_inkey.command_detail, &cmd_q.cmd_data.getInkeyInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-       tr.terminal_rsp_data.select_item.device_id.src = DEVICE_ID_ME;
-       tr.terminal_rsp_data.select_item.device_id.dest = DEVICE_ID_SIM;
-
-       switch (cnf->keyType) {
-               case TAPI_SAT_USER_CONFIRM_YES:
-                       if (cmd_q.cmd_data.getInkeyInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
-                               tr.terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-                       else
-                               tr.terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS;
-
-                       if (cmd_q.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.inkey_type == INKEY_TYPE_YES_NO_REQUESTED) {
-                               tr.terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
-                               tr.terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FROMAT_8BIT_DATA;
-                               tr.terminal_rsp_data.get_inkey.text.string_length = 1;
-                               tr.terminal_rsp_data.get_inkey.text.string[0] = 0x01;
-                       }
-                       else if (ad_data_length > 0) {
-                               tr.terminal_rsp_data.get_inkey.text.string_length = ad_data_length;
-                               /*Set the input mode*/
-                               if (cmd_q.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_set == FALSE) {
-                                       tr.terminal_rsp_data.get_inkey.text.is_digit_only = TRUE;
-                                       tr.terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FROMAT_8BIT_DATA;
-                                       tr.terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
-                                       /*      TODO DCS handling*/
-                                       memcpy((void*)tr.terminal_rsp_data.get_inkey.text.string, additional_data, ad_data_length);
-                               }
-                               else {
-                                       tr.terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
-
-                                       if(cmd_q.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_type == INPUT_ALPHABET_TYPE_SMS_DEFAULT )
-                                               tr.terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FROMAT_SMS_DEFAULT;
-                                       else if(cmd_q.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_type == INPUT_ALPHABET_TYPE_UCS2 )
-                                               tr.terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FROMAT_UCS2;
-                                       else
-                                               tr.terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FROMAT_RESERVED;
-
-                                       if (tr.terminal_rsp_data.get_inkey.text.dcs.a_format == ALPHABET_FROMAT_UCS2) {
-                                               dbg("UCS2 DATA");
-                                               /*      TODO DCS handling*/
-                                               tr.terminal_rsp_data.get_inkey.text.string_length = ad_data_length;
-                                               memcpy((void*)tr.terminal_rsp_data.get_inkey.text.string, additional_data, ad_data_length);
-                                       }
-                                       else if (tr.terminal_rsp_data.get_inkey.text.dcs.a_format       == ALPHABET_FROMAT_SMS_DEFAULT) {
-                                               dbg("GSM7 packed DATA");
-                                               /*      TODO DCS handling*/
-                                               memcpy((void*)tr.terminal_rsp_data.get_inkey.text.string, additional_data, ad_data_length);
-                                       }
-                                       else {
-                                               dbg("[SAT] invalid DCS[%d]",tr.terminal_rsp_data.get_inkey.text.dcs.a_format);
-                                       }
-                               }
-                       }
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_HELP_INFO:
-                       tr.terminal_rsp_data.get_inkey.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
-                       ctx->help_requested = TRUE;
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_NO_OR_CANCEL:
-                       if (cmd_q.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.inkey_type        == INKEY_TYPE_YES_NO_REQUESTED) {
-                               tr.terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS;
-                               tr.terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
-                               tr.terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FROMAT_8BIT_DATA;
-                               tr.terminal_rsp_data.get_inkey.text.string_length = 1;
-                               tr.terminal_rsp_data.get_inkey.text.string[0] = 0x00;
-                       }
-                       else {
-                               tr.terminal_rsp_data.get_inkey.result_type = RESULT_BACKWARD_MOVE_BY_USER;
-                       }
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_TIMEOUT:
-                       tr.terminal_rsp_data.get_inkey.result_type = RESULT_NO_RESPONSE_FROM_USER;
-                       if (cmd_q.cmd_data.getInkeyInd.duration.time_interval > 0) {
-                               tr.terminal_rsp_data.get_inkey.duration.time_interval = cmd_q.cmd_data.getInkeyInd.duration.time_interval;
-                               tr.terminal_rsp_data.get_inkey.duration.time_unit = cmd_q.cmd_data.getInkeyInd.duration.time_unit;
-                       }
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_END:
-                       tr.terminal_rsp_data.get_inkey.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
-                       break;
-
-               default:
-                       dbg("not handled value[%d] here", cnf->keyType);
-                       break;
-       }
-       dbg("tr.terminal_rsp_data.get_inkey.text.string=[%s]",tr.terminal_rsp_data.get_inkey.text.string);
-       rt = sat_mgr_send_terminal_response(ctx, p, conn_name, &tr);;
-       return rt;
-}
-
-static TapiResult_t _user_confirm_get_input(struct custom_data *ctx, TcorePlugin *p, char *conn_name, TelSatUiUserConfirmInfo_t *cnf, unsigned char*additional_data, unsigned short ad_data_length)
-{
-       TapiResult_t rt = TAPI_API_SUCCESS;
-       struct sat_mgr_cmd_q cmd_q;
-       struct treq_sat_terminal_rsp_data tr;
-       unsigned char* packing_data = NULL;
-       unsigned short packing_data_len = 0; //7Bit Packing is needed
-
-       memset(&cmd_q, 0x00, sizeof(struct sat_mgr_cmd_q));
-       memset(&tr, 0x00, sizeof(struct treq_sat_terminal_rsp_data));
-
-       if (sat_mgr_dequeue_cmd(ctx, &cmd_q, cnf->commandId) == FALSE) {
-               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
-               return TAPI_API_SAT_INVALID_COMMAND_ID;
-       }
-
-       tr.cmd_number = cmd_q.cmd_data.getInputInd.command_detail.cmd_num;
-       tr.cmd_type = cmd_q.cmd_data.getInputInd.command_detail.cmd_type;
-       memcpy((void*)&tr.terminal_rsp_data.get_input.command_detail, &cmd_q.cmd_data.getInputInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-       tr.terminal_rsp_data.select_item.device_id.src = DEVICE_ID_ME;
-       tr.terminal_rsp_data.select_item.device_id.dest = DEVICE_ID_SIM;
-
-       switch (cnf->keyType) {
-               case TAPI_SAT_USER_CONFIRM_YES:
-                       if (cmd_q.cmd_data.getInputInd.command_detail.cmd_qualifier.get_input.alphabet_set      == FALSE) {
-                               dbg("[SAT] alphabet set used");
-                               tr.terminal_rsp_data.get_input.text.is_digit_only = TRUE;
-                       }
-                       tr.terminal_rsp_data.get_input.text.dcs.m_class = MSG_CLASS_RESERVED;
-                       //SMS-Default-Data
-                       if (cmd_q.cmd_data.getInputInd.command_detail.cmd_qualifier.get_input.user_input_unpacked_format        == FALSE) {
-                               dbg("[SAT] packing to SMS7 default");
-                               packing_data = calloc(1, sizeof(unsigned char));
-                               if (packing_data == NULL) {
-                                       dbg("[SAT] packing_data malloc failed\n");
-                                       return TAPI_API_OPERATION_FAILED;
-                               }
-
-                               if (ad_data_length != 0) {
-                                       /*      TODO DCS handling*/
-                                       memcpy((void*)&tr.terminal_rsp_data.get_input.text.string, additional_data, ad_data_length);
-                               }
-                               tr.terminal_rsp_data.get_input.text.string_length = packing_data_len;
-                               tr.terminal_rsp_data.get_input.text.dcs.a_format =      TAPI_SAT_ALPHABET_FORMAT_SMS_DEFAULT;
-                       }
-                       //SMS 8bit or UCS2 format
-                       else {
-                               dbg("[SAT] packing not required");
-                               if(cmd_q.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_input.alphabet_type == INPUT_ALPHABET_TYPE_SMS_DEFAULT )
-                                       tr.terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FROMAT_SMS_DEFAULT;
-                               else if(cmd_q.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_input.alphabet_type == INPUT_ALPHABET_TYPE_UCS2 )
-                                       tr.terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FROMAT_UCS2;
-                               else
-                                       tr.terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FROMAT_RESERVED;
-
-                               if (tr.terminal_rsp_data.get_input.text.dcs.a_format == ALPHABET_FROMAT_UCS2) {
-                                       /*      TODO DCS handling*/
-                                       tr.terminal_rsp_data.get_input.text.string_length = ad_data_length;
-                                       memcpy((void*)&tr.terminal_rsp_data.get_input.text.string, additional_data, ad_data_length);
-                               } else {
-                                       /*      TODO DCS handling*/
-                                       tr.terminal_rsp_data.get_input.text.string_length = ad_data_length;
-                                       memcpy((void*)&tr.terminal_rsp_data.get_input.text.string, additional_data, ad_data_length);
-                               }
-                       }
-
-                       if (cmd_q.cmd_data.getInputInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
-                               tr.terminal_rsp_data.get_input.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-                       else
-                               tr.terminal_rsp_data.get_input.result_type = RESULT_SUCCESS;
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_HELP_INFO:
-                       tr.terminal_rsp_data.get_input.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
-                       ctx->help_requested = TRUE;
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_NO_OR_CANCEL:
-                       tr.terminal_rsp_data.get_input.result_type = RESULT_BACKWARD_MOVE_BY_USER;
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_TIMEOUT:
-                       tr.terminal_rsp_data.get_input.result_type = RESULT_NO_RESPONSE_FROM_USER;
-                       break;
-
-               case TAPI_SAT_USER_CONFIRM_END:
-                       tr.terminal_rsp_data.get_input.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
-                       break;
-               default:
-                       break;
-       }
-       dbg("tr.terminal_rsp_data.get_input.text.string=[%s]",tr.terminal_rsp_data.get_input.text.string);
-       rt = sat_mgr_send_terminal_response(ctx, p, conn_name, &tr);;
-
-       if (packing_data)
-               free(packing_data);
-
-       return rt;
-}
-
-TapiResult_t sat_mgr_handle_user_confirm(struct custom_data *ctx, TcorePlugin *p, char *conn_name,     TelSatUiUserConfirmInfo_t *cnf, unsigned char *additional_data, unsigned short ad_data_length)
-{
-       TapiResult_t rt = TAPI_API_SUCCESS;
-       dbg("[SAT] cnf->commandId=[0x%x], cnf->commandType=[0x%x], cnf->keyType=[%d], ad_data_length=[%d]",
-                       cnf->commandId, cnf->commandType, cnf->keyType, ad_data_length);
-
-       if (cnf->commandType != TAPI_SAT_CMD_TYPE_SETUP_MENU) {
-               struct sat_mgr_cmd_q cmd_q;
-               if (sat_mgr_dequeue_cmd_front_by_id(ctx, &cmd_q)) {
-                       if (cmd_q.cmd_type != cnf->commandType) {
-                               dbg("[SAT] command type mismatch");
-                               return TAPI_API_SAT_COMMAND_TYPE_MISMATCH;
-                       }
-               } else {
-                       dbg("[SAT] no commands in queue");
-                       return TAPI_API_SAT_INVALID_COMMAND_ID;
-               }
-       }
-
-       switch (cnf->commandType) {
-               case TAPI_SAT_CMD_TYPE_SELECT_ITEM:
-                       rt = _user_confirm_menu_select(ctx, p, conn_name, cnf,  additional_data, ad_data_length);
-                       break;
-               case TAPI_SAT_CMD_TYPE_DISPLAY_TEXT:
-                       rt = _user_confirm_display_text(ctx, p, conn_name, cnf, additional_data, ad_data_length);
-                       break;
-               case TAPI_SAT_CMD_TYPE_GET_INKEY:
-                       rt = _user_confirm_get_inkey(ctx, p, conn_name, cnf, additional_data, ad_data_length);
-                       break;
-               case TAPI_SAT_CMD_TYPE_GET_INPUT:
-                       rt = _user_confirm_get_input(ctx, p, conn_name, cnf, additional_data, ad_data_length);
-                       break;
-               default:
-                       dbg("[SAT] sat_mgr_handle_user_confirm :Unknown cnf->commandType:[0x%x]",       cnf->commandType);
-                       rt = TAPI_API_SERVER_FAILURE;
-                       break;
-       }
-
-       if(rt != TAPI_API_SUCCESS)
-               dbg("[SAT] current user confirm procedure make error[%d]", rt);
-
-       return rt;
-}
diff --git a/src/sat_ui_support/TelCall.h b/src/sat_ui_support/TelCall.h
new file mode 100644 (file)
index 0000000..307cf2f
--- /dev/null
@@ -0,0 +1,928 @@
+/*
+ * libslp-tapi
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @open
+ * @ingroup            TelephonyAPI
+ * @addtogroup TAPI_CALL       CALL
+ * @{
+ *
+ * @file TelCall.h
+
+ @brief This file serves as a "C" header file defines structures for Tapi Call Services. \n
+ It contains a sample set of constants, enums, structs that would be required by applications.
+ */
+
+#ifndef _TEL_CALL_H_
+#define _TEL_CALL_H_
+
+#include <TelSs.h>
+#include <TelDefines.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TAPI_CALLING_NAME_SIZE_MAX      80      /**< The maximum length of the string for calling party name.   */
+#define TAPI_CALL_UUS_DATA_LEN_MAX      131     /**< The Maximum length of the user to user singnalling data string.   */
+#define TAPI_CALL_DISPLAY_RECORD_MAX    32      /**< The maximum length of the string for display record in CDMA   */
+#define MAX_TAPI_CALL_COUNT                            6       /**< Maximum number of call can be possible at a time */
+#define MAX_TAPI_CONF_CALL_COUNT               5       /**< Maximum number of Call can be possible in a conference call at a time */
+#define INVALID_CALL_HANDLE                            0               /**< TS_UINT is used for call handle */
+
+/* Call */
+#define        TAPI_CALL_DIALDIGIT_LEN_MAX             82              /**< Maximum Dialling Digit Length  */
+#define        TAPI_CALL_SUBADDRESS_LEN_MAX    40              /**< Maximum Call Subaddress Length */
+#define        TAPI_CALL_NUMBER_LEN_MAX                7               /**< Dialling Num length */
+#define        TAPI_CONTEXT_CALL_SIZE_MAX              6               /**< Maximum Call context */
+#define        TAPI_CALL_DIAL_NUMBER_LEN_MAX   82
+
+#define TAPI_INVALID_CONTEXTHANDLE             (HTapiContext)-1
+#define TAPI_CLIENT_SIZE_MAX                   30
+#define TAPI_CALL_CUSTOM_SERVICE_DATA_MAX              128
+
+/**
+ * @enum TelCallCause_t
+ * This structure defines the values for Call Cause.
+ */
+typedef enum {
+       TAPI_CAUSE_SUCCESS,                             /**< Success  */
+       TAPI_CAUSE_ACCESSDISCARD,                       /**< Access discarded  */
+       TAPI_CAUSE_BARR_BYOPERATOR,             /**< Barred by operator */
+       TAPI_CAUSE_BEARERMODE_NOTIMPL,          /**< Bearer mode not implemented */
+       TAPI_CAUSE_BEARERMODE_RESTRICTED,       /**< Bearer mode restricted */
+       TAPI_CAUSE_BEARERMODE_UNAUTH,           /**< Bearer mode un authorized */
+       TAPI_CAUSE_BEARERMODE_UNAVAIL,          /**< Bearer mode not available */
+       TAPI_CAUSE_BUSY,                                        /**< (Network/Server) busy */
+       TAPI_CAUSE_CALLMETER_EXPIRED,           /**< Call meter expired */
+       TAPI_CAUSE_CALLNO_ERROR,                        /**< Call number error */
+       TAPI_CAUSE_CKTUNAVAIL,                          /**< Circuit channel unavailable */                     //10
+       TAPI_CAUSE_CONGESTION,                          /**< Congestion happened */
+       TAPI_CAUSE_NO_CIRCUIT_AVAIL,            /**< Circuit  not available */
+       TAPI_CAUSE_DESTIN_INCOMPAT,             /**< Destination incompatibility */
+       TAPI_CAUSE_DTMF_NOSPEECH,                       /**< No speech in DTMF */
+       TAPI_CAUSE_DTMF_REJECTED,                       /**< DTMF rejected */
+       TAPI_CAUSE_FACILITY_NOTIMPL,            /**< Facility not implemented */
+       TAPI_CAUSE_FACILITY_NOTSUBSCRIBED,      /**< Facility not subscribed */
+       TAPI_CAUSE_INCOMINGCUGCALLS_BARRED, /**< Incoming CUG Calls barred */
+       TAPI_CAUSE_INVALNUM,                            /**< Invalid number */
+       TAPI_CAUSE_MPTY_ERROR,                          /**< Multiparty error */                                                //20
+       TAPI_CAUSE_NOANSWER,                            /**< No answer  */
+       TAPI_CAUSE_NONCUGMEMBER,                        /**< Non CUG member */
+       TAPI_CAUSE_NUMBERCHANGED,                       /**< Number changed */
+       TAPI_CAUSE_NUMBER_ERROR,                        /**< Number error */
+       TAPI_CAUSE_NWFAILURE,                           /**< Network failure */
+       TAPI_CAUSE_OPERATIONUNAVAIL,            /**< Operation not available */
+       TAPI_CAUSE_OUTOFORDER,                          /**< Out of order */
+       TAPI_CAUSE_PROTOCOL_ERROR,                      /**< Protocol error */
+       TAPI_CAUSE_QOSUNAVAIL,                          /**< QOS unavailable */
+       TAPI_CAUSE_REJECT,                                      /**< Rejected */                                                                //30
+       TAPI_CAUSE_REJ_FAIL,                            /**< Rejection failed */
+       TAPI_CAUSE_REJ_SRVC_NOT_AVL,            /**< Rejection service not available  */
+       TAPI_CAUSE_REMOTE_CKTUNAVAIL,           /**< Remote Circuit channel unavailable */
+       TAPI_CAUSE_RESOURCEUNAVAIL,             /**< Resource not available */
+       TAPI_CAUSE_SERVICEID_ERROR,             /**< Service id error */
+       TAPI_CAUSE_SERVICE_NOTIMPL,             /**< Service not implemented */
+       TAPI_CAUSE_SERVICE_UNAVAIL,             /**< Service not available */
+       TAPI_CAUSE_MODIFY_SAME_BEARER,          /**< Modify same bearer */
+       TAPI_CAUSE_MODIFY_NOT_PERMITTED,        /**< Modification not permitted */
+       TAPI_CAUSE_HOLD_FAIL,                           /**< Call hold fail */                                                  //40
+       TAPI_CAUSE_TEMPFAILURE,                 /**< Temporary failure */
+       TAPI_CAUSE_WRONGNUM,                            /**< Wrong number */
+       TAPI_CAUSE_NORMAL_UNSPECIFIED,          /**< Normal but unspecified */
+       TAPI_CAUSE_SSERRINVALIDTIVALUE, /**< SS invalid Transaction ID Value */
+       TAPI_CAUSE_SSERRINVALIDTI,                      /**< SS Invalid transaction ID */
+       TAPI_CAUSE_SSINCOMPATIBLESTATE, /**< SS incompatible state */
+       TAPI_CAUSE_SSERRSYNTAXERROR,            /**< SS syntax error */
+       TAPI_CAUSE_SSPROTOCOLERROR,             /**< Protocol error */
+       TAPI_CAUSE_SSNEGATIVEPASSWORDCHECK, /**< Negative password check */
+       TAPI_CAUSE_SSSENTASPHASE1,                      /**< SS sent as phase1 message */                               //50
+       TAPI_CAUSE_SSERROR,                             /**< Supplementary service error */
+       TAPI_CAUSE_SS_USSD_BUSY,                        /**< Second USSD request will be rejected when already USSD transaction is ongoing. */
+       TAPI_CAUSE_IDLE,                                        /**< Idle */
+       TAPI_CAUSE_NETWORK_SPECIFIC,            /**< Network specific error */
+       TAPI_CAUSE_FADE,                                        /**< voice call was dropped e.g. because of a loss of signal */
+       TAPI_CAUSE_UNKNOWN,                             /**< unknown no details available */
+       TAPI_CAUSE_INCOM_CALL,                          /**< terminated by incoming call */
+       TAPI_CAUSE_ALERT_STOP,                          /**< terminated by alert stop */
+       TAPI_CAUSE_INTERCEPT,                           /**< voice call was dropped by interception */
+       TAPI_CAUSE_REORDER,                             /**< voice call was dropped by reordering */    //60
+       TAPI_CAUSE_CLIENT_END,                          /**< client ended the call */
+       TAPI_CAUSE_ACCESS_CLASS_BLOCKED,        /**< access class blocked */
+       TAPI_CAUSE_MEMCAPEXCEEDED,                      /**< Memory capacity exceeded */
+       TAPI_CAUSE_TYPENOTSUPPORTED,            /**< Type not supported */
+       TAPI_CAUSE_REPLACENOTSUPPORTED, /**< Replace not supported */
+       TAPI_CAUSE_PROTOCOLID_ERROR,            /**< Protocol id error */
+       TAPI_CAUSE_CLASSNOTSUPPORTED,           /**< Class not supported */
+       TAPI_CAUSE_DATACODING_ERROR,            /**< Data coding error */
+       TAPI_CAUSE_INVAL_MSG,                           /**< Invalid message */
+       TAPI_CAUSE_CALL_BARRED,                 /**< Call barred */                                                     //70
+       TAPI_CAUSE_SIM_CALL_CONTROL_CHANGED_TO_SS,              /**< Sim call control changed to SS */
+       TAPI_CAUSE_SIM_CALL_CONTROL_CHANGED_TO_CALL,    /**< SIM Call control changed to call */
+       TAPI_CAUSE_SIM_ERROR,                           /**< SIM error */
+       TAPI_CAUSE_SIM_CALL_CONTROL_MODIFIED,                   /**< SIM call control modified */
+       TAPI_CAUSE_RANDOM_ACCESS_FAILURE,       /**< Random access error */
+       TAPI_CAUSE_LOWER_LAYER_FAILURE, /**< Lower layer error */
+       TAPI_CAUSE_ACCESS_REJECTED,             /**< Access rejected */
+       TAPI_CAUSE_RESET_NOT_ALLOWED,           /**< Reset not allowed */
+       TAPI_CAUSE_EMERGENCY_CALL_NOT_ALLOWED,                  /**< Emergency call not allowed */
+       TAPI_CAUSE_ACCESS_NOT_ALLOWED,          /**< Access not allowed */                                              //80
+       TAPI_CAUSE_RADIO_LINK_FAILURE,          /**< Radio link failure */
+       TAPI_CAUSE_INVALID_IDENTITY,            /**< Invalid identity */
+       TAPI_CAUSE_UNKNOWN_IDENTITY,            /**< Unknown identity */
+       TAPI_CAUSE_UNACCEPTABLE_IDENTITY,       /**< Un acceptable identity */
+       TAPI_CAUSE_NO_SERVICE_HERE,             /**< No service here */
+       TAPI_CAUSE_SERVICE_NOT_ALLOWED, /**< Service not allowed */
+       TAPI_CAUSE_SERVICE_NOT_AVAIL,           /**< Service not available */
+       TAPI_CAUSE_SERVICE_NOT_WORKING, /**< Service not working */
+       TAPI_CAUSE_CANNOT_IDENTIFY_CALL,        /**< Cannot identify the call */
+       TAPI_CAUSE_DEACTIVATION,                        /**< Deactivation */                                                    //90
+       TAPI_CAUSE_FATAL_ERROR,                 /**< Fatal error */
+       TAPI_CAUSE_SEND_DTMF_SUCCESS,           /**< Sending DTMF Success */
+       TAPI_CAUSE_SEND_DTMF_FAIL,                      /**< Sending DTMF Failed */
+       TAPI_CAUSE_TIMER_EXPIRED,                       /**< Call Timer Expired */
+} TelCallCause_t;
+
+/**
+ * @enum TelTapiEndCause_t
+ * When a call is ended, this end cause is given with the CALL END notification to the application.  This end cause can be originated
+ * from different elements in the communication path or different modules in the same element.
+ */
+typedef enum {
+       TAPI_CALL_END_NO_CAUSE = 0x00,                          /**< No Cause */
+
+       TAPI_CC_CAUSE_UNASSIGNED_NUMBER,                        /**< Unassigned Number */
+       TAPI_CC_CAUSE_NO_ROUTE_TO_DEST,                 /**< No Route to Destination */
+       TAPI_CC_CAUSE_CHANNEL_UNACCEPTABLE,             /**< Channel Unacceptable */
+       TAPI_CC_CAUSE_OPERATOR_DETERMINED_BARRING,      /**< Operator Determined Barring */
+       TAPI_CC_CAUSE_NORMAL_CALL_CLEARING,             /**< Normal Call Clearing */
+
+       TAPI_CC_CAUSE_USER_BUSY,                                        /**< User Busy */
+       TAPI_CC_CAUSE_NO_USER_RESPONDING,                       /**< No user Responding */
+       TAPI_CC_CAUSE_USER_ALERTING_NO_ANSWER,          /**< User Alerting no Answer */
+       TAPI_CC_CAUSE_CALL_REJECTED,                            /**< Call Rejected */
+       TAPI_CC_CAUSE_NUMBER_CHANGED,                           /**< Number Changed */
+
+       TAPI_CC_CAUSE_NON_SELECTED_USER_CLEARING,       /**< Non Selected User Clearing */
+       TAPI_CC_CAUSE_DESTINATION_OUT_OF_ORDER, /**< Destination out of Order */
+       TAPI_CC_CAUSE_INVALID_NUMBER_FORMAT,            /**< Invalid Number Format */
+       TAPI_CC_CAUSE_FACILITY_REJECTED,                        /**< Facility Rejected */
+       TAPI_CC_CAUSE_RESPONSE_TO_STATUS_ENQUIRY,       /**< Response to Status Enquiry */
+
+       TAPI_CC_CAUSE_NORMAL_UNSPECIFIED,                               /**< Normal Unspecified */
+       TAPI_CC_CAUSE_NO_CIRCUIT_CHANNEL_AVAILABLE,     /**< No Circuit Channel Available */
+       TAPI_CC_CAUSE_NETWORK_OUT_OF_ORDER,                     /**< Network out of Order */
+       TAPI_CC_CAUSE_TEMPORARY_FAILURE,                                /**< Temporary Failure */
+       TAPI_CC_CAUSE_SWITCHING_EQUIPMENT_CONGESTION,   /**< Switching Equipment Congestion */
+
+       TAPI_CC_CAUSE_ACCESS_INFORMATION_DISCARDED,                     /**< Access Information Discarded */
+       TAPI_CC_CAUSE_REQUESTED_CIRCUIT_CHANNEL_NOT_AVAILABLE,  /**< Requested Circuit channel not available */
+       TAPI_CC_CAUSE_RESOURCES_UNAVAILABLE_UNSPECIFIED,                /**< Resources unavailable unspecified */
+       TAPI_CC_CAUSE_QUALITY_OF_SERVICE_UNAVAILABLE,                   /**< Quality of service unavailable */
+       TAPI_CC_CAUSE_REQUESTED_FACILITY_NOT_SUBSCRIBED,                /**< Requested facility not subscribed */
+
+       TAPI_CC_CAUSE_INCOMING_CALL_BARRED_WITHIN_CUG,                  /**< incomming call barred within CUG */
+       TAPI_CC_CAUSE_BEARER_CAPABILITY_NOT_AUTHORISED,         /**< Bearer Capability not Authorised */
+       TAPI_CC_CAUSE_BEARER_CAPABILITY_NOT_PRESENTLY_AVAILABLE,/**< Bearer capability not presently Available */
+       TAPI_CC_CAUSE_SERVICE_OR_OPTION_NOT_AVAILABLE,                  /**< Service or Option not available */
+       TAPI_CC_CAUSE_BEARER_SERVICE_NOT_IMPLEMENTED,                   /**< Service not implemented */
+
+       TAPI_CC_CAUSE_ACM_GEQ_ACMMAX,                                                   /**< ACM GEQ ACMAX */
+       TAPI_CC_CAUSE_REQUESTED_FACILITY_NOT_IMPLEMENTED,               /**< Requested facility not implemented */
+       TAPI_CC_CAUSE_ONLY_RESTRICTED_DIGITAL_INFO_BC_AVAILABLE,/**< Resticted digital info BC not available */
+       TAPI_CC_CAUSE_SERVICE_OR_OPTION_NOT_IMPLEMENTED,                /**< Service or Option not Implemented  */
+       TAPI_CC_CAUSE_INVALID_TRANSACTION_ID_VALUE,                     /**< Transaction ID value */
+
+       TAPI_CC_CAUSE_USER_NOT_MEMBER_OF_CUG,                           /**< Not member of CUG */
+       TAPI_CC_CAUSE_INCOMPATIBLE_DESTINATION,                 /**< Incompatible Destination */
+       TAPI_CC_CAUSE_INVALID_TRANSIT_NETWORK_SELECTION,        /**< Transit Network selection */
+       TAPI_CC_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE,           /**< Semantically Incorrect message */
+       TAPI_CC_CAUSE_INVALID_MANDATORY_INFORMATION,            /**< Invalid Mandatory Message */
+
+       TAPI_CC_CAUSE_MESSAGE_TYPE_NON_EXISTENT,                                        /**< Message Type Non Existent */
+       TAPI_CC_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROT_STATE,      /**< Message type not compatible with Prot state */
+       TAPI_CC_CAUSE_IE_NON_EXISTENT_OR_NOT_IMPLEMENTED,                       /**< IE non exitent or not implemented */
+       TAPI_CC_CAUSE_CONDITIONAL_IE_ERROR,                                             /**< Conditional IE error */
+       TAPI_CC_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE,       /**< Not Compatible with protocol state */
+
+       TAPI_CC_CAUSE_RECOVERY_ON_TIMER_EXPIRY, /**< Recovery on timer expiry */
+       TAPI_CC_CAUSE_PROTOCOL_ERROR_UNSPECIFIED,       /**< Protocol error unspecified */
+       TAPI_CC_CAUSE_INTERWORKING_UNSPECIFIED, /**< Interworking unspecified */
+
+       TAPI_CC_CAUSE_END = 128,
+
+       /* Reject causes*/
+       TAPI_REJECT_CAUSE_IMSI_UNKNOWN_IN_HLR,  /**< IMSI unknown in HLR */
+       TAPI_REJECT_CAUSE_ILLEGAL_MS,                   /**< Illegal MS */
+       TAPI_REJECT_CAUSE_IMSI_UNKNOWN_IN_VLR,  /**< IMSI unknown in VLR */
+       TAPI_REJECT_CAUSE_IMEI_NOT_ACCEPTED,    /**< IMEI not accepted */
+       TAPI_REJECT_CAUSE_ILLEGAL_ME,                   /**< Illegal ME */
+
+       TAPI_REJECT_CAUSE_GPRS_SERVICES_NOT_ALLOWED,                                            /**< GPRS service not allowed */
+       TAPI_REJECT_CAUSE_GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED,      /**< GPRS services and Non-GPRS services not allowed */
+       TAPI_REJECT_CAUSE_MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK, /**< MS device cannot be derived by the network */
+       TAPI_REJECT_CAUSE_IMPLICITLY_DETACHED,                                                          /**< Implicitly detached */
+       TAPI_REJECT_CAUSE_PLMN_NOT_ALLOWED,                                                             /**< PLMN not allowed */
+
+       TAPI_REJECT_CAUSE_LA_NOT_ALLOWED,                                                       /**< LA not allowed */
+       TAPI_REJECT_CAUSE_NATIONAL_ROAMING_NOT_ALLOWED,                 /**< National roaming not allowed */
+       TAPI_REJECT_CAUSE_GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN,       /**< GPRS services not allowed in this PLMN */
+       TAPI_REJECT_CAUSE_NO_SUITABLE_CELLS_IN_LA,                                      /**< No suitable cells in the LA */
+       TAPI_REJECT_CAUSE_MSC_TEMPORARILY_NOT_REACHABLE,                        /**< MSC temporarily not reachable */
+
+       TAPI_REJECT_CAUSE_NETWORK_FAILURE,              /**< Network unavailable */
+       TAPI_REJECT_CAUSE_MAC_FAILURE,                  /**< MAC failure */
+       TAPI_REJECT_CAUSE_SYNCH_FAILURE,                /**< SYNCh failure */
+       TAPI_REJECT_CAUSE_CONGESTTION,                  /**< Congestion */
+       TAPI_REJECT_CAUSE_GSM_AUTH_UNACCEPTED,  /**< GSM Auth unaccepted */
+
+       TAPI_REJECT_CAUSE_SERVICE_OPTION_NOT_SUPPORTED, /**< Service option not supported */
+       TAPI_REJECT_CAUSE_REQ_SERV_OPT_NOT_SUBSCRIBED,  /**< REQ_SERV option not suscribed */
+       TAPI_REJECT_CAUSE_SERVICE_OPT__OUT_OF_ORDER,    /**< Service OPT out of order */
+       TAPI_REJECT_CAUSE_CALL_CANNOT_BE_IDENTIFIED,    /**< Call cannot be identified */
+       TAPI_REJECT_CAUSE_NO_PDP_CONTEXT_ACTIVATED,     /**< No PDP context Activated */
+
+       TAPI_REJECT_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_MIN_VALUE,   /**< Retry upon entry into a new call min value */
+       TAPI_REJECT_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_MAX_VALUE,   /**< Retry upon entry into a new call max value */
+       TAPI_REJECT_CAUSE_SEMANTICALLY_INCORRECT_MSG,                                   /**< Semantically incorret message */
+       TAPI_REJECT_CAUSE_INVALID_MANDATORY_INFO,                                               /**< Invalid mandatory information */
+       TAPI_REJECT_CAUSE_MESSAGE_TYPE_NON_EXISTANT,                                    /**< Message type non-existant */
+
+       TAPI_REJECT_CAUSE_MESSAGE_TYPE_NOT_COMP_PRT_ST,         /**< Message type not COMP PRT ST */
+       TAPI_REJECT_CAUSE_IE_NON_EXISTANT,                                              /**< IE not existant */
+       TAPI_REJECT_CAUSE_MSG_NOT_COMPATIBLE_PROTOCOL_STATE,    /**< MSG not compatible protocol state */
+
+       /* Connection Management establishment rejection cause */
+       TAPI_REJECT_CAUSE_REJ_UNSPECIFIED,      /**< rej unspecified */
+
+       /* AS reject causes */
+       TAPI_REJECT_CAUSE_AS_REJ_RR_REL_IND,                                            /**< RR release indication */
+       TAPI_REJECT_CAUSE_AS_REJ_RR_RANDOM_ACCESS_FAILURE,                      /**< Random Access Failure */
+       TAPI_REJECT_CAUSE_AS_REJ_RRC_REL_IND,                                           /**< RRC release indication */
+       TAPI_REJECT_CAUSE_AS_REJ_RRC_CLOSE_SESSION_IND,                 /**< RRC close session indication */
+       TAPI_REJECT_CAUSE_AS_REJ_RRC_OPEN_SESSION_FAILURE,                      /**< RRC open session failure */
+       TAPI_REJECT_CAUSE_AS_REJ_LOW_LEVEL_FAIL,                                        /**< Low level failure */
+       TAPI_REJECT_CAUSE_AS_REJ_LOW_LEVEL_FAIL_REDIAL_NOT_ALLOWED, /**< Low level failure redial not alowed */
+       TAPI_REJECT_CAUSE_AS_REJ_LOW_LEVEL_IMMED_RETRY,                 /**< low level immediate retry */
+
+       /* MM reject causes */
+       TAPI_REJECT_CAUSE_MM_REJ_INVALID_SIM,                   /**< invalid Sim */
+       TAPI_REJECT_CAUSE_MM_REJ_NO_SERVICE,                    /**< No service */
+       TAPI_REJECT_CAUSE_MM_REJ_TIMER_T3230_EXP,               /**< Timer T3230 expire */
+       TAPI_REJECT_CAUSE_MM_REJ_NO_CELL_AVAILABLE,     /**< No call available  */
+       TAPI_REJECT_CAUSE_MM_REJ_WRONG_STATE,                   /**< wrong state */
+       TAPI_REJECT_CAUSE_MM_REJ_ACCESS_CLASS_BLOCKED,  /**< Access class blocked */
+
+       /* Definitions for release ind causes between MM  and CNM*/
+       TAPI_REJECT_CAUSE_ABORT_MSG_RECEIVED,   /**< Abort Message received */
+       TAPI_REJECT_CAUSE_OTHER_CAUSE,                  /**< Other cause  */
+
+       /* CNM reject causes */
+       TAPI_REJECT_CAUSE_CNM_REJ_TIMER_T303_EXP,       /**< Timer T303 expiry */
+       TAPI_REJECT_CAUSE_CNM_REJ_NO_RESOURCES, /**< Rejected due to unavailibilty of resources */
+       TAPI_REJECT_CAUSE_CNM_MM_REL_PENDING,           /**< MM release pending */
+       TAPI_REJECT_CAUSE_CNM_INVALID_USER_DATA,        /**< Invalid user data */
+       TAPI_CALL_END_CAUSE_MAX = 255,                          /**< Maximum End Cause limit for gsm/wcdma */
+
+       /* CDMA CALL END CAUSE */
+       TAPI_CDMA_END_CAUSE_REL_BY_USER = 0x1001,               /**< Call Released by User */
+       TAPI_CDMA_END_CAUSE_REL_BY_NET,                         /**< Call Released by Network */
+       TAPI_CDMA_END_CAUSE_REL_NET_BUSY,                               /**< Call Released because of Network busy */
+       TAPI_CDMA_END_CAUSE_NO_SVC,                                     /**< Call Released because of No Service area */
+       TAPI_CDMA_END_CAUSE_FADING,                                     /**< Call Released because of Fading */
+       TAPI_CDMA_END_CAUSE_RELEASE_BY_REORDER,         /**< Call Released because of reorder */
+       TAPI_CDMA_END_CAUSE_RELEASE_BY_INTERCEPT,               /**< Call Released because of intercept */
+       TAPI_CDMA_END_CAUSE_SILENT_ZONE_RETRY,                  /**< Call Released because of silent zone retry */
+       TAPI_CDMA_END_CAUSE_OTA_CALL_FAIL,                              /**< Call Released because of OTA cal failure */
+       TAPI_CDMA_END_CAUSE_PHONE_OFFLINE,                              /**< Call Released because of phone offline */
+       TAPI_CDMA_END_CAUSE_PHONE_IS_CDMA_LOCKED,               /**< Call Released because of CDMA locked */
+       TAPI_CDMA_END_CAUSE_FLASH_IS_IN_PROGRESS_ERR,   /**< Call Released because of flash-is-in-progress error */
+       TAPI_CDMA_END_CAUSE_E911_MODE_ERR,                              /**< Call Released because of e911 mode */
+       TAPI_CDMA_END_CAUSE_OTHERS,                                     /**< Call Released by Others */
+       TAPI_CDMA_END_CAUSE_MAX                                         /**< Maximum End Cause limit for cdma */
+} TelTapiEndCause_t;
+
+/**
+ * @enum TelConferenceCallState_t
+ * This enum defines the call conference states
+ */
+typedef enum {
+       TAPI_CALL_CONFERENCE_IDLE,      /**< idle */
+       TAPI_CALL_CONFERENCE_ACTIVE /**< active */
+} TelConferenceCallState_t;
+
+/**
+ * @enum TelCallStates_t
+ * Applications can use these sates or can have their own states.
+ */
+typedef enum {
+       TAPI_CALL_STATE_IDLE,           /**< Call is in idle state - i.e. no call */
+       TAPI_CALL_STATE_ACTIVE,         /**< Call is in connected and conversation state */
+       TAPI_CALL_STATE_HELD,           /**< Call is in held state */
+       TAPI_CALL_STATE_DIALING,        /**< Call is in dialing state */
+       TAPI_CALL_STATE_ALERT,          /**< Call is in alerting state */
+       TAPI_CALL_STATE_INCOMING,       /**< Call is in incoming state */
+       TAPI_CALL_STATE_WAITING,        /**< Call is in answered state, and waiting for connected indication event */
+       TAPI_CALL_STATE_MAX
+} TelCallStates_t;
+
+/**
+ * IN GSM ONLY: call identification number.
+ */
+typedef enum {
+       TAPI_CALL_ACTIVE_LINE1, /**< Line 1 */
+       TAPI_CALL_ACTIVE_LINE2  /**< Line 2 */
+} TelCallActiveLine_t;
+
+typedef enum {
+       TAPI_CALL_UUS_NONE, /**< No User to User information  */
+       TAPI_CALL_UUS_1,        /**< User to User information 1 */
+} TelCallUusType_t;
+
+/**
+ * The Incoming call indication could have be one of the following SS info messages in it.
+ */
+typedef enum {
+       /*      Number details are present in the "char number" of call info struct. if number is not present
+        then "no cli cause" member in  mt_ss_info is set accordingly.  */
+       TAPI_CALL_MT_CLI_PRESENT = 0x31,
+
+       /*      Calling Name Info presnet,      TelCallingNameInfo_t of call info struct contains this info.  */
+       TAPI_CALL_MT_CNA_PRESENT = 0x32,
+
+       /*      Undefined ss indication. Ignore mt_ss_info */
+       TAPI_CALL_MT_SS_UNDEFINED = 0x00,
+
+} TelCallMtSSInfo_t;
+
+/**
+ * @enum TelCallAnswerType_t
+ * Answer type used as in parameter in the answer call API.
+ */
+typedef enum {
+       TAPI_CALL_ANSWER_ACCEPT = 0,            /**< Used to answer an incoming call when there are no current active calls. */
+       TAPI_CALL_ANSWER_REJECT,                        /**< Used to reject the incoming call */
+       TAPI_CALL_ANSWER_REPLACE,                       /**< Release current active call and accept the */
+       TAPI_CALL_ANSWER_HOLD_AND_ACCEPT,       /**< Hold the current active call, and accept the wating call */
+} TelCallAnswerType_t;
+
+/**
+ * @enum TelCallEndType_t
+ * End type used as in parameter in the end call API.
+ */
+typedef enum {
+       TAPI_CALL_END = 0,      
+       TAPI_CALL_END_ALL,
+       TAPI_CALL_END_ACTIVE_ALL,
+       TAPI_CALL_END_HOLD_ALL,
+} TelCallEndType_t;
+
+
+
+
+/**
+ * @enum TelCallType_t
+ * Applications needs to use this call type while using the setup call API. Like the requested call is a voice call or video call.
+ */
+typedef enum {
+       TAPI_CALL_TYPE_VOICE,   /**< Voice call type. */// in ipcv4, 0x0100
+       TAPI_CALL_TYPE_DATA,    /**< Data call type - (for modem, fax, packet, etc. calls). */// in ipcv4, 0x0200
+       TAPI_CALL_TYPE_E911     /**< Emergency call type. */// in ipcv4, 0x0700
+} TelCallType_t;
+
+/**
+ * @enum TelCallAlertingPattern_t
+ * This enumeration defines the different alerting patterns available.
+ */
+typedef enum {
+       TAPI_CALL_ALERTING_PATTERN_1 = 0x00, /**< Pattern 1 */
+       TAPI_CALL_ALERTING_PATTERN_2 = 0x01, /**< Pattern 2 */
+       TAPI_CALL_ALERTING_PATTERN_3 = 0x02, /**< Pattern 3 */
+       TAPI_CALL_ALERTING_PATTERN_4 = 0x03, /**< Pattern 4 */
+       TAPI_CALL_ALERTING_PATTERN_5 = 0x04, /**< Pattern 5 */
+       TAPI_CALL_ALERTING_PATTERN_6 = 0x05, /**< Pattern 6 */
+       TAPI_CALL_ALERTING_PATTERN_7 = 0x06, /**< Pattern 7 */
+       TAPI_CALL_ALERTING_PATTERN_8 = 0x07, /**< Pattern 8 */
+       TAPI_CALL_NO_ALERTING_PATTERN = 0x08 /**< No Alerting Pattern */
+} TelCallAlertingPattern_t;
+
+/**
+ * @enum TelCallActiveState_t
+ * State of the current call.
+ */
+typedef enum {
+       TAPI_CALL_CONNECT_IDLE, /**< Call is in Idle state. */
+       TAPI_CALL_CONNECT_ACTIVE,       /**< Call is in Active state.*/
+       TAPI_CALL_CONNECT_HELD          /**< Call is in Held state. */
+} TelCallActiveState_t;
+
+/**
+ * @enum TelCallCugOptions_t
+ * This enumeration defines the closed user group options
+ */
+typedef enum {
+       TAPI_CALL_CUG_NO_INFO = 0x00,           /**< No information */
+       TAPI_CALL_CUG_SUPRESS_OA,                       /**< suppress OA */
+       TAPI_CALL_CUG_SUPRESS_PRF_CUG,          /**< suppress preferential CUG */
+       TAPI_CALL_CUG_SUPRESS_OA_AND_CUG        /**< suppress OA and preferential CUG */
+} TelCallCugOptions_t;
+
+/**
+ * @enum TelCallUusProtocolType_t
+ *  This enumeration defines the tapi call uus protocol types
+ */
+typedef enum {
+       TAPI_CALL_UUS_PROTO_SPECIFIC = 0,                       /**< The user information is structured according to user needs. */
+       TAPI_CALL_UUS_PROTO_OSI_HIGHER_LAYER = 1,       /**< OSI high layer protocols */
+       TAPI_CALL_UUS_PROTO_IA5_CHARS = 4,                      /**< user information consists of IA5 characters */
+       TAPI_CALL_UUS_PROTO_V120 = 7,                           /**< rate adaptation */
+       TAPI_CALL_UUS_PROTO_Q931 = 8                            /**< user-network call control messages */
+} TelCallUusProtocolType_t;
+
+/**
+ * @enum TelCallNameMode_t
+ *  This enumeration defines the call name mode
+ */
+typedef enum {
+       TAPI_CALL_NAME_AVAIL = 0,                               /**< This identifier refers to the presentation of the calling party's name identity to the called party. */
+       TAPI_CALL_NAME_RESTRICTED = 1,                  /**< This identifier refers to the restriction of presentation of the name identity of the calling party to the called party. */
+       TAPI_CALL_NAME_UNAVAIL = 2,                     /**< This identifier refers to the unavailability of the calling party's name identity to be offered to the called party. */
+       TAPI_CALL_NAME_AVAIL_RESTRICTED = 3     /**< This identifier refers to the calling party's name identity to be offered to the called party with which presentation restriction is overridden.  */
+} TelCallNameMode_t;
+
+/**
+ * @enum TelCallSSNocliCause_t
+ * This enumeration defines the value for "No Cli cause".
+ */
+typedef enum {
+       TAPI_SS_NO_CLI_CAUSE_UNAVAILABLE = 0x00,                /**< Unavailable */
+       TAPI_SS_NO_CLI_CAUSE_REJECTBY_USER = 0x01,              /**< Rejected by User */
+       TAPI_SS_NO_CLI_CAUSE_INTERACTION_OTHERSERVICES = 0x02, /**<  Other services */
+       TAPI_SS_NO_CLI_CAUSE_COINLINE_PAYPHONE = 0x03,  /**< Coin line phone */
+       TAPI_SS_NO_CLI_CAUSE_MAX                                                /**< maximum usage */
+} TelCallSSNocliCause_t;
+
+/**
+ * Fwded Ind Type used for MO and Mt from SS Noti Info
+ */
+typedef enum {
+       TAPI_CALL_OUTGOING_FWDED = 0x00,        /* Outgoing call forwarded */
+       TAPI_CALL_INCOMMING_FWDED = 0x01,       /* Incoming call forwarded */
+} TelCallForwardType_t;
+
+/**
+ * @enum TelCallPrivacyMode_t
+ * This structure contains the voice privacy option mode(CDMA only).
+ */
+typedef enum {
+       TAPI_CALL_PRIVACY_MODE_STANDARD = 0x00, /**< Standard mode */
+       TAPI_CALL_PRIVACY_MODE_ENHANCED         /**< Enhanced mode */
+} TelCallPrivacyMode_t;
+
+/**
+ * @enum TelCallPrivacyType_t
+ * This structure contains the voice privacy request type(CDMA only).
+ */
+typedef enum {
+       TAPI_CALL_PRIVACY_TYPE_MS = 0x01,       /**< Mobile Station Voice Privacy Mode */
+       TAPI_CALL_PRIVACY_TYPE_BS,                      /**< Base Station Voice Privacy Mode */
+       TAPI_CALL_PRIVACY_TYPE_CURRENT          /**< Current Serving Privacy Mode */
+} TelCallPrivacyType_t;
+
+/**
+ * @enum TelCallEmergecyMode_t
+ * This structure contains the emergency callback mode(CDMA only).
+ */
+typedef enum {
+       TAPI_CALL_EMERGENCY_MODE_EXIT,  /**< Emergency CB Exit mode */
+       TAPI_CALL_EMERGENCY_MODE_ENTER  /**< Emergency CB Enter mode */
+} TelCallEmergecyMode_t;
+
+/**
+ * @enum TelCallOtaType_t
+ * This structure contains the OTA type(CDMA only).
+ */
+typedef enum {
+       TAPI_CALL_OTATYPE_OTASP = 0x01, /**< OTASP : mobile initiated OTA*/
+       TAPI_CALL_OTATYPE_OTAPA,                /**< OTAPA : network initiated OTA */
+} TelCallOtaType_t;
+
+/**
+ * @enum TelCallOtaspStatus_t
+ * This structure contains the OTASP Status(CDMA only).
+ */
+typedef enum {
+       TAPI_CALL_OTASP_OK_SPL_UNLOCKED = 0x01, /**< OTASP : SPL unlocked ok*/
+       TAPI_CALL_OTASP_OK_AKEY_EXCESS,         /**< OTASP : A-Key excess ok*/
+       TAPI_CALL_OTASP_OK_SSD_UPDATE,                  /**< OTASP : SSD update ok */
+       TAPI_CALL_OTASP_OK_NAM_DWNLD,                   /**< OTASP : NAM download ok */
+       TAPI_CALL_OTASP_OK_MDN_DWNLD,                   /**< OTASP : MDN download ok */
+       TAPI_CALL_OTASP_OK_IMSI_DWNLD,                  /**< OTASP :  IMSI download ok*/
+       TAPI_CALL_OTASP_OK_PRL_DWNLD,                   /**< OTASP : PRL download ok */
+       TAPI_CALL_OTASP_OK_COMMIT,                              /**< OTASP : commit ok */
+       TAPI_CALL_OTASP_OK_PROGRAMMING,         /**< OTASP : programming ok */
+       TAPI_CALL_OTASP_SUCCESS,                                /**< OTASP : success */
+       TAPI_CALL_OTASP_UNSUCCESS,                              /**< OTASP : unsuccess */
+       TAPI_CALL_OTASP_OK_OTAPA_VERIFY,                /**< OTASP : verify ok */
+       TAPI_CALL_OTASP_PROGRESS,                               /**< OTASP : progress */
+       TAPI_CALL_OTASP_FAILURES_EXCESS_SPC,    /**< OTASP : SPC excess failure */
+       TAPI_CALL_OTASP_LOCK_CODE_PW_SET,               /**< OTASP : lock code password set*/
+} TelCallOtaspStatus_t;
+
+/**
+ * @enum TelCallOtapaStatus_t
+ * This structure contains the OTAPA Status(CDMA only).
+ */
+typedef enum {
+       TAPI_CALL_OTAPA_STOP = 0x00,    /**< OTAPA : stop */
+       TAPI_CALL_OTAPA_START,                  /**< OTAPA : start */
+} TelCallOtapaStatus_t;
+
+/**
+ * @enum TelCallTimeMaskType_t
+ * This structure contains call time request mask type.
+ */
+typedef enum {
+       TAPI_CALL_TIME_TYPE_TOTAL_CALL_CNT = 0x01,      /**< Total Call Count Mask */
+       TAPI_CALL_TIME_TYPE_TOTAL_CALL_TIME = 0x02, /**< Total Call Time Mask */
+       TAPI_CALL_TIME_TYPE_LAST_CALL_TIME = 0x04,      /**< Last Call Time Mask */
+} TelCallTimeMaskType_t;
+
+/**
+ * @enum TelCallToneDuration_t
+ * This structure contains dtmf tone length.
+ */
+typedef enum {
+       TAPI_CALL_TONE_DURATION_SHORT = 0x01,
+       TAPI_CALL_TONE_DURATION_LONG
+} TelCallToneDuration_t;
+
+/**
+ * @enum TelCallEmergencyCategory_t
+ * This structure contains emergency category type
+ */
+typedef enum {
+       TAPI_CALL_ECC_DEFAULT = 0x00,
+       TAPI_CALL_ECC_POLICE = 0x01,
+       TAPI_CALL_ECC_AMBULANCE = 0x02,
+       TAPI_CALL_ECC_FIREBRIGADE = 0x04,
+       TAPI_CALL_ECC_MARINEGUARD = 0x08,
+       TAPI_CALL_ECC_MOUNTAINRESCUE = 0x10,
+       TAPI_CALL_ECC_MANUAL_ECALL = 0x20,
+       TAPI_CALL_ECCY_AUTO_ECALL = 0x40
+} TelCallEmergencyCategory_t;
+
+typedef enum {
+       TAPI_CALL_IDENTITY_DEFAULT, /**< Calling line identity will be sent. Based on network setting, Line identity will presented to the called party. */
+       TAPI_CALL_IDENTITY_SHOW,        /**< Display calling line identity */
+       TAPI_CALL_IDENTITY_HIDE /**< Hide the display of Calling line identity */
+} TelCallIdentityMode_t;
+
+
+/**
+ * context type
+ */
+typedef enum {
+       TAPI_CONTEXT_TYPE_NONE = 0x00,
+       TAPI_CONTEXT_TYPE_VOICE_CALL = 0x01,
+       TAPI_CONTEXT_TYPE_DATA_CALL = 0x2,
+       TAPI_CONTEXT_TYPE_VIDEO_CALL = 0x3,
+       TAPI_CONTEXT_TYPE_NETTEXT,
+       TAPI_CONTEXT_TYPE_E911,
+} TapiContextType;
+
+
+/**
+ * Timer State and or Call Timer ID
+ */
+typedef enum {
+       TAPI_CALL_TSTATE_IDLE = 0x00,           /**< No timer running */
+       TAPI_CALL_TSTATE_SETUP_PENDING, /**< Setup Timer */
+       TAPI_CALL_TSTATE_CONNECT_PENDING,       /**< Connected Timer */
+       TAPI_CALL_TSTATE_END_PENDING,           /**< Release Timer */
+       TAPI_CALL_TSTATE_HOLD_PENDING,          /**< Hold Timer */
+       TAPI_CALL_TSTATE_RETRIEVE_PENDING,      /**< Retrieve Timer */
+       TAPI_CALL_TSTATE_JOIN_PENDING,          /**< Join Timer */
+       TAPI_CALL_TSTATE_SPLIT_PENDING, /**< Split Timer */
+       TAPI_CALL_TSTATE_ECT_PENDING,           /**< ECT Timer */
+       TAPI_CALL_TSTATE_DTMF_PENDING,          /**< DTMF Timer */
+} TelTapiCallTimerState;
+
+typedef struct {
+       TS_BOOL bRequestedBySAT;                        /** This flag is to indicate whether the request has been initiated by SAT or not.Possible values are 0 and 1. This flag should be updated only when originating a setup request */
+       TelCallIdentityMode_t IdentityMode; /**< Sets Calling Line Identity mode. If default value  TAPI_IDENTITY_DEFAULT is set, OEM will set the default value. */
+       TelCallEmergencyCategory_t ecc;
+} tel_set_call_satflag_identiymode;
+
+/**
+ * This structure contains information about the redirect destination  information.
+ */
+typedef struct {
+       unsigned char number[TAPI_CALL_DIAL_NUMBER_LEN_MAX + 1]; /**< Redirect destination number */
+} TelCallDeflectDstInfo_t;
+
+/**
+ * This structure defines the calling name information
+ */
+typedef struct {
+       TelCallNameMode_t NameMode;                                     /**< Display mode of the szNameData. */
+       char szNameData[TAPI_CALLING_NAME_SIZE_MAX];    /**< Calling party name string.   */
+} TelCallingNameInfo_t;
+
+/**
+ * This structure contains information about an outgoing call.
+ */
+typedef struct {
+       TelCallType_t CallType;                                         /**< sets type of call (voice, data, video, emergency) */
+       char szNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< A string containing the destination phone number. This follows the dial number format.*/
+} TelCallDial_t;
+
+/**
+ * This structure contains information about call status.
+ */
+typedef struct {
+       int CallHandle;
+       int bMoCall;                                                                    /**< Status will be yes for MO Call. If MT call, then FALSE*/
+       char pNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1];  /**< Mobile Number */
+       TelCallType_t CallType;                                         /**< Specifies type of call (voice, data, emergency) */
+       TelCallStates_t CallState;                                              /**< Current Call state */
+       int bConferenceState;                                                   /**< Whether Call is in Conference or not*/
+} TelCallStatus_t;
+
+typedef void (*TelCallStatusCallback)( TelCallStatus_t *out, void *user_data );
+
+
+/**
+ * This structure contains information about call redirection details.
+ */
+typedef struct {
+       char szRedirectedNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1];               /**< Redirected party number */
+       char szRedirectSubAddress[TAPI_CALL_SUBADDRESS_LEN_MAX + 1];    /**< Redirect party sub-address */
+} TelCallRedirectionInfo_t;
+
+/**
+ * This structure contains the incoming call information.
+ */
+typedef struct {
+       unsigned int CallHandle;                                /**< At Foundation API Level, Call handle indicates the Handle of the Call for the Application . At Framework API Level, call handle indicates the Call identifier used for call by the OEM Adaptation Layer Plug-in */
+       TelCallType_t CallType;                         /**< Call type */
+       TelSsLineIdentificationType_t CliPresentationIndicator; /**< Calling Party presentation indicator */
+       char szCallingPartyNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< caller number,null terminated ASCII */
+       TelCallingNameInfo_t CallingNameInfo;   /**< Call name info. If there is no information from network, this information will be NULL.*/
+       TelCallRedirectionInfo_t RedirectInfo;  /**< The data for the Call Redirect information. If there is no information from network, this information will be NULL.  */
+       TelCallSSNocliCause_t CliCause;         /**< No of CLI cause */
+       int fwded;                                                              /**< True or false. If Incoming call is a forwarded call, then true else false. */
+       TelCallActiveLine_t ActiveLine;         /**< Current Active Line */
+} TelCallIncomingCallInfo_t;
+
+/**
+ *SS Info message.
+ */
+typedef struct {
+       TelCallMtSSInfo_t type; /* Type of the SS Info presnet. */
+       TelCallSSNocliCause_t no_cli_cause;
+} TelCallMtSsInfo_t; // not used
+
+typedef struct {
+       int isMobileOriginated;                                 /* Is this call Mobile Originated? */
+       TelCallNameMode_t nameMode;                             /* Calling Party Name availability mode */
+       char callNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /* A character array of the destination address. This follows the dial callNumber format. */
+       unsigned int startTime;                                 /* Time when a call is started */
+       unsigned int endTime;                                           /* Time when a call is ended */
+       TelCallType_t callType;                                 /* Type of a call */
+       TelCallStates_t callState;                                      /* State of a call */
+       TelCallActiveState_t activeState;                       /* Status of a call */
+       TelConferenceCallState_t conferenceState;       /* State of a conference call */
+       TelCallingNameInfo_t callingNameInfo;           /* Calling name information of a call */
+       TelCallActiveLine_t current_line;                       /* Line information of a call */
+       TelCallCause_t cause;                                           /* End type of a call when a call is ended */
+       TelTapiEndCause_t endCause;                             /* EndCause */
+} TelTapiCallInfo_t;
+
+/**
+ * This structure contains the connected number information.
+ */
+typedef struct {
+       TelCallSSNocliCause_t no_cli_cause; /**< Cause when no CLI number. */
+       unsigned char dcs;                                      /**< DCS */
+       unsigned char number_type;                      /**< Number type */
+       TelCallNameMode_t name_mode;            /**< Display mode of the name. */
+       char number[TAPI_CALL_DIALDIGIT_LEN_MAX + 1];           /**< Caller number, null terminated ASCII */
+       char sub_address[TAPI_CALL_SUBADDRESS_LEN_MAX + 1]; /**< Called sub-address, null terminated ASCII */
+} TelCallConnectedNumberInfo_t;
+
+/**
+ * This structure contains the voice privacy info(CDMA only).
+ */
+typedef struct {
+       TelCallPrivacyType_t PrivacyType; /**< Voice Privacy Request Type */
+       TelCallPrivacyMode_t PrivacyMode; /**< Voice Privacy Mode */
+} TelCallVoicePrivacyInfo_t;
+
+/**
+ * This structure contains the OTA progress indication information(CDMA only).
+ */
+typedef struct {
+       TelCallOtaType_t OtaType;                       /**< OTA type */
+       TelCallOtaspStatus_t OtaspStatus;       /**< OTASP status : if OTA type is  OTASP, it is valid */
+       TelCallOtapaStatus_t OtapaStatus;       /**< OTAPA status : if OTA type is  OTAPA, it is valid */
+} TelCallOtaProgressInfo_t;
+
+/**
+ * This structure contains information about a call time and call count.
+ */
+typedef struct {
+       unsigned short req_type_mask;   /**< call time request type */
+       unsigned long TotalCallCnt;     /**< Total Call Count */
+       unsigned long OutgoingCallCnt;  /**< Outgoing Call Count */
+       unsigned long IncomingCallCnt;  /**< Incoming Call Count */
+       unsigned long TotalCallTime;    /**< Overall Call Time(Outgoing + Incoming, in second) */
+       unsigned long OutgoingCallTime; /**< Overall Outgoing Call Time(in second) */
+       unsigned long IncomingCallTime; /**< Overall Incoming Call Time(in second) */
+       unsigned long LastCallTime;     /**< Last Call Time(in second) */
+} TelCallTimeInfo_t;
+
+/**
+ * This structure contains information about display record in CDMA.
+ */
+typedef struct {
+       unsigned char Record[TAPI_CALL_DISPLAY_RECORD_MAX + 1]; /**< display record */
+} TelCallDisplayRecordInfo_t;
+
+// New Struct for New API
+typedef enum {
+       TAPI_SOUND_MUTE              =0x00,             /**<Sound is mute*/
+       TAPI_SOUND_VOLUME_LEVEL_1=0x01,         /**<Volume level is 1*/
+       TAPI_SOUND_VOLUME_LEVEL_2=0x02,         /**<Volume level is 2*/
+       TAPI_SOUND_VOLUME_LEVEL_3=0x03,         /**<Volume level is 3*/
+       TAPI_SOUND_VOLUME_LEVEL_4=0x04,         /**<Volume level is 4*/
+       TAPI_SOUND_VOLUME_LEVEL_5=0x05,         /**<Volume level is 5*/
+       TAPI_SOUND_VOLUME_LEVEL_6=0x06,         /**<Volume level is 6*/
+       TAPI_SOUND_VOLUME_LEVEL_7=0x07,         /**<Volume level is 7*/
+       TAPI_SOUND_VOLUME_LEVEL_8=0x08,         /**<Volume level is 8*/
+       TAPI_SOUND_VOLUME_LEVEL_9=0x09          /**<Volume level is 9*/
+} TelSoundVolume_t;
+
+typedef enum {
+       TAPI_SOUND_DEVICE_RECEIVER = 0x00,
+       TAPI_SOUND_DEVICE_SPEAKER_PHONE = 0x10,
+       TAPI_SOUND_DEVICE_HFK = 0x20,
+       TAPI_SOUND_DEVICE_HEADSET = 0x30,
+       TAPI_SOUND_DEVICE_BLUETOOTH = 0x40,
+       TAPI_SOUND_DEVICE_EC = 0xA0,
+} TelSoundDevice_t;
+
+typedef enum {
+       TAPI_SOUND_TYPE_VOICE = 0x01,
+       TAPI_SOUND_TYPE_KEYTONE = 0x02,
+       TAPI_SOUND_TYPE_BELL = 0x03,
+       TAPI_SOUND_TYPE_MESSAGE = 0x04,
+       TAPI_SOUND_TYPE_ALARM = 0x05,
+       TAPI_SOUND_TYPE_PDA_MISC = 0x06,
+} TelSoundType_t;
+
+
+typedef struct {
+       TelSoundDevice_t device;
+       TelSoundType_t type;
+       TelSoundVolume_t volume;
+} TelCallVolumeInfo_t;
+
+typedef struct {
+       enum PathType {
+               TAPI_SOUND_PATH_HANDSET                 =0x01,          /**<Audio path is handset*/
+               TAPI_SOUND_PATH_HEADSET         =0x02,          /**<Audio path is handset*/
+               TAPI_SOUND_PATH_HANDSFREE               =0x03,          /**<Audio path is Handsfree*/
+               TAPI_SOUND_PATH_BLUETOOTH               =0x04,  /**<Audio path is bluetooth*/
+               TAPI_SOUND_PATH_STEREO_BLUETOOTH   =0x05,       /**<Audio path is stereo bluetooth*/
+               TAPI_SOUND_PATH_SPK_PHONE               =0x06,  /**<Audio path is speaker phone*/
+               TAPI_SOUND_PATH_HEADSET_3_5PI       =0x07,      /**<Audio path is headset_3_5PI*/
+               TAPI_SOUND_PATH_BT_NSEC_OFF         =0x08,
+               TAPI_SOUND_PATH_MIC1                =0x09,
+               TAPI_SOUND_PATH_MIC2                =0x0A,
+               TAPI_SOUND_PATH_HEADSET_HAC         =0x0B,
+       } type;
+       enum ExtraVolumeStatus {
+               TAPI_SOUND_EX_VOLUME_OFF,
+               TAPI_SOUND_EX_VOLUME_ON,
+       } ex_volume;
+} TelSoundPath_t;
+
+
+typedef enum {
+       TAPI_SOUND_MUTE_STATUS_OFF,
+       TAPI_SOUND_MUTE_STATUS_ON,
+} TelSoundMuteStatus_t;
+
+typedef struct {
+       unsigned int id;
+} TelCallAnswerCnf_t;
+
+typedef struct {
+       TelCallEndType_t type;
+       unsigned int id;
+} TelCallEndCnf_t;
+
+typedef struct {
+       unsigned int id;
+} TelCallHoldCnf_t;
+
+typedef struct {
+       unsigned int id;
+} TelCallActiveCnf_t;
+
+typedef struct {
+       unsigned int id;
+} TelCallSwapCnf_t;
+
+typedef struct {
+       unsigned int id;
+} TelCallJoinCnf_t;
+
+typedef struct {
+       unsigned int id;
+} TelCallSplitCnf_t;
+
+typedef struct {
+       unsigned int id;
+} TelCallTransferCnf_t;
+
+typedef struct {
+       unsigned int record_num;
+       TelCallVolumeInfo_t record[ 20 ];
+} TelCallGetVolumeInfoResp_t;
+
+typedef struct {
+       TelSoundMuteStatus_t status;
+} TelCallGetMuteStatusResp_t;
+
+typedef struct {
+       int code;
+       unsigned char data[ TAPI_CALL_CUSTOM_SERVICE_DATA_MAX ];
+       unsigned int data_len;
+} TelCallCustomServiceCnf_t;
+
+
+
+
+
+typedef struct {
+       unsigned int id;
+       TelTapiEndCause_t cause; /**< End cause for the call indicates whether the call is released normally or due to other cause*/
+} TelCallStatusIdleNoti_t;
+
+typedef struct {
+       unsigned int id;
+} TelCallStatusActiveNoti_t;
+
+typedef struct {
+       unsigned int id;
+} TelCallStatusHeldNoti_t;
+
+typedef struct {
+       unsigned int id;
+} TelCallStatusDialingNoti_t;
+
+typedef struct {
+       unsigned int id;
+} TelCallStatusAlertNoti_t;
+
+typedef struct {
+       unsigned int id;
+} TelCallStatusIncomingNoti_t;
+
+typedef struct {
+       unsigned int id;
+} TelCallStatusWaitingNoti_t;
+
+typedef struct {
+       int code;
+       unsigned char data[ TAPI_CALL_CUSTOM_SERVICE_DATA_MAX ];
+       unsigned int data_len;
+} TelCallCustomServiceNoti_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // _TEL_CALL_H_
+/**
+ * @}
+ */
diff --git a/src/sat_ui_support/TelDefines.h b/src/sat_ui_support/TelDefines.h
new file mode 100644 (file)
index 0000000..cb5411f
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * libtapi
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @ingroup            TelephonyAPI
+ * @addtogroup COMMON_TAPI     COMMON
+ * @{
+ *
+ * @file TelDefines.h
+ * @brief  This file  provides #defines required for Telephony server and TAPI Client Library
+ */
+
+#ifndef _TEL_DEFINES_H_
+#define _TEL_DEFINES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Machine independence */
+typedef long TS_INT32;
+typedef unsigned long TS_UINT32;
+
+typedef int TS_INT;
+typedef unsigned int TS_UINT;
+typedef double TS_DOUBLE;
+
+typedef int TS_BOOL;
+
+/* Programming concept */
+typedef unsigned char TS_BYTE;
+typedef unsigned short TS_WORD;
+typedef unsigned long TS_DWORD;
+typedef unsigned char TS_UINT8;
+typedef char TS_INT8;
+typedef unsigned short TS_UINT16;
+typedef unsigned long TS_ULONG;
+typedef unsigned long long TS_UINT64;
+typedef unsigned short TS_USHORT;
+
+#ifndef TRUE
+#define TRUE           1
+#endif
+
+#ifndef FALSE
+#define FALSE          0
+#endif
+
+#ifndef DEPRECATED
+#define DEPRECATED __attribute__((deprecated))
+#endif
+
+typedef int HObj;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TEL_DEFINES_H_ */
+
+/**
+ *  @}
+ */
diff --git a/src/sat_ui_support/TelErr.h b/src/sat_ui_support/TelErr.h
new file mode 100644 (file)
index 0000000..0b25164
--- /dev/null
@@ -0,0 +1,186 @@
+/*
+ * libslp-tapi
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @open
+ * @ingroup                    TelephonyAPI
+ * @addtogroup         COMMON_TAPI     COMMON
+ * @{
+ *     These error codes are used by Applications.
+ */
+
+
+#ifndef _TEL_ERR_H_
+#define _TEL_ERR_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/************************************************************
+**    Errors defined in  "+CME ERROR" ,
+**    - see 3GPP TS 27.007
+**    - ranges are 0x00 ~ 0x7FFF
+************************************************************/
+/**
+       Error codes sent by the modem in response to the above operations.
+*/
+typedef enum
+{
+  /* GENERAL ERRORS */
+  TAPI_OP_GEN_ERR_PHONE_FAILURE        = 0,                                            /* 0 */
+  TAPI_OP_GEN_ERR_NO_CONNECTION_TO_PHONE,                                      /* 1 */
+  TAPI_OP_GEN_ERR_PHONE_ADAPTOR_LINK_RESERVED,                 /* 2 */
+  TAPI_OP_GEN_ERR_OPER_NOT_ALLOWED,                                            /* 3 */
+  TAPI_OP_GEN_ERR_OPER_NOT_SUPPORTED,                                          /* 4 */
+  TAPI_OP_GEN_ERR_PH_SIM_PIN_REQU,                                             /* 5 */
+  TAPI_OP_GEN_ERR_PH_FSIM_PIN_REQU,                                            /* 6 */
+  TAPI_OP_GEN_ERR_PH_FSIM_PUK_REQU,                                            /* 7 */
+  TAPI_OP_GEN_ERR_SIM_NOT_INSERTED     =10,                                    /* 10 */
+  TAPI_OP_GEN_ERR_SIM_PIN_REQU,                                                        /* 11 */
+  TAPI_OP_GEN_ERR_SIM_PUK_REQU,                                                        /* 12 */
+  TAPI_OP_GEN_ERR_SIM_FAILURE,                                                 /* 13 */
+  TAPI_OP_GEN_ERR_SIM_BUSY,                                                            /* 14 */
+  TAPI_OP_GEN_ERR_SIM_WRONG,                                                           /* 15 */
+  TAPI_OP_GEN_ERR_INCORRECT_PW,                                                        /* 16 */
+  TAPI_OP_GEN_ERR_SIM_PIN2_REQU,                                                       /* 17 */
+  TAPI_OP_GEN_ERR_SIM_PUK2_REQU,                                                       /* 18 */
+  TAPI_OP_GEN_ERR_MEM_FULL     = 20,                                                   /* 20 */
+  TAPI_OP_GEN_ERR_INVALID_INDEX,                                                       /* 21 */
+  TAPI_OP_GEN_ERR_NOT_FOUND,                                                           /* 22 */
+  TAPI_OP_GEN_ERR_MEM_FAILURE,                                                 /* 23 */
+  TAPI_OP_GEN_ERR_TEXT_STR_TOO_LONG,                                           /* 24 */
+  TAPI_OP_GEN_ERR_INVALID_CHARACTERS_IN_TEXT_STR,                      /* 25 */
+  TAPI_OP_GEN_ERR_DIAL_STR_TOO_LONG,                                           /* 26 */
+  TAPI_OP_GEN_ERR_INVALID_CHARACTERS_IN_DIAL_STR,                      /* 27 */
+  TAPI_OP_GEN_ERR_NO_NET_SVC   = 30,                                           /* 30 */
+  TAPI_OP_GEN_ERR_NET_TIMEOUT,                                                 /* 31 */
+  TAPI_OP_GEN_ERR_NET_NOT_ALLOWED_EMERGENCY_CALLS_ONLY,        /* 32 */
+  TAPI_OP_GEN_ERR_NET_PERS_PIN_REQU    = 40,                                   /* 40 */
+  TAPI_OP_GEN_ERR_NET_PERS_PUK_REQU,                                           /* 41 */
+  TAPI_OP_GEN_ERR_NET_SUBSET_PERS_PIN_REQU,                            /* 42 */
+  TAPI_OP_GEN_ERR_NET_SUBSET_PERS_PUK_REQU,                            /* 43 */
+  TAPI_OP_GEN_ERR_SVC_PROVIDER_PERS_PIN_REQU,                          /* 44 */
+  TAPI_OP_GEN_ERR_SVC_PROVIDER_PERS_PUK_REQU,                          /* 45 */
+  TAPI_OP_GEN_ERR_CORPORATE_PERS_PIN_REQU,                             /* 46 */
+  TAPI_OP_GEN_ERR_CORPORATE_PERS_PUK_REQU,                             /* 47 */
+  TAPI_OP_GEN_ERR_HIDDEN_KEY_REQU,                                             /* 48 */
+  TAPI_OP_GEN_ERR_UNKNOWN      = 100,                                          /* 100 */
+
+  /* Errors related to a failure to perform an Attach */
+  TAPI_OP_GEN_ERR_ILLEGAL_MS   = 103,                                  /* 103 */
+  TAPI_OP_GEN_ERR_ILLEGAL_ME   = 106,                                  /* 106 */
+  TAPI_OP_GEN_ERR_GPRS_SVC_NOT_ALLOWED,                                        /* 107 */
+  TAPI_OP_GEN_ERR_PLMN_NOT_ALLOWED     = 111,                          /* 111 */
+  TAPI_OP_GEN_ERR_LOCATION_AREA_NOT_ALLOWED,                           /* 112 */
+  TAPI_OP_GEN_ERR_ROAMING_NOT_ALLOWED_IN_THIS_LOCATION_AREA,/* 113 */
+
+  /* Errors related to a failure to Activate a Context */
+  TAPI_OP_GEN_ERR_SVC_OPT_NOT_SUPPORTED        = 132,                  /* 132 */
+  TAPI_OP_GEN_ERR_REQ_SVC_OPT_NOT_SUBSCRIBED,                          /* 133 */
+  TAPI_OP_GEN_ERR_SVC_OPT_TEMPORARILY_OUT_OF_ORDER,            /* 134 */
+  TAPI_OP_GEN_ERR_UNSPECIFIED_GPRS_ERR = 148,                  /* 148 */
+  TAPI_OP_GEN_ERR_PDP_AUTHENTICATION_FAILURE,                          /* 149 */
+  TAPI_OP_GEN_ERR_INVALID_MOBILE_CLASS,                                        /* 150 */
+
+  /* VBS / VGCS and eMLPP -related errors */
+  TAPI_OP_GEN_ERR_VBS_VGCS_NOT_SUPPORTED_BY_THE_NET    = 151,  /* 151 */
+  TAPI_OP_GEN_ERR_NO_SVC_SUBSCRIPTION_ON_SIM,                          /* 152 */
+  TAPI_OP_GEN_ERR_NO_SUBSCRIPTION_FOR_GROUP_ID,                        /* 153 */
+  TAPI_OP_GEN_ERR_GROUP_ID_NOT_ACTIVATED_ON_SIM,                       /* 154 */
+  TAPI_OP_GEN_ERR_NO_MATCHING_NOTI     = 155,                          /* 155 */
+  TAPI_OP_GEN_ERR_VBS_VGCS_CALL_ALREADY_PRESENT,                       /* 156 */
+  TAPI_OP_GEN_ERR_CONGESTION,                                                          /* 157 */
+  TAPI_OP_GEN_ERR_NET_FAILURE,                                                 /* 158 */
+  TAPI_OP_GEN_ERR_UPLINK_BUSY,                                                 /* 159 */
+  TAPI_OP_GEN_ERR_NO_ACCESS_RIGHTS_FOR_SIM_FILE        = 160,  /* 160 */
+  TAPI_OP_GEN_ERR_NO_SUBSCRIPTION_FOR_PRIORITY,                        /* 161 */
+  TAPI_OP_GEN_ERR_OPER_NOT_APPLICABLE_OR_NOT_POSSIBLE, /* 162 */
+
+
+  TAPI_OP_GEN_ERR_NONE = 0x8000,                               /* 0x8000 : No Errors */
+
+  /* General Common Errors : 0x8000 - 0x80FF */
+  TAPI_OP_GEN_ERR_INVALID_IPC,                                                 /* 0x8001 : Invalid IPC_GSM Parameter or Format */
+  TAPI_OP_GEN_ERR_PHONE_OFFLINE,                                                       /* 0x8002 : */
+  TAPI_OP_GEN_ERR_CMD_NOT_ALLOWED,                                             /* 0x8003 : */
+  TAPI_OP_GEN_ERR_PHONE_IS_INUSE,                                                      /* 0x8004 : */
+  TAPI_OP_GEN_ERR_INVALID_STATE        = 0x8005,                                       /* 0x8005 : */
+
+  TAPI_OP_GEN_ERR_NO_BUFFER,                                                           /* 0x8006 :  No internal free buffers */
+  TAPI_OP_GEN_ERR_OPER_REJ,                                                            /* 0x8007 :  Operation Rejected */
+  TAPI_OP_GEN_ERR_INSUFFICIENT_RESOURCE,                                       /* 0x8008 : insufficient resource */
+  TAPI_OP_GEN_ERR_NET_NOT_RESPOND,                                             /* 0x8009 : Network not responding */
+  TAPI_OP_GEN_ERR_SIM_PIN_ENABLE_REQ   = 0x800A,                       /* 0x800A : SIM Pin Enable Required */
+  TAPI_OP_GEN_ERR_SIM_PERM_BLOCKED,                                    /* 0x800B : SIM Permanent Blocked */
+  TAPI_OP_GEN_ERR_SIM_PHONEBOOK_RESTRICTED,                            /*0x800C: SIM Phonebook Restricted*/
+  TAPI_OP_GEM_ERR_FIXED_DIALING_NUMBER_ONLY,                           /*0x800D: Restricted By FDN Mode */
+
+  /* Reserved : 0x800E ~ 0x80FF */
+  TAPI_OP_GEN_ERR_800E_RESERVED_START  = 0x800E,                       /* 0x800E */
+
+  TAPI_OP_GEN_ERR_80FF_RESERVED_END    = 0x80ff,                               /* 0x80FF */
+
+  /* the other errors */
+  TAPI_OP_GEN_ERR_OTHERS                               = 0xFFFE,                                 /* 0xFFFE */
+
+  TAPI_OP_GEN_ERR_MAX                                  = 0xFFFF
+
+}tapi_phone_err_t;
+
+typedef enum {
+       TAPI_PDP_FAILURE_CAUSE_NORMAL                                           = 0x00,           // 0x00 : Normal Process ( no problem )
+       TAPI_PDP_FAILURE_CAUSE_REL_BY_USER                                      = 0x01,           // Call Released by User
+       TAPI_PDP_FAILURE_CAUSE_REGULAR_DEACTIVATION                     = 0x02,           // Regular de-activation
+       TAPI_PDP_FAILURE_CAUSE_LLC_SNDCP                                        = 0x03,           // LLC SNDCP failure
+       TAPI_PDP_FAILURE_CAUSE_INSUFFICIENT_RESOURCE            = 0x04,           // Insufficient resources
+       TAPI_PDP_FAILURE_CAUSE_UNKNOWN_APN                                      = 0x05,           // Missing or unknown APN
+       TAPI_PDP_FAILURE_CAUSE_UNKNOWN_PDP_ADDRESS                      = 0x06,           // Unknown PDP address or type
+       TAPI_PDP_FAILURE_CAUSE_USER_AUTH_FAILED                         = 0x07,           // Unknown PDP address or type
+       TAPI_PDP_FAILURE_CAUSE_ACT_REJ_GGSN                                     = 0x08,           // Unknown PDP address or type
+       TAPI_PDP_FAILURE_CAUSE_ACT_REJ_UNSPECIFIED                      = 0x09,           // Unknown PDP address or type
+       TAPI_PDP_FAILURE_CAUSE_SVC_OPTION_NOT_SUPPORTED         = 0x0A,           // Service option not supported
+       TAPI_PDP_FAILURE_CAUSE_SVC_NOT_SUBSCRIBED                       = 0x0B,           // Requested service option not subscribed
+       TAPI_PDP_FAILURE_CAUSE_SVC_OPT_OUT_ORDER                        = 0x0C,           // Service out of order
+    TAPI_PDP_FAILURE_CAUSE_NSAPI_USED                                  = 0x0D,           // NSAPI already used
+       TAPI_PDP_FAILURE_CAUSE_QOS_NOT_ACCEPTED                         = 0x0E,           // QoS not accepted
+       TAPI_PDP_FAILURE_CAUSE_NETWORK_FAILURE                          = 0x0F,           // Network Failure
+    TAPI_PDP_FAILURE_CAUSE_REACT_REQUIRED                              = 0x10,           // Reactivation Required
+       TAPI_PDP_FAILURE_CAUSE_FEATURE_NOT_SUPPORTED            = 0x11,           // Feature not supported
+       TAPI_PDP_FAILURE_CAUSE_TFT_FILTER_ERROR                         = 0x12,           // TFT or filter error
+       TAPI_PDP_FAILURE_CAUSE_UNKOWN_PDP_CONTEXT                       = 0x13,           // Unknown PDP context
+       TAPI_PDP_FAILURE_CAUSE_INVALID_MSG                                      = 0x14,           // Invalid MSG
+       TAPI_PDP_FAILURE_CAUSE_PROTOCOL_ERROR                           = 0x15,           // Protocol error
+       TAPI_PDP_FAILURE_CAUSE_MOBILE_FAILURE_ERROR                     = 0x16,           // Mobile failure error
+       TAPI_PDP_FAILURE_CAUSE_TIMEOUT_ERROR                            = 0x17,           // Timeout error
+       TAPI_PDP_FAILURE_CAUSE_UNKNOWN_ERROR                            = 0x18,           // Unknown error
+       TAPI_PDP_FAILURE_CAUSE_MAX ,
+} tapi_pdp_err_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _TEL_ERR_H_
+
+/**
+* @}
+*/
diff --git a/src/sat_ui_support/TelSat.h b/src/sat_ui_support/TelSat.h
new file mode 100644 (file)
index 0000000..3d07eb6
--- /dev/null
@@ -0,0 +1,714 @@
+/*
+ * libslp-tapi
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+* @open
+* @ingroup             TelephonyAPI
+* @addtogroup  SAT_TAPI        SAT
+* @{
+*
+* @file TelSat.h
+
+     @brief This file serves as a "C" header file defines structures for Telephony SAT Services. \n
+      It contains a sample set of constants, enums, structs that would be required by applications.
+
+
+ */
+
+#ifndef _TEL_SAT_H_
+#define _TEL_SAT_H_
+
+#include <TelDefines.h>
+#include <TelCall.h>
+#include <TelSs.h>
+#include <TelSatObj.h>
+#include <TelSatProactvCmd.h>
+#include <TelSatEnvelope.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#define TAPI_SAT_DEF_TITLE_LEN_MAX                     50 /**< max length for Menu Title */
+#define TAPI_SAT_DEF_ITEM_STR_LEN_MAX          50 /**< max length for Menu Item  */
+#define TAPI_SAT_DEF_TEXT_STRING_LEN_MAX       500 /**< max length for Text String  */
+#define TAPI_SAT_DEF_BIT_MASK_CONTACT          0x01 /**< Bit Mask for Contact */
+#define TAPI_SAT_DEF_BIT_MASK_MSG                      0x02 /**< Bit Mask for Msg */
+#define TAPI_SAT_DEF_BIT_MASK_OTHER                    0x04 /**< Bit Mask for Psh */
+#define TAPI_SAT_REFRESH_FILE_LIST                     20 /**< Refresh File List*/
+#define TAPI_SAT_DEF_SS_LEN_MAX             250
+#define TAPI_SAT_DEF_USSD_LEN_MAX           250
+
+//     Telephony UI USER CONFIRM TYPE
+/**
+ * @enum TelSatUiUserConfirmType_t
+ * This enumeration defines the UI User Confirm Type.
+ */
+typedef enum
+{
+       TAPI_SAT_USER_CONFIRM_YES,                                              /**<This Enum Informs That user confirms yes */
+       TAPI_SAT_USER_CONFIRM_NO_OR_CANCEL,                             /**<This enum informs that user confirms no/cancel */
+       TAPI_SAT_USER_CONFIRM_HELP_INFO,                                /**<This enum informs that user wants help information */
+       TAPI_SAT_USER_CONFIRM_END,                                              /**<This enum informs that user confirms end */
+       TAPI_SAT_USER_CONFIRM_TIMEOUT,                                  /**<This enum informs that user did not respond */
+}TelSatUiUserConfirmType_t;
+
+//     Telephony UI INKEY TYPE
+/**
+ * @enum TelSatUiInkeyYesNoCaseType_t
+ * This enumeration defines the UI Inkey Type Yes or No.
+ */
+typedef enum
+{
+       TAPI_SAT_INKEY_CONFIRM_NO                               = 0x00,                 /**<No*/
+       TAPI_SAT_INKEY_CONFIRM_YES                              = 0x01,                 /**<Yes*/
+}TelSatUiInkeyYesNoCaseType_t;
+
+//     Telephony UI DISPLAY STATUS
+/**
+ * @enum TelSatUiDisplayStatusType_t
+ * This enumeration defines the UI Display Status.
+ */
+typedef enum
+{
+       TAPI_SAT_DISPLAY_SUCCESS                                = 0x00,                                 /**<This enum informs  UI display success*/
+       TAPI_SAT_DISPLAY_FAIL                                   = 0x01,                                 /**<This enum informs  UI display failure*/
+}TelSatUiDisplayStatusType_t;
+
+//     TELEPHONY REFRESH APPLICATION TYPE
+/**
+ * @enum TelSatRefreshAppType_t
+ * This enumeration defines the Refresh Application Type.
+ */
+ typedef enum
+{
+       TAPI_SAT_REFRESH_CONTACT = 0x00,                                /**<refresh application type - Phonebook*/
+       TAPI_SAT_REFRESH_MSG,                                                   /**<refresh application type - SMS*/
+       TAPI_SAT_REFRESH_OTHER,                                                 /**<refresh application type - other*/
+       TAPI_SAT_REFRESH_MAX,                                                   /**<Maximum Enumeration Value*/
+}TelSatRefreshAppType_t;
+
+//     Telephony COMMAND PERFORMED RESULT
+/**
+ * @enum TelSatCommandPerformResultType_t
+ * This enumeration defines the Result of Proactive Command execution.
+ */
+typedef enum
+{
+       TAPI_SAT_CMD_PERFORM_SUCCESS = 0x00,            /**<command performed successfully*/
+       TAPI_SAT_CMD_PERFORM_FAIL,                                      /**<command execution failed*/
+       TAPI_SAT_CMD_PERFORM_MAX,                                       /**<Maximum Enumeration Value*/
+}TelSatCommandPerformResultType_t;
+
+//     Telephony CALL CONTROL TYPE
+/**
+ * @enum TelSatCallCtrlType_t
+ * This enumeration defines Call Control Type.
+ */
+typedef enum
+{
+       TAPI_SAT_CALL_CNF_NONE  = 0x00,         /**<call control confirm type - None*/
+       TAPI_SAT_CALL_CNF_CALL,                 /**<call control confirm type - call*/
+       TAPI_SAT_CALL_CNF_SS,                           /**<call control confirm type - ss*/
+       TAPI_SAT_CALL_CNF_USSD,                         /**<call control confirm type - ussd*/
+       TAPI_SAT_CALL_CNF_MAX,                          /**<Maximum Enumeration Value*/
+}TelSatCallCtrlType_t;
+
+//     SAT UI USER CONFIRMATION INFO
+/**
+ * This structure defines the user confirmation data.
+ */
+typedef struct
+{
+       int                                             commandId;                              /**<Proactive Command Number sent by USIM*/
+       TelSatCommandType_t             commandType;                    /**<Proactive Command Type*/
+       TelSatUiUserConfirmType_t       keyType;                                /**<User Response Type*/
+       unsigned char*                          pAdditionalData;                /**<Additional Data*/
+       int                                                     dataLen;                                /**<Additional Data Length*/
+}TelSatUiUserConfirmInfo_t;
+
+//     Telephony TEXT INFO
+/**
+ * This structure defines the character data for sat engine data structure.
+ */
+typedef struct
+{
+       unsigned short  stringLen;                                                                              /**<character data length*/
+       unsigned char           string[TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1];             /**<character data*/
+}TelSatTextInfo_t;
+
+//     Telephony MAIN MENU TITLE INFO
+/**
+ * This structure defines the main menu title to check sat menu.
+ */
+typedef struct
+{
+       int                             bIsMainMenuPresent;             /**<flag to check sat main menu existence*/
+       TelSatTextInfo_t        mainMenuTitle;                  /**<main menu title data*/
+}TelSatMainMenuTitleInfo_t;
+
+//     Telephony DISPLAY TEXT DATA
+/**
+ * This structure defines the display text proactive command for sat ui.
+ */
+typedef struct
+{
+       int                                                     commandId;                                      /**<Proactive Command Number sent by USIM*/
+       TelSatTextInfo_t                                text;                                           /**<character data to display on screen*/
+       unsigned int                                    duration;                                       /**<the duration of display */
+       int                                                     bIsPriorityHigh;                        /**<indicates whether the text is to be displayed if some other app is using the screen.*/
+       int                                                     bIsUserRespRequired;            /**<indicates whether user response required or Not*/
+       TelSatIconIdentifierInfo_t      iconId;                                         /**< Icon Identifier */
+}TelSatDisplayTextInd_t;
+
+//     Telephony INKEY DATA
+/**
+ * This structure defines the get inkey proactive command data for sat ui.
+ */
+typedef struct
+{
+       int                                                     commandId;                              /**<Proactive Command Number sent by USIM*/
+       TelSatInkeyType_t                               keyType;                                /**<input Type:Character Set or Yes/No*/
+       TelSatUseInputAlphabetType_t    inputCharMode;                  /**<input character mode(SMS default, UCS2)*/
+       int                                                     bIsNumeric;                             /**<is input character numeric(0-9, *, # and +)*/
+       int                                                     bIsHelpInfoAvailable;   /**<help info request flag*/
+       TelSatTextInfo_t                                text;                                   /**<character data to display on screen*/
+       unsigned int                                    duration;                               /**<the duration of display*/
+       TelSatIconIdentifierInfo_t              iconId;                                 /**<Icon Identifier*/
+}TelSatGetInkeyInd_t;
+
+//     Telephony GET INPUT DATA
+/**
+ * This structure defines the get input proactive command data for sat ui.
+ */
+typedef struct
+{
+       int                                                     commandId;                              /**<Proactive Command Number sent by USIM*/
+       TelSatUseInputAlphabetType_t    inputCharMode;                  /**<input character mode(SMS default, UCS2)*/
+       int                                                     bIsNumeric;                             /**<is input character numeric(0-9, *, # and +)*/
+       int                                                     bIsHelpInfoAvailable;   /**<flag for help info request */
+       int                                                     bIsEchoInput;                   /**<indicates whether to show input data on screen or not*/
+       TelSatTextInfo_t                                text;                                   /**<character data to display on screen*/
+       TelSatRespLenInfo_t                             respLen;                                /**<input data min, max length*/
+       TelSatTextInfo_t                                defaultText;                    /**<default input character data*/
+       TelSatIconIdentifierInfo_t              iconId;                                 /**<Icon Identifier*/
+}TelSatGetInputInd_t;
+
+//     Telephony PLAY TONE DATA
+/**
+ * This structure defines the play tone proactive command data for application.
+ */
+typedef struct
+{
+       int                                             commandId;      /**<Proactive Command Number sent by USIM*/
+       TelSatTextInfo_t                        text;           /**<character data to display on screen*/
+       TelSatToneInfo_t                        tone;           /**<tone info   */
+       TelSatDurationInfo_t            duration;       /**<the duration for playing tone*/
+       TelSatIconIdentifierInfo_t      iconId;         /**<Icon Identifier*/
+}TelSatPlayToneInd_t;
+
+//     Telephony UI info
+/**
+ * This structure defines the data for sat ui.
+ */
+typedef struct
+{
+       int                                             commandId;              /**<Proactive Command Number sent by USIM*/
+       int                                             user_confirm;
+       TelSatTextInfo_t                        text;                   /**<character data to display on screen*/
+       TelSatIconIdentifierInfo_t      iconId;                 /**<Icon Identifier*/
+}TelSatSendUiInfo_t;
+
+//     Telephony MENU ITEM DATA FOR SETUP MENU
+/**
+ * This structure defines the menu item info for setup menu.
+ */
+typedef struct
+{
+       char itemString[TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6];     /**<menu item character data*/
+       char itemId;                                                                                    /**<identifies the item on the menu that user selected*/
+}TelSatMenuInfo_t;
+
+//     Telephony SETUP MENU INFO
+/**
+ * This structure defines the sat main menu info.
+ */
+typedef struct
+{
+       int commandId;  /**<Proactive Command Number sent by USIM*/
+       int     bIsMainMenuPresent;
+       char satMainTitle[TAPI_SAT_DEF_TITLE_LEN_MAX + 1];      /**<menu title text*/
+       TelSatMenuInfo_t satMainMenuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**< menu items*/
+       unsigned short satMainMenuNum;  /**<number of menu items*/
+       int     bIsSatMainMenuHelpInfo; /**<flag for help information request */
+       int     bIsUpdatedSatMainMenu;
+       TelSatIconIdentifierInfo_t iconId;      /**<Icon Identifier*/
+       TelSatIconIdentifierListInfo_t iconIdList;      /**<List of Icon Identifiers*/
+}TelSatSetupMenuInfo_t;
+
+//     Telephony SELECT ITEM DATA
+/**
+ * This structure defines the select item proactive command data for sat ui.
+ */
+typedef struct
+{
+       int                                                     commandId;                                                                      /**<Proactive Command Number sent by USIM*/
+       int                                                     bIsHelpInfoAvailable;                                           /**<flag for help information request*/
+       TelSatTextInfo_t                                text;                                                                           /**<menu title text*/
+       char                                                    defaultItemIndex;                                                       /**<selected default item - default value is 0*/
+       char                                                    menuItemCount;                                                          /**<number of menu items*/
+       TelSatMenuItemInfo_t                    menuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX];         /**<menu items*/
+       TelSatIconIdentifierInfo_t              iconId;                                                                         /**<Icon Identifier*/
+       TelSatIconIdentifierListInfo_t  iconIdList;                                                                     /**<List of Icon Identifiers*/
+
+}TelSatSelectItemInd_t;
+
+//     Telephony IDLE MODE TEXT DATA
+/**
+ * This structure defines the setup idle mode text proactive command for idle application.
+ */
+typedef struct
+{
+       int                                             commandId;                      /**<Proactive Command Number sent by USIM*/
+       TelSatTextInfo_t                        text;                           /**<character data to display on screen*/
+       TelSatIconIdentifierInfo_t      iconId;
+} TelSatSetupIdleModeTextInd_t;
+
+//     Telephony REFRESH DATA
+/**
+ * This structure defines the refresh proactive command data for sat ui.
+ */
+typedef struct
+{
+       int                                                     commandId;                      /**<Proactive Command Number sent by USIM*/
+       TelSatCmdQualiRefresh_t         refreshType;            /**<refresh mode*/
+}TelSatRefreshIndUiInfo_t;
+
+//     Telephony REFRESH DATA
+/**
+ * This structure defines the refresh proactive command data for applications which are concerned with files resident on USIM .
+ */
+typedef struct
+{
+       int                                             commandId;                                                              /**<Proactive Command Number sent by USIM*/
+       TelSatRefreshAppType_t          appType;                                                                /**<concerned application type */
+       TelSatCmdQualiRefresh_t         refreshMode;                                                    /**<refresh mode*/
+       unsigned char                                   fileCount;                                                              /**<refresh file count*/
+//     TelSimFileID_t                          fileId[TAPI_SAT_REFRESH_FILE_LIST];             /**<refresh file identifier*/
+}TelSatRefreshInd_t;
+
+//     Telephony END PROACTIVE COMMAND INFO
+/**
+ * This structure defines the data objects to indicate to sat ui, the end of execution of a specific proactive command by other application.
+ */
+typedef struct
+{
+       int                                                                     commandId;                      /**<Proactive Command Number sent by USIM*/
+       char                                                                    commandType;            /**< Command Type*/
+       TelSatCommandPerformResultType_t                result;                         /**<result of command execution by application*/
+}TelSatProactiveCmdEndIndInfo_t;
+
+//     Telephony SEND SMS DATA
+/**
+ * This structure defines the send sms proactive command data for sms application.
+ */
+typedef struct
+{
+       int                                     commandId;                              /**<Proactive Command Number sent by USIM*/
+       int                                     bIsPackingRequired;             /**<flag to check if packing required for sms tpdu*/
+       TelSatAddressInfo_t     address;                                /**<destination address*/
+       TelSatSmsTpduInfo_t     smsTpdu;                                /**<SMS TPDU data*/
+} TelSatSendSmsIndSmsData_t;
+
+//     Telephony SEND SS DATA
+/**
+ * This structure defines the send ss proactive command data for ss application.
+ */
+typedef struct
+{
+       int                                     commandId;              /**<Proactive Command Number sent by USIM*/
+       unsigned short          ssStringLen;
+       unsigned char           ssString[TAPI_SAT_DEF_SS_LEN_MAX+1];
+}TelSatSendSsIndSsData_t;
+
+//     Telephony USSD DATA
+/**
+ * This structure defines the send ussd proactive command data for ussd application.
+ */
+typedef struct
+{
+       int                     commandId;              /**<Proactive Command Number sent by USIM*/
+       unsigned char           rawDcs;                 /**<data coding scheme*/
+       unsigned short          ussdStringLen;
+       unsigned char           ussdString[TAPI_SAT_DEF_USSD_LEN_MAX+1];
+}TelSatSendUssdIndUssdData_t;
+
+//     Telephony SEND DTMF DATA
+/**
+ * This structure defines the send dtmf proactive command data for dtmf application.
+ */
+typedef struct
+{
+       int                                     commandId;                      /**<Proactive Command Number sent by USIM*/
+       int                                     bIsHiddenMode;          /**<hidden mode flag*/
+       TelSatTextInfo_t                dtmfString;                     /**<dtmf string data*/
+}TelSatSendDtmfIndDtmfData_t;
+
+//     Telephony SETUP CALL  DATA
+/**
+ * This structure defines the setup call proactive command data for call application.
+ */
+typedef struct
+{
+       int                                                     commandId;              /**<Proactive Command Number sent by USIM*/
+       TelSatCmdQualiSetupCall_t               calltype;                       /**<call type*/
+       TelSatTextInfo_t                                dispText;                       /**<display data for calling*/
+       TelSatTextInfo_t                                callNumber;             /**<call number*/
+       unsigned int                                    duration;                       /**<maximum repeat duration*/
+       TelSatIconIdentifierInfo_t              iconId;                 /**<icon identifier for call application*/
+}TelSatSetupCallIndCallData_t;
+
+//     Telephony LAUNCH BROWSER DATA
+/**
+ * This structure defines the launch browser proactive command data for browser application.
+ */
+typedef struct
+{
+       int                                                     commandId;              /**<Proactive Command Number sent by USIM*/
+       TelSatUrlInfo_t                                 url;                    /**<url to connect*/
+       TelSatCmdQualiLaunchBrowser_t   launchType;             /**<launch type*/
+       TelSatBrowserIdentityType_t     IdentityType;   /**<Browser Identity -default, html, etc*/
+}TelSatLaunchBrowserIndBrowserData_t;
+
+//     Telephony PROVIDE LOCAL INFO DATA
+/**
+ * This structure defines the provide local info proactive command data for application.
+ */
+typedef struct
+{
+       int commandId;                                                                          /**<Proactive Command Number sent by USIM*/
+       TelSatCmdQualiProvideLocalInfo_t localInfoType;         /**<Provide Local Information Type*/
+}TelSatProvideLocalInfoInd_t;
+
+//     Telephony LANGUAGE NOTIFICATION DATA
+/**
+ * This structure defines the language notification proactive command data for application.
+ */
+typedef struct
+{
+       int                                                     commandId;                                              /**<Proactive Command Number sent by USIM*/
+       int                                                     bSpecificLanguageNotification;  /**<flag for checking specific language notification. if FALSE, non-specific language notification      */
+       TelSatLanguageInfo_t                    language;                                       /**<language info from USIM application */
+}TelSatLanguageNotiInfoInd_t;
+
+//     Telephony PLAY TONE RETURN INFO
+/**
+ * This structure defines the return result data for Play Tone proactive command.
+ */
+typedef struct
+{
+       TelSatResultType_t      resp;                   /**<result response value*/
+}TelSatSetupMenuRetInfo_t;
+
+//     Telephony REFRESH RETURN INFO
+/**
+ * This structure defines the return result data for refresh proactive command.
+ */
+typedef struct
+{
+       TelSatRefreshAppType_t  appType;                        /**<application type*/
+       TelSatResultType_t              resp;                           /**<result response value*/
+}TelSatRefreshRetInfo_t;
+
+//     Telephony CALL RETURN INFO
+/**
+ * This structure defines the return result data for setup call proactive command.
+ */
+typedef struct
+{
+       TelSatResultType_t                              resp;                                                   /**<result response value*/
+       int                                                     bIsTapiCauseExist;                              /**<flag for checking tapi error cause */
+       TelCallCause_t                                  tapiCause;                                              /**<tapi call error cause*/
+       TelSsCause_t                                            ssCause;                                                /**<tapi ss error cause*/
+       TelSatMeProblemType_t                           meProblem;                                              /**<me problem error cause*/
+       int                                                             bIsOtherInfoExist;                              /**<call control result existence flag*/
+       TelSatCallCtrlProblemType_t             permanentCallCtrlProblem;               /**<call control problem type*/
+       TelSatCallCtrlRequestedActionInfo_t     callCtrlRequestedAction;                /**<call control request data*/
+       TelSatResultInfo_t                      result2;                                                /**<call control envelope result value*/
+       TelSatTextTypeInfo_t                    text;                                                   /**<call control envelope display data*/
+}TelSatCallRetInfo_t;
+
+//     Telephony SS RETURN INFO
+/**
+ * This structure defines the return result data for send ss proactive command.
+ */
+typedef struct
+{
+       TelSatResultType_t                              resp;                                                   /**<result response value*/
+       TelSsCause_t                                            ssCause;                                                /**<error - ss cause*/
+       TelSatTextInfo_t                                        ssString;                                               /**<ss result string*/
+       TelSatMeProblemType_t                   meProblem;                                              /**<error - me problem*/
+       int                                                             bIsOtherInfoExist;                              /**<call control result exist flag*/
+       TelSatCallCtrlProblemType_t                     additionalCallCtrlProblemInfo;  /**<call control problem*/
+       TelSatCallCtrlRequestedActionInfo_t     callCtrlRequestedAction;                /**<call control request data*/
+       TelSatResultInfo_t                                      result2;                                                /**<call control envelope result value*/
+}TelSatSsRetInfo_t;
+
+//     Telephony USSD RETURN INFO
+/**
+ * This structure defines the return result data for send ussd proactive command.
+ */
+typedef struct
+{
+       TelSatResultType_t                                      resp;                                                   /**<result response value*/
+       TelSsCause_t                                            ssCause;                                                /**<error - ss cause*/
+       TelSatTextInfo_t                                        ussdString;                                             /**<ussd result string*/
+       TelSatDataCodingSchemeInfo_t            dcsUssdString;                                  /**<dcs of ussd result string */
+       TelSatMeProblemType_t                           meProblem;                                              /**<error - me problem*/
+       int                                                             bIsOtherInfoExist;                              /**<call control result exist flag*/
+       TelSatCallCtrlProblemType_t                     additionalCallCtrlProblemInfo;  /**<call control problem*/
+       int                                                             bCallCtrlHasModification;               /**<call control request modification flag*/
+       TelSatCallCtrlRequestedActionInfo_t     callCtrlRequestedAction;                /**<call control request data*/
+       TelSatResultInfo_t                                      result2;                                                /**<call control envelope result value*/
+       TelSatTextTypeInfo_t                            text2;                                                  /**<cc envelope display data */
+}TelSatUssdRetInfo_t;
+
+//     Telephony SMS RETURN INFO
+/**
+ * This structure defines the return result data for send sms proactive command.
+ */
+typedef struct
+{
+       TelSatResultType_t      resp;                   /**<result response value*/
+}TelSatSmsRetInfo_t;
+
+//     Telephony DTMF RETUEN INFO
+/**
+ * This structure defines the return result data for send dtmf proactive command.
+ */
+typedef struct
+{
+       TelSatResultType_t      resp;                   /**<result response value*/
+}TelSatDtmfRetInfo_t;
+
+//     Telephony BROWSER RETURN INFO
+/**
+ * This structure defines the return result data for launch browser proactive command.
+ */
+typedef struct
+{
+       TelSatResultType_t                                      resp;                   /**<result response value*/
+       TelSatLaunchBrowserProblemType_t    browserProblem;     /**<specific browser problem*/
+}TelSatBrowserRetInfo_t;
+
+//     Telephony SETUP IDLE MODE TEXT RETURN INFO
+/**
+ * This structure defines the return result data for setup idle mode text proactive command.
+ */
+typedef struct
+{
+       TelSatResultType_t      resp;                   /**<result response value*/
+}TelSatIdleTextRetInfo_t;
+
+//     Telephony PLAY TONE RETURN INFO
+/**
+ * This structure defines the return result data for Play Tone proactive command.
+ */
+typedef struct
+{
+       TelSatResultType_t      resp;                   /**<result response value*/
+}TelSatPlayToneRetInfo_t;
+
+//     Telephony  PROVIDE LOCAL INFO RETURN INFO
+/**
+ * This structure defines the return result data for setup idle mode text proactive command.
+ */
+typedef struct
+{
+       TelSatResultType_t                                      resp;                   /**<result response value*/
+       int                                                             bOtherInfo;             /**<flag to check whether other information are required or not */
+       TelSatCmdQualiProvideLocalInfo_t        infoType;               /**<local info type - e.g. time zone or language info, etc      */
+       union
+       {
+               TelSatDataTimeZoneInfo_t                timeZoneInfo;   /**<    current time zone info  */
+               TelSatLanguageInfo_t                    languageInfo;   /**<    current ME language setting info        */
+       }u;                                                                                                     /**<    Union*/
+}TelSatProvideLocalRetInfo_t;
+
+//     Telephony LANGUAGE NOTI RETURN INFO
+/**
+ * This structure defines the return result data for setup idle mode text proactive command.
+ */
+typedef struct
+       {
+               TelSatResultType_t               resp;                          /**<result response value*/
+       }TelSatLanguageNotiRetInfo_t;
+
+//     Telephony DISPLAY TEXT RETURN INFO
+/**
+ * This structure defines the return result data for setup idle mode text proactive command.
+ */
+typedef struct
+       {
+               TelSatResultType_t               resp;                          /**<result response value*/
+               TelSatMeProblemType_t    meProblem;                     /**<Me Problem Type */
+       }TelSatDiplayTextRetInfo_t;
+
+//     Telephony APPLICATIONS RETURN DATA
+/**
+ * This structure defines the common return result data for applications proactive command.
+ */
+typedef struct
+{
+       TelSatCommandType_t     commandType;                                            /**<Proactive Command type*/
+       int commandId;                                                                                  /**<Proactive Command Number sent by USIM*/
+       union
+               {
+                       TelSatSetupMenuRetInfo_t        setupMenu;                      /**<result response value for setup menu*/
+                       TelSatRefreshRetInfo_t          refresh;                                /**<result response value for refresh*/
+                       TelSatCallRetInfo_t                     setupCall;                              /**<result response value for setup call*/
+                       TelSatSsRetInfo_t                       sendSs;                                 /**<result response value for send ss*/
+                       TelSatUssdRetInfo_t                     sendUssd;                               /**<result response value for send ussd*/
+                       TelSatSmsRetInfo_t                      sendSms;                                /**<result response value for send sms*/
+                       TelSatDtmfRetInfo_t                     sendDtmf;                               /**<result response value for send dtmf*/
+                       TelSatBrowserRetInfo_t          launchBrowser;                  /**<result response value for launch browser*/
+                       TelSatIdleTextRetInfo_t         setupIdleModeText;              /**<result response value for setup idle mode text*/
+                       TelSatLanguageNotiRetInfo_t     languageNoti;                   /**<result response value for language notification*/
+                       TelSatProvideLocalRetInfo_t provideLocalInfo;           /**<result response value for provide local info*/
+                       TelSatDiplayTextRetInfo_t   displayText;                        /**<result response value for dsiplay text*/
+                       TelSatPlayToneRetInfo_t     playTone;                           /**<result response value for play tone*/
+               }appsRet;                                                                                               /**< common union result value */
+}TelSatAppsRetInfo_t;
+
+//     Telephony CALL CONTROL CONFIRM  DATA FOR CALL
+/**
+ * This structure defines the call control confirm data for call.
+ */
+typedef struct
+{
+       TelSatTextInfo_t                                address;                                        /**< call destination address*/
+       TelSatTextInfo_t                                subAddress;                                     /**< call SUB address*/
+       TelSatBcRepeatIndicatorType_t   bcRepeatIndicator;                      /**< bc repeat indicator*/
+       TelSatTextInfo_t                                ccp1;                                           /**< Configuration Capability Parameter 1*/
+       TelSatTextInfo_t                                ccp2;                                           /**< Configuration Capability Parameter 2*/
+} TelSatCallCtrlIndCallData_t;
+
+//     Telephony CALL CONTROL CONFIRM  DATA FOR SS
+/**
+ * This structure defines the call control confirm data for ss.
+ */
+typedef struct
+{
+       TelSatTextInfo_t                                ssString;                                       /**< ss destination address*/
+       TelSatTextInfo_t                                subAddress;                                     /**< call SUB address*/
+       TelSatBcRepeatIndicatorType_t   bcRepeatIndicator;                      /**< bc repeat indicator*/
+       TelSatTextInfo_t                                ccp1;                                           /**< Configuration Capability Parameter 1*/
+       TelSatTextInfo_t                                ccp2;                                           /**< Configuration Capability Parameter 2*/
+} TelSatCallCtrlIndSsData_t;
+
+//     Telephony CALL CONTROL CONFIRM  DATA FOR USSD
+/**
+ * This structure defines the call control confirm data for ussd.
+ */
+typedef struct
+{
+       TelSatTextInfo_t                ussdString;                     /**< ussd destination address*/
+} TelSatCallCtrlIndUssdData_t;
+
+//     Telephony READ FILE REQUEST DATA
+/**
+ * This structure defines the common call control confirm data.
+ */
+typedef struct
+{
+       TelSatCallType_t                        callCtrlCnfType;                                /**<call control confirm type - call, ss or ussd*/
+       TelSatCallCtrlResultType_t      callCtrlResult;                                 /**<call control result*/
+       TelSatTextInfo_t                        dispData;                                               /**<call control display data*/
+       int                                             bIsUserInfoDisplayEnabled;              /**<flag for checking existence of call control display */
+
+       union
+               {
+                       TelSatCallCtrlIndCallData_t             callCtrlCnfCallData;    /**<call control call address*/
+                       TelSatCallCtrlIndSsData_t               callCtrlCnfSsData;              /**<call control ss string*/
+                       TelSatCallCtrlIndUssdData_t             callCtrlCnfUssdData;    /**<call control ussd string*/
+               }u;                                                                                                                             /**<   Union*/
+} TelSatCallCtrlIndData_t;
+
+//     Telephony MO SMS CONTROL CONFIRMATION DATA
+/**
+ * This structure defines the mo sms control confirm data.
+ */
+typedef struct
+{
+       TelSatCallCtrlResultType_t              moSmsCtrlResult;                        /**<envelope result*/
+       int                                                             bIsUserInfoDisplayEnabled;      /**<display present flag*/
+       TelSatTextTypeInfo_t                    dispData;                                       /**<display data for sending SMS*/
+       TelSatTextTypeInfo_t                    rpDestAddr;                             /**<the RP_Destination_Address of the Service Center */
+       TelSatTextTypeInfo_t                    tpDestAddr;                                     /**<the TP_Destination_Address */
+} TelSatMoSmCtrlIndData_t;
+
+//     Telephony EVENT LIST INFO
+/**
+ * This structure defines the Event List Info.
+ */
+typedef struct
+{
+       int bIsEventDownloadActive;                     /**<Is Event Download Active*/
+       int bIsMtCallEvent;                                     /**<Is Mt Call Event*/
+       int bIsCallConnected;                           /**<Is Call Connected*/
+       int bIsCallDisconnected;                        /**<Is Call Disconnected*/
+       int bIsLocationStatus;                          /**<Is Location Status*/
+       int bIsUserActivity;                            /**<Is User Activity*/
+       int bIsIdleScreenAvailable;                     /**<Is Idle Screen Available*/
+       int bIsCardReaderStatus;                        /**<Is Card Reader Status*/
+       int bIsLanguageSelection;                       /**<Is Language Selection*/
+       int bIsBrowserTermination;                      /**<Is Browser Termination*/
+       int bIsDataAvailable;                           /**<Is Data Available*/
+       int bIsChannelStatus;                           /**<Is Channel Status*/
+}      TelSatEventListData_t;
+
+/**
+ * This is the structure to be used by the Application to send envelope/event download data.
+ * This contains the data structures to be used to send any envelope/event download data.
+ */
+typedef struct
+{
+       TelSatEventDownloadType_t                                       eventDownloadType;                              /**<    eventDownload Type      */
+
+       union
+       {
+               int                                                                     bIdleScreenAvailable;                   /**<flag to specify whether Idle Screen is Available or not*/
+               TelSatLanguageSelectionEventReqInfo_t   languageSelectionEventReqInfo;  /**<Selected Language Information*/
+               TelSatBrowserTerminationEventReqInfo_t  browserTerminationEventReqInfo; /**<BrowserTermination Event Information        */
+               TelSatDataAvailableEventReqInfo_t               dataAvailableEventReqInfo;              /**<dataAvailableEventReqInfo   */
+               TelSatChannelStatusEventReqInfo_t               channelStatusEventReqInfo;              /**<channelStatusEventReqInfo   */
+       } u;                                                                                                                                            /**<Union*/
+} TelSatEventDownloadReqInfo_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TEL_SAT_H_ */
+
+/**
+* @}
+*/
diff --git a/src/sat_ui_support/TelSatEnvelope.h b/src/sat_ui_support/TelSatEnvelope.h
new file mode 100644 (file)
index 0000000..0232bff
--- /dev/null
@@ -0,0 +1,225 @@
+/*
+ * libslp-tapi
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+* @open
+* @ingroup             TelephonyAPI
+* @addtogroup  SAT_TAPI        SAT
+* @{
+*
+* @file TelSatEnvelope.h
+
+     @brief This file serves as a "C" header file defines structures for Tapi Sat envelope command Services. \n
+      It contains a sample set of constants, enums, structs that would be required by applications.
+ */
+
+#ifndef _TEL_SAT_ENVELOPE_H_
+#define _TEL_SAT_ENVELOPE_H_
+
+#include <TelSatObj.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+ * @enum TelSatCallType_t
+ * This enum indicates the SAT call type
+ */
+typedef enum
+{
+       TAPI_SAT_CALL_TYPE_MO_VOICE = 0X00,     /**<    call type -  mo voice   */
+       TAPI_SAT_CALL_TYPE_MO_SMS,                      /**<    call type - mo sms      */
+       TAPI_SAT_CALL_TYPE_SS,                          /**<    call type -  ss */
+       TAPI_SAT_CALL_TYPE_USSD,                        /**<    call type -  ussd       */
+       TAPI_SAT_PDP_CNTXT_ACT,                         /**<    call type -  pdp context action */
+       TAPI_SAT_CALL_TYPE_MAX                          /**<    call type -  max        */
+}TelSatCallType_t;
+
+/**
+ * @enum TelSatCallCtrlResultType_t
+ * This enum indicates the result of call control by SIM.
+ */
+typedef enum
+{
+       TAPI_SAT_CALL_CTRL_R_ALLOWED_NO_MOD                     = 0,            /**<    call control result type -  ALLOWED WITH NO MOD */
+       TAPI_SAT_CALL_CTRL_R_NOT_ALLOWED                        = 1,            /**<    call control result type -  NOT ALLOWED */
+       TAPI_SAT_CALL_CTRL_R_ALLOWED_WITH_MOD           = 2,            /**<    call control result type -  ALLOWED WITH MOD    */
+       TAPI_SAT_CALL_CTRL_R_RESERVED                           = 0xFF          /**<    call control result type -  RESERVED    */
+
+} TelSatCallCtrlResultType_t;
+
+/**
+ * @enum TelSatEnvelopeResp_t
+ * This enum indicates the general result of sending an envelope command to USIM.
+ */
+typedef enum
+{
+       TAPI_SAT_ENVELOPE_SUCCESS,      /**<    envelope result - success       */
+       TAPI_SAT_ENVELOPE_SIM_BUSY,     /**<    envelope result - USIM busy     */
+       TAPI_SAT_ENVELOPE_FAILED        /**<    envelope result - failed        */
+
+}TelSatEnvelopeResp_t;
+
+//     8.      MENU SELECTION
+/**
+ * This structure contains the data objects for MENU SELECTION envelope.
+ */
+typedef struct
+{
+       unsigned char           itemIdentifier;         /**<    menu selection item identifier  */
+       int                             bIsHelpRequested;       /**<    flag to check whether help information required or not  */
+} TelSatMenuSelectionReqInfo_t;
+
+//     9.1 CALL CONTROL BY SIM
+/**
+ * This struct contains the data objects for Call Control result data sent by USIM.
+ */
+typedef struct
+{
+       TelSatAddressInfo_t                             address;                        /**<    call number     */
+       TelSatSubAddressInfo_t                  subAddress;                     /**<    call number sub address */
+       TelSatBcRepeatIndicatorType_t   bcRepeatIndicator;      /**<    bc repeat indicator */
+       TelSatCapaConfigParamInfo_t             ccp1;                           /**<    capability configuration parameter1     */
+       TelSatCapaConfigParamInfo_t             ccp2;                           /**<    capability configuration parameter2     */
+}TelSatVoiceCallCtrlIndInfo_t;
+
+/**
+ * This struct contains SAT ss control result data sent by USIM.
+ */
+typedef struct
+{
+       TelSatSsStringInfo_t                    ssString;                       /**<    ss number       */
+       TelSatSubAddressInfo_t                  subAddress;                     /**<    ss sub address */
+       TelSatBcRepeatIndicatorType_t   bcRepeatIndicator;      /**<    bc repeat indicator     */
+       TelSatCapaConfigParamInfo_t             ccp1;                           /**<    capability configuration parameter1     */
+       TelSatCapaConfigParamInfo_t             ccp2;                           /**<    capability configuration parameter2     */
+}TelSatSsCtrlIndInfo_t;
+
+/**
+ * This struct contains SAT mo SMS control configuration data
+ */
+typedef struct
+{
+       TelSatAddressInfo_t             rpDestAddress;  /**<    sms control rp destination address      */
+       TelSatAddressInfo_t             tpDestAddress;  /**<    sms control tp destination address      */
+} TelSatMoSmsCtrlIndInfo_t;
+
+/**
+ * This struct contains SAT call control configuration data
+ */
+typedef struct
+{
+       TelSatCallType_t                                        callType;               /**<    call type       */
+       TelSatCallCtrlResultType_t                      callCtrlResult; /**<    call control result     */
+       TelSatAlphaIdentifierInfo_t                     alphaIdentifier;/**<    alpha identifier        */
+       unsigned char                                           callId;                 /**<    call id */
+       TelSatCallType_t                                        oldCallType;    /**<    old call type   */
+       union
+       {
+               TelSatVoiceCallCtrlIndInfo_t    voiceCallData;  /**<    voice call control data */
+               TelSatSsCtrlIndInfo_t                   ssData;                 /**<    ss control data */
+               TelSatMoSmsCtrlIndInfo_t                smsData;
+       }u;                                                                                                     /**<    Union           */
+} TelSatCallCtrlIndInfo_t;
+
+//     9.2 MO SHORT MESSAGE CONTROL BY SIM RESULT
+/**
+ * This struct contains SAT mo ss control request data
+ */
+ typedef struct
+{
+       TelSatCallCtrlResultType_t              callCtrlResult;         /**<    call control result     */
+       TelSatAlphaIdentifierInfo_t             alphaIdentifier;        /**<    alpha identifier        */
+       TelSatMoSmsCtrlIndInfo_t                smsData;                        /**<    sms control data        */
+}TelSatMoSMCtrlResult_t;
+
+//     11.5 EVENT DOWNLOAD - USER ACTIVITY EVENT
+/**
+ * This struct contains SAT user activity event request data
+ */
+typedef struct
+{
+       TelSatEventListInfo_t                           eventList;                      /**<    event List      */
+       TelSatDeviceIdentitiesInfo_t            deviceIdentities;       /**<    device identities info  */
+
+} TelSatUserActivityEventReqInfo_t;
+
+//     11.6 EVENT DOWNLOAD - IDLE SCREEN AVAILABLE EVENT
+/**
+ * This structure contains the data objects for IDLE SCREEN AVAILABLE event download.
+ */
+typedef struct
+{
+       TelSatEventDownloadType_t       eventData;      /**<    event type      */
+} TelSatIdleScreenAvailableEventReqInfo_t;
+
+//     11.8 EVENT DOWNLOAD - LANGUAGE SELECTION EVENT
+/**
+ * This structure contains the data objects for LANGUAGE SELECTION event download.
+ */
+typedef struct
+{
+       TelSatLanguageType_t     language;              /**<    selected language info  */
+} TelSatLanguageSelectionEventReqInfo_t;
+
+//     11.9 EVENT DOWNLOAD - BROWSER TERMINATION EVENT
+/**
+ * This structure contains the data objects for BROWSER TERMINATION event download.
+ */
+typedef struct
+{
+       TelSatBrowserTerminationCauseType_t             browserTerminationCause;        /**<    browser Termination Cause       */
+} TelSatBrowserTerminationEventReqInfo_t;
+
+//     11.10 EVENT DOWNLOAD - DATA AVAILABLE EVENT
+/**
+ * This struct contains SAT data available event request data
+ */
+typedef struct
+{
+       TelSatEventListInfo_t                   eventList;                      /**<    event List      */
+       TelSatDeviceIdentitiesInfo_t    deviceIdentities;       /**<    device identities info  */
+       TelSatChannelStatusInfo_t               channelStatus;          /**<    channel status  */
+       TelSatChannelDataLengthInfo_t   channelDataLen;         /**<    channel data length     */
+
+} TelSatDataAvailableEventReqInfo_t;
+
+//     11.11 EVENT DOWNLOAD - CHANNEL STATUS EVENT
+/**
+ * This struct contains SAT channel status even request data
+ */
+typedef struct
+{
+       TelSatEventListInfo_t                   eventList;                      /**<    event list      */
+       TelSatDeviceIdentitiesInfo_t    deviceIdentities;       /**<    device identities info  */
+       TelSatChannelStatusInfo_t               channelStatus;          /**<    channel Status  */
+} TelSatChannelStatusEventReqInfo_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TEL_SAT_ENVELOPE_H_ */
+
+/**
+ * @}
+ */
diff --git a/src/sat_ui_support/TelSatObj.h b/src/sat_ui_support/TelSatObj.h
new file mode 100644 (file)
index 0000000..7c75233
--- /dev/null
@@ -0,0 +1,1399 @@
+/*
+ * libslp-tapi
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @open
+ * @ingroup            TelephonyAPI
+ * @addtogroup         SAT_TAPI        SAT
+ * @{
+ *
+ * @file TelSatObj.h
+
+ @brief This file serves as a "C" header file defines structures for Telephony SAT Services. \n
+ It contains a sample set of constants, enums, structs that would be required by applications.
+ */
+
+#ifndef _TEL_SAT_OBJ_H_
+#define _TEL_SAT_OBJ_H_
+
+#include <TelDefines.h>
+#include <TelSim.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#define EXTENDED_ASCII 1
+
+#define TAPI_SAT_DIALLING_NUMBER_LEN_MAX                               200      /**<   max length of dialing number            */
+#define TAPI_SAT_ALPHA_ID_LEN_MAX                                              255      /**<   max length of  alpha identifier         */
+#define TAPI_SAT_TEXT_STRING_LEN_MAX                                   500      /**<   max length of text string -when the string data is in 7Bit packed format, this length is not enough to support the maximum size so should increase the value to a value > 275 */
+#define TAPI_SAT_SUB_ADDR_LEN_MAX                                              30       /**<   max length of sub address               */
+#define TAPI_SAT_CCP_DATA_LEN_MAX                                              30       /**<   max length of ccp data          */
+#define TAPI_SAT_ITEM_TEXT_LEN_MAX                                             45       /**<   max length of item text                 */
+#define TAPI_SAT_SMS_TPDU_SMS_DATA_LEN_MAX                             175      /**<   max length of sms tpdu data             */
+#define TAPI_SAT_SS_STRING_LEN_MAX                                             160      /**<   max length of ss string         */
+#define TAPI_SAT_USSD_STRING_LEN_MAX                                   255      /**<   max length of ussd string               */
+#define TAPI_SAT_FILE_ID_LIST_MAX_COUNT                                        255      /**<   max count of file id list               */
+#define TAPI_SAT_ITEMS_NEXT_ACTION_INDI_LIST_MAX_COUNT 50       /**<   max count of items next action indication list  */
+#define TAPI_SAT_EVENT_LIST_MAX_COUNT                                  17       /**<   max count of sat event list             */
+#define TAPI_SAT_IMG_INSTANT_RAW_DATA_LEN_MAX                  256      /**<   max length of image instant raw         */
+#define TAPI_SAT_CLUT_DATA_LEN_MAX                                             256      /**<   max length of clut data                 */
+#define TAPI_SAT_IMG_DATA_FILE_PATH_LEN_MAX                            50       /**<   max length of image data file name (Icon, CLUT)         */
+#define TAPI_SAT_ICON_LIST_MAX_COUNT                                   50       /**<   max count of icon list          */
+#define TAPI_SAT_DTMF_STRING_LEN_MAX                                   30       /**<   max length of dtmf string               */
+#define TAPI_SAT_DATE_TIME_AND_TIME_ZONE_LEN                   7        /**<   max length of date time and time zone           */
+#define TAPI_SAT_URL_LEN_MAX                                                   129      /**<   max length of url               */
+#define TAPI_SAT_BEARER_LIST_MAX_COUNT                                 50       /**<   max count of bearer list                */
+#define TAPI_SAT_PROVISIONING_FILE_PATH_LEN_MAX                        50       /**<   max length of provisioning file path    */
+#define TAPI_SAT_BEARER_PARAMS_LEN_MAX                                 10       /**<   max length of bearer parameters                 */
+#define TAPI_SAT_CHANNEL_DATA_STRING_LEN_MAX                   255      /**<   max length of channel data string               */
+#define TAPI_SAT_CHANNEL_STATUS_LEN                                            2        /**<   max length of channel status            */
+#define TAPI_SAT_CHANNEL_ID_LEN                                                        3        /**<   max length of channel id                */
+#define TAPI_SAT_OTHER_ADDR_LEN_MAX                                            30       /**<   max length of other address             */
+#define TAPI_SAT_PORT_NUMBER_LEN                                               2        /**<   max length of port number               */
+#define TAPI_SAT_NET_ACC_NAM_LEN_MAX                                   30       /**<   max length of net acc name              */
+#define TAPI_SAT_AID_LEN_MAX                                                   128      /**<   max length of aid               */
+#define TAPI_SAT_REMOTE_ENTITY_ADDR_LEN_MAX                            50       /**<   max length of remote entity address     */
+#define TAPI_SAT_ITEM_TEXT_ATTRIBUTES_LIST_MAX_COUNT   50       /**<   max count of item text attributes list          */
+#define TAPI_SAT_MCC_CODE_LEN                                                  3        /**<   max length of mcc               */
+#define TAPI_SAT_MNC_CODE_LEN                                                  3        /**<   max length of mnc               */
+#define TAPI_SAT_LAC_CODE_LEN                                                  2        /**<   max length of lac               */
+#define TAPI_SAT_CELL_ID_LEN                                                   2        /**<   max length of cell id   */
+
+/**
+ * @enum TelSatAlphabetFormatType_t
+ * This enum lists the Alphabet Format.
+ */
+typedef enum {
+       TAPI_SAT_ALPHABET_FORMAT_SMS_DEFAULT = 0x00, /**<       ALPHABET FROMAT SMS DEFAULT             */
+       TAPI_SAT_ALPHABET_FORMAT_8BIT_DATA = 0x01, /**< ALPHABET FROMAT 8BIT DATA               */
+       TAPI_SAT_ALPHABET_FORMAT_UCS2 = 0x02, /**<      ALPHABET FROMAT UCS2            */
+       TAPI_SAT_ALPHABET_FORMAT_RESERVED = 0x03 /**<   ALPHABET FROMAT RESERVED                */
+} TelSatAlphabetFormatType_t;
+
+/**
+ * @enum TelSatMsgClassType_t
+ * This enum lists the message class.
+ */
+typedef enum {
+       TAPI_SAT_MSG_CLASS_NONE = 0x00, /**<    none    */
+       TAPI_SAT_MSG_CLASS_0 = 0x01, /**<       class 0                 */
+       TAPI_SAT_MSG_CLASS_1, /**<      class 1 Default meaning:ME-specific             */
+       TAPI_SAT_MSG_CLASS_2, /**<      class 2 SIM specific message            */
+       TAPI_SAT_MSG_CLASS_3, /**<      class 3 Default meaning: TE specific            */
+       TAPI_SAT_MSG_CLASS_RESERVED = 0xFF /**< class reserved          */
+} TelSatMsgClassType_t;
+
+/**
+ * @enum TelSatCommandType_t
+ * This enum lists the type of command and the next action indicator.
+ */
+typedef enum {
+       TAPI_SAT_CMD_TYPE_NONE = 0x00, /**<     command type - None             */
+
+       TAPI_SAT_CMD_TYPE_REFRESH = 0x01, /**<  command type - refresh          */
+       TAPI_SAT_CMD_TYPE_MORE_TIME = 0x02, /**<        command type - more time                */
+       TAPI_SAT_CMD_TYPE_SETUP_EVENT_LIST = 0x05, /**< command type - setup event list                 */
+       TAPI_SAT_CMD_TYPE_SETUP_CALL = 0x10, /**<       command type - setup call               */
+       TAPI_SAT_CMD_TYPE_SEND_SS = 0x11, /**<  command type - send ss          */
+       TAPI_SAT_CMD_TYPE_SEND_USSD = 0x12, /**<        command type - send ussd                */
+       TAPI_SAT_CMD_TYPE_SEND_SMS = 0x13, /**< command type - send sms                 */
+       TAPI_SAT_CMD_TYPE_SEND_DTMF = 0x14, /**<        command type - send dtmf                */
+       TAPI_SAT_CMD_TYPE_LAUNCH_BROWSER = 0x15, /**<   command type - launch browser           */
+       TAPI_SAT_CMD_TYPE_PLAY_TONE = 0x20, /**<        command type - play tone                */
+       TAPI_SAT_CMD_TYPE_DISPLAY_TEXT = 0x21, /**<     command type - display text             */
+       TAPI_SAT_CMD_TYPE_GET_INKEY = 0x22, /**<        command type - get inkey                */
+       TAPI_SAT_CMD_TYPE_GET_INPUT = 0x23, /**<        command type - get input                */
+       TAPI_SAT_CMD_TYPE_SELECT_ITEM = 0x24, /**<      command type - select item              */
+       TAPI_SAT_CMD_TYPE_SETUP_MENU = 0x25, /**<       command type - setup menu               */
+       TAPI_SAT_CMD_TYPE_PROVIDE_LOCAL_INFO = 0x26, /**<       command type - provide local info               */
+       TAPI_SAT_CMD_TYPE_SETUP_IDLE_MODE_TEXT = 0x28, /**<     command type - setup idle mode text             */
+       TAPI_SAT_CMD_TYPE_LANGUAGE_NOTIFICATION = 0x35, /**<    command type - language notification            */
+       TAPI_SAT_CMD_TYPE_OPEN_CHANNEL = 0x40, /**<     command type - open channel -class e            */
+       TAPI_SAT_CMD_TYPE_CLOSE_CHANNEL = 0x41, /**<    command type - close channel - class e          */
+       TAPI_SAT_CMD_TYPE_RECEIVE_DATA = 0x42, /**<     command type - receive data -class e            */
+       TAPI_SAT_CMD_TYPE_SEND_DATA = 0x43, /**<        command type - send data                */
+       TAPI_SAT_CMD_TYPE_GET_CHANNEL_STATUS = 0x44, /**<       command type - get channel status -class e              */
+       TAPI_SAT_CMD_TYPE_END_OF_APP_EXEC = 0xFD, /**<  inform to End the execution of a Proactive Command*/
+       TAPI_SAT_CMD_TYPE_END_PROACTIVE_SESSION = 0xFE, /**<    inform end proactive session            */
+       TAPI_SAT_CMD_TYPE_RESERVED = 0xFF /**<  command type - reserved         */
+} TelSatCommandType_t;
+
+/**
+ * @enum TelSatCmdQualiRefresh_t
+ * This enum lists the Command qualifier values for Refresh command.
+ */
+typedef enum {
+       TAPI_SAT_REFRESH_SIM_INIT_AND_FULL_FCN = 0x00, /**<     command qualifier for REFRESH SIM INIT AND FULL FILE CHANGE_NOTIFICATION                */
+       TAPI_SAT_REFRESH_FCN = 0x01, /**<       command qualifier for REFRESH FILE CHANGE NOTIFICATION          */
+       TAPI_SAT_REFRESH_SIM_INIT_AND_FCN = 0x02, /**<  command qualifier for REFRESH SIM INIT AND FILE CHANGE NOTIFICATION             */
+       TAPI_SAT_REFRESH_SIM_INIT = 0x03, /**<  command qualifier for REFRESH SIM INIT          */
+       TAPI_SAT_REFRESH_SIM_RESET = 0x04, /**< command qualifier for REFRESH SIM RESET         */
+       TAPI_SAT_REFRESH_3G_APPLICATION_RESET = 0x05, /**<      command qualifier for REFRESH 3G APPLICATION RESET              */
+       TAPI_SAT_REFRESH_3G_SESSION_RESET = 0x06, /**<  command qualifier for REFRESH 3G SESSION RESET          */
+       TAPI_SAT_REFRESH_RESERVED = 0xFF /**<   command qualifier for REFRESH RESERVED          */
+} TelSatCmdQualiRefresh_t;
+
+/**
+ * @enum TelSatCmdQualiSetupCall_t
+ * This enum lists the Command qualifier values for setup call command.
+ */
+typedef enum {
+       TAPI_SAT_SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY = 0x00, /**<       command qualifier for SETUP CALL IF ANOTHER CALL NOT BUSY               */
+       TAPI_SAT_SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY_WITH_REDIAL = 0x01, /**<   command qualifier for SETUP CALL IF ANOTHER CALL NOT BUSY WITH REDIAL           */
+       TAPI_SAT_SETUP_CALL_PUT_ALL_OTHER_CALLS_ON_HOLD = 0x02, /**<    command qualifier for SETUP CALL PUTTING ALL OTHER CALLS ON HOLD                */
+       TAPI_SAT_SETUP_CALL_PUT_ALL_OTHER_CALLS_ON_HOLD_WITH_REDIAL = 0x03, /**<        command qualifier for SETUP CALL PUTTING ALL OTHER CALLS ON HOLD WITH REDIAL            */
+       TAPI_SAT_SETUP_CALL_DISCONN_ALL_OTHER_CALLS = 0x04, /**<        command qualifier for SETUP CALL DISCONNECTING ALL OTHER CALLS          */
+       TAPI_SAT_SETUP_CALL_DISCONN_ALL_OTHER_CALLS_WITH_REDIAL = 0x05, /**<    command qualifier for SETUP CALL DISCONNECTING ALL OTHER CALLS WITH REDIAL              */
+       TAPI_SAT_SETUP_CALL_RESERVED = 0xFF /**<        command qualifier for SETUP CALL RESERVED               */
+} TelSatCmdQualiSetupCall_t;
+
+/**
+ * @enum TelSatDisplayTextPriorityType_t
+ * This is associated with the command qualifier for display text.
+ */
+typedef enum {
+       TAPI_SAT_MSG_PRIORITY_NORMAL = 0, /**<  MSG PRIORITY NORMAL             */
+       TAPI_SAT_MSG_PRIORITY_HIGH = 1 /**<     MSG PRIORITY HIGH               */
+} TelSatDisplayTextPriorityType_t;
+
+/**
+ * @enum TelSatDisplayTextMsgClearType_t
+ * This is associated with the command qualifier for display text.
+ */
+typedef enum {
+       TAPI_SAT_AUTO_CLEAR_MSG_AFTER_A_DELAY = 0, /**< message clear type -  AUTO CLEAR MSG AFTER A DELAY              */
+       TAPI_SAT_WAIT_FOR_USER_TO_CLEAR_MSG = 1 /**<    message clear type -  WAIT FOR USER TO CLEAR MSG                */
+} TelSatDisplayTextMsgClearType_t;
+
+/**
+ * @enum TelSatInkeyType_t
+ * This is associated with the command qualifier for get inkey.
+ */
+typedef enum {
+       TAPI_SAT_INKEY_TYPE_CHARACTER_SET_ENABLED = 0, /**<     command qualifier for  INKEY TYPE CHARACTER SET ENABLED         */
+       TAPI_SAT_INKEY_TYPE_YES_NO_REQUESTED = 1 /**<   command qualifier for  INKEY TYPE YES NO REQUESTED              */
+} TelSatInkeyType_t;
+
+/**
+ * @enum TelSatUseInputAlphabetType_t
+ * This is associated with the command qualifier for get input.
+ */
+typedef enum {
+       TAPI_SAT_USER_INPUT_ALPHABET_TYPE_SMS_DEFAULT = 1, /**< command qualifier for  ALPHABET TYPE SMS DEFAULT                */
+       TAPI_SAT_USER_INPUT_ALPHABET_TYPE_UCS2 = 2 /**< command qualifier for  ALPHABET TYPE UCS2               */
+} TelSatUseInputAlphabetType_t;
+
+/**
+ * @enum TelSatDisplayVibrateAlertType_t
+ * This is associated with the command qualifier for play tone command.
+ */
+typedef enum {
+       TAPI_SAT_VIBRATE_ALERT_OPTIONAL = 0, /**<       VIBRATE ALERT UPTO THE TERMINAL         */
+       TAPI_SAT_VIBRATE_ALERT_REQUIRED = 1 /**<        VIBRATE, IF AVAILABLE, WITH TONE.               */
+} TelSatDisplayVibrateAlertType_t;
+
+/**
+ * @enum TelSatPresentationType_t
+ * This is associated with the command qualifier for select item command.
+ */
+typedef enum {
+       TAPI_SAT_PRESENTATION_TYPE_NOT_SPECIFIED = 0x00, /**<   command qualifier for PRESENTATION TYPE NOT SPECIFIED */
+       TAPI_SAT_PRESENTATION_TYPE_DATA_VALUE = 0x01, /**<      command qualifier for PRESENTATION TYPE DATA VALUE              */
+       TAPI_SAT_PRESENTATION_TYPE_NAVIGATION_OPTION = 0x02 /**<        command qualifier for PRESENTATION TYPE NAVIGATION OPTION       */
+} TelSatPresentationType_t;
+
+/**
+ * @enum TelSatSelectionPreferenceType_t
+ * This is associated with the command qualifier for select item command.
+ */
+typedef enum {
+       TAPI_SAT_SELECTION_PREFERENCE_NONE_REQUESTED = 0, /**<  command qualifier for SELECTION PREFERENCE NONE REQUESTED               */
+       TAPI_SAT_SELECTION_PREFERENCE_USING_SOFT_KEY = 1 /**<   command qualifier for SELECTION PREFERENCE USING SOFT KEY               */
+} TelSatSelectionPreferenceType_t;
+
+/**
+ * @enum TelSatCmdQualiProvideLocalInfo_t
+ * This enum defines the Command qualifier values for provide local info command.
+ */
+typedef enum {
+       TAPI_SAT_PROVIDE_DATE_TIME_AND_TIME_ZONE = 0x03, /**<   command qualifier for PROVIDE DATE TIME AND TIME ZONE           */
+       TAPI_SAT_PROVIDE_LANGUAGE_SETTING = 0x04, /**<  command qualifier for PROVIDE LANGUAGE SETTING          */
+       TAPI_SAT_PROVIDE_IMEISV = 0x08, TAPI_SAT_PROVIDE_RESERVED = 0xFF /**<   reserved                */
+} TelSatCmdQualiProvideLocalInfo_t;
+
+/**
+ * @enum TelSatCmdQualiLaunchBrowser_t
+ * This enum defines the Command qualifier values for launch browser command.
+ */
+typedef enum {
+       TAPI_SAT_LAUNCH_BROWSER = 0, /**<       command qualifier for  LAUNCH BROWSER           */
+       TAPI_SAT_NOT_USED = 1, /**<     command qualifier for  NOT USED         */
+       TAPI_SAT_USE_EXISTING_BROWSER = 2, /**< command qualifier for  USE EXISTING BROWSER if secure session, do not use it.           */
+       TAPI_SAT_CLOSE_AND_LAUNCH_NEW_BROWSER = 3, /**< command qualifier for CLOSE AND LAUNCH NEW BROWSER              */
+       TAPI_SAT_NOT_USED2 = 4, /**<    command qualifier for  NOT USED2                */
+       TAPI_SAT_LB_RESERVED = 0xFF /**<        reserved        */
+} TelSatCmdQualiLaunchBrowser_t;
+
+/**
+ * @enum TelSatDeviceIdentitiesTagType_t
+ * This enum lists the device identity tag value IDs.
+ */
+typedef enum {
+       TAPI_SAT_DEVICE_ID_KEYPAD = 0x01, /**<  DEVICE ID KEYPAD                */
+       TAPI_SAT_DEVICE_ID_DISPLAY = 0x02, /**< DEVICE ID DISPLAY               */
+       TAPI_SAT_DEVICE_ID_EARPIECE = 0x03, /**<        DEVICE ID EARPIECE              */
+
+       TAPI_SAT_DEVICE_ID_SIM = 0x81, /**<     DEVICE ID SIM           */
+       TAPI_SAT_DEVICE_ID_ME = 0x82, /**<      DEVICE ID ME            */
+       TAPI_SAT_DEVICE_ID_NETWORK = 0x83, /**< DEVICE ID NETWORK               */
+
+       TAPI_SAT_DEVICE_ID_RESERVED = 0XFF /**< reserved        */
+} TelSatDeviceIdentitiesTagType_t;
+
+/**
+ * @enum TelSatTimeUnitType_t
+ * This enum lists the time units for the duration data object.
+ */
+typedef enum {
+       TAPI_SAT_TIME_UNIT_MINUTES = 0x0, /**<  time unit - minutes             */
+       TAPI_SAT_TIME_UNIT_SECONDS = 0x01, /**< time unit - second              */
+       TAPI_SAT_TIME_UNIT_TENTHS_OF_SECONDS = 0x02, /**<       time unit - tenths of seconds           */
+       TAPI_SAT_TIME_UNIT_RESERVED = 0xFF /**< reserved        */
+} TelSatTimeUnitType_t;
+
+/**
+ * @enum TelSatResultType_t
+ * This enum lists the values for the RESULT data object - General Response.
+ */
+typedef enum {
+       TAPI_SAT_R_SUCCESS = 0x0, /**<  command performed successfully */
+       TAPI_SAT_R_SUCCESS_WITH_PARTIAL_COMPREHENSION = 0x01, /**<      command performed with partial comprehension    */
+       TAPI_SAT_R_SUCCESS_WITH_MISSING_INFO = 0x02, /**<       command performed, with missing information     */
+
+       TAPI_SAT_R_REFRESH_PERFORMED_WITH_ADDITIONAL_EFS_READ = 0x03, /**<      REFRESH PERFORMED WITH ADDITIONAL EFS READ              */
+       TAPI_SAT_R_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED = 0x04, /**<        command performed but REQUESTED ICON NOT DISPLAYED                      */
+       TAPI_SAT_R_SUCCESS_BUT_MODIFIED_BY_CALL_CONTROL_BY_SIM = 0x05, /**<     command performed but MODIFIED BY CALL CONTROL BY SIM           */
+       TAPI_SAT_R_SUCCESS_LIMITED_SERVICE = 0x06, /**< command performed with LIMITED SERVICE          */
+       TAPI_SAT_R_SUCCESS_WITH_MODIFICATION = 0x07, /**<       command performed with MODIFICATION             */
+       TAPI_SAT_R_REFRESH_PRFRMD_BUT_INDICATED_USIM_NOT_ACTIVE = 0x08, /**<    REFRESH PERFORMED BUT INDICATED USIM NOT ACTIVE                 */
+
+       TAPI_SAT_R_PROACTIVE_SESSION_TERMINATED_BY_USER = 0x10, /**<    proactive sim application session terminated by user            */
+       TAPI_SAT_R_BACKWARD_MOVE_BY_USER = 0x11, /**<   backward move in the proactive sim application session request by the user              */
+       TAPI_SAT_R_NO_RESPONSE_FROM_USER = 0x12, /**<   no response from user           */
+
+       TAPI_SAT_R_HELP_INFO_REQUIRED_BY_USER = 0x13, /**<      HELP INFO REQUIRED BY USER              */
+       TAPI_SAT_R_USSD_OR_SS_TRANSACTION_TERMINATED_BY_USER = 0x14, /**<       USSD OR SS TRANSACTION TERMINATED BY USER       */
+
+       TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND = 0x20, /**<    ME currently unable to process command          */
+       TAPI_SAT_R_NETWORK_UNABLE_TO_PROCESS_COMMAND = 0x21, /**<       Network currently unable to process command             */
+       TAPI_SAT_R_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ = 0x22, /**<      User did not accept call setup request          */
+       TAPI_SAT_R_USER_CLEAR_DOWN_CALL_BEFORE_CONN = 0x23, /**<        User cleared down call before connection or network released            */
+
+       TAPI_SAT_R_INTERACTION_WITH_CC_BY_SIM_IN_TMP_PRBLM = 0x25, /**< INTERACTION WITH CALL CONTROL BY SIM IN TEMPORARY PROBLEM               */
+       TAPI_SAT_R_LAUNCH_BROWSER_GENERIC_ERROR_CODE = 0x26, /**<       LAUNCH BROWSER GENERIC ERROR CODE               */
+
+       TAPI_SAT_R_BEYOND_ME_CAPABILITIES = 0x30, /**<  command beyond ME's capabilities                */
+       TAPI_SAT_R_COMMAND_TYPE_NOT_UNDERSTOOD_BY_ME = 0x31, /**<       command type not understood by ME               */
+       TAPI_SAT_R_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME = 0x32, /**<       command data not understood by ME               */
+       TAPI_SAT_R_COMMAND_NUMBER_NOT_KNOWN_BY_ME = 0x33, /**<  command number not known by ME          */
+       TAPI_SAT_R_SS_RETURN_ERROR = 0x34, /**< SS return error         */
+       TAPI_SAT_R_SMS_RP_ERROR = 0x35, /**<    SMS rp-error            */
+       TAPI_SAT_R_ERROR_REQUIRED_VALUES_ARE_MISSING = 0x36, /**<       Error, required values are missing              */
+
+       TAPI_SAT_R_USSD_RETURN_ERROR = 0x37, /**<       USSD_RETURN_ERROR               */
+       TAPI_SAT_R_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM = 0x39, /**< INTERACTION WITH CALL CONTROL OR SMS CONTROL PERMANENT PROBLEM          */
+       TAPI_SAT_R_BEARER_INDEPENDENT_PROTOCOL_ERROR = 0x3A, /**<       BEARER INDEPENDENT PROTOCOL ERROR               */
+       TAPI_SAT_R_FRAMES_ERROR = 0x3C /**<     FRAMES ERROR            */
+} TelSatResultType_t;
+
+/**
+ * @enum TelSatMeProblemType_t
+ * This enum lists the values for the Additional response for the RESULT object and specifies a particular ME PROBLEM.
+ */
+typedef enum {
+       TAPI_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE = 0x0, /**<       ME problem with NO SPECIFIC CAUSE               */
+       TAPI_SAT_ME_PROBLEM_SCREEN_BUSY = 0x01, /**<    ME problem with SCREEN BUSY             */
+       TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_CALL = 0x02, /**<        ME problem with ME BUSY ON CALL         */
+       TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_SS = 0x03, /**<  ME problem with ME_BUSY ON SS           */
+       TAPI_SAT_ME_PROBLEM_NO_SERVICE = 0x04, /**<     ME problem with NO SERVICE              */
+       TAPI_SAT_ME_PROBLEM_ACCESS_CONTROL_CLASS_BAR = 0x05, /**<       ME problem with ACCESS CONTROL CLASS BAR                */
+       TAPI_SAT_ME_PROBLEM_RADIO_RES_NOT_GRANTED = 0x06, /**<  ME problem with RADIO RES NOT GRANTED           */
+       TAPI_SAT_ME_PROBLEM_NOT_IN_SPEECH_CALL = 0x07, /**<     ME problem with NOT IN SPEECH CALL      */
+       TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_USSD = 0x08, /**<        ME problem with ME BUSY ON USSD         */
+       TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_SEND_DTMF_CMD = 0x09, /**<       ME problem with ME BUSY ON SEND DTMF CMD        */
+       TAPI_SAT_ME_PROBLEM_NO_USIM_ACTIVE = 0x0A, /**< ME problem with NO USIM ACTIVE          */
+       TAPI_SAT_ME_PROBLEM_INVALID = 0xFF /**< ME problem with INVALID                 */
+} TelSatMeProblemType_t;
+
+/**
+ * @enum TelSatNetworkProblemType_t
+ * This enum lists the values for the Additional response for the RESULT object and specifies a particular network PROBLEM.
+ */
+typedef enum {
+       TAPI_SAT_NETWORK_PROBLEM_NO_SPECIFIC_CAUSE = 0x0, /**<  Network problem with no specific cause          */
+       TAPI_SAT_NETWORK_PROBLEM_USER_BUSY = 0x91 /**<  Network problem with USER BUSY          */
+} TelSatNetworkProblemType_t;
+
+/**
+ * @enum TelSatSsProblemType_t
+ * This enum lists the values for the Additional response for the RESULT object related to SEND SS.
+ */
+typedef enum {
+       TAPI_SAT_SS_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**< SS problem with no specific cause               */
+       TAPI_SAT_SS_PROBLEM_FACILITY_NOT_SUPPORTED = 0x15 /**<  SS problem with FACILITY NOT SUPPORTED          */
+} TelSatSsProblemType_t;
+
+/**
+ * @enum TelSatSmsProblemType_t
+ * This enum lists the values for the Additional response for the RESULT object related to SEND SMS.
+ */
+typedef enum {
+       TAPI_SAT_SMS_PROBLEM_NO_SPECIFIC_CAUSE = 0 /**< SMS problem with no specific cause              */
+} TelSatSmsProblemType_t;
+
+/**
+ * @enum TelSatUssdProblemType_t
+ * This enum lists the values for the Additional response for the RESULT object related to SEND USSD STRING.
+ */
+typedef enum {
+       TAPI_SAT_USSD_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**<       USSD problem with no specific cause             */
+       TAPI_SAT_USSD_PROBLEM_UNKNOWN_ALPHABET = 0x47 /**<      USSD problem with UNKNOWN ALPHABET              */
+} TelSatUssdProblemType_t;
+
+/**
+ * @enum TelSatCallCtrlProblemType_t
+ * This enum lists the values for the Additional response for the RESULT object related to CALL CONTROL or MO SMS CONTROL.
+ */
+typedef enum {
+       TAPI_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**< Call Control problem with no specific cause             */
+       TAPI_SAT_CC_PROBLEM_ACTION_NOT_ALLOWED = 1, /**<        Call Control problem with action not allowed    */
+       TAPI_SAT_CC_PROBLEM_REQUEST_TYPE_HAS_CHANGED = 2 /**<   Call Control problem with request type has changed      */
+} TelSatCallCtrlProblemType_t;
+
+/**
+ * @enum TelSatLaunchBrowserProblemType_t
+ * This enum lists the values for the Additional response for the RESULT object related to LAUNCH BROWSER PROBLEM
+ */
+typedef enum {
+       TAPI_SAT_BROWSER_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**<    Browser problem with no specific cause          */
+       TAPI_SAT_BROWSER_PROBLEM_BEARER_UNAVAILABLE = 1, /**<   Browser problem with bearer unavailable         */
+       TAPI_SAT_BROWSER_PROBLEM_BROWSER_UNAVAILABLE = 2, /**<  Browser problem with browser unavailable                */
+       TAPI_SAT_BROWSER_PRBLM_ME_UNABLE_TO_READ_PROV_DATA = 3 /**<     Browser problem with ME unable to read provisioning data                */
+} TelSatLaunchBrowserProblemType_t;
+
+/**
+ * @enum TelSatBipProblemType_t
+ * This enum lists the values for the Additional response for the RESULT object.
+ *  Permanent Problems  ::: 12.12.11 ADDITIONAL INFORMATION :  BEARER INDEPENDENT PROTOCOL
+ */
+typedef enum {
+       TAPI_SAT_BIP_PROBLEM_NO_SPECIFIC_CAUSE = 0x00, /**<     BIP problem with no specific cause      */
+       TAPI_SAT_BIP_PROBLEM_NO_CHANNEL_AVAILABLE = 0x01, /**<  BIP problem with no channel available           */
+       TAPI_SAT_BIP_PROBLEM_CHANNEL_CLOSED = 0x02, /**<        BIP problem with channel closed                 */
+       TAPI_SAT_BIP_PROBLEM_CHANNEL_ID_NOT_VALID = 0x03, /**<  BIP problem with channel id not valid           */
+       TAPI_SAT_BIP_PROBLEM_BUF_SIZE_NOT_AVAILABLE = 0x04, /**<        BIP problem with buffer size not available              */
+       TAPI_SAT_BIP_PROBLEM_SECURITY_ERROR = 0x05, /**<        BIP problem with security error                 */
+       TAPI_SAT_BIP_PRBLM_SIM_ME_IF_TRNSPRT_LEVEL_NOT_AVL = 0x06, /**< BIP problem with SIM ME interface transport level not available         */
+       TAPI_SAT_BIP_REMOTE_DEV_NOT_REACHABLE = 0x07, /**<      BIP problem with remote device not reachable            */
+       TAPI_SAT_BIP_SERVICE_ERROR = 0x08, /**< BIP service error               */
+       TAPI_SAT_BIP_SERVICE_IDENTIFIER_UNKNOWN = 0x09 /**<     BIP service identifier unknown          */
+} TelSatBipProblemType_t;
+
+/**
+ * @enum TelSatSmsTpduType_t
+ * This enum lists the values for the SMS TPDU type.
+ */
+typedef enum {
+       TAPI_SAT_SMS_TPDU_TYPE_DELIVER_TPDU = 0, /**<   sms tpdu type - DELIVER TPDU    */
+       TAPI_SAT_SMS_TPDU_TYPE_DELIVER_RPT = 1, /**<    sms tpdu type - DELIVER RPT     */
+       TAPI_SAT_SMS_TPDU_TYPE_SUBMIT_TPDU = 2, /**<    sms tpdu type - SUBMIT TPDU             */
+       TAPI_SAT_SMS_TPDU_TYPE_SUBMIT_RPT = 3, /**<     sms tpdu type - SUBMIT RPT      */
+       TAPI_SAT_SMS_TPDU_TYPE_STATUS_RPT = 4, /**<     sms tpdu type - STATUS RPT      */
+       TAPI_SAT_SMS_TPDU_TYPE_TPDU_CMD = 5 /**<        sms tpdu type - TPDU CMD        */
+} TelSatSmsTpduType_t;
+
+/**
+ * @enum TelSatToneType_t
+ * This enum lists the values tones type.
+ */
+typedef enum {
+       // standard supervisory tones
+       TAPI_SAT_DIAL_TONE = 0x01, /**< TONE TYPE DIAL TONE             */
+       TAPI_SAT_CALLED_SUBSCRIBER_BUSY = 0x02, /**<    TONE TYPE CALLED SUBSCRIBER BUSY                */
+       TAPI_SAT_CONGESTION = 0x03, /**<        TONE TYPE CONGESTION    */
+       TAPI_SAT_RADIO_PATH_ACK = 0x04, /**<    TONE TYPE RADIO PATH ACK        */
+       TAPI_SAT_RADIO_PATH_NOT_AVAILABLE_CALL_DROPPED = 0x05, /**<     TONE TYPE RADIO PATH NOT AVAILABLE CALL DROPPED */
+       TAPI_SAT_ERR_SPECIAL_INFO = 0x06, /**<  TONE TYPE ERR SPECIAL INFO      */
+       TAPI_SAT_CALL_WAITING_TONE = 0x07, /**< TONE TYPE CALL WAITING TONE             */
+       TAPI_SAT_RINGING_TONE = 0x08, /**<      TONE TYPE RINGING TONE  */
+
+       // ME proprietary tones
+       TAPI_SAT_GENERAL_BEEP = 0x10, /**<      TONE TYPE GENERAL BEEP          */
+       TAPI_SAT_POSITIVE_ACK_TONE = 0x11, /**< TONE TYPE POSITIVE ACK TONE             */
+       TAPI_SAT_NEGATIVE_ACK_OR_ERROR_TONE = 0x12, /**<        TONE TYPE NEGATIVE ACK OR ERROR TONE            */
+       TAPI_SAT_RINGING_TONE_SLCTD_BY_USR_FOR_INCOM_SPEECH_CALL = 0x13, /**<   TONE TYPE RINGING TONE SELECTED BY USER FOR INCOMING SPEECH CALL                */
+       TAPI_SAT_ALERT_TONE_SELECTED_BY_USER_FOR_INCOMING_SMS = 0x14, /**<      TONE TYPE ALERT TONE SELECTED BY USER FOR INCOMING SMS          */
+       TAPI_SAT_CRITICAL_ALERT = 0x15, /**<    TONE TYPE CRITICAL ALERT                */
+
+       //Themed tones
+       TAPI_SAT_HAPPY_TONE = 0x30, /**<        TONE TYPE HAPPY TONE            */
+       TAPI_SAT_SAD_TONE = 0x31, /**<  TONE TYPE SAD TONE                      */
+       TAPI_SAT_URGENT_ACTION_TONE = 0x32, /**<        TONE TYPE URGENT ACTION TONE            */
+       TAPI_SAT_QUESTION_TONE = 0x33, /**<     TONE TYPE QUESTION TONE                 */
+       TAPI_SAT_MESSAGE_RECEIVED_TONE = 0x34, /**<     TONE TYPE MESSAGE RECEIVED TONE                 */
+
+       //Melody tones
+       TAPI_SAT_MELODY_1 = 0x40, /**<  TONE TYPE MELODY 1              */
+       TAPI_SAT_MELODY_2 = 0x41, /**<  TONE TYPE MELODY 2              */
+       TAPI_SAT_MELODY_3 = 0x42, /**<  TONE TYPE MELODY 3              */
+       TAPI_SAT_MELODY_4 = 0x43, /**<  TONE TYPE MELODY 4              */
+       TAPI_SAT_MELODY_5 = 0x44, /**<  TONE TYPE MELODY 5              */
+       TAPI_SAT_MELODY_6 = 0x45, /**<  TONE TYPE MELODY 6              */
+       TAPI_SAT_MELODY_7 = 0x46, /**<  TONE TYPE MELODY 7              */
+       TAPI_SAT_MELODY_8 = 0x47, /**<  TONE TYPE MELODY 8              */
+
+       TAPI_SAT_TONE_TYPE_RESERVED = 0xFF /**< TONE TYPE RESERVED              */
+} TelSatToneType_t;
+
+/**
+ * @enum TelSatEventDownloadType_t
+ * This enum lists event types required by ME to monitor and report to SIM.
+ */
+typedef enum {
+       TAPI_EVENT_SAT_DW_TYPE_MT_CALL = 0,
+       TAPI_EVENT_SAT_DW_TYPE_CALL_CONNECTED = 1,
+       TAPI_EVENT_SAT_DW_TYPE_CALL_DISCONNECTED = 2,
+       TAPI_EVENT_SAT_DW_TYPE_LOCATION_STATUS = 3,
+       TAPI_EVENT_SAT_DW_TYPE_USER_ACTIVITY = 4, /**<  data download type - USER_ACTIVITY              */
+       TAPI_EVENT_SAT_DW_TYPE_IDLE_SCREEN_AVAILABLE = 5, /**<  data download type - IDLE SCREEN AVAILABLE              */
+       TAPI_EVENT_SAT_DW_TYPE_CARD_READER_STATUS = 6,
+       TAPI_EVENT_SAT_DW_TYPE_LANGUAGE_SELECTION = 7, /**<     data download type - LANGUAGE SELECTION         */
+       TAPI_EVENT_SAT_DW_TYPE_BROWSER_TERMINATION = 8, /**<    data download type - BROWSER TERMINATION                */
+       TAPI_EVENT_SAT_DW_TYPE_DATA_AVAILABLE = 9, /**< data download type -DATA AVAILABLE              */
+       TAPI_EVENT_SAT_DW_TYPE_CHANNEL_STATUS = 0x0A, /**<      data download type - CHANNEL STATUS             */
+       TAPI_EVENT_SAT_DW_TYPE_ACCESS_TECHNOLOGY_CHANGED = 0x0B,
+       TAPI_EVENT_SAT_DW_TYPE_DISPLAY_PARAMETERS_CHANGED = 0x0C,
+       TAPI_EVENT_SAT_DW_TYPE_LOCAL_CONNECTION = 0x0D,
+       TAPI_EVENT_SAT_DW_TYPE_NW_SEARCH_MODE_CHANGED = 0X0E,
+       TAPI_EVENT_SAT_DW_TYPE_BROWSING_STATUS = 0X0F,
+       TAPI_EVENT_SAT_DW_TYPE_FRAMES_INFORMATION_CHANGED = 0X10,
+       TAPI_EVENT_SAT_DW_TYPE_RESERVED_FOR_3GPP = 0X11,
+       TAPI_EVENT_SAT_DW_TYPE_UNKNOWN = 0xFF /**<      data download type - unknown            */
+} TelSatEventDownloadType_t;
+
+/**
+ * @enum TelSatImageCodingSchemeType_t
+ * This enum lists image coding scheme types required by ME to show.
+ */
+typedef enum {
+       TAPI_SAT_SIM_IMAGE_CODING_SCHEME_BASIC = 0x11, /**<     IMAGE CODING SCHEME BASIC               */
+       TAPI_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR = 0x21, /**<    IMAGE CODING SCHEME COLOUR              */
+       TAPI_SAT_SIM_IMAGE_CODING_SCHEME_RESERVED = 0xFF /**<      RESERVED             */
+} TelSatImageCodingSchemeType_t;
+
+/**
+ * @enum TelSatIconQualifierType_t
+ * This enum defines the icon qualifier.
+ */
+typedef enum {
+       TAPI_SAT_ICON_QUALI_SELF_EXPLANATORY = 0, /**<  ICON QUALI SELF EXPLANATORY     */
+       TAPI_SAT_ICON_QUALI_NOT_SELF_EXPLANATORY = 1, /**<      ICON QUALI NOT SELF EXPLANATORY         */
+       TAPI_SAT_ICON_QUALI_RESERVED = 0xFF /**<          RESERVED      */
+} TelSatIconQualifierType_t;
+
+/**
+ * @enum TelSatBcRepeatIndicatorType_t
+ * This enum defines the SIM ATK BC repeat indicator type.
+ */
+typedef enum {
+       TAPI_SAT_BC_REPEAT_INDI_ALTERNATE_MODE = 0x01, /**<     BC REPEAT ALTERNATE MODE                */
+       TAPI_SAT_BC_REPEAT_INDI_SEQUENTIAL_MODE = 0x03, /**<    BC REPEAT SEQUENTIAL MODE               */
+       TAPI_SAT_BC_REPEAT_INDI_RESERVED = 0xFF /**<    RESERVED        */
+} TelSatBcRepeatIndicatorType_t;
+
+/**
+ * @enum TelSatCallCtrlStringType_t
+ * This enum defines call control string type.
+ */
+typedef enum {
+       TAPI_SAT_CC_VOICE = 0x00, /**<  Call Control String Type - voice                */
+       TAPI_SAT_CC_SS = 0x01, /**<     Call Control String Type - ss           */
+       TAPI_SAT_CC_USSD = 0x02, /**<   Call Control String Type - ussd         */
+       TAPI_SAT_CC_NONE = 0xFF /**<    Call Control String Type - none                 */
+} TelSatCallCtrlStringType_t;
+
+/**
+ * @enum TelSatLanguageType_t
+ * This enum lists the language values.
+ */
+typedef enum {
+       TAPI_SAT_LP_GERMAN = 0x00, /**< GERMAN          */
+       TAPI_SAT_LP_ENGLISH = 0x01, /**<        ENGLISH         */
+       TAPI_SAT_LP_ITALIAN = 0x02, /**<        ITALIAN         */
+       TAPI_SAT_LP_FRENCH = 0x03, /**< FRENCH          */
+       TAPI_SAT_LP_SPANISH = 0x04, /**<        SPANISH         */
+       TAPI_SAT_LP_DUTCH = 0x05, /**<  DUTCH           */
+       TAPI_SAT_LP_SWEDISH = 0x06, /**<        SWEDISH */
+       TAPI_SAT_LP_DANISH = 0x07, /**< DANISH  */
+       TAPI_SAT_LP_PORTUGUESE = 0x08, /**<     PORTUGUESE      */
+       TAPI_SAT_LP_FINNISH = 0x09, /**<        FINNISH */
+       TAPI_SAT_LP_NORWEGIAN = 0x0A, /**<      NORWEGIAN       */
+       TAPI_SAT_LP_GREEK = 0x0B, /**<  GREEK   */
+       TAPI_SAT_LP_TURKISH = 0x0C, /**<        TURKISH */
+       TAPI_SAT_LP_HUNGARIAN = 0x0D, /**<      HUNGARIAN       */
+       TAPI_SAT_LP_POLISH = 0x0E, /**< POLISH  */
+       TAPI_SAT_LP_LANG_UNSPECIFIED = 0x0F /**<        LANGUAGE UNSPECIFIED    */
+} TelSatLanguageType_t;
+
+/**
+ * @enum TelSatBrowserIdentityType_t
+ * This enum lists the SAT browser identity type.
+ */
+typedef enum {
+       TAPI_SAT_BROWSER_ID_DEFAULT = 0x0, /**< DEFAULT BROWSER                 */
+       TAPI_SAT_BROWSER_ID_WML, /**<   BROWSER WML     */
+       TAPI_SAT_BROWSER_ID_HTML, /**<  BROWSER HTML    */
+       TAPI_SAT_BROWSER_ID_XHTML, /**< BROWSER XHTML   */
+       TAPI_SAT_BROWSER_ID_CHTML, /**< BROWSER CHTML   */
+       TAPI_SAT_BROWSER_ID_RESERVED = 0xFF /**<        RESERVED        */
+} TelSatBrowserIdentityType_t;
+
+/**
+ * @enum TelSatBearerType_t
+ * This enum lists the SAT bearer type.
+ */
+typedef enum {
+       TAPI_SAT_BEARER_TYPE_SMS = 0x0, /**<    BEARER SMS              */
+       TAPI_SAT_BEARER_TYPE_CSD = 0x1, /**<    BEARER CSD              */
+       TAPI_SAT_BEARER_TYPE_USSD = 0x2, /**<   BEARER USSD             */
+       TAPI_SAT_BEARER_TYPE_GPRS = 0x3, /**<   BEARER GPRS             */
+       TAPI_SAT_BEARER_TYPE_RESERVED = 0xFF /**<       BEARER RESERVED         */
+} TelSatBearerType_t;
+
+/**
+ * @enum TelSatBrowserTerminationCauseType_t
+ * This enum lists the SAT browser termination cause type.
+ */
+typedef enum {
+       TAPI_SAT_BROWSER_TERMINATED_BY_USER = 0, /**<   BROWSER TERMINATED BY USER              */
+       TAPI_SAT_BROWSER_TERMINATED_BY_ERROR = 1, /**<  BROWSER TERMINATED BY ERROR             */
+} TelSatBrowserTerminationCauseType_t;
+
+/**
+ * @enum TelSatBearerDescType_t
+ * This enum lists the SAT bearer destination type.
+ */
+typedef enum {
+       TAPI_SAT_BEARER_CSD = 0x1, /**< BEARER DESC CSD                 */
+       TAPI_SAT_BEARER_GPRS = 0x2, /**<        BEARER DESC GPRS                */
+       TAPI_SAT_BEARER_DEFAULT_BEARER_FROM_TRANSPORT_LAYER = 0x3, /**< BEARER DESC DEFAULT BEARER FROM TRANSPORT LAYER         */
+       TAPI_SAT_BEARER_LOCAL_LINK_TECHNOLOGY_INDEPENDENT = 0x4, /**<   BEARER DESC LOCAL LINK TECHNOLOGY INDEPENDENT           */
+       TAPI_SAT_BEARER_BLUETOOTH = 0x5, /**<   BEARER DESC BLUETOOTH   */
+       TAPI_SAT_BEARER_IrDA = 0x6, /**<        BEARER DESC IrDA        */
+       TAPI_SAT_BEARER_RS232 = 0x7, /**<       BEARER DESC RS232       */
+       TAPI_SAT_BEARER_USB = 0x10, /**<        BEARER DESC USB */
+       TAPI_SAT_BEARER_RESERVED = 0xFF /**<    RESERVED        */
+} TelSatBearerDescType_t;
+
+/**
+ * @enum TelSatBearerParamCsdDataRateType_t
+ * This enum lists the SAT bearer parameter csd data rate. refer TS 27.007
+ */
+typedef enum {
+       TAPI_SAT_BIP_DR_AUTOBAUDING = 0, /**<   CSD data rate - AUTOBAUDING             */
+       TAPI_SAT_BIP_DR_300BPS_V21 = 1, /**<    CSD data rate -300BPS V21               */
+       TAPI_SAT_BIP_DR_1200BPS_V22 = 2, /**<   CSD data rate - 1200BPS V22             */
+       TAPI_SAT_BIP_DR_1200_75BPS_V23 = 3, /**<        CSD data rate -1200 75BPS V23                   */
+       TAPI_SAT_BIP_DR_2400BPS_V22 = 4, /**<   CSD data rate -2400BPS V22              */
+       TAPI_SAT_BIP_DR_2400BPS_V26 = 5, /**<   CSD data rate - 2400BPS V26                     */
+       TAPI_SAT_BIP_DR_4800BPS_V32 = 6, /**<   CSD data rate - 4800BPS V32             */
+       TAPI_SAT_BIP_DR_9600BPS_V32 = 7, /**<   CSD data rate - 9600BPS V32             */
+       TAPI_SAT_BIP_DR_9600BPS_V34 = 12, /**<  CSD data rate - 9600BPS_V34             */
+       TAPI_SAT_BIP_DR_14400BPS_V34 = 14, /**< CSD data rate -14400BPS V34             */
+       TAPI_SAT_BIP_DR_19200BPS_V34 = 15, /**< CSD data rate -19200BPS V34             */
+       TAPI_SAT_BIP_DR_28800BPS_V34 = 16, /**< CSD data rate -28800BPS V34             */
+       TAPI_SAT_BIP_DR_33600BPS_V34 = 17, /**< CSD data rate -33600BPS V34             */
+       TAPI_SAT_BIP_DR_1200BPS_V120 = 34, /**< CSD data rate -1200BPS V120             */
+       TAPI_SAT_BIP_DR_2400BPS_V120 = 36, /**< CSD data rate -2400BPS V120             */
+       TAPI_SAT_BIP_DR_4800BPS_V120 = 38, /**< CSD data rate -4800BPS V120             */
+       TAPI_SAT_BIP_DR_9600BPS_V120 = 39, /**< CSD data rate -9600BPS V120             */
+       TAPI_SAT_BIP_DR_14400BPS_V120 = 43, /**<        CSD data rate -14400BPS V120            */
+       TAPI_SAT_BIP_DR_19200BPS_V120 = 47, /**<        CSD data rate -19200BPS V120            */
+       TAPI_SAT_BIP_DR_28800BPS_V120 = 48, /**<        CSD data rate -28800BPS V120            */
+       TAPI_SAT_BIP_DR_38400BPS_V120 = 49, /**<        CSD data rate -38400BPS V120            */
+       TAPI_SAT_BIP_DR_48000BPS_V120 = 50, /**<        CSD data rate -48000BPS V120            */
+       TAPI_SAT_BIP_DR_56000BPS_V120 = 51, /**<        CSD data rate -56000BPS V120            */
+       TAPI_SAT_BIP_DR_300BPS_V110 = 65, /**<  CSD data rate - 300BPS V110             */
+       TAPI_SAT_BIP_DR_1200BPS_V110 = 66, /**< CSD data rate -1200BPS V110             */
+       TAPI_SAT_BIP_DR_2400BPS_V110_OR_X31_FALG_STUFFING = 68, /**<    CSD data rate - 2400BPS V110 OR X31 FALG STUFFING               */
+       TAPI_SAT_BIP_DR_4800BPS_V110_OR_X31_FALG_STUFFING = 70, /**<    CSD data rate - 4800BPS V110 OR X31 FALG STUFFING               */
+       TAPI_SAT_BIP_DR_9600BPS_V110_OR_X31_FALG_STUFFING = 71, /**<    CSD data rate - 9600BPS V110 OR X31 FALG STUFFING               */
+       TAPI_SAT_BIP_DR_14400BPS_V110_OR_X31_FALG_STUFFING = 75, /**<   CSD data rate - 14400BPS V110 OR X31 FALG STUFFING              */
+       TAPI_SAT_BIP_DR_19200BPS_V110_OR_X31_FALG_STUFFING = 79, /**<   CSD data rate -19200BPS V110 OR X31 FALG STUFFING               */
+       TAPI_SAT_BIP_DR_28800BPS_V110_OR_X31_FALG_STUFFING = 80, /**<   CSD data rate -28800BPS V110 OR X31 FALG STUFFING               */
+       TAPI_SAT_BIP_DR_38400BPS_V110_OR_X31_FALG_STUFFING = 81, /**<   CSD data rate -38400BPS V110 OR X31 FALG STUFFING               */
+       TAPI_SAT_BIP_DR_48000BPS_V110_OR_X31_FALG_STUFFING = 82, /**<   CSD data rate -48000BPS V110 OR X31 FALG STUFFING               */
+       TAPI_SAT_BIP_DR_56000BPS_V110_OR_X31_FALG_STUFFING = 83, /**<   CSD data rate -56000BPS V110 OR X31 FALG STUFFING               */
+       TAPI_SAT_BIP_DR_64000BPS = 84, /**<     CSD data rate -64000BPS                 */
+       TAPI_SAT_BIP_DR_56000BPS_BIT_TRANSPERENT = 115, /**<    CSD data rate -56000BPS BIT TRANSPERENT                 */
+       TAPI_SAT_BIP_DR_64000BPS_BIT_TRANSPERENT = 116, /**<    CSD data rate -64000BPS BIT TRANSPERENT                 */
+       TAPI_SAT_BIP_DR_32000BPS_PIAFS32K = 120, /**<   CSD data rate -32000BPS PIAFS32K                */
+       TAPI_SAT_BIP_DR_64000BPS_PIAFS64K = 121, /**<   CSD data rate - 64000BPS PIAFS64K               */
+       TAPI_SAT_BIP_DR_28800BPS_MULTIMEDIA = 130, /**< CSD data rate -28800BPS MULTIMEDIA              */
+       TAPI_SAT_BIP_DR_32000BPS_MULTIMEDIA = 131, /**< CSD data rate -32000BPS MULTIMEDIA              */
+       TAPI_SAT_BIP_DR_33600BPS_MULTIMEDIA = 132, /**< CSD data rate - 33600BPS MULTIMEDIA             */
+       TAPI_SAT_BIP_DR_56000BPS_MULTIMEDIA = 133, /**< CSD data rate -56000BPS MULTIMEDIA              */
+       TAPI_SAT_BIP_DR_64000BPS_MULTIMEDIA = 134 /**<  CSD data rate -64000BPS MULTIMEDIA              */
+} TelSatBearerParamCsdDataRateType_t;
+
+/**
+ * @enum TelSatBearerParamCsdBearerServiceType_t
+ * This enum lists the SAT bearer parameter csd bearer service
+ */
+typedef enum {
+       TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_ASYNC_UDI = 0, /**<    CSD Bearer service - DATA CIRCUIT ASYNCHRONOUS UDI              */
+       TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_SYNC = 1, /**< CSD Bearer service - DATA CIRCUIT SYNCHRONOUS UDI               */
+       TAPI_SAT_BIP_CSD_BS_PAD_ACCESS_ASYNC_UDI = 2, /**<      CSD Bearer service - PAD ACCESS ASYNCHRONOUS UDI                        */
+       TAPI_SAT_BIP_CSD_BS_PACKET_ACCESS_SYNC = 3, /**<        CSD Bearer service - PACKET ACCESS SYNCHRONOUS UDI              */
+       TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_ASYNC_RDI = 4, /**<    CSD Bearer service - DATA CIRCUIT ASYNCHRONOUS RDI              */
+       TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_SYNC_RDI = 5, /**<     CSD Bearer service - DATA CIRCUIT SYNCHRONOUS RDI               */
+       TAPI_SAT_BIP_CSD_BS_PAD_ACCESS_ASYNC_RDI = 6, /**<      CSD Bearer service - PAD ACCESS ASYNCHRONOUS RDI                */
+       TAPI_SAT_BIP_CSD_BS_PACKET_ACCESS_SYNC_RDI = 7 /**<     CSD Bearer service - PACKET ACCESS SYNCHRONOUS RDI              */
+} TelSatBearerParamCsdBearerServiceType_t;
+
+/**
+ * @enum TelSatBearerParamCsdConnectionElementType_t
+ * This enum lists the SAT bearer parameter csd connection element
+ */
+typedef enum {
+       TAPI_SAT_BIP_CSD_CONN_ELEM_TRANSPARENT = 0, /**<        CSD connection element - TRANSPARENT            */
+       TAPI_SAT_BIP_CSD_CONN_ELEM_NON_TRANSPARENT = 1, /**<    CSD connection element - NON TRANSPARENT                */
+       TAPI_SAT_BIP_CSD_CONN_ELEM_BOTH_TRANSPARENT_PREF = 2, /**<      CSD connection element -BOTH TRANSPARENT PREFFERED              */
+       TAPI_SAT_BIP_CSD_CONN_ELEM_BOTH_NON_TRANSPARENT_PREF = 3 /**<   CSD connection element -  NON TRANSPARENT PREFFERED             */
+} TelSatBearerParamCsdConnectionElementType_t;
+
+/**
+ * @enum TelSatBearerParamGprsPrecedenceClassType_t
+ * This enum lists the SAT bearer parameter GPRS precedence class. refer  TS 23.107
+ */
+typedef enum {
+       TAPI_SAT_BIP_GPRS_PRECED_CLASS_HIGH_PRIORITY = 0x01, /**<       GPRS precedence class -HIGH PRIORITY            */
+       TAPI_SAT_BIP_GPRS_PRECED_CLASS_NORM_PRIORITY = 0x02, /**<       GPRS precedence class -NORM PRIORITY            */
+       TAPI_SAT_BIP_GPRS_PRECED_CLASS_LOW_PRIORITY = 0x03 /**< GPRS precedence class - LOW PRIORITY            */
+} TelSatBearerParamGprsPrecedenceClassType_t;
+
+/**
+ * @enum TelSatBearerParamGprsDelayClassType_t
+ * This enum lists the SAT bearer parameter GPRS delay class.
+ */
+typedef enum {
+       TAPI_SAT_BIP_GPRS_DELAY_CLASS_1 = 0x01, /**<    GPRS delay class - 1            */
+       TAPI_SAT_BIP_GPRS_DELAY_CLASS_2 = 0x02, /**<    GPRS delay class -      2       */
+       TAPI_SAT_BIP_GPRS_DELAY_CLASS_3 = 0x03, /**<    GPRS delay class -      3       */
+       TAPI_SAT_BIP_GPRS_DELAY_CLASS_4 = 0x04 /**<     GPRS delay class - 4            */
+} TelSatBearerParamGprsDelayClassType_t;
+
+/**
+ * @enum TelSatBearerParamGprsReliabilityClassType_t
+ * This enum lists the SAT bearer parameter GPRS Reliability class.
+ */
+typedef enum {
+       TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_1 = 0x01, /**<      GPRS Reliability class -1               */
+       TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_2 = 0x02, /**<      GPRS Reliability class -2               */
+       TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_3 = 0x03, /**<      GPRS Reliability class -3               */
+       TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_4 = 0x04, /**<      GPRS Reliability class -4               */
+       TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_5 = 0x05 /**<       GPRS Reliability class -5               */
+} TelSatBearerParamGprsReliabilityClassType_t;
+
+/**
+ * @enum TelSatBearerParamGprsPeakThroughputClassType_t
+ * This enum lists the SAT bearer parameter GPRS peak throughput class.
+ */
+typedef enum {
+       TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_8KBPS = 0x01, /**< GPRS peak throughput class- UPTO 8KBPS          */
+       TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_16KBPS = 0x02, /**<        GPRS peak throughput class- UPTO 16KBPS         */
+       TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_32KBPS = 0x03, /**<        GPRS peak throughput class-UPTO 32KBPS          */
+       TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_64KBPS = 0x04, /**<        GPRS peak throughput class-UPTO 64KBPS          */
+       TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_128KBPS = 0x05, /**<       GPRS peak throughput class- UPTO 128KBPS                        */
+       TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_256KBPS = 0x06, /**<       GPRS peak throughput class- UPTO 256KBPS                        */
+       TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_512KBPS = 0x07, /**<       GPRS peak throughput class- UPTO 512KBPS                */
+       TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_1024KBPS = 0x08, /**<      GPRS peak throughput class-UPTO 1024KBPS                */
+       TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_2048KBPS = 0x09 /**<       GPRS peak throughput class- UPTO 2048KBPS               */
+} TelSatBearerParamGprsPeakThroughputClassType_t;
+
+/**
+ * @enum TelSatBearerParamGprsMeanThroughputClassType_t
+ * This enum lists the SAT bearer parameter GPRS mean throughput class.
+ */
+typedef enum {
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_22_BPS = 0x01, /**< GPRS mean throughput class - DOT 22 BPS         */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_44_BPS = 0x02, /**< GPRS mean throughput class - DOT 44 BPS         */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_1_DOT_11_BPS = 0x03, /**<       GPRS mean throughput class -1 DOT 11 BPS                */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_2_DOT_2_BPS = 0x04, /**<        GPRS mean throughput class -2 DOT 2 BPS         */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_2_DOT_4_BPS = 0x05, /**<        GPRS mean throughput class -2 DOT 4 BPS                 */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_11_DOT_1_BPS = 0x06, /**<       GPRS mean throughput class - 11 DOT 1 BPS               */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_22BPS = 0x07, /**<      GPRS mean throughput class -22BPS               */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_44BPS = 0x08, /**<      GPRS mean throughput class - 44BPS              */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_111BPS = 0x09, /**<     GPRS mean throughput class - 111BPS             */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_22_KBPS = 0x0A, /**<        GPRS mean throughput class - DOT 22 KBPS                */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_44_KBPS = 0x0B, /**<        GPRS mean throughput class -DOT 44 KBPS                 */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_1_DOT_11_KBPS = 0x0C, /**<      GPRS mean throughput class -1 DOT 11 KBPS               */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_2_DOT_2_KBPS = 0x0D, /**<       GPRS mean throughput class -2 DOT 2 KBPS                */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_4_DOT_4_KBPS = 0x0E, /**<       GPRS mean throughput class - 4 DOT 4 KBPS               */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_11_DOT_1_KBPS = 0x0F, /**<      GPRS mean throughput class -11 DOT 1 KBPS               */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_22KBPS = 0x10, /**<     GPRS mean throughput class - 22KBPS             */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_44KBPS = 0x11, /**<     GPRS mean throughput class - 44KBPS             */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_111KBPS = 0x12, /**<    GPRS mean throughput class -111KBPS             */
+       TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_BEST_EFFORT = 0x13 /**< GPRS mean throughput class - BEST EFFORT                */
+} TelSatBearerParamGprsMeanThroughputClassType_t;
+
+/**
+ * @enum TelSatBearerParamGprsPdpType_t
+ * This enum lists the SAT bearer parameter GPRS pdp type.
+ */
+typedef enum {
+       TAPI_SAT_BIP_GPRS_PDP_TYPE_IP = 0x02, /**<      bearer parameter GPRS pdp type - IP             */
+       TAPI_SAT_BIP_GPRS_PDP_TYPE_RESERVED = 0xff /**< reserved                */
+} TelSatBearerParamGprsPdpType_t;
+
+/**
+ * @enum TelSatBearerParamLocalLinksServiceIdentityType_t
+ * This enum lists the SAT bearer parameters local links service identity.
+ */
+typedef enum {
+       TAPI_SAT_BIP_LL_SERVICE_IDENT_VALUE_ASSIGNED_BY_USIM = 0x00, /**<       local links service identity - value assigned by USIM           */
+       TAPI_SAT_BIP_LL_SERVICE_IDENT_VALUE_ASSIGNED_BY_REMOTED_DEVICE = 0xFF /**<      local links service identity - value assigned by remote service */
+} TelSatBearerParamLocalLinksServiceIdentityType_t;
+
+/**
+ * @enum TelSatChannelStatusType_t
+ * This enum lists the SAT channel status type.
+ */
+typedef enum {
+       TAPI_SAT_CS_LINK_ESTABLISHED_OR_PDP_CTX_NOT_ACTIVATED, /**<     channel status type-CS LINK ESTABLISHED OR PDP CTX NOT ACTIVATED                */
+       TAPI_SAT_CS_LINK_ESTABLISHED_OR_PDP_CTX_ACTIVATED, /**< channel status type-CS LINK ESTABLISHED OR PDP CTX ACTIVATED            */
+       TAPI_SAT_UICC_SERVER_MODE_TCP_IN_CLOSED_STATE, /**<     channel status type-UICC SERVER MODE TCP IN CLOSED STATE                */
+       TAPI_SAT_UICC_SERVER_MODE_TCP_IN_LISTEN_STATE, /**<     channel status type-UICC SERVER MODE TCP IN LISTEN STATE                */
+       TAPI_SAT_UICC_SERVER_MODE_TCP_IN_ESTABLISHED_STATE, /**<        channel status type-UICC SERVER MODE TCP IN ESTABLISHED STATE           */
+       TAPI_SAT_UICC_SERVER_MODE_RESERVED /**< reserved                */
+} TelSatChannelStatusType_t;
+
+/**
+ * @enum TelSatChannelStatusInfoType_t
+ * This enum lists the SAT channel status info type.
+ */
+typedef enum {
+       TAPI_SAT_CHANNEL_STATUS_NO_FURTHER_INFO_AVAILABLE = 0, /**<     CHANNEL STATUS NO FURTHER INFO AVAILABLE                */
+       TAPI_SAT_CHANNEL_STATUS_NOT_USED = 1, /**<      CHANNEL STATUS NOT USED                 */
+       TAPI_SAT_CHANNEL_STATUS_LINK_DROPPED = 5 /**<   CHANNEL STATUS LINK DROPPED     */
+} TelSatChannelStatusInfoType_t;
+
+/**
+ * @enum TelSatAddressType_t
+ * This enum lists the SAT address type.
+ */
+typedef enum {
+       TAPI_SAT_ADDR_TYPE_IPv4 = 0x21, /**<    address type - IPv4     */
+       TAPI_SAT_ADDR_TYPE_IPv6 = 0x57, /**<    address type - IPv6     */
+       TAPI_SAT_ADDR_RESERVED = 0xFF /**<      reserved                */
+} TelSatAddressType_t;
+
+/**
+ * @enum TelSatTransportProtocolType_t
+ * This enum lists the SAT transport protocol type.
+ */
+typedef enum {
+       TAPI_SAT_TP_TYPE_UDP_UICC_CLIENT = 0x01, /**<   transport protocol type- UDP UICC CLIENT        */
+       TAPI_SAT_TP_TYPE_TCP_UICC_CLIENT = 0x02, /**<   transport protocol type-TCP UICC CLIENT         */
+       TAPI_SAT_TP_TYPE_TCP_UICC_SERVER = 0x03 /**<    transport protocol type- TCP UICC SERVER        */
+} TelSatTransportProtocolType_t;
+
+/**
+ * @enum TelSatRemoteEntityAddrCodingType_t
+ * This enum lists the SAT remote entity address coding type.
+ */
+typedef enum {
+       TAPI_SAT_REMOTE_ENTITY_ADDR_CODING_TYPE_IEEE802_48BIT = 0, /**< remote entity address coding type- IEEE802 48BIT                */
+       TAPI_SAT_REMOTE_ENTITY_ADDR_CODING_TYPE_IRDA_32BIT = 1, /**<    remote entity address coding type- IRDA 32BIT           */
+       TAPI_SAT_REMOTE_ENTITY_ADDR_CODING_TYPE_RESERVED = 0xFF /**<    reserved                */
+} TelSatRemoteEntityAddrCodingType_t;
+
+/**
+ * This structure defines the Address data object.
+ */
+typedef struct {
+       TelSimTypeOfNum_t ton; /**<     type of number          */
+       TelSimNumberingPlanIdentity_t npi; /**< number plan identity            */
+       unsigned char diallingNumberLen; /**<   dialing number length           */
+       char diallingNumber[TAPI_SAT_DIALLING_NUMBER_LEN_MAX]; /**<     dialing number  */
+} TelSatAddressInfo_t;
+
+/**
+ * This structure defines the data coding scheme object.
+ */
+typedef struct {
+       int bIsCompressedFormat; /**<   flag to verify compressed format        */
+       TelSatAlphabetFormatType_t alphabetFormat; /**< alphabet format Type            */
+       TelSatMsgClassType_t msgClass; /**<     Type of message class           */
+       unsigned char rawDcs; /**<      raw dcs info            */
+} TelSatDataCodingSchemeInfo_t;
+
+/**
+ * This structure defines the Alpha ID data object.
+ */
+typedef struct {
+       int bIsPresent; /**<    flag for checking existence of alpha identifier         */
+       TelSatDataCodingSchemeInfo_t dcs; /**<  dcs info                */
+       unsigned char stringLen; /**<   alpha identifier length                 */
+       char string[TAPI_SAT_ALPHA_ID_LEN_MAX]; /**<    alpha identifier info   */
+} TelSatAlphaIdentifierInfo_t;
+
+/**
+ * This structure defines the Sub Address data object.
+ */
+typedef struct {
+       unsigned char subAddressLen; /**<       sub address length              */
+       char subAddress[TAPI_SAT_SUB_ADDR_LEN_MAX]; /**<        sub address             */
+} TelSatSubAddressInfo_t;
+
+/**
+ * This structure defines the Capability Configuration Parameters data object.
+ */
+typedef struct {
+       unsigned char dataLen; /**<     capability configuration parameter length       */
+       char data[TAPI_SAT_CCP_DATA_LEN_MAX]; /**<      capability configuration parameter      */
+} TelSatCapaConfigParamInfo_t;
+
+/**
+ * This struct defines the Command qualifier values for send SMS command.
+ */
+typedef struct {
+       int bIsPackingByMeRequired; /**<        flag to verify packing requirement, if FALSE, packing by ME not required        */
+} TelSatCmdQualiSendSms_t;
+
+/**
+ * This struct defines the Command qualifier values for display text command.
+ */
+typedef struct {
+       TelSatDisplayTextPriorityType_t msgPriority; /**<       message priority                */
+       TelSatDisplayTextMsgClearType_t msgClear; /**<  message clear type              */
+} TelSatCmdQualiDisplayText_t;
+
+/**
+ * This struct defines the Command qualifier values for get inkey command.
+ */
+typedef struct {
+       TelSatInkeyType_t inkeyType; /**<       inkey type              */
+       int bIsUsingAlphabetSet; /**<   flag for checking whether using alphabet set or not. if FALSE, digits(0-9,*,#and+) only         */
+       TelSatUseInputAlphabetType_t alphabetType; /**< alphabet type           */
+       int bIsImmediateResponseRequired;/**<   flag for checking whether immediate response required or not            */
+       int bIsHelpInfoAvailable; /**<  flag for checking whether help info available or not. if FALSE, no help information available   */
+} TelSatCmdQualiGetInkey_t;
+
+/**
+ * This struct defines the Command qualifier values for get input command.
+ */
+typedef struct {
+       int bIsUsingAlphabetSet; /**<   flag for checking whether using alphabet set. if FALSE, digits(0-9,*,#and+) only        */
+       TelSatUseInputAlphabetType_t alphabetType; /**< alphabet type. only using alphabet set case.            */
+       int bIsMeEchoUserInput; /**<    flag for checking whether ME should echo user input. if FALSE, user input shall not be displayed*/
+       int bIsUserInputUnpackedFormat; /**<    flag for checking whether user input is in unpacked format or not.  if FALSE, user input in SMS packed format   */
+       int bIsHelpInfoAvailable; /**<  flag to verify if help info available or not. if FALSE, no help information available   */
+} TelSatCmdQualiGetInput_t;
+
+/**
+ * This struct defines the Command qualifier values for play tone command.
+ */
+typedef struct {
+       TelSatDisplayVibrateAlertType_t vibrateAlert; /**<      type of vibrate alert           */
+} TelSatCmdQualiPlayTone_t;
+
+/**
+ * This struct defines the Command qualifier values for select item command.
+ */
+typedef struct {
+       TelSatPresentationType_t presentationType; /**< type of presentation. only presentation type specified          */
+       TelSatSelectionPreferenceType_t selectionPreference; /**<       type of selection preference            */
+       int bIsHelpInfoAvailable; /**<  flag for checking whether help info available or not. if FALSE, no help information available   */
+} TelSatCmdQualiSelectItem_t;
+
+/**
+ * This struct defines the Command qualifier values for setup menu command.
+ */
+typedef struct {
+       TelSatSelectionPreferenceType_t selectionPreference; /**<       type of selection preference            */
+       int bIsHelpInfoAvailable; /**<  flag to verify help info available or not. if FALSE, no help information available      */
+} TelSatCmdQualiSetupMenu_t;
+
+/**
+ * This struct defines the Command qualifier values for language notification command.
+ */
+typedef struct {
+       int bSpecificLanguageNotification; /**< flag for specific language notification. if FALSE, non-specific language notification   */
+} TelSatCmdQualiLanguageNotification_t;
+
+/**
+ * SAT command qualifier open channel
+ */
+typedef struct {
+       int bIsEstablishImmediateLink; /**<     flag whether establishing immediate link or not. if FALSE, on demand link establishment */
+       int bIsAutomaticReconnection; /**<      flag whether automatic reconnection or not. if FALSE, no automatic reconnection */
+       int bIsModeBackground; /**<     flag whether background mode or not.            */
+} TelSatCmdQualiOpenChannel_t;
+
+/**
+ * SAT command qualifier send data
+ */
+typedef struct {
+       int bIsSendDataImmediately; /**<        flag whether to send data immediately or not. if FALSE, store data in Tx buffer*/
+} TelSatCmdQualiSendData_t;
+
+/**
+ * This structure contains the command number, type and the qualifier objects of a SATK command.
+ */
+typedef struct {
+       unsigned char commandNumber; /**< specific command number       */
+       TelSatCommandType_t commandType; /**<   proactive command type          */
+
+       union {
+               TelSatCmdQualiRefresh_t cmdQualiRefresh; /**<   refresh command qualifier info  */
+               TelSatCmdQualiSetupCall_t cmdQualiSetupCall; /**<       setup call command qualifier info       */
+               TelSatCmdQualiSendSms_t cmdQualiSendSms; /**<   send sms command qualifier info */
+               TelSatCmdQualiDisplayText_t cmdQualiDisplayText; /**<   display text command qualifier info     */
+               TelSatCmdQualiGetInkey_t cmdQualiGetInkey; /**< get inkey command qualifier info        */
+               TelSatCmdQualiGetInput_t cmdQualiGetInput; /**< get input command qualifier info        */
+               TelSatCmdQualiPlayTone_t cmdQualiPlayTone; /**< play tone command qualifier info        */
+               TelSatCmdQualiSelectItem_t cmdQualiSelectItem; /**<     select item command qualifier info      */
+               TelSatCmdQualiSetupMenu_t cmdQualiSetupMenu; /**<       setup menu command qualifier info       */
+               TelSatCmdQualiProvideLocalInfo_t cmdQualiProvideLocalInfo;/**<  provide local info command qualifier info       */
+               TelSatCmdQualiLanguageNotification_t cmdQualiLanguageNotification;/**<  language notification command qualifier info    */
+               TelSatCmdQualiLaunchBrowser_t cmdQualiLaunchBrowser; /**<       launch Browser command qualifier info   */
+               TelSatCmdQualiOpenChannel_t cmdQualiOpenChannel; /**<   Open channel command qualifier info     */
+               TelSatCmdQualiSendData_t cmdQualiSendData; /**< send data command qualifier info        */
+       } u; /**<       Union   */
+} TelSatCommandDetailInfo_t;
+
+/**
+ * This struct defines the device identity values.
+ */
+typedef struct {
+       TelSatDeviceIdentitiesTagType_t source; /**<    device identity tag for source  */
+       TelSatDeviceIdentitiesTagType_t destination; /**<       device identity for destination */
+} TelSatDeviceIdentitiesInfo_t;
+
+/**
+ * This structure defines the Duration data object.
+ */
+typedef struct {
+       TelSatTimeUnitType_t timeUnit; /**<     time units for the duration data                */
+       unsigned char timeInterval; /**<        time interval           */
+} TelSatDurationInfo_t;
+
+/**
+ * This structure defines the menu item data object.
+ */
+typedef struct {
+       unsigned char itemId; /**<      item identifier                 */
+       unsigned char textLen; /**<     text length             */
+       unsigned char text[TAPI_SAT_ITEM_TEXT_LEN_MAX + 1]; /**<        text information                */
+} TelSatMenuItemInfo_t;
+
+/**
+ * This structure defines the item identifier object.
+ */
+typedef struct {
+       unsigned char selectedItemIdentifier; /**<      selected item identifier                */
+} TelSatItemIdentifierInfo_t;
+
+/**
+ * This structure defines expected user response length.
+ */
+typedef struct {
+       unsigned char min; /**< user response length minimum value              */
+       unsigned char max; /**< user response length maximum value              */
+} TelSatRespLenInfo_t;
+
+/**
+ * This structure defines RESUlT data object.
+ */
+typedef struct {
+       TelSatResultType_t generalResult; /**<  general result  */
+       TelSatMeProblemType_t meProblem; /**<   additional information on general result        */
+} TelSatResultInfo_t;
+
+/**
+ * This structure defines RESUlT data object.
+ */
+typedef struct {
+       TelSatSmsTpduType_t tpduType; /**<      SMS TPDU TYPE   */
+       unsigned char dataLen; /**<     SMS TPDU DATA LENGTH    */
+       unsigned char data[TAPI_SAT_SMS_TPDU_SMS_DATA_LEN_MAX]; /**< SMS TPDU DATA*/
+} TelSatSmsTpduInfo_t;
+
+/**
+ * This structure defines SS STRING data object.
+ */
+typedef struct {
+       TelSimTypeOfNum_t ton; /**<     type of number  */
+       TelSimNumberingPlanIdentity_t npi; /**< number plan identity    */
+       unsigned char stringLen; /**<   ss string length        */
+       char string[TAPI_SAT_SS_STRING_LEN_MAX]; /**<   ss string       */
+} TelSatSsStringInfo_t;
+
+/**
+ * This structure defines TEXT STRING data object.
+ */
+typedef struct {
+       int bIsDigitOnly; /**<  flag for checking whether only digits used or not       */
+       TelSatDataCodingSchemeInfo_t dcs; /**<  data coding scheme              */
+       unsigned short stringLen; /**<  text length             */
+       char string[TAPI_SAT_TEXT_STRING_LEN_MAX + 1]; /**<     text string     */
+} TelSatTextTypeInfo_t;
+
+/**
+ * This structure defines menu item text object.
+ */
+typedef struct {
+       int bIsDigitOnly; /**<  flag for checking whether only digits used or not       */
+       TelSatDataCodingSchemeInfo_t dcs; /**<  data coding scheme              */
+       unsigned char stringLen; /**<   menu item string length */
+       char* pString; /**<     Menu Item String */
+} TelSatMenuItemTextInfo_t;
+
+/**
+ * This structure defines tone object.
+ */
+typedef struct {
+       TelSatToneType_t type; /**<     tone type       */
+} TelSatToneInfo_t;
+
+/**
+ * This structure defines USSD string data object.
+ */
+typedef struct {
+       TelSatDataCodingSchemeInfo_t dcs; /**<  data coding scheme      */
+       unsigned char ussdStringLen; /**<       ussd string length      */
+       char ussdString[TAPI_SAT_USSD_STRING_LEN_MAX]; /**<     ussd string     */
+} TelSatUssdStringInfo_t;
+
+/**
+ * This structure defines File list data object.
+ */
+typedef struct {
+       unsigned char fileCount; /**<   file count      */
+//     TelSimFileName_t fileId[TAPI_SAT_FILE_ID_LIST_MAX_COUNT]; /**<  file identifier */
+} TelSatFileListInfo_t;
+
+/**
+ * This structure defines default text data object.
+ */
+typedef struct {
+       int bIsPresent; /**<    flag for checking whether default text exists or not    */
+       int bIsDigitOnly; /**<  flag for checking whether only digits used or not       */
+       TelSatDataCodingSchemeInfo_t dcs; /**<  data coding scheme      */
+       unsigned char stringLen; /**<   default text string length              */
+       char string[TAPI_SAT_TEXT_STRING_LEN_MAX]; /**< default text    */
+} TelSatDefaultTextInfo_t;
+
+/**
+ * This structure defines Next Action Indicator List data object.
+ */
+typedef struct {
+       unsigned char listCount; /**<   next action identifier count    */
+       unsigned char list[TAPI_SAT_ITEMS_NEXT_ACTION_INDI_LIST_MAX_COUNT]; /**<        next action identifier list     */
+} TelSatItemsNextActionIndiListInfo_t;
+
+/**
+ * This structure defines event list data object.
+ */
+typedef struct {
+       unsigned char eventListCount; /**<      event list count        */
+       TelSatEventDownloadType_t list[TAPI_SAT_EVENT_LIST_MAX_COUNT]; /**<     event list */
+} TelSatEventListInfo_t;
+
+/**
+ * This structure defines icon info object.
+ */
+typedef struct {
+       unsigned char width; /**<       icon width              */
+       unsigned char height; /**<      icon height     */
+       TelSatImageCodingSchemeType_t ics; /**< image coding scheme     */
+       unsigned short iconDataLen; /**<        icon data length        */
+       unsigned short clutDataLen; /**<        clut data length        */
+       char iconFile[TAPI_SAT_IMG_DATA_FILE_PATH_LEN_MAX];
+       char clutFile[TAPI_SAT_IMG_DATA_FILE_PATH_LEN_MAX];
+} TelSatIconInfo_t;
+
+/**
+ * This structure defines icon data object.
+ */
+typedef struct {
+       int bIsPresent; /**<    flag for checking whether icon identifier exists or not         */
+       TelSatIconQualifierType_t iconQualifier; /**<   icon qualifier type             */
+       unsigned char iconIdentifier; /**<      icon identifier         */
+       TelSatIconInfo_t iconInfo; /**< icon info       */
+} TelSatIconIdentifierInfo_t;
+
+/**
+ * This structure defines icon identifier data object.
+ */
+typedef struct {
+       int bIsPresent; /**<    flag for checking whether icon identifier exists or not */
+       TelSatIconQualifierType_t iconListQualifier; /**<       icon list qualifier     */
+       unsigned char iconCount; /**<   icon count      */
+       unsigned char iconIdentifierList[TAPI_SAT_ICON_LIST_MAX_COUNT]; /**<    icon identifier list    */
+       TelSatIconInfo_t iconInfo[TAPI_SAT_ICON_LIST_MAX_COUNT]; /**<   icon list info  */
+} TelSatIconIdentifierListInfo_t;
+
+/**
+ * This structure defines SAT bc repeat indicator Info
+ */
+typedef struct {
+       TelSatBcRepeatIndicatorType_t indType; /**<     bc repeat indicator type        */
+} TelSatBcRepeatIndicatorInfo_t;
+
+/**
+ * This structure defines call control strings.
+ */
+typedef struct {
+       TelSatCallCtrlStringType_t callCtrlStringType; /**<     call control type       */
+       union {
+               TelSatAddressInfo_t voiceString; /**<   voice call string       */
+               TelSatSsStringInfo_t ssString; /**<     ss string       */
+               TelSatUssdStringInfo_t ussdString; /**< ussd string     */
+       } u; /**<       Union   */
+} TelSatCallCtrlAddressStringInfo_t;
+
+/**
+ * This structure defines the Action requested call control data.
+ */
+typedef struct {
+       TelSatCallCtrlAddressStringInfo_t callCtrlAddString; /**< Call control address string */
+       TelSatCapaConfigParamInfo_t ccp1; /**< Capability configuration parameter 1 */
+       TelSatSubAddressInfo_t subAddress; /**< Subaddress */
+       TelSatAlphaIdentifierInfo_t alphaId; /**< Alpha identifier */
+       TelSatBcRepeatIndicatorInfo_t bcRepeatIndicator; /**< Bc repeat indicator */
+       TelSatCapaConfigParamInfo_t ccp2; /**< Capability configuration parameter 2 */
+} TelSatCallCtrlRequestedActionInfo_t;
+
+/**
+ * This structure defines dtmf string data object.
+ */
+typedef struct {
+       unsigned char stringLen; /**<   dtmf string lengh       */
+       char dtmfTone[TAPI_SAT_DTMF_STRING_LEN_MAX]; /**<       dtmf tone data  */
+} TelSatDtmfStringInfo_t;
+
+/**
+ * This structure defines language data object.
+ */
+typedef struct {
+       TelSatLanguageType_t language; /**<     language type   */
+} TelSatLanguageInfo_t;
+
+/**
+ * This structure defines date time and time zone data object.
+ */
+typedef struct {
+       unsigned char year; /**<        year    */
+       unsigned char month; /**<       month   */
+       unsigned char day; /**< day     */
+       unsigned char hour; /**<        hour    */
+       unsigned char minute; /**<      minute  */
+       unsigned char second; /**<      second  */
+       unsigned char timeZone; /**<    timeZone        */
+} TelSatDataTimeZoneInfo_t;
+
+/**
+ * This structure defines SAT browser identities.
+ */
+typedef struct {
+       TelSatBrowserIdentityType_t browserIdentity; /**<       browser identity        */
+} TelSatBrowserIdentitiesInfo_t;
+
+/**
+ * This structure defines SAT browser URL Data Object.
+ */
+typedef struct {
+       char string[TAPI_SAT_URL_LEN_MAX + 1]; /**<     url string      */
+} TelSatUrlInfo_t;
+
+/**
+ * This structure defines SAT bearer type.
+ */
+typedef struct {
+       unsigned char listLen; /**<     bearer list length      */
+       TelSatBearerType_t bearerList[TAPI_SAT_BEARER_LIST_MAX_COUNT]; /**<     bearer list     */
+} TelSatBearerInfo_t;
+
+/**
+ * This structure defines SAT provisioning reference.
+ */
+typedef struct {
+       char provisioningFilePath[TAPI_SAT_PROVISIONING_FILE_PATH_LEN_MAX]; /**<        provisioning file path  */
+} TelSatProvisioningRefInfo_t;
+
+/**
+ * This structure defines SAT browser termination cause.
+ */
+typedef struct {
+       TelSatBrowserTerminationCauseType_t cause; /**< browser termination cause       */
+} TelSatBrowserTerminationCauseInfo_t;
+
+/**
+ * This structure defines SAT Csd bearer parameters .
+ */
+typedef struct {
+       TelSatBearerParamCsdDataRateType_t dataRate; /**<       bearer csd data rate    */
+       TelSatBearerParamCsdBearerServiceType_t bearerService; /**<     bearer csd service type */
+       TelSatBearerParamCsdConnectionElementType_t connectionElement; /**<     bearer connection element type  */
+} TelSatBearerParametersCsdInfo_t;
+
+/**
+ * This structure defines SAT bearer parameters GPRS.
+ */
+typedef struct {
+       TelSatBearerParamGprsPrecedenceClassType_t precedenceClass; /**<        bearer gprs     precedence class        */
+       TelSatBearerParamGprsDelayClassType_t delayClass; /**<  bearer gprs delay       */
+       TelSatBearerParamGprsReliabilityClassType_t reliabilityClass; /**<      bearer gprs reliability */
+       TelSatBearerParamGprsPeakThroughputClassType_t peakThroughputClass;/**< bearer gprs peak throughput     */
+       TelSatBearerParamGprsMeanThroughputClassType_t meanThroughputClass;/**< bearer gprs mean throughput     */
+       TelSatBearerParamGprsPdpType_t pdpType; /**<    bearer gprs pdp type    */
+} TelSatBearerParametersGprsInfo_t;
+
+/**
+ * This structure defines SAT bearer parameters local links.
+ */
+typedef struct {
+       TelSatBearerParamLocalLinksServiceIdentityType_t serviceIdentifier; /**<        bearer local link service identifier            */
+       char serviceRecord[TAPI_SAT_BEARER_PARAMS_LEN_MAX]; /**<        bearer local link service record        */
+} TelSatBearerParametersLocalLinksInfo_t;
+
+/**
+ * This structure defines SAT bearer description.
+ */
+typedef struct {
+       TelSatBearerDescType_t bearerType; /**< bearer type     */
+       union {
+               TelSatBearerParametersCsdInfo_t bearerParamsCsd; /**<   csd     */
+               TelSatBearerParametersGprsInfo_t bearerParamsGprs; /**< gprs    */
+               TelSatBearerParametersLocalLinksInfo_t bearerParamsLocalLinks; /**<     local link      */
+       } bearer_params; /**<Union */
+} TelSatBearerDescriptionInfo_t;
+
+/**
+ * This structure defines SAT channel data.
+ */
+typedef struct {
+       unsigned char channelDataStringLen; /**<        channel data length     */
+       char channelDataString[TAPI_SAT_CHANNEL_DATA_STRING_LEN_MAX]; /**<      channel data    */
+} TelSatChannelDataInfo_t;
+
+/**
+ * This structure defines SAT channel data length.
+ */
+typedef struct {
+       unsigned char channelDataLen; /**<      channel data length     */
+} TelSatChannelDataLengthInfo_t;
+
+/**
+ * This structure defines SAT buffer size.
+ */
+typedef struct {
+       unsigned char bufferSize[2]; /**<       channel data buffer size        */
+} TelSatBufferSizeInfo_t;
+
+/**
+ * This structure defines SAT channel status.
+ */
+typedef struct {
+       unsigned char channelId; /**<   channel id      */
+       TelSatChannelStatusType_t status; /**<  channel status          */
+       TelSatChannelStatusInfoType_t channelInfo; /**< channel status info     */
+} TelSatChannelStatusInfo_t;
+
+/**
+ * This structure defines SAT other address.
+ */
+typedef struct {
+       TelSatAddressType_t addressType; /**<   channel address type    */
+       unsigned char addressLen; /**<  channel address length  */
+       char address[TAPI_SAT_OTHER_ADDR_LEN_MAX]; /**< channel address */
+} TelSatOtherAddressInfo_t;
+
+/**
+ * This structure defines SIM me interface transport level.
+ */
+typedef struct {
+       TelSatTransportProtocolType_t transportProtocolType; /**<       transport protocol type */
+       unsigned short portNumber; /**< port number     */
+} TelSatSimMeInterfaceTransportLevelInfo_t;
+
+/**
+ * This structure defines SAT network access name.
+ */
+typedef struct {
+       unsigned char length; /**<      network access name length      */
+       unsigned char netAccName[TAPI_SAT_NET_ACC_NAM_LEN_MAX]; /**<    network access name     */
+} TelSatnetworkAccessNameInfo_t;
+
+/**
+ * This structure defines SAT aid.
+ */
+typedef struct {
+       char aid[TAPI_SAT_AID_LEN_MAX]; /**<    application Id  */
+} TelSatAidInfo_t;
+
+/**
+ * This structure defines SAT remote entity address.
+ */
+typedef struct {
+       TelSatRemoteEntityAddrCodingType_t codingType; /**<     remote entity address coding type       */
+       unsigned short length; /**<     remote entity address length    */
+       unsigned char remoteEntityAddress[TAPI_SAT_REMOTE_ENTITY_ADDR_LEN_MAX]; /**<    remote entity address data      */
+} TelSatRemoteEntityAddressInfo_t;
+
+/**
+ * This structure defines SAT text attribute.
+ */
+typedef struct {
+       unsigned char textFormatting[4]; /**<   text attribute -e.g. bold, center align, etc    */
+} TelSatTextAttributeInfo_t;
+
+/**
+ * This structure defines SAT text attribute list.
+ */
+typedef struct {
+       unsigned int listCount; /**<    text attribute list count               */
+       TelSatTextAttributeInfo_t list[TAPI_SAT_ITEM_TEXT_ATTRIBUTES_LIST_MAX_COUNT]; /**<      text attribute list info        */
+} TelSatTextAttributeListInfo_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TEL_SAT_OBJ_H_ */
+
+/**
+ * @}
+ */
diff --git a/src/sat_ui_support/TelSatProactvCmd.h b/src/sat_ui_support/TelSatProactvCmd.h
new file mode 100644 (file)
index 0000000..86ad042
--- /dev/null
@@ -0,0 +1,704 @@
+/*
+ * libslp-tapi
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @open
+ * @ingroup            TelephonyAPI
+ * @addtogroup SAT_TAPI        SAT
+ * @{
+ *
+ * @file TelSatProactvCmd.h
+
+ @brief This file serves as a "C" header file defines structures for Tapi SAT Proactive commands and terminal response Services. \n
+ It contains a sample set of constants, enums, structs that would be required by applications.
+ */
+
+#ifndef _TEL_SAT_PROACTV_CMD_H_
+#define _TEL_SAT_PROACTV_CMD_H_
+
+#include <TelSatObj.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#define TAPI_SAT_MENU_ITEM_COUNT_MAX                   40      /**<    max count of sat menu items     */
+#define TAPI_SAT_PROVISIONING_REF_MAX_COUNT            10      /**<    max count of sat provisioning reference */
+
+/**
+ * This structure contains the data objects for DISPLAY TEXT proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+} TelSatMoreTimeIndInfo_t;
+
+/**
+ * This structure contains the data objects for DISPLAY TEXT proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatTextTypeInfo_t text; /**< display text info       */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       int bImmediateRespRequested; /**<       flag for checking whether immediate response required or not    */
+       TelSatDurationInfo_t duration; /**<     duration for which text should be displayed     */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+} TelSatDisplayTextIndInfo_t;
+
+/**
+ * This structure contains the data objects for GET INKEY proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatTextTypeInfo_t text; /**< display text info       */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       TelSatDurationInfo_t duration; /**<     duration for which text should be displayed     */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+} TelSatGetInkeyIndInfo_t;
+
+/**
+ * This structure contains the data objects for GET INPUT proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatTextTypeInfo_t text; /**< display text info       */
+       TelSatRespLenInfo_t respLen; /**<       input response length   */
+       TelSatTextTypeInfo_t defaultText; /**<  default text info       */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+} TelSatGetInputIndInfo_t;
+
+/**
+ * This structure contains the data objects for PLAY TONE proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatAlphaIdentifierInfo_t alphaId; /**<       alpha identifier(string) info   */
+       TelSatToneInfo_t tone; /**<     tone info       */
+       TelSatDurationInfo_t duration; /**<     duration for which tone should be played        */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+} TelSatPlayToneIndInfo_t;
+
+/**
+ * This structure contains the data objects for SETUP MENU proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatAlphaIdentifierInfo_t alphaId; /**<       alpha identifier(string) info   */
+       unsigned char menuItemCount; /**<       count of menu items     */
+       TelSatMenuItemInfo_t menuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**<       menu item data  */
+       TelSatItemsNextActionIndiListInfo_t itemNextActionIndList; /**< next action indication list     */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       TelSatIconIdentifierListInfo_t iconIdList; /**< icon identifier list info       */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+       TelSatTextAttributeListInfo_t itemTextAttributeList; /**<       item text attribute list        */
+} TelSatSetupMenuIndInfo_t;
+
+/**
+ * This structure contains the data objects for SELECT ITEM proactive command indication data.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatAlphaIdentifierInfo_t alphaId; /**<       alpha identifier(string) info   */
+       TelSatItemsNextActionIndiListInfo_t itemNextActionIndList; /**< next action indication list     */
+       unsigned char defaultItemIdentifier; /**<       default item identifier(default selected item id)       */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       TelSatIconIdentifierListInfo_t iconIdList; /**< icon identifier list info       */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+       TelSatTextAttributeListInfo_t itemTextAttributeList; /**<       item text attribute list        */
+       unsigned char menuItemCount; /**<       count of menu items     */
+       TelSatMenuItemInfo_t menuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**<       menu item data  */
+} TelSatSelectItemIndInfo_t;
+
+/**
+ * This structure contains the data objects for SEND SHORT MESSAGE proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatAlphaIdentifierInfo_t alphaId; /**<       alpha identifier(string) info   */
+       TelSatAddressInfo_t address; /**<       address for sending sms */
+       TelSatSmsTpduInfo_t smsTpdu; /**<       sms tpdu info   */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+} TelSatSendSmsIndInfo_t;
+
+/**
+ * This structure contains the data objects for SEND SS proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatAlphaIdentifierInfo_t alphaId; /**<       alpha identifier(string) info   */
+       TelSatSsStringInfo_t ssString; /**<     ss string       */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+} TelSatSendSsIndInfo_t;
+
+/**
+ * This structure contains the data objects for SEND USSD proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatAlphaIdentifierInfo_t alphaId; /**<       alpha identifier(string) info   */
+       TelSatUssdStringInfo_t ussdString; /**< ussd string info        */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+} TelSatSendUssdIndInfo_t;
+
+/**
+ * This structure contains the data objects for SETUP CALL proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatAddressInfo_t address; /**<       setup call address info*/
+       TelSatCapaConfigParamInfo_t ccp; /**<   capability configuration parameter      */
+       TelSatSubAddressInfo_t subAddress; /**< setup call sub address  */
+       TelSatDurationInfo_t duration; /**<     command execution time duration */
+       TelSatAlphaIdentifierInfo_t userConfirmPhaseAlphaId;/**<        user Confirmation Phase AlphaId */
+       TelSatAlphaIdentifierInfo_t callSetupPhaseAlphaId; /**< call Setup Phase AlphaId        */
+       TelSatIconIdentifierInfo_t userConfirmPhaseIconId; /**< user Confirmation Phase IconId  */
+       TelSatIconIdentifierInfo_t callSetupPhaseIconId; /**<   call Setup Phase IconId */
+       TelSatTextAttributeInfo_t userConfirmPhaseTextAttribute; /**<   user Confirmation Phase Text Attribute  */
+       TelSatTextAttributeInfo_t callSetupPhaseTextAttribute; /**<     call Setup PhaseText Attribute  */
+} TelSatSetupCallIndInfo_t;
+
+/**
+ * This structure contains the data objects for REFRESH proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatFileListInfo_t fileList; /**<     file list for refresh   */
+       TelSatAidInfo_t aid; /**<       application Id  */
+} TelSatRefreshIndInfo_t;
+
+/**
+ * This structure contains the data objects for PROVIDE LOCAL INFO proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+
+} TelSatProvideLocalInfoIndInfo_t;
+
+/**
+ * This structure contains the data objects for SETUP EVENT LIST proactive command indication data.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatEventListInfo_t eventList; /**<   event list contains events which are required by USIM application       */
+
+} TelSatSetupEventListIndInfo_t;
+
+/**
+ * This structure contains the data objects for SETUP IDLE MODE TEXT proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatTextTypeInfo_t text; /**< text to be shown on idle screen */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+} TelSatSetupIdleModeTextIndInfo_t;
+
+/**
+ * This structure contains the data objects for SEND DTMF COMMAND proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatAlphaIdentifierInfo_t alphaId; /**<       alpha identifier(string) info   */
+       TelSatDtmfStringInfo_t dtmfString; /**< dtmf string     */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+} TelSatSendDtmfIndInfo_t;
+
+/**
+ * This structure contains the data objects for LANGUAGE NOTIFICATION proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatLanguageInfo_t language; /**<     language info from USIM application     */
+} TelSatLanguageNotificationIndInfo_t;
+
+/**
+ * This structure contains the data objects for LAUNCH BROWSER proactive command indication.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatBrowserIdentitiesInfo_t browserId; /**<   browser identity        */
+       TelSatUrlInfo_t url; /**<       url     */
+       TelSatBearerInfo_t bearer; /**< bearer which is used by browser */
+       unsigned char provisioningRefCount; /**<        provisioning reference count    */
+       TelSatProvisioningRefInfo_t provisioningRef[TAPI_SAT_PROVISIONING_REF_MAX_COUNT]; /**<  provisioning reference data     */
+       TelSatTextTypeInfo_t text; /**< display text info       */
+       TelSatAlphaIdentifierInfo_t alphaId; /**<       alpha identifier(string) info   */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+} TelSatLaunchBrowserIndInfo_t;
+
+/**
+ * This structure contains the data objects for OPEN CHANNEL CSB proactive command indication data.
+ */
+typedef struct {
+       TelSatAddressInfo_t address; /**<       channel address */
+       TelSatSubAddressInfo_t subAddress; /**< channel sub address     */
+       TelSatDurationInfo_t duration1; /**<    connection require time */
+       TelSatDurationInfo_t duration2; /**<    connection require time2        */
+       TelSatBearerParametersCsdInfo_t bearerParamsCsd; /**<   csd info        */
+       TelSatBufferSizeInfo_t bufferSize; /**< bufferSize      */
+       TelSatOtherAddressInfo_t otherAddress; /**<     otherAddress    */
+       TelSatTextTypeInfo_t userLogin; /**<    userLogin       */
+       TelSatTextTypeInfo_t userPassword; /**< userPassword    */
+       TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**<     simMeInterfaceTransportLevel    */
+       TelSatOtherAddressInfo_t dataDestinationAddress; /**<   dataDestinationAddress  */
+} TelSatOpenChannelCsbInfo_t;
+
+/**
+ * This structure contains the data objects for OPEN CHANNEL (packet) proactive command indication data.
+ */
+typedef struct {
+       TelSatBearerParametersGprsInfo_t bearerParamsGprs; /**< gprs info       */
+       TelSatBufferSizeInfo_t bufferSize; /**< bufferSize      */
+       TelSatnetworkAccessNameInfo_t networkAccessName; /**<   networkAccessName       */
+       TelSatOtherAddressInfo_t otherAddress; /**<     otherAddress    */
+       TelSatTextTypeInfo_t userLogin; /**<    userLogin       */
+       TelSatTextTypeInfo_t userPassword; /**< userPassword    */
+       TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**<     simMeInterfaceTransportLevel    */
+       TelSatOtherAddressInfo_t dataDestinationAddress; /**<   dataDestinationAddress  */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+} TelSatOpenChannelpdbInfo_t;
+
+/**
+ * This structure contains the data objects for OPEN CHANNEL LOCAL LINK proactive command indication data.
+ */
+typedef struct {
+       TelSatDurationInfo_t duration1; /**<    command execution time duration1        */
+       TelSatDurationInfo_t duration2; /**<    command execution time duration2        */
+       TelSatBearerParametersLocalLinksInfo_t bearerParamsLocalLinks; /**<     local link info */
+       TelSatBufferSizeInfo_t bufferSize; /**< bufferSize      */
+       TelSatTextTypeInfo_t userPassword; /**< userPassword    */
+       TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**<     simMeInterfaceTransportLevel    */
+       TelSatOtherAddressInfo_t dataDestinationAddress; /**<   dataDestinationAddress  */
+       TelSatRemoteEntityAddressInfo_t remoteEntityAddress; /**<       remoteEntityAddress     */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+} TelSatOpenChannelLocalBearerInfo_t;
+
+/**
+ * This structure contains the data objects for OPEN CHANNEL (DEFAULT BEARER) proactive command indication data.
+ */
+typedef struct {
+       TelSatBufferSizeInfo_t bufferSize; /**< bufferSize      */
+       TelSatOtherAddressInfo_t otherAddress; /**<     otherAddress    */
+       TelSatTextTypeInfo_t userLogin; /**<    userLogin       */
+       TelSatTextTypeInfo_t userPassword; /**< userPassword    */
+       TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel;/**<      simMeInterfaceTransportLevel    */
+       TelSatOtherAddressInfo_t dataDestinationAddress; /**<   dataDestinationAddress  */
+} TelSatOpenChannelDefaultBearerInfo_t;
+
+/**
+ * This structure contains the data objects for OPEN CHANNEL (UICC Server Mode) proactive command indication data.
+ */
+typedef struct {
+       TelSatBufferSizeInfo_t bufferSize; /**< bufferSize      */
+       TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**<     simMeInterfaceTransportLevel    */
+} TelSatOpenChannelUiccServerModeInfo_t;
+
+/**
+ * This structure contains the data objects for OPEN CHANNEL proactive command indication data.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       int bIsUiccServerMode; /**<     flag whether UICC server mode or not    */
+       TelSatBearerDescType_t bearerType; /**< bearer destination type */
+       TelSatAlphaIdentifierInfo_t alphaId; /**<       alpha identifier(string) info   */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       union {
+               TelSatOpenChannelCsbInfo_t csBearer; /**<       cs info */
+               TelSatOpenChannelpdbInfo_t pdBearer; /**<       pbd info        */
+               TelSatOpenChannelLocalBearerInfo_t locBearer; /**<      local link info */
+               TelSatOpenChannelDefaultBearerInfo_t defaultBearer; /**<        defaultBearer   */
+               TelSatOpenChannelUiccServerModeInfo_t uiccServerMode; /**<      uiccServerMode  */
+       } details; /**< Open Channel Details */
+} TelSatOpenChannelIndInfo_t;
+
+/**
+ * This structure contains the data objects for CLOSE CHANNEL proactive command indication data.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatAlphaIdentifierInfo_t alphaId; /**<       alpha identifier(string) info   */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       TelSatTextAttributeInfo_t textAttribute; /**<   text attribute info -e.g. bold, center align    */
+} TelSatCloseChannelIndInfo_t;
+
+/**
+ * This structure contains the data objects for RECEIVE DATA proactive command indication data.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatAlphaIdentifierInfo_t alphaId; /**<       alpha identifier(string) info   */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       TelSatChannelDataLengthInfo_t channelDataLen; /**<      channel data length     */
+} TelSatReceiveDataIndInfo_t;
+
+/**
+ * This structure contains the data objects for SEND DATA proactive command indication data.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+       TelSatAlphaIdentifierInfo_t alphaId; /**<       alpha identifier(string) info   */
+       TelSatIconIdentifierInfo_t iconId; /**< icon identifier info    */
+       TelSatChannelDataInfo_t channel_data; /**<      channel data for sending        */
+} TelSatSendDataIndInfo_t;
+
+/**
+ * This structure contains the data objects for GET CHANNEL STATUS proactive command indication data.
+ */
+typedef struct {
+       TelSatCommandDetailInfo_t commandDetail; /**<   command detail info. includes command number, type, qualifier   */
+       TelSatDeviceIdentitiesInfo_t deviceIdentities; /**<     device identities info. includes source and destination devices */
+} TelSatGetChannelStatusIndInfo_t;
+
+/**
+ * This structure contains the data object for END PROACTIVE SESSION command indication.
+ */
+typedef struct {
+       TelSatCommandType_t commandType; /**<   proactive command type  */
+} TelSatEndProactiveSessionIndInfo_t;
+
+/**
+ * This structure contains the data objects for PROACTIVE command indication union data.
+ */
+typedef struct {
+       union {
+               TelSatMoreTimeIndInfo_t moreTime;
+               TelSatDisplayTextIndInfo_t displayText; /**<    Parsed proactive command info from TLV to Telephony data type - display text    */
+               TelSatGetInkeyIndInfo_t getInkey; /**<  Parsed proactive command info from TLV to Telephony data type - getInkey        */
+               TelSatGetInputIndInfo_t getInput; /**<  Parsed proactive command info from TLV to Telephony data type - getInput        */
+               TelSatPlayToneIndInfo_t playTone; /**<  Parsed proactive command info from TLV to Telephony data type - play tone       */
+               TelSatSetupMenuIndInfo_t setupMenu; /**<        Parsed proactive command info from TLV to Telephony data type - setup menu      */
+               TelSatSelectItemIndInfo_t selectItem; /**<      Parsed proactive command info from TLV to Telephony data type - select item     */
+               TelSatSendSmsIndInfo_t sendSms; /**<    Parsed proactive command info from TLV to Telephony data type - send sms        */
+               TelSatSendSsIndInfo_t sendSs; /**<      Parsed proactive command info from TLV to Telephony data type - send ss */
+               TelSatSendUssdIndInfo_t sendUssd; /**<  Parsed proactive command info from TLV to Telephony data type - send  ussd      */
+               TelSatSetupCallIndInfo_t setupCall; /**<        Parsed proactive command info from TLV to Telephony data type - setup call      */
+               TelSatRefreshIndInfo_t refresh; /**<    Parsed proactive command info from TLV to Telephony data type - refresh */
+               TelSatProvideLocalInfoIndInfo_t provideLocInfo; /**<    Parsed proactive command info from TLV to Telephony data type - provide local info      */
+               TelSatLaunchBrowserIndInfo_t launchBrowser; /**<        Parsed proactive command info from TLV to Telephony data type - launch browser  */
+               TelSatSetupIdleModeTextIndInfo_t idleText; /**< Parsed proactive command info from TLV to Telephony data type - setup idle mode text    */
+               TelSatSendDtmfIndInfo_t sendDtmf; /**<  Parsed proactive command info from TLV to Telephony data type - send dtmf       */
+               TelSatLanguageNotificationIndInfo_t languageNotification;/**<   Parsed proactive command info from TLV to Telephony data type - language notification   */
+               TelSatSetupEventListIndInfo_t setupEventList; /**<      Parsed proactive command info from TLV to Telephony data type - setup event list        */
+               TelSatOpenChannelIndInfo_t openChannel; /**<    Parsed proactive command info from TLV to Telephony data type - open channel    */
+               TelSatCloseChannelIndInfo_t closeChannel; /**<  Parsed proactive command info from TLV to Telephony data type - close channel   */
+               TelSatReceiveDataIndInfo_t receiveData; /**<    Parsed proactive command info from TLV to Telephony data type - receive data    */
+               TelSatSendDataIndInfo_t sendData; /**<  Parsed proactive command info from TLV to Telephony data type - send data       */
+               TelSatGetChannelStatusIndInfo_t getChannelStatus; /**<  Parsed proactive command info from TLV to Telephony data type - get channel status      */
+       } cmdInfo; /**< Union   */
+} TelSatProactiveCmdData_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of DISPLAY TEXT proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+} TelSatDisplayTextRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of GET INKEY proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+       TelSatTextTypeInfo_t text; /**< inserted key info       */
+       TelSatDurationInfo_t duration;
+} TelSatGetInkeyRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of PLAY TONE proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+} TelSatPlayToneRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of MORE TIME proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+} TelSatMoreTimeRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of SETUP MENU proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+} TelSatSetupMenuRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of GET INPUT proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+       TelSatTextTypeInfo_t text; /**< inserted string info    */
+} TelSatGetInputRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of SELECT ITEM proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+       int bOtherInfo; /**<    flag to check whether other information is required or not      */
+       unsigned char itemIdentifier; /**<      item identifier */
+} TelSatSelectItemRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of PROVIDE LOCAL INFORMATION proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+       int bOtherInfo; /**<    flag to check whether other information is required or not      */
+       TelSatCmdQualiProvideLocalInfo_t infoType; /**< local info type - e.g. time zone or language info, etc  */
+       union {
+               TelSatDataTimeZoneInfo_t timeZoneInfo; /**<     current time zone info  */
+               TelSatLanguageInfo_t languageInfo; /**< current ME language setting info        */
+       } u; /**<       Union   */
+} TelSatProvideLocalInfoRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of SETUP EVENT LIST proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+} TelSatSetupEventListRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of SEND SMS proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+       TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< call control problem    */
+} TelSatSendSmsRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of SET UP CALL proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+       int bOtherInfo; /**<    flag to check whether other information are required or not     */
+       TelSatNetworkProblemType_t networkProblem; /**< network problem during setup call       */
+       TelSatCallCtrlProblemType_t permanentCallCtrlProblem; /**<      permanent call control problem  */
+       TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**<       call control requested action info      */
+       TelSatResultInfo_t result2; /**<        additional response on general result   */
+       TelSatTextTypeInfo_t text; /**< text string info        */
+       int bIsTapiCause; /**<  flag to check whether tapi makes problem or not */
+       unsigned long tapiCause; /**<   tapi call level cause   */
+       unsigned long tapiSsCause; /**< tapi ss level cause     */
+} TelSatSetupCallRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of SEND SS proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+       int bOtherInfo; /**<    flag to check whether whether other information is required or not      */
+       TelSatSsProblemType_t additionalSsProblemInfo; /**<     additional ss problem */
+       TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< additional call control problem */
+       TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**<       call control requested action info      */
+       TelSatResultInfo_t result2; /**<        additional response on general result   */
+       TelSatTextTypeInfo_t text; /**< text string info        */
+} TelSatSendSsRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of SEND USSD proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+       int bOtherInfo; /**<    flag to check whether other information is required or not      */
+       TelSatUssdProblemType_t additionalUssdProblemInfo; /**< additional ussd problem */
+       TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< additional call control problem */
+       int bCallCtrlHasModification; /**<      flag to check whether modification happens during call control  */
+       TelSatTextTypeInfo_t text; /**< text string info        */
+       TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**<       call control requested action info      */
+       TelSatResultInfo_t result2; /**<        additional response on general result   */
+       TelSatTextTypeInfo_t text2; /**<        text string info        */
+} TelSatSendUssdRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of REFRESH proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+} TelSatRefreshRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of GET CHANNEL STATUS proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+       int bOtherInfo; /**<    flag whether other information are required or not      */
+       TelSatBipProblemType_t additionalProblemInfo; /**<      bip specific problem info       */
+       TelSatChannelStatusInfo_t channelStatus; /**<   channel Status  */
+} TelSatGetChannelStatusRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of CLOSE CHANNEL proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+       TelSatBipProblemType_t additionalProblemInfo; /**<      bip specific problem info       */
+} TelSatCloseChannelRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of OPEN CHANNEL proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+       int bOtherInfo; /**<    flag whether other information are required or not */
+       TelSatBearerDescriptionInfo_t bearerDescription; /**<   bearerDescription       */
+       TelSatBipProblemType_t additionalProblemInfo; /**<      bip specific problem info       */
+       TelSatChannelStatusInfo_t channelStatus; /**<   channelStatus   */
+       TelSatBufferSizeInfo_t bufferSize; /**< bufferSize      */
+} TelSatOpenChannelRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of LANGAUGE NOTIFICATION proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+} TelSatLanguageNotificationRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of LAUNCH BROWSER proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+       TelSatLaunchBrowserProblemType_t additionalProblemInfo; /**<    browser specific problem info   */
+} TelSatLaunchBrowserRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of RECEIVE DATA proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+       TelSatBipProblemType_t additionalProblemInfo; /**<      bip specific problem info       */
+       int bOtherInfo; /**<    flag whether other information are required or not      */
+       TelSatChannelDataInfo_t channel_data; /**<      channel data    */
+       unsigned char channelDataLen; /**<      channel data length     */
+} TelSatReceiveDataRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of SEND DATA proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+       TelSatBipProblemType_t additionalProblemInfo; /**<      bip specific problem info       */
+       unsigned char channelDataLen; /**<      channel data length     */
+} TelSatSendDataRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of SETUP IDLE MODE TEXT proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+} TelSatSetupIdlemodeTextRespInfo_t;
+
+/**
+ * This structure contains the data objects for the Terminal Response of SEND DTMF proactive command.
+ */
+typedef struct {
+       TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not       */
+} TelSatSendDtmfRespInfo_t;
+
+/**
+ * This contains the data structures to be used to send proactive command response.
+ */
+typedef struct {
+       unsigned char commandNumber; /**<         proactive command number      */
+       TelSatCommandType_t commandType; /**<     proactive command type        */
+       union {
+               TelSatMoreTimeRespInfo_t moreTime;
+               TelSatDisplayTextRespInfo_t displayText; /**<   terminal response info from displayText proactive command       */
+               TelSatGetInkeyRespInfo_t getInkey; /**< terminal response info from getInkey proactive command  */
+               TelSatGetInputRespInfo_t getInput; /**< terminal response info from getInput proactive command  */
+               TelSatPlayToneRespInfo_t playTone; /**< terminal response info from playTone proactive command  */
+               TelSatSetupMenuRespInfo_t setupMenu; /**<       terminal response info from setupMenu proactive command */
+               TelSatSelectItemRespInfo_t selectItem; /**<     terminal response info from selectItem proactive command        */
+               TelSatSendSmsRespInfo_t sendSms; /**<   terminal response info from sendSms proactive command   */
+               TelSatSendSsRespInfo_t sendSs; /**<     terminal response info from sendSs proactive command    */
+               TelSatSendUssdRespInfo_t sendUssd; /**< terminal response info from sendUssd proactive command  */
+               TelSatSetupCallRespInfo_t setupCall; /**<       terminal response info from setupCall proactive command */
+               TelSatRefreshRespInfo_t refresh; /**<   terminal response info from refresh proactive command   */
+               TelSatProvideLocalInfoRespInfo_t provideLocInfo; /**<   terminal response info from provide Local Info proactive command        */
+               TelSatLaunchBrowserRespInfo_t launchBrowser; /**<       terminal response info from launch Browser proactive command    */
+               TelSatSetupIdlemodeTextRespInfo_t idleText; /**<        terminal response info from setup idle mode text proactive command      */
+               TelSatSendDtmfRespInfo_t sendDtmf; /**< terminal response info from send Dtmf proactive command */
+               TelSatLanguageNotificationRespInfo_t languageNotification; /**< terminal response info from language Notification proactive command     */
+               TelSatSetupEventListRespInfo_t setupEventList; /**<     terminal response info from setup Event List proactive command  */
+               TelSatOpenChannelRespInfo_t openChannel; /**<   terminal response info from openChannel proactive command       */
+       } terminalRespInfo; /**<        Union   */
+} TelSatRespInfo_t;
+
+/*
+ *SAT Icon Data
+ */
+
+typedef struct {
+       unsigned char iconId;
+       unsigned char imgType;
+       unsigned char imgLen;
+       unsigned char imgData[256];
+} TelSatIconDataResp_t;
+
+typedef struct {
+       unsigned char iconId;
+       unsigned char imgType;
+       unsigned char fileId[2];
+       unsigned char reqDataLen[2];
+       unsigned char offset[2];
+} TelsatIconDataGet_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TEL_SAT_PROACTV_CMD_H_ */
+
+/**
+ * @}
+ */
diff --git a/src/sat_ui_support/TelSim.h b/src/sat_ui_support/TelSim.h
new file mode 100644 (file)
index 0000000..7b598f5
--- /dev/null
@@ -0,0 +1,1074 @@
+/*
+ * libslp-tapi
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @open
+ * @ingroup            TelephonyAPI
+ * @addtogroup SIM_TAPI        SIM
+ * @{
+ *
+ * @file TelSim.h
+
+ @brief This file serves as a "C" header file defines structures for Tapi SIM Services. \n
+ It contains a sample set of constants, enums, structs that would be required by applications.
+ */
+
+#ifndef _TELSIM_H_
+#define _TELSIM_H_
+
+#include <TelDefines.h>
+//#include <TapiCommon.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** Maximum ICCID Length */
+#define TAPI_SIM_ICCID_LEN_MAX 20
+
+/** Alpha Id  max length */
+#define TAPI_SIM_XDN_ALPHA_ID_MAX_LEN 30
+
+/** Dialing number max length */
+#define TAPI_SIM_XDN_DIALING_NUMBER_LEN        20
+
+/** CSP profile entry count max length */
+#define TAPI_SIM_CPHS_CUSTOMER_SERVICE_PROFILE_ENTRY_COUNT_MAX 11
+
+/** Authentication code max length */
+#define TAPI_SIM_AUTH_MAX_REQ_DATA_LEN 256
+
+/** Authentication response data max length */
+#define TAPI_SIM_AUTH_MAX_RESP_DATA_LEN 128
+
+/** SAP APDU max length */
+#define TAPI_SIM_APDU_MAX_LEN 256+2 // to be fine tuned according to lower layers, 2bytes for SW1 & SW2 should be added
+
+/** SIM 3G Phone book EF Max count */
+#define TAPI_SIM_PB_3G_FILE_MAX_COUNT 13
+
+/** SAP Answer to Reset data max length */
+#define TAPI_SIM_SAP_ATR_DATA  256
+
+
+/**
+ * @enum TelSimCardType_t
+ * This enumeration defines the card type.
+ */
+typedef enum {
+       TAPI_SIM_CARD_TYPE_UNKNOWN, /**< Unknown card */
+       TAPI_SIM_CARD_TYPE_GSM, /**< SIm(GSM) card*/
+       TAPI_SIM_CARD_TYPE_USIM, /**< USIM card */
+       TAPI_SIM_CARD_TYPE_RUIM,
+       TAPI_SIM_CARD_TYPE_IMS,
+} TelSimCardType_t;
+
+/**
+ * @enum TelSimFacilityStatus_t
+ * This enumeration defines the pin status.
+ */
+typedef enum {
+       TAPI_SIM_FACILITY_DISABLED = 0x00,
+       TAPI_SIM_FACILITY_ENABLED = 0x01,
+       TAPI_SIM_FACILITY_UNKNOWN = 0xFF
+} TelSimFacilityStatus_t;
+
+/**
+ * @enum TelSimPinOperationResult_t
+ * This enumeration defines the pin operation result from the lower layers.
+ */
+typedef enum {
+       TAPI_SIM_PIN_OPERATION_SUCCESS, /**< Operation involving PIN (verification/change/enable/disable, etc) is successful.  */
+       TAPI_SIM_BUSY, /**< SIM is busy  */
+       TAPI_SIM_CARD_ERROR, /**< SIM card error - Permanently blocked and general errors   */
+       TAPI_SIM_INCOMPATIBLE_PIN_OPERATION, /**< SIM Incompatible pin operation that is in case when invalid SIM command is given or incorrect parameters are supplied to the SIM. */
+       TAPI_SIM_PIN_INCORRECT_PASSWORD, /**< SIM PIN  Incorrect password */
+       TAPI_SIM_PUK_INCORRECT_PASSWORD, /**< SIM PUK Incorrect Password */
+       TAPI_SIM_PUK_REQUIRED, /**< PUK Required */
+       TAPI_SIM_PIN_REQUIRED, /**< PIN Required */
+       TAPI_SIM_NCK_REQUIRED, /**< Network Control Key Required */
+       TAPI_SIM_NSCK_REQUIRED, /**< Network Subset Control Key Required */
+       TAPI_SIM_SPCK_REQUIRED, /**< Service Provider Control Key Required */
+       TAPI_SIM_CCK_REQUIRED, /**< Corporate Control Key Required */
+       TAPI_SIM_LOCK_REQUIRED, /**<  PH-SIM (phone-SIM) locked state **/
+} TelSimPinOperationResult_t;
+
+/**
+ * @enum TelSimAccessResult_t
+ * This enumeration defines the SIM access result from the lower layers.
+ */
+typedef enum {
+       TAPI_SIM_ACCESS_SUCCESS, /**< Access to file successful.  */
+       TAPI_SIM_ACCESS_CARD_ERROR, /**< SIM card error    */
+       TAPI_SIM_ACCESS_FILE_NOT_FOUND, /**< File not found  */
+       TAPI_SIM_ACCESS_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition is not fulfilled  */
+       TAPI_SIM_ACCESS_FAILED, /**< Access failed.  */
+} TelSimAccessResult_t;
+
+/**
+ * @enum TelSimPinType_t
+ * This enumeration defines the pin type.
+ */
+typedef enum {
+       TAPI_SIM_PTYPE_PIN1 = 0x00, /**< PIN 1 code */
+       TAPI_SIM_PTYPE_PIN2 = 0x01, /**< PIN 2 code */
+       TAPI_SIM_PTYPE_PUK1 = 0x02, /**< PUK 1 code */
+       TAPI_SIM_PTYPE_PUK2 = 0x03, /**< PUK 2 code */
+       TAPI_SIM_PTYPE_UPIN = 0x04, /**< Universal PIN - Unused now */
+       TAPI_SIM_PTYPE_ADM = 0x05, /**< Administrator - Unused now */
+       TAPI_SIM_PTYPE_SIM = 0x06 /**< SIM Lock code */
+} TelSimPinType_t;
+
+/**
+ * @enum TelSimTypeOfNum_t
+ * This enumeration defines the type of number.
+ */
+typedef enum {
+       TAPI_SIM_TON_UNKNOWN = 0, /**< unknown */
+       TAPI_SIM_TON_INTERNATIONAL = 1, /**< international number */
+       TAPI_SIM_TON_NATIONAL = 2, /**< national number */
+       TAPI_SIM_TON_NETWORK_SPECIFIC = 3, /**< network specific number */
+       TAPI_SIM_TON_DEDICATED_ACCESS = 4, /**< subscriber number */
+       TAPI_SIM_TON_ALPHA_NUMERIC = 5, /**< alphanumeric, GSM 7-bit default alphabet) */
+       TAPI_SIM_TON_ABBREVIATED_NUMBER = 6, /**< abbreviated number */
+       TAPI_SIM_TON_RESERVED_FOR_EXT = 7 /**< reserved for extension */
+} TelSimTypeOfNum_t;
+
+/**
+ *  @enum TelSimTextEncrypt_t
+ *   This enumeration defines the text encryption types
+ */
+typedef enum {
+       TAPI_SIM_TEXT_ENC_ASCII, /**< ASCII Encoding */
+       TAPI_SIM_TEXT_ENC_GSM7BIT, /**< GSM 7 Bit Encoding */
+       TAPI_SIM_TEXT_ENC_UCS2, /**< UCS2 Encoding */
+       TAPI_SIM_TEXT_ENC_HEX, /**< HEX Encoding */
+} TelSimTextEncrypt_t;
+
+/**
+ * @enum TelSimNumberingPlanIdentity_t
+ * This enumeration defines the numbering plan identifier.
+ */
+typedef enum {
+       TAPI_SIM_NPI_UNKNOWN = 0, /**< Unknown */
+       TAPI_SIM_NPI_ISDN_TEL = 1, /**< ISDN/Telephone numbering plan */
+       TAPI_SIM_NPI_DATA_NUMBERING_PLAN = 3, /**< Data numbering plan */
+       TAPI_SIM_NPI_TELEX = 4, /**< Telex numbering plan */
+       TAPI_SIM_NPI_SVC_CNTR_SPECIFIC_PLAN = 5, /**< Service Center Specific plan */
+       TAPI_SIM_NPI_SVC_CNTR_SPECIFIC_PLAN2 = 6, /**< Service Center Specific plan */
+       TAPI_SIM_NPI_NATIONAL = 8, /**< National numbering plan */
+       TAPI_SIM_NPI_PRIVATE = 9, /**< Private numbering plan */
+       TAPI_SIM_NPI_ERMES_NUMBERING_PLAN = 10, /**< ERMES numbering plan */
+       TAPI_SIM_NPI_RESERVED_FOR_EXT = 0xF /**< Reserved for extension */
+} TelSimNumberingPlanIdentity_t;
+
+/**
+ * @enum TelSimEccEmergencyServiceInfo_t
+ * This enumeration defines the emergency service type.
+ */
+typedef enum {
+       TAPI_SIM_ECC_ESC_POLICE = 0x01, /**< Police */
+       TAPI_SIM_ECC_ESC_AMBULANCE = 0x02, /**< Ambulance */
+       TAPI_SIM_ECC_ESC_FIREBRIGADE = 0x04, /**< Fire brigade */
+       TAPI_SIM_ECC_ESC_MARAINEGUARD = 0x08, /**< Marine guard */
+       TAPI_SIM_ECC_ESC_MOUTAINRESCUE = 0x10, /**< Mountain rescue */
+       TAPI_SIM_ECC_ESC_SPARE = 0x00 /**< Spare */
+} TelSimEccEmergencyServiceInfo_t;
+
+/**
+ * @enum TelSimLanguagePreferenceCode_t
+ * This enumeration defines the language indication code.
+ */
+typedef enum {
+       TAPI_SIM_LP_GERMAN = 0x00, /**< German */
+       TAPI_SIM_LP_ENGLISH = 0x01, /**< English */
+       TAPI_SIM_LP_ITALIAN = 0x02, /**< Italian */
+       TAPI_SIM_LP_FRENCH = 0x03, /**< French */
+       TAPI_SIM_LP_SPANISH = 0x04, /**< Spanish */
+       TAPI_SIM_LP_DUTCH = 0x05, /**< Dutch */
+       TAPI_SIM_LP_SWEDISH = 0x06, /**< Swedish */
+       TAPI_SIM_LP_DANISH = 0x07, /**< Danish */
+       TAPI_SIM_LP_PORTUGUESE = 0x08, /**< Portuguese */
+       TAPI_SIM_LP_FINNISH = 0x09, /**< Finnish */
+       TAPI_SIM_LP_NORWEGIAN = 0x0A, /**< Norwegian */
+       TAPI_SIM_LP_GREEK = 0x0B, /**< Greek */
+       TAPI_SIM_LP_TURKISH = 0x0C, /**< Turkish */
+       TAPI_SIM_LP_HUNGARIAN = 0x0D, /**< Hungarian */
+       TAPI_SIM_LP_POLISH = 0x0E, /**< Polish */
+       TAPI_SIM_LP_KOREAN = 0x0F, /**< Korean */
+       TAPI_SIM_LP_CHINESE = 0x10, /**< Chinese */
+       TAPI_SIM_LP_RUSSIAN = 0x11, /**< Russian */
+       TAPI_SIM_LP_JAPANESE = 0x12, /**< Japanese */
+       TAPI_SIM_LP_LANG_UNSPECIFIED = 0xFF /**< Unspecified */
+} TelSimLanguagePreferenceCode_t;
+
+/**
+ * @enum TelSimCardStatus_t
+ * This enumeration defines the SIM card status
+ */
+typedef enum {
+       TAPI_SIM_STATUS_CARD_ERROR = 0x00, /**< Bad card / On the fly SIM gone bad **/
+       TAPI_SIM_STATUS_CARD_NOT_PRESENT = 0x01, /**<  Card not present **/
+       TAPI_SIM_STATUS_SIM_INITIALIZING = 0x02, /**<  SIM is Initializing state **/
+       TAPI_SIM_STATUS_SIM_INIT_COMPLETED = 0x03, /**<  SIM Initialization ok **/
+       TAPI_SIM_STATUS_SIM_PIN_REQUIRED = 0x04, /**<  PIN  required state **/
+       TAPI_SIM_STATUS_SIM_PUK_REQUIRED = 0x05, /**<  PUK required state **/
+       TAPI_SIM_STATUS_CARD_BLOCKED = 0x06, /**<  PIN/PUK blocked(permanently blocked- All the attempts for PIN/PUK failed) **/
+       TAPI_SIM_STATUS_SIM_NCK_REQUIRED = 0x07, /**<  Network Control Key required state **/
+       TAPI_SIM_STATUS_SIM_NSCK_REQUIRED = 0x08, /**<  Network Subset Control Key required state **/
+       TAPI_SIM_STATUS_SIM_SPCK_REQUIRED = 0x09, /**<  Service Provider Control Key required state **/
+       TAPI_SIM_STATUS_SIM_CCK_REQUIRED = 0x0a, /**<  Corporate Control Key required state **/
+       TAPI_SIM_STATUS_CARD_REMOVED = 0x0b, /**<  Card removed **/
+       TAPI_SIM_STATUS_SIM_LOCK_REQUIRED = 0x0c /**<  PH-SIM (phone-SIM) locked state **/
+} TelSimCardStatus_t;
+
+/**
+ * @enum TelSimCphsPhaseType_t
+ * This enum gives the current CPHS phase of SIM card.
+ */
+typedef enum {
+       TAPI_SIM_CPHS_PHASE1 = 0x01, /**< phase1  */
+       TAPI_SIM_CPHS_PHASE2 = 0x02, /**< phase2  */
+       TAPI_SIM_CPHS_PHASE_RFU = 0xff /**< RFU  */
+} TelSimCphsPhaseType_t;
+
+/**
+ * @enum TelSimCphsIndexLevelIndicator_t
+ * This struct gives CPHS index level indication.
+ */
+typedef enum {
+       TAPI_SIM_CPHS_INDEX_LEVEL_ONE = 0x01, /**< SIM cphs index level one */
+       TAPI_SIM_CPHS_INDEX_LEVEL_TWO = 0x02, /**< SIM cphs index level two */
+       TAPI_SIM_CPHS_INDEX_LEVEL_THREE = 0x03, /**< SIM cphs index level three */
+       TAPI_SIM_CPHS_INDEX_LEVEL_RFU = 0xff /**< SIM cphs index level rfu */
+} TelSimCphsIndexLevelIndicator_t;
+
+/**
+ * @enum TelSimCphsCustomerServiceGroup_t
+ * This struct gives CPHS group service type information .
+ */
+typedef enum {
+       TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_OFFERING = 0x01, /**< Group csp offering*/
+       TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_RESTRICTION = 0x02, /**< Group csp restriction*/
+       TAPI_SIM_CPHS_CSP_SERVICE_GROUP_OTHER_SUPP_SERVICES = 0x03, /**< Group csp supplementary services*/
+       TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_COMPLETION = 0x04, /**< Group csp completion*/
+       TAPI_SIM_CPHS_CSP_SERVICE_GROUP_TELESERVICES = 0x05, /**< Group csp teleservices*/
+       TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CPHS_TELESERVICES = 0x06, /**< Group csp cphs teleservies*/
+       TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CPHS_FEATURES = 0x07, /**< Group csp cphs features*/
+       TAPI_SIM_CPHS_CSP_SERVICE_GROUP_NUMBER_IDENTIFIERS = 0x08, /**< Group csp number identifiers*/
+       TAPI_SIM_CPHS_CSP_SERVICE_GROUP_PHASE_SERVICES = 0x09, /**< Group csp phase services*/
+       TAPI_SIM_CPHS_CSP_SERVICE_GROUP_VALUE_ADDED_SERVICES = 0xC0, /**< Group csp value added services*/
+       TAPI_SIM_CPHS_CSP_SERVICE_GROUP_INFORMATION_NUMBERS = 0xD5 /**< Group csp information numbers*/
+} TelSimCphsCustomerServiceGroup_t;
+
+/**
+ * @enum TelSimMailboxType_t
+ * This enum gives mailbox type.
+ */
+typedef enum {
+       TAPI_SIM_MAILBOX_VOICE = 0x01, /**< CFIS voice*/
+       TAPI_SIM_MAILBOX_VOICE2 = 0x02, /**< CFIS voice*/
+       TAPI_SIM_MAILBOX_FAX = 0x03, /**< CFIS fax*/
+       TAPI_SIM_MAILBOX_DATA = 0x04, /**< CFIS data*/
+} TelSimMailboxType_t;
+
+/**
+ * @enum TelSimDynamicFlagsSelectedLineId_t
+ * This enum gives dynamics flag selected line  information.
+ */
+typedef enum {
+       TAPI_SIM_DYNAMIC_FLAGS_LINE1 = 0x01, /**< line 1 */
+       TAPI_SIM_DYNAMIC_FLAGS_LINE2 = 0x00, /**< line 2*/
+       TAPI_SIM_DYNAMIC_FLAGS_RFU = 0xff /**< rfu*/
+} TelSimDynamicFlagsSelectedLineId_t;
+
+/**
+ * @enum tapi_sim_dynamic2_flag_als_status_t
+ * This enum gives dynamics2 flag selected line  information.
+ */
+typedef enum {
+       TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_LOCKED = 0x01, /**< Dynamic flags locked */
+       TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_UNLOCKED = 0x00, /**< Dynamic flags unlocked */
+       TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_RFU = 0xff /**< rfu */
+} TelSimDynamic2FlagAlsStatus_t;
+
+
+/**
+ * @enum TelSimAuthenticationType_t
+ * This is used for Authentication Procedure by using SIM.
+ */
+typedef enum {
+       TAPI_SIM_AUTH_TYPE_IMS = 0x00, /**< IMS Authentication */
+       TAPI_SIM_AUTH_TYPE_GSM, /**< GSM Authentication */
+       TAPI_SIM_AUTH_TYPE_3G, /**< 3G Authentication */
+       TAPI_SIM_AUTH_TYPE_MAX /**< TBD */
+} TelSimAuthenticationType_t;
+
+/**
+ * @enum TelSimAuthenticationResult_t
+ * This is used for Authentication Procedure.
+ */
+typedef enum {
+       TAPI_SIM_AUTH_NO_ERROR = 0x00, /**< ISIM no error */
+       TAPI_SIM_AUTH_CANNOT_PERFORM, /**< status - can't perform authentication */
+       TAPI_SIM_AUTH_SKIP_RESPONSE, /**< status - skip authentication response */
+       TAPI_SIM_AUTH_MAK_CODE_FAILURE, /**< status - MAK(Multiple Activation Key) code failure */
+       TAPI_SIM_AUTH_SQN_FAILURE, /**< status - SQN(SeQuenceNumber) failure */
+       TAPI_SIM_AUTH_SYNCH_FAILURE, /**< status - synch failure */
+       TAPI_SIM_AUTH_UNSUPPORTED_CONTEXT, /**< status - unsupported context */
+       TAPI_SIM_AUTH_MAX /**< TBD */
+} TelSimAuthenticationResult_t;
+
+/**
+ * @enum TelSimLockType_t
+ *     This structure gives security lock type enum values
+ */
+typedef enum {
+       TAPI_SIM_LOCK_PS = 0x01, /** < PH-SIM (phone-SIM) locked.Lock Phone to SIM/UICC card
+        *      (MT asks password when other than current SIM/UICC card inserted;
+        *      MT may remember certain amount of previously used cards thus not
+        *      requiring password when they are inserted
+        */
+       TAPI_SIM_LOCK_PF, /** < PH-FSIM (phone-first-SIM) Lock Phone to the very
+        * First inserted SIM/UICC card(MT asks password when other than the first SIM/UICC
+        * card is inserted
+        */
+       TAPI_SIM_LOCK_SC, /** < SIM Lock (PIN, PIN2, PUK, PUK2) Lock SIM/UICC card ( SIM asks password in ME power-up and
+        *      when this command is issued
+        */
+       TAPI_SIM_LOCK_FD, /** < FDN - SIM card or active application in the UICC (GSM or USIM)
+        *      fixed dialing memory feature */
+       TAPI_SIM_LOCK_PN, /**< Network Personalization */
+       TAPI_SIM_LOCK_PU, /** < network subset Personalization */
+       TAPI_SIM_LOCK_PP, /** < service Provider Personalization */
+       TAPI_SIM_LOCK_PC, /** < Corporate Personalization */
+} TelSimLockType_t;
+
+/**
+ * @enum TelSimLockKey_t
+ *     This structure gives security lock key information enum values
+ */
+typedef enum {
+       TAPI_SIM_LOCK_KEY_NOT_NEED = 0x00, /**< key not need */
+       TAPI_SIM_LOCK_KEY_PIN = 0x01, /**< PIN required */
+       TAPI_SIM_LOCK_KEY_PUK = 0x02, /**< PUK required */
+       TAPI_SIM_LOCK_KEY_PIN2 = 0x03, /**< PIN2 required */
+       TAPI_SIM_LOCK_KEY_PUK2 = 0x04, /**< PUK2 required */
+       TAPI_SIM_LOCK_PERM_BLOCKED = 0x05, /**< Permanent block SIM */
+} TelSimLockStatus_t;
+
+/**
+ * @enum TelSimSapPowerMode_t
+ * This enum gives the SAP message Ids between SAP client and SAP server.
+ */
+typedef enum {
+       TAPI_SIM_SAP_POWER_SIM_ON_REQ, /**< SAP Client request about power SIM on in Server */
+       TAPI_SIM_SAP_POWER_SIM_OFF_REQ, /**< SAP Client request about power SIM off in Server */
+       TAPI_SIM_SAP_RESET_SIM_REQ, /**< SAP Client request about SIM reset in Server */
+} TelSimSapPowerMode_t;
+
+/**
+ * @enum TelSimSapConnectionStatus_t
+ * This enum gives the SAP connection status information .
+ */
+typedef enum {
+       TAPI_SIM_SAP_CONNECTION_STATUS_OK = 0x00, /**< connect successfully */
+       TAPI_SIM_SAP_CONNECTION_STATUS_UNABLE_TO_ESTABLISH, /**< unable to establish connection */
+       TAPI_SIM_SAP_CONNECTION_STATUS_NOT_SUPPORT_MAX_SIZE, /**< when server does not support message length that client want send */
+       TAPI_SIM_SAP_CONNECTION_STATUS_TOO_SMALL_MAX_SIZE /**< when client want to connect with very small message length which is not supported by Server */
+} TelSimSapConnectionStatus_t;
+
+/**
+ * @enum TelSimSapDissconnectType_t
+ * This enum gives the SAP  disconnect type information.
+ */
+typedef enum {
+       TAPI_SIM_SAP_DISCONNECT_TYPE_GRACEFUL = 0x00, /**< disconnection procedure ends after finishing current work */
+       TAPI_SIM_SAP_DISCONNECT_TYPE_IMMEDIATE /**<  disconnection procedure ends immediately*/
+} TelSimSapDissconnectType_t;
+
+/**
+ * @enum TelSimSapStatusInfo_t
+ * This enum gives the SAP current connection status information
+ */
+typedef enum {
+       TAPI_SIM_SAP_STATUS_UNKNOWN = 0x00, /**<  SAP server connection status - unknown*/
+       TAPI_SIM_SAP_STATUS_NO_SIM, /**<  SAP server connection status - no SIM*/
+       TAPI_SIM_SAP_STATUS_NOT_READY, /**<  SAP server connection status - not ready*/
+       TAPI_SIM_SAP_STATUS_READY, /**<  SAP server connection status - ready*/
+       TAPI_SIM_SAP_STATUS_CONNECTED /**<  SAP server connection status - connected*/
+} TelSimSapStatusInfo_t;
+
+/**
+ * @enum TelSimSapCardStatus_t
+ * This enum gives the SIM card status if server`s status changed about connection with subscription module
+ */
+typedef enum {
+       TAPI_SIM_SAP_CARD_STATUS_UNKNOWN = 0x00, /**<  SAP server status(card reader status) - unknown*/
+       TAPI_SIM_SAP_CARD_STATUS_RESET, /**<  SAP server status(card reader status) - reset*/
+       TAPI_SIM_SAP_CARD_STATUS_NOT_ACCESSIBLE, /**<  SAP server status(card reader status) - not accessible*/
+       TAPI_SIM_SAP_CARD_STATUS_REMOVED, /**<  SAP server status(card reader status) - removed*/
+       TAPI_SIM_SAP_CARD_STATUS_INSERTED, /**<  SAP server status(card reader status) - inserted*/
+       TAPI_SIM_SAP_CARD_STATUS_RECOVERED /**<  SAP server status(card reader status) - recovered*/
+} TelSimSapCardStatus_t;
+
+/**
+ * @enum TelSimSapResultCode_t
+ * This enum gives the SAP result information.
+ */
+typedef enum {
+       TAPI_SIM_SAP_RESULT_CODE_OK = 0x00, /**<  SAP operation result - ok*/
+       TAPI_SIM_SAP_RESULT_CODE_NO_REASON, /**<  SAP operation result - no reason*/
+       TAPI_SIM_SAP_RESULT_CODE_CARD_NOT_ACCESSIBLE, /**<  SAP operation result - not accessible*/
+       TAPI_SIM_SAP_RESULT_CODE_CARD_ALREADY_POWER_OFF, /**<  SAP operation result - card already power off*/
+       TAPI_SIM_SAP_RESULT_CODE_CARD_REMOVED, /**<  SAP operation result - card removed*/
+       TAPI_SIM_SAP_RESULT_CODE_CARD_ALREADY_POWER_ON, /**<  SAP operation result - card already power on*/
+       TAPI_SIM_SAP_RESULT_CODE_DATA_NOT_AVAILABLE, /**<  SAP operation result - data not available*/
+       TAPI_SIM_SAP_RESULT_CODE_NOT_SUPPORT /**<  SAP operation result - not support*/
+} TelSimSapResultCode_t;
+
+/**
+ * @enum TelSimSapProtocol_t
+ * This enum gives SAP transport protocol type
+ */
+typedef enum {
+       TAPI_SIM_SAP_PROTOCOL_T0, /**< T = 0, character*/
+       TAPI_SIM_SAP_PROTOCOL_T1 /**< T = 1, block*/
+} TelSimSapProtocol_t;
+
+/**
+ * @enum TelSimPbAccessResult_t
+ * This enumeration defines the Phone book access result
+ */
+typedef enum {
+       TAPI_SIM_PB_SUCCESS, /**< SIM phonebook operation successful. */
+       TAPI_SIM_PB_FAIL, /**< SIM phonebook operation failure. */
+       TAPI_SIM_PB_INVALID_INDEX, /**< The index passed was not a valid index. */
+       TAPI_SIM_PB_INVALID_NUMBER_LENGTH, /**< The number length is exceeds the max length allowed (or 0). */
+       TAPI_SIM_PB_INVALID_NAME_LENGTH, /**< The name length is exceeds the max length allowed (or 0). */
+       TAPI_SIM_PB_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition for PB file is not satisfied. */
+} TelSimPbAccessResult_t;
+
+/**
+ * @enum TelSimPbFileType_t
+ * This enumeration defines  different storage types to be selected in SIM or USIM
+ */
+typedef enum {
+       TAPI_SIM_PB_FDN, /**< Fixed Dialing Number */
+       TAPI_SIM_PB_ADN, /**< SIM - ADN  */
+       TAPI_SIM_PB_SDN, /**< Service Dialing Number  */
+       TAPI_SIM_PB_3GSIM, /**< USIM - 3G phone book */
+       TAPI_SIM_PB_AAS, /**< Additional number Alpha String */
+       TAPI_SIM_PB_GAS, /**< Grouping identifier Alpha String */
+       TAPI_SIM_PB_UNKNOWNN = 0xFF, /**< Unknown file type */
+} TelSimPbType_t;
+
+/**
+ * @enum tapi_pb_storage_field_tag_type_t
+ *  This enumeration defines the different storage field types in 3G Phone book.
+ */
+typedef enum {
+       /* for 3G phone storage field type */
+       TAPI_PB_3G_NAME = 0x01, /**< Name */
+       TAPI_PB_3G_NUMBER, /**< Number */
+       TAPI_PB_3G_ANR, /**< Another number */
+       TAPI_PB_3G_EMAIL, /**< Email */
+       TAPI_PB_3G_SNE, /**< Second name entry */
+       TAPI_PB_3G_GRP, /**< Group file */
+       TAPI_PB_3G_PBC, /** <1 byte control info and 1 byte hidden info*/
+       TAPI_PB_3G_ANRA, /**< Another number */
+       TAPI_PB_3G_ANRB, /**< Another number */
+} TelSimPb3GFileType_t;
+
+/**
+ * This data structure defines the data for the Imsi information.
+ */
+typedef struct {
+       char szMcc[3 + 1]; /**< mobile country code */
+       char szMnc[3 + 1]; /**< mobile network code */
+       char szMsin[10 + 1]; /**< mobile station identification number */
+} TelSimImsiInfo_t;
+
+typedef struct {
+       char name[30+1];
+       char number[6+1];
+       TelSimEccEmergencyServiceInfo_t category;
+}TelSimEcc_t;
+
+typedef struct {
+       int ecc_count;
+       TelSimEcc_t list[15];
+}TelSimEccList_t;
+
+/**
+ *This data structure defines the data which is provided a unique identification number for the (U)ICC.
+ */
+typedef struct {
+       int icc_length; /**< Integrated Circuit Card number length */
+       char icc_num[TAPI_SIM_ICCID_LEN_MAX]; /**< Integrated Circuit Card number */
+} TelSimIccIdInfo_t;
+
+typedef struct {
+       int line1;
+       int line2;
+}TelSimCallForwardingInfo_t;
+
+typedef struct {
+       int line1;
+       int line2;
+       int fax;
+       int video;
+}TelSimMessageWaitingInfo_t;
+
+typedef struct {
+       TelSimMailboxType_t type;
+       char name[TAPI_SIM_XDN_DIALING_NUMBER_LEN+1];
+       char number[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN+1];
+       TelSimTypeOfNum_t ton;
+}TelSimMailboxInfo_t;
+
+typedef struct {
+       int count;
+       TelSimMailboxInfo_t list[4]; //max is 4
+}TelSimMailboxList_t;
+
+/**
+ *     This data structure represents MSISDN information
+ */
+typedef struct {
+       char num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1]; /**< MSISDN number. If not exist, Null string will be returned*/
+       char name[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**< MSISDN name. If not exist, Null string will be returned*/
+} TelSimSubscriberInfo_t;
+
+typedef struct {
+       int count;
+       TelSimSubscriberInfo_t list[3]; //max is 3
+}TelSimMsisdnList_t;
+
+typedef struct {
+       char plmn[6+1];
+       int b_umts;
+       int b_gsm;
+}TelSimOplmnwact_t;
+
+typedef struct {
+       int count;
+       TelSimOplmnwact_t list[30]; //max is 30
+}TelSimOplmnwactList_t;
+
+/**
+ *This is used for authentication request procedure.
+ */
+typedef struct {
+       TelSimAuthenticationType_t auth_type; /**< Authentication type */
+       int rand_length; /**< the length of RAND */
+       int autn_length; /**< the length of AUTN. it is not used in case of GSM AUTH */
+       char rand_data[TAPI_SIM_AUTH_MAX_REQ_DATA_LEN]; /**< RAND data */
+       char autn_data[TAPI_SIM_AUTH_MAX_REQ_DATA_LEN]; /**< AUTN data. it is not used in case of GSM AUTH */
+} TelSimAuthenticationData_t;
+
+/**
+ * This is used for result data of authentication.
+ */
+typedef struct {
+       TelSimAuthenticationType_t auth_type; /**< authentication type */
+       TelSimAuthenticationResult_t auth_result; /**< authentication result */
+       int resp_length; /**< response length. IMS and 3G case, it stands for RES_AUTS. GSM case, it stands for SRES. */
+       char resp_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< response data. IMS and 3G case, it stands for RES_AUTS. GSM case, it stands for SRES. */
+       int authentication_key_length; /**< the length of authentication key, Kc*/
+       char authentication_key[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< the data of of authentication key, Kc*/
+       int cipher_length; /**< the length of cipher key length */
+       char cipher_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< cipher key */
+       int integrity_length; /**< the length of integrity key length */
+       char integrity_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< integrity key */
+} TelSimAuthenticationResponse_t;
+
+
+/**
+ * This structure contains information about pin data.
+ * SIM PIN DATA. For PIN handling (Change, UnBlock) & for Type of PIN information.
+ */
+typedef struct {
+       TelSimPinType_t type; /**< Pin type */
+       unsigned char* pw; /**< PIN code */
+       unsigned int pw_len; /**< PIN code length*/
+} TelSimSecPw_t;
+
+/**
+ * This data structure defines the data for the PIN Information.
+ */
+typedef struct {
+       TelSimPinType_t type; /**< Specifies the PIN or PUK type.*/
+       int retry_count; /**< Number of attempts remaining for PIN/PUK verification.*/
+} TelSimSecResult_t;
+
+/**
+ * This structure is used to en/disable facility
+ */
+typedef struct {
+       TelSimLockType_t lock_type; /**< Facility type */
+       unsigned char *pw; /**< password */
+       int pw_len; /**< password length */
+} TelSimFacilityPw_t;
+
+typedef struct {
+       TelSimLockType_t type; /**< Specifies the PIN or PUK type.*/
+       int retry_count; /**< Number of attempts remaining for PIN/PUK verification.*/
+} TelSimFacilityResult_t;
+
+typedef struct {
+       TelSimLockType_t type;
+       TelSimFacilityStatus_t f_status;
+}TelSimFacilityInfo_t;
+
+/**
+ *
+ * This structure is used to get information about LOCK_TYPE
+ */
+typedef struct {
+       TelSimLockType_t lock_type; /**< Lock type */
+       TelSimLockStatus_t lock_status; /**< Lock key */
+       int retry_count; /**< retry counts */
+} TelSimLockInfo_t;
+
+/**
+ * This data structure defines the data for the apdu.
+ */
+typedef struct {
+       unsigned char apdu_len;
+       unsigned char* apdu;
+} TelSimApdu_t;
+
+/**
+ * This data structure defines the data for the Response of sending apdu.
+ */
+typedef struct {
+       unsigned char apdu_resp_len;
+       unsigned char apdu_resp[TAPI_SIM_APDU_MAX_LEN];
+} TelSimApduResp_t;
+
+/**
+ * This data structure defines the data for the Response of sending apdu.
+ */
+typedef struct {
+       unsigned char atr_resp_len;
+       unsigned char atr_resp[TAPI_SIM_APDU_MAX_LEN];
+} TelSimAtrResp_t;
+
+
+/**CPHS related structs **/
+
+/**
+ *     This sturcture gives information of available optional CPHS SIM files.
+ */
+typedef struct {
+       /* Byte 2 - bit1 & 2*/
+       int bCustomerServiceProfile; /**< Customer Service Profile (CSP)  */
+       /* Byte 2 - bit3 & 4*/
+       int bServiceStringTable; /**< Service String Table (SST) */
+       /* Byte 2 - bit5 & 6*/
+       int bMailBoxNumbers; /**< MailBoxNumbers */
+       /* Byte 2 - bit7 & 8*/
+       int bOperatorNameShortForm; /**< Short form of operator name */
+       /* Byte 3 - bit1 & 2*/
+       int bInformationNumbers; /**< Information numbers */
+} TelSimCphsServiceTable_t;
+
+/*
+ These requirements are additional to the GSM 900 and DCS1800 recommendations.
+ They apply to all products which are to be compliant with the CPHS specification.
+
+ In addition to those SIM storage fields previously defined in DCS1800 to support
+ existing MS features and services, the Association has defined the following fields  :-
+
+ 1)    Call Forwarding flag                                            (mandatory)
+ 2)    Voice message waiting flag                                      (mandatory)
+ 3)    PLMN operator name                                              (mandatory)
+ 4)    Customer Service Profile (CSP)                          (optional)
+ 5)    CPHS Information                                                        (mandatory)
+ 6)    Mailbox Numbers                                                 (optional)
+ 7)    Information Numbers                                             (optional)
+
+ */
+
+/*
+ DATA FIELD - 6F 16: CPHS INFORMATION
+ Access Conditions:
+ READ  CHV1
+ UPDATE        ADM
+ */
+/**
+ *
+ *This structure gives CPHS information data.
+ */
+typedef struct {
+       TelSimCphsPhaseType_t CphsPhase; /**< CPHS phase type */
+       TelSimCphsServiceTable_t CphsServiceTable; /**< CPHS service table */
+} TelSimCphsInfo_t;
+
+/*
+ DATA FIELD -6F 11: Voice message waiting flag
+ Access Conditions:
+ READ  CHV1
+ UPDATE        CHV1
+ */
+/**
+ *
+ * This struct gives CPHS voice message waiting flag information .
+ */
+typedef struct {
+       int bWaitVoiceMsgLine1; /**< VoiceMsgLine 1 */
+       int bWaitVoiceMsgLine2; /**< VoiceMsgLine 2 */
+       int bWaitFaxMsg; /**< FAX Msg */
+       int bWaitDataMsg; /**< Data Msg */
+} TelSimCphsVoiceMsgWaitFlagInfo_t;
+
+/*
+ DATA FIELD -6F 13: Call forwarding flags
+ Access Conditions:
+ READ  CHV1
+ UPDATE        CHV1
+ */
+/**
+ * This struct gives CPHS call forwarding flag information.
+ */
+typedef struct {
+       int bCallForwardUnconditionalLine1; /**< CallForwardUnconditionalLine 1 */
+       int bCallForwardUnconditionalLine2; /**< CallForwardUnconditionalLine 2 */
+       int bCallForwardUnconditionalFax; /**< CallForwardUnconditional FAX */
+       int bCallForwardUnconditionalData; /**<CallForwardUnconditional data*/
+       int bCallForwardUnconditionalSms; /**< CallForwardUnconditional SMS */
+       int bCallForwardUnconditionalBearer; /**< CallForwardUnconditional bearer*/
+} TelSimCphsCallForwardingFlagInfo_t;
+
+/*
+ DATA FIELD -6F 19: Information Numbers
+ Access Conditions:
+ READ  CHV1
+ UPDATE        CHV1
+ */
+/**
+ * This struct gives CPHS information numbers data.
+ */
+typedef struct {
+       int bUsed; /**< SIM CPHS index level one */
+       unsigned char AlphaIdLength; /**< length of alpha identifier */
+
+       TelSimCphsIndexLevelIndicator_t IndexLevelIndicator; /**< SIM CPHS index level one */
+       int PremiumServiceIndicator; /**< SIM CPHS index level one */
+       int NetworkSpecificIndicator; /**< SIM CPHS index level one */
+       unsigned char Alpha_id[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**<  Alpha Identifier */
+
+       unsigned long DiallingnumLength; /**< Length of BCD number/SSC contents */
+       TelSimTypeOfNum_t TypeOfNumber; /**< TON */
+       TelSimNumberingPlanIdentity_t NumberingPlanIdentity; /**< NPI */
+       char DiallingNum[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1]; /**< dialing Number/SSC String */
+       unsigned char Ext1RecordId; /**< Extensiion1 Record Identifier */
+} TelSimCphsInformationNum_t;
+
+/*
+ DATA FIELD- 6F 15: Customer Service Profile (Storing a list of service options which are relevant to that specific customer)
+ Access Conditions:
+ READ  CHV1
+ UPDATE        CHV1
+ */
+/**
+ *
+ * This struct gives CPHS service call offering information.
+ */
+typedef struct {
+       int bCallForwardingUnconditional; /**< CallForwarding Unconditional */
+       int bCallForwardingOnUserBusy; /**< CallForwarding On UserBusy */
+       int bCallForwardingOnNoReply; /**< CallForwarding On NoReply */
+       int bCallForwardingOnUserNotReachable; /**< CallForwarding On User Not Reachable */
+       int bCallTransfer; /**< Call Transfer */
+} TelSimCphsServiceCallOffering_t;
+
+/**
+ *
+ * This struct gives CPHS service call restriction information.
+ */
+typedef struct {
+       int bBarringOfAllOutgoingCalls; /**< Barring Of All Outgoing Calls*/
+       int bBarringOfOutgoingInternationalCalls; /**< Barring Of Outgoing International Calls */
+       int bBarringOfOutgoingInternationalCallsExceptHplmn; /**< Barring Of Outgoing International Calls Except HPLMN */
+       int bBarringOfAllIncomingCallsRoamingOutsideHplmn; /**< Barring Of All Incoming Calls Roaming Outside HPLMN */
+       int bBarringOfIncomingCallsWhenRoaming; /**< Barring Of IncomingCalls When Roaming */
+} TelSimCphsServiceCallRestriction_t;
+
+/**
+ *
+ * This struct gives CPHS service SS  information.
+ */
+typedef struct {
+       int bMultiPartyService; /**< MultiPartyService*/
+       int bClosedUserGroup; /**< ClosedUserGroup*/
+       int bAdviceOfCharge; /**< AdviceOfCharge*/
+       int bPreferentialClosedUserGroup; /**< PreferentialClosedUserGroup*/
+       int bClosedUserGroupOutgoingAccess; /**< ClosedUserGroupOutgoingAccess*/
+} TelSimCphsServiceOtherSupplimentaryService_t;
+
+/**
+ *
+ * This struct gives CPHS service call complete information.
+ */
+typedef struct {
+       int bCallHold; /**< Call Hold*/
+       int bCallWaiting; /**< Call Waiting*/
+       int bCompletionOfCallToBusySubscriber; /**< Completion Of Call To Busy Subscriber*/
+       int bUserUserSignalling; /**< User User Signaling*/
+} TelSimCphsServiceCallComplete_t;
+
+/**
+ *
+ * This struct gives CPHS service teleservices  information.
+ */
+typedef struct {
+       int bShortMessageMobileOriginated; /**< Short Message Mobile Originated*/
+       int bShortMessageMobileTerminated; /**< Short Message Mobile Terminated*/
+       int bShortMessageCellBroadcast; /**< Short Message Cell Broadcast*/
+       int bShortMessageReplyPath; /**< Short  Message Reply Path*/
+       int bShortMessageDeliveryConf; /**< Short Message Delivery Conf*/
+       int bShortMessageProtocolIdentifier; /**< Short Message Protocol Identifier*/
+       int bShortMessageValidityPeriod; /**< Short Message Validity Period*/
+} TelSimCphsServiceTeleservices_t;
+
+/**
+ *
+ * This struct gives CPHS alternative line service  information.
+ */
+typedef struct {
+       int bAlternativeLineService; /**< Alternative Line Service*/
+} TelSimCphsServiceCphsTeleservices_t;
+
+/**
+ *
+ * This struct gives CPHS string service table information.
+ */
+typedef struct {
+       int bStringServiceTable; /**< String Service Table*/
+} TelSimCphsServiceCphsFeatures_t;
+
+/**
+ *
+ * This struct gives CPHS service number identifier  information.
+ */
+typedef struct {
+       int bCallingLineIdentificationPresent; /**< Calling Line Identification Present*/
+       int bConnectedLineIdentificationRestrict; /**< Connected Line Identification Restrict*/
+       int bConnectedLineIdentificationPresent; /**< Connected Line Identification Present*/
+       int bMaliciousCallIdentifier; /**< Malicious Call Identifier*/
+       int bCallingLineIdentificationSend; /**< Calling Line Identification Send*/
+       int bCallingLineIdentificationBlock; /**< Calling Line Identification Block*/
+} TelSimCphsServiceNumberIdentifier_t;
+
+/**
+ *
+ * This struct gives CPHS service phase services information.
+ */
+typedef struct {
+       int bMenuForGprs; /**< Menu For GPRS*/
+       int bMenuForHighSpeedCsd; /**< Menu For HighSpeedCsd*/
+       int bMenuForVoiceGroupCall; /**< Menu For VoiceGroupCall*/
+       int bMenuForVoiceBroadcastService; /**< Menu For VoiceBroadcastService*/
+       int bMenuForMultipleSubscriberProfile; /**< Menu For MultipleSubscriberProfile*/
+       int bMenuForMultipleBand; /**< Menu For MultipleBand*/
+} TelSimCphsServicePhaseServices_t;
+
+/**
+ *
+ * This struct gives CPHS value added service   information.
+ */
+typedef struct {
+       int bRestrictMenuForManualSelection; /**< RestrictMenu For ManualSelection*/
+       int bRestrictMenuForVoiceMail; /**< RestrictMenu For VoiceMail*/
+       int bRestrictMenuForMoSmsAndPaging; /**< RestrictMenu For MoSmsAndPaging*/
+       int bRestrictMenuForMoSmsWithEmialType; /**< RestrictMenu For MoSmsWithEmialType*/
+       int bRestrictMenuForFaxCalls; /**< RestrictMenu For FaxCalls*/
+       int bRestrictMenuForDataCalls; /**< RestrictMenu For DataCalls*/
+       int bRestrictMenuForChangeLanguage; /**< RestrictMenu For ChangeLanguage*/
+} TelSimCphsServiceValueAddedServices_t;
+
+/**
+ *
+ * This struct gives CPHS service information number data.
+ */
+typedef struct {
+       int bInformationNumbers; /**< Information Numbers*/
+} TelSimCphsServiceInformationNumbers_t;
+
+/**
+ *
+ * This struct gives CPHS service profile entry  information.
+ */
+typedef struct {
+       TelSimCphsCustomerServiceGroup_t CustomerServiceGroup; /**< customer service group*/
+       union {
+               TelSimCphsServiceCallOffering_t CallOffering; /**< call offering*/
+               TelSimCphsServiceCallRestriction_t CallRestriction; /**< call restriction*/
+               TelSimCphsServiceOtherSupplimentaryService_t OtherSuppServices; /**< other SS services*/
+               TelSimCphsServiceCallComplete_t CallComplete; /**< call complete*/
+               TelSimCphsServiceTeleservices_t Teleservices; /**< teleservices*/
+               TelSimCphsServiceCphsTeleservices_t CphsTeleservices; /**< CPHS teleservices*/
+               TelSimCphsServiceCphsTeleservices_t CphsFeatures; /**< CPHS features*/
+               TelSimCphsServiceNumberIdentifier_t NumberIdentifiers; /**< number identifiers*/
+               TelSimCphsServicePhaseServices_t PhaseServices; /**< phase services*/
+               TelSimCphsServiceValueAddedServices_t ValueAddedServices; /**< value added services*/
+               TelSimCphsServiceInformationNumbers_t InformationNumbers; /**< information numbers*/
+       } u;
+} TelSimCphsCustomerServiceProfileEntry_t;
+
+/**
+ *
+ * This struct gives CPHS service profile information.
+ */
+typedef struct {
+       TelSimCphsCustomerServiceProfileEntry_t ServiceProfileEntry[TAPI_SIM_CPHS_CUSTOMER_SERVICE_PROFILE_ENTRY_COUNT_MAX]; /**< service profile entry*/
+} TelSimCphsCustomerServiceProfileInfo_t;
+
+/**
+ *
+ * This struct gives dynamics flag selected line  information.
+ */
+typedef struct {
+       TelSimDynamicFlagsSelectedLineId_t DynamicFlags; /**< Dynamic flags information */
+} TelSimDynamicFlagsInfo_t;
+
+/**
+ *
+ * This struct gives dynamics flag selected line  information.
+ */
+typedef struct {
+       TelSimDynamic2FlagAlsStatus_t Dynamic2Flag; /**< Dynamic flags status */
+} TelSimDynamic2FlagsInfo_t;
+
+
+/**
+ * This data structure gives the phone book availability of current SIM.
+ */
+typedef struct {
+       int b_fdn; /**< Fixed Dialing Number */
+       int b_adn; /**< SIM - ADN(2G phonebook   */
+       int b_sdn; /**< Service Dialing Number  */
+       int b_3g; /**< USIM - 3G phonebook */
+       int b_aas; /**< Additional number Alpha String phonebook */
+       int b_gas; /**< Grouping information Alpha String phonebook */
+} TelSimPbList_t;
+
+typedef struct {
+       TelSimPbType_t phonebook_type;
+       unsigned short index;
+       unsigned short next_index; //this field is not used in add/update case
+
+       unsigned char name[60];
+       TelSimTextEncrypt_t dcs;
+
+       unsigned char number[40];
+       TelSimTypeOfNum_t ton;
+
+       /* following field is valid in only USIM*/
+       unsigned char anr1[40];
+       TelSimTypeOfNum_t anr1_ton;
+       unsigned char anr2[40];
+       TelSimTypeOfNum_t anr2_ton;
+       unsigned char anr3[40];
+       TelSimTypeOfNum_t anr3_ton;
+
+       unsigned char email1[60];
+       unsigned char email2[60];
+       unsigned char email3[60];
+       unsigned char email4[60];
+
+       unsigned short group_index; //GRP
+       unsigned short pb_control; //PBC
+} TelSimPbRecord_t;
+
+/**
+ *     This data structure defines the phone book storage count information.
+ */
+typedef struct {
+       TelSimPbType_t StorageFileType; /**< Storage  file type */
+       unsigned short TotalRecordCount; /**< Total record count */
+       unsigned short UsedRecordCount; /**< Used record count */
+} TelSimPbStorageInfo_t;
+
+/**
+ * This data structure gives the phone book entry information.
+ */
+typedef struct {
+       TelSimPbType_t StorageFileType; /**< Storage  file type */
+       unsigned short PbIndexMin; /**< Phone book minimum index*/
+       unsigned short PbIndexMax; /**< Phone book maximum index */
+       unsigned short PbNumLenMax; /**< Phone number maximum length */
+       unsigned short PbTextLenMax; /**< Text maximum length */
+} TelSimPbEntryInfo_t;
+
+/**
+ *
+ This structure gives 3G phone book capability information.
+ */
+typedef struct {
+       TelSimPb3GFileType_t FileType3G; /**< 3G phonebook file type */
+       unsigned short PbIndexMax; /**< max index */
+       unsigned short PbTextMax; /**< max text length */
+       unsigned short TotalRecordCount; /**< total record count */
+} TelSimPb3GFileTypeCapabiltyInfo_t;
+
+/**
+ *
+ * This data structure defines the data for the SIM PHONEBOOK & ITS CAPABILITIES information.
+ * It refers to EF_PBR
+ */
+typedef struct {
+       unsigned char FileTypeCount; /**< phonebook file type count */
+       TelSimPb3GFileTypeCapabiltyInfo_t FileTypeInfo[TAPI_SIM_PB_3G_FILE_MAX_COUNT]; /**< phonebook file type information */
+} TelSimPbCapabilityInfo_t;
+
+
+
+/* SAP (SIM Access Profile) related interface structures and enum */
+/**
+ * This struct gives the SAP ATR response data information.
+ */
+typedef struct {
+       int atr_len; /**<  SAP ATR response data length */
+       unsigned char atr_data[TAPI_SIM_SAP_ATR_DATA]; /**<  SAP ATR response data */
+} TelSapAtrInfo_t;
+
+/* SAP transfer APDU request */
+
+/**
+ * This data structure gives the SAP APDU data information.
+ */
+typedef struct {
+       int apdu_len; /**<  SAP APDU length */
+       unsigned char apdu_data[TAPI_SIM_APDU_MAX_LEN]; /**<  SAP APDU data */
+} TelSapApduData_t;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _TELSIM_H_
+/**
+ * @}
+ */
diff --git a/src/sat_ui_support/TelSs.h b/src/sat_ui_support/TelSs.h
new file mode 100644 (file)
index 0000000..772e156
--- /dev/null
@@ -0,0 +1,465 @@
+/*
+ * libslp-tapi
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @open
+ * @ingroup            TelephonyAPI
+ * @addtogroup  SS_TAPI        SS(Supplementary services)
+ * @{
+ *
+ * @file TelSs.h
+
+ @brief This file serves as a "C" header file and defines structures for Tapi Supplementary Services\n
+ It contains a sample set of constants, enums, structs that would be required by applications.
+ */
+
+#ifndef _TEL_SS_H_
+#define _TEL_SS_H_
+
+#include <TelDefines.h>
+#include <TelErr.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** maximum length of barring password */
+#define TAPI_SS_GSM_BARR_PW_LEN_MAX                            4 /**<Maximum length of barring password */
+
+/** maximum length of dial digit */
+#define TAPI_CALL_DIALDIGIT_LEN_MAX                            82 /**<maximum length of dial digit *///( To Accommodate Unpacked string length, which will be greater than 182, 182* 8 /7 = 208, Packed len = 182* 7/8 = 160)
+#define TAPI_SS_USSD_DATA_SIZE_MAX                             208      /**<User-to-user data maximum size */
+#define TAPI_SS_RECORD_NUM_MAX                                 5 /**< SS record maximum size */
+#define TAPI_SS_AOC_CURRENCY_LEN_MAX                   3 /**< maximum length of AOC currency */
+
+/* Supplementary Svc */
+#define TAPI_SS_ADDRESS_LEN_MAX                                        40
+#define TAPI_SS_CCBS_SIZE_MAX                                  5
+#define TAPI_SS_TELECOMM_SERVCE_SIZE_MAX               13
+#define TAPI_SS_PHONE_NUM_LEN_MAX                              33
+#define TAPI_SS_MMISTRING_LEN_MAX                              33
+#define TAPI_SS_PWD_LEN_MAX                                            5
+#define TAPI_MAX_RELEASE_COMPLETE_DATA_LEN             260
+#define TAPI_MAX_ULONG                                                 0xffffffff
+
+/**
+ *  This enumeration defines the call forwarding flavor.
+ */
+typedef enum {
+       TAPI_SS_CF_WHEN_CFU = 0x01, /* 0x01 : Call Forwarding Unconditional */
+       TAPI_SS_CF_WHEN_CFB,        /* 0x02 : Call Forwarding Mobile Busy */
+       TAPI_SS_CF_WHEN_CFNRy,      /* 0x03 : Call Forwarding No Reply */
+       TAPI_SS_CF_WHEN_CFNRc,      /* 0x04 : Call Forwarding Not Reachable */
+       TAPI_SS_CF_WHEN_CF_ALL,     /* 0x05 : All Call Forwarding */
+       TAPI_SS_CF_WHEN_CFC,        /* 0x06 : All Conditional Call Forwarding */
+       TAPI_SS_CF_WHEN_MAX         /* 0x07 : Max */
+} TelSsForwardWhen_t;
+
+/**
+ * The various types of call barring. Note, only one type of incoming barring and only one type of outgoing barring may be active at any time.
+ */
+typedef enum {
+       TAPI_SS_CB_TYPE_BAOC = 0x01,                /* 0x01 : Barring All Outgoing Calls */
+       TAPI_SS_CB_TYPE_BOIC,                /* 0x02 : Barring Outgoing International Calls */
+       TAPI_SS_CB_TYPE_BOIC_NOT_HC, /* 0x03 : Barring Outgoing International Calls
+                                                                except to Home Country */
+       TAPI_SS_CB_TYPE_BAIC,                /* 0x04 : Barring All Incoming Calls */
+       TAPI_SS_CB_TYPE_BIC_ROAM,       /* 0x05 : Barring Incoming Calls when roam, 
+                                                                       outside of the Home Country */
+       TAPI_SS_CB_TYPE_AB,                   /* 0x06 : All Barring Services */
+       TAPI_SS_CB_TYPE_AOB,                 /* 0x07 : All Outgoing Barring Services */
+       TAPI_SS_CB_TYPE_AIB,                  /* 0x08 : All Incoming Barring Services */
+       TAPI_SS_CB_TYPE_BIC_NOT_SIM, /* 0x09 : Barring Incoming Calls which is
+                                                                not stored in the SIM memory */
+       TAPI_SS_CB_TYPE_MAX
+} TelSsBarringType_t;
+
+/**
+ * This enumeration defines the ussd Indication Type
+ */
+typedef enum {
+       TAPI_SS_USSD_STATUS_NOTIFY = 0x00, /**< notify : to display USSD data to user */
+       TAPI_SS_USSD_STATUS_NO_ACTION_REQUIRE = 0x01, /**< No further user action required */
+       TAPI_SS_USSD_STATUS_ACTION_REQUIRE = 0x02, /**< Further user action required*/
+       TAPI_SS_USSD_STATUS_TERMINATED_BY_NET = 0x03, /**< 0x03 : USSD terminated by network */
+       TAPI_SS_USSD_STATUS_OTHER_CLIENT = 0x04, /**< 0x04 : other local client has responded */
+       TAPI_SS_USSD_STATUS_NOT_SUPPORT = 0x05, /**< 0x05 : operation not supported */
+       TAPI_SS_USSD_STATUS_TIME_OUT = 0x06 /**< 0x06 : Time out when there is no response from network */
+} TelSsUssdStatus_t;
+
+/**
+ *
+ * This enum defines the values for USSD type.
+ */
+typedef enum {
+       TAPI_SS_USSD_TYPE_USER_INIT = 0x01, /**< USSD request type User Initiated. */
+       TAPI_SS_USSD_TYPE_USER_RSP, /**< USSD request type User Response. */
+       TAPI_SS_USSD_TYPE_USER_REL /**< USSD request type User Release. */
+} TelSsUssdType_t;
+
+/**
+ *  This enumeration defines the call barring operation mode .
+ */
+typedef enum {
+       TAPI_SS_CB_MODE_ACTIVATE, /**< Activate call barring  */
+       TAPI_SS_CB_MODE_DEACTIVATE, /**< De Activate call barring */
+} TelSsBarringMode_t;
+
+/**
+ *  This enumeration defines the call barring operation mode .
+ */
+typedef enum {
+       TAPI_SS_CW_MODE_ACTIVATE, /**< Activate call barring  */
+       TAPI_SS_CW_MODE_DEACTIVATE, /**< De Activate call barring */
+} TelSsCallWaitingMode_t;
+
+/**
+ *  This enumeration defines the call type .
+ */
+typedef enum {
+       /* TELESERVICE */
+       TAPI_SS_CLASS_ALL_TELE=0x10,                        /* 0x10 : All Teleservices */
+       TAPI_SS_CLASS_VOICE=0x11,                              /* 0x11 : All Voice ( telephony ) */
+       TAPI_SS_CLASS_ALL_DATA_TELE=0x12,             /* 0x12 : All Data Teleservices */
+       TAPI_SS_CLASS_FAX=0x13,                                /* 0x13 : All Fax Service */
+       TAPI_SS_CLASS_SMS=0x16,                                /* 0x16 : SMS service     */
+       TAPI_SS_CLASS_VGCS=0x17,                              /* 0x17 : Voice Group Call Service */
+       TAPI_SS_CLASS_VBS=0x18,                                /* 0x18 : Voice Broadcast */
+       TAPI_SS_CLASS_ALL_TELE_EXPT_SMS=0x19,    /* 0x19 : All teleservice except SMS */
+
+       /* BEARER SERVICE */
+       TAPI_SS_CLASS_ALL_BEARER=0x20,                  /* 0X20 : all bearer services */
+       TAPI_SS_CLASS_ALL_ASYNC=0x21,                    /* 0x21 : All Async services */
+       TAPI_SS_CLASS_ALL_SYNC=0x22,                      /* 0x22 : All sync services*/
+       TAPI_SS_CLASS_ALL_CS_SYNC=0x24,                /* 0x24 : All Circuit switched sync */
+       TAPI_SS_CLASS_ALL_CS_ASYNC=0x25,              /* 0x25 : All Circuit switched async */
+       TAPI_SS_CLASS_ALL_DEDI_PS=0x26,                /* 0x26 : All Dedicated packet Access */
+       TAPI_SS_CLASS_ALL_DEDI_PAD=0x27,              /* 0x27 : All Dedicated PAD Access */
+       TAPI_SS_CLASS_ALL_DATA_CDA=0x28,                /*0x28 : All Data CDA*/  
+
+       /* PLMN SPECIFIC TELESERVICE */
+       TAPI_SS_CLASS_PLMN_TELE_ALL = 0x50,         /*0x50 : PLMN specific teleservices*/
+       TAPI_SS_CLASS_PLMN_TELE_1 = 0x51,              /*0x51 :PLMN specific teleservice 1*/
+       TAPI_SS_CLASS_PLMN_TELE_2 = 0x52,             /*0x52 : PLMN specific teleservice 2*/
+       TAPI_SS_CLASS_PLMN_TELE_3 = 0x53,             /*0x53 : PLMN specific teleservice 3*/
+       TAPI_SS_CLASS_PLMN_TELE_4 = 0x54,             /*0x54 : PLMN specific teleservice 4*/
+       TAPI_SS_CLASS_PLMN_TELE_5 = 0x55,             /*0x55 : PLMN specific teleservice 5*/
+       TAPI_SS_CLASS_PLMN_TELE_6 = 0x56,             /*0x56 : PLMN specific teleservice 6*/
+       TAPI_SS_CLASS_PLMN_TELE_7 = 0x57,             /*0x57 : PLMN specific teleservice 7*/
+       TAPI_SS_CLASS_PLMN_TELE_8 = 0x58,             /*0x58 : PLMN specific teleservice 8*/
+       TAPI_SS_CLASS_PLMN_TELE_9 = 0x59,             /*0x59 : PLMN specific teleservice 9*/
+       TAPI_SS_CLASS_PLMN_TELE_A = 0x60,           /*0x60 :PLMN specific teleservice 10*/
+       TAPI_SS_CLASS_PLMN_TELE_B = 0x61,           /*0x61 :PLMN specific teleservice 11*/
+       TAPI_SS_CLASS_PLMN_TELE_C = 0x62,             /*0x62 : PLMN specific teleservice 12*/
+       TAPI_SS_CLASS_PLMN_TELE_D = 0x63,             /*0x63 : PLMN specific teleservice 13*/
+       TAPI_SS_CLASS_PLMN_TELE_E = 0x64,             /*0x64 : PLMN specific teleservice 14*/
+       TAPI_SS_CLASS_PLMN_TELE_F = 0x65,             /*0x65 : PLMN specific teleservice 15*/
+
+       /* PLMN SPECIFIC BEARER SERVICE */
+       TAPI_SS_CLASS_PLMN_BEAR_ALL = 0x70,         /*0x70 : All PLMN specific bearer services*/
+       TAPI_SS_CLASS_PLMN_BEAR_1 = 0x71,              /*0x71 :PLMN specific bearer service 1*/
+       TAPI_SS_CLASS_PLMN_BEAR_2 = 0x72,             /*0x72 : PLMN specific bearer service  2*/
+       TAPI_SS_CLASS_PLMN_BEAR_3 = 0x73,             /*0x73 : PLMN specific bearer service  3*/
+       TAPI_SS_CLASS_PLMN_BEAR_4 = 0x74,             /*0x74 : PLMN specific bearer service  4*/
+       TAPI_SS_CLASS_PLMN_BEAR_5 = 0x75,             /*0x75 : PLMN specific bearer service  5*/
+       TAPI_SS_CLASS_PLMN_BEAR_6 = 0x76,             /*0x76 : PLMN specific bearer service  6*/
+       TAPI_SS_CLASS_PLMN_BEAR_7 = 0x77,             /*0x77 : PLMN specific bearer service  7*/
+       TAPI_SS_CLASS_PLMN_BEAR_8 = 0x78,             /*0x78 : PLMN specific bearer service  8*/
+       TAPI_SS_CLASS_PLMN_BEAR_9 = 0x79,             /*0x79 : PLMN specific bearer service  9*/
+       TAPI_SS_CLASS_PLMN_BEAR_A = 0x80,            /*0x80 : PLMN specific bearer service  10*/
+       TAPI_SS_CLASS_PLMN_BEAR_B = 0x81,             /*0x81 : PLMN specific bearer service  11*/
+       TAPI_SS_CLASS_PLMN_BEAR_C = 0x82,            /*0x82 : PLMN specific bearer service  12*/
+       TAPI_SS_CLASS_PLMN_BEAR_D = 0x83,            /*0x83 : PLMN specific bearer service  13*/
+       TAPI_SS_CLASS_PLMN_BEAR_E = 0x84,             /*0x84 : PLMN specific bearer service  14*/
+       TAPI_SS_CLASS_PLMN_BEAR_F = 0x85,             /*0x85 : PLMN specific bearer service  15*/
+
+       /* CPHS - AUXILIARY SERVICE */
+       TAPI_SS_CLASS_AUX_VOICE = 0x89,                 /* 0x89 : All Auxiliary Voice ( Auxiliary telephony ) */
+
+       TAPI_SS_CLASS_ALL_GPRS_BEARER=0x99,       /* 0x99 : All GPRS bearer services */
+       TAPI_SS_CLASS_ALL_TELE_BEARER=0xFF,        /* 0xFF : all tele and bearer services */
+} TelSsClass_t;
+
+/**
+ *  This enumeration defines the forward mode .
+ */
+typedef enum {
+       TAPI_SS_CF_MODE_DISABLE_EV, /**< Deactivate call forwarding  */
+       TAPI_SS_CF_MODE_ENABLE_EV, /**< Activate call forwarding */
+       TAPI_SS_CF_MODE_REGISTRATION_EV, /**< Register Call forwarding  */
+       TAPI_SS_CF_MODE_ERASURE_EV, /**< De-register call forwarding */
+} TelSsForwardMode_t;
+
+typedef enum {
+       TAPI_SS_CF_NO_REPLY_TIME_5_SECS = 5, /**< Timer value set to 5secs*/
+       TAPI_SS_CF_NO_REPLY_TIME_10_SECS = 10, /**< Timer value set to 10secs*/
+       TAPI_SS_CF_NO_REPLY_TIME_15_SECS = 15, /**< Timer value set to 15secs*/
+       TAPI_SS_CF_NO_REPLY_TIME_20_SECS = 20, /**< Timer value set to 20secs*/
+       TAPI_SS_CF_NO_REPLY_TIME_25_SECS = 25, /**< Timer value set to 25secs*/
+       TAPI_SS_CF_NO_REPLY_TIME_30_SECS = 30, /**< Timer value set to 30secs*/
+} TelSsNoReplyTime_t;
+
+/**
+ *  Describes whether a supplementary service request was a success or a failure; and if it failed, why.
+ */
+typedef enum {
+       TAPI_SS_SUCCESS, /**<  SS operation was successful */
+       TAPI_SS_TIMEREXPIRE, /**< SS operation timer expired on network. */
+       TAPI_SS_UNKNOWNSUBSCRIBER, /**< SS error indicating unknown/illegal subscriber.  */
+       TAPI_SS_BEARERSERVICENOTPROVISIONED, /**<The network returns this error when it is requested to  @n
+        perform an operation on a supplementary service  */
+       TAPI_SS_TELESERVICENOTPROVISIONED, /**<The network returns this error when it is requested to perform  @n
+        an operation on a supplementary service  */
+       TAPI_SS_ILLEGALSSOPERATION, /**<This error is returned by the network when it is requested to perform an illegal operation @n
+        which is defined as not applicable for the relevant supplementary service */
+       TAPI_SS_ERRORSTATUS, /**<This error is returned by the network when it is requested to perform an operation @n
+        which is not compatible with the current status of the relevant supplementary service. */
+       TAPI_SS_NOTAVAILABLE, /**< SS not available in network */
+       TAPI_SS_SUBSCRIPTIONVIOLATION, /**< SS service subscription violation. */
+       TAPI_SS_INCOMPATIBILITY, /**< This error is returned by the network when it is requested for a supplementary service operation incompatible with the @n
+        status of another supplementary service or with the teleservice or bearer service for which the operation is requested */
+       TAPI_SS_SYSTEMFAILURE, /**< This error is returned by the network, when it cannot perform an operation because of a failure in the network */
+       TAPI_SS_DATAMISSING, /**< This error is returned by the network when an optional parameter is missing in an invoke component @n
+        or an inner data structure, while it is required by the context of the request. */
+       TAPI_SS_UNEXPECTEDDATAVALUE, /**< SS error indicating unexpected data value on network side *//**< SS operation barred.  */
+       TAPI_SS_PWREGISTRATIONFAILURE, /**< SS error indicating change password failure. */
+       TAPI_SS_NEGATIVEPWCHECK, /**< SS error indicating negative password check.  */
+       TAPI_SS_FACILITYNOTSUPPORTED, /**< SS service facility not supported  */
+       TAPI_SS_RESOURCESNOTAVAILABLE, /**< SS error indicating resources not available in network.  */
+       TAPI_SS_MAXNOMPTYEXCEEDED, /**< SS error indicating Maximum MPTY is reached.  */
+       TAPI_SS_CALLBARRED, /**< This error is returned by the network to the MS when call independent subscriber control procedures are barred by the operator */
+       TAPI_SS_NUMBEROFPWATTEMPTSVIOLATION, /**< SS error indicating barring password attempts violated.  */
+       TAPI_SS_ABSENTSUBSCRIBER, /**< This error is returned when the subscriber has activated the detach service or the system detects the absence condition */
+       TAPI_SS_ILLEGALSUBSCRIBER, /**<This error is returned when illegality of the access has been @n
+        established by use of authentication procedure. */
+       TAPI_SS_ILLEGALEQUIPMENT, /**<This error is returned when the IMEI check procedure has shown that  @n
+        the IMEI is blacklisted or not whitelisted  */
+       TAPI_SS_USSDBUSY, /**< SS error indicating USSD Busy(Already SS / USSD is ongoing).  */
+       TAPI_SS_UNKNOWNALPHABET, /**< SS error indicating unknown SS data coding of alphabet */
+       TAPI_SS_INVALIDDEFLECTEDTONUMBER, /**< SS error indicating the invalid deflected to number.  */
+       TAPI_SS_DEFLECTIONTOSERVEDSUBSCRIBER, /**< This error is returned if a diversion to the served  @n
+        subscriber's number was requested.  */
+       TAPI_SS_SPECIALSERVICECODE, /**< This error is returned if diversion to a special service code was requested.  */
+       TAPI_SS_REJECTEDBYUSER, /**< SS operation rejected by user.  */
+       TAPI_SS_REJECTEDBYNETWORK, /**< SS operation rejected by network.  */
+       TAPI_SS_NET_NOT_ALLOWED_EMERGENCY_CALLS_ONLY, /**< SS operation is not allowed by network.  */
+       TAPI_SS_UNKNOWNERROR, /**< SS error indicating unknown error  */
+       TAPI_SS_OEM_NOT_SUPPORTED /**< If oem do not support any of SS requests, then this error will be returned back */
+} TelSsCause_t;
+
+/**
+ *   The status of a supplementary service feature (e.g. Call Forwarding or Call Barring). @n
+ *   These enumerated values should be used as masks
+ */
+typedef enum {
+       TAPI_SS_STATUS_ACTIVE, /**< Provisioned & registered & active */
+       TAPI_SS_STATUS_REGISTERED, /**< Provisioned & registered (but not active/active-quiescent */
+       TAPI_SS_STATUS_PROVISIONED, /**<Provisioned but not registered (or active/active-quiescent) */
+       TAPI_SS_STATUS_QUIESCENT, /**< Provisioned & registered & active but quiescent */
+       TAPI_SS_STATUS_NOTHING /**< Not provisioned */
+} TelSsStatus_t;
+
+/**
+ * These are the four types of identity presentation / restriction services.
+ */
+typedef enum {
+       TAPI_CALLING_LINE_IDENTITY_PRESENTATION, /**< identify the party calling this phone */
+       TAPI_CALLING_LINE_IDENTITY_RESTRICTION, /**< hide the identity of this phone when calling others */
+       TAPI_CONNECTED_LINE_IDENTITY_PRESENTATION, /**< identify the party to whom the calling party (this phone) is connected */
+       TAPI_CONNECTED_LINE_IDENTITY_RESTRICTION, /**< restrict yourself from being identified by incoming calls, such as forwarded calls */
+       TAPI_CALLED_LINE_IDENTITY_PRESENTATION, /**< Called line identity presentation  */
+       TAPI_CALLING_NAME_PRESENTATION /**< Calling Name Presentation */
+} TelSsLineIdentificationType_t;
+
+/**
+ *  This enumeration defines the cli service status .
+ */
+typedef enum {
+       TAPI_CLI_STATUS_NOT_PROVISONED = 0x01, /**<Service not provided by the service provider */
+       TAPI_CLI_STATUS_PROVISIONED, /**<Service is provided by the service provider */
+       TAPI_CLI_STATUS_ACTIVATED, /**<Service is activated at the network */
+       TAPI_CLI_STATUS_UNKOWN, /**<Service status is unknown*/
+       TAPI_CLI_STATUS_TEMP_RESTRICTED, /**<Service is temporarily restricted */
+       TAPI_CLI_STATUS_TEMP_ALLOWED /**<Service is temporarily allowed */
+} TelSsCliStatus_t;
+
+/**
+ *  This enumeration defines the values for Cli service type .
+ */
+typedef enum {
+       TAPI_SS_CLI_CLIP = 0x01, /**< Calling Line Identification Presentation. */
+       TAPI_SS_CLI_CLIR = 0x02, /**<  Calling Line Identification Restriction. */
+       TAPI_SS_CLI_COLP = 0x03, /**<  Connected Line Identification Presentation. */
+       TAPI_SS_CLI_COLR = 0x04, /**<  Connected Line Identification Restriction. */
+       TAPI_SS_CLI_CDIP = 0x05, /**<  Called Line Identification Presentation. */
+       TAPI_SS_CLI_CNAP = 0x06, /**<  Calling Name Presentation.*/
+} TelSsCliType_t;
+
+/**
+ * This enum defines the values for AOC type.
+ */
+typedef enum {
+       TAPI_SS_AOC_TYPE_RESET = 0x00, /**< Specifies the Reset MAXACM Value. */
+       TAPI_SS_AOC_TYPE_ACM = 0x01, /**< Specifies the Accumulated call meter. */
+       TAPI_SS_AOC_TYPE_CCM = 0x02, /**< Specifies the Current call meter. */
+       TAPI_SS_AOC_TYPE_MAXACM = 0x04, /**< Specifies the Max accumulated call meter. */
+       TAPI_SS_AOC_TYPE_PUC = 0x08 /**< Specifies the Price per unit and currency.*/
+} TelSsAocType_t;
+
+/**
+ *  This structure  defines the different parameters related to forward info.
+ */
+typedef struct {
+       TelSsClass_t Class;
+       TelSsForwardMode_t Mode; /**< Forward Mode */
+       TelSsForwardWhen_t Condition; /**< Forward Condition */
+       char szPhoneNumber[TAPI_CALL_DIALDIGIT_LEN_MAX]; /**< Phone Number*/
+       TelSsNoReplyTime_t NoReplyConditionTimer; /**< No reply wait time 5-30 secs in intervals of 5. */
+} TelSsForwardInfo_t;
+
+/**
+ *  This structure defines the values for USSD request type.
+ */
+typedef struct {
+       TelSsUssdType_t Type;
+       int Length; /**< USSD  String Length */
+       char szString[TAPI_SS_USSD_DATA_SIZE_MAX]; /**< USSD  String */
+} TelSsUssdMsgInfo_t;
+
+/**
+ *  This structure  defines the different parameters related to call barring.
+ */
+typedef struct {
+       TelSsClass_t Class; /**< Call type */
+       TelSsBarringMode_t Mode; /**< Barring mode  */
+       TelSsBarringType_t Type; /**< Barring type */
+       char szPassword[TAPI_SS_GSM_BARR_PW_LEN_MAX]; /**< password */
+} TelSsBarringInfo_t;
+
+/**
+ *  This structure  defines the different parameters related to call waiting.
+ */
+typedef struct {
+       TelSsClass_t Class; /**< Call type */
+       TelSsCallWaitingMode_t Mode; /**< Waiting mode  */
+} TelSsWaitingInfo_t;
+
+/**
+ * This structure defines the release complete message notification type.
+ */
+typedef struct {
+       unsigned char RelCompMsgLen; /**< Specifies the Release complete msg length.*/
+       unsigned char szRelCompMsg[TAPI_MAX_RELEASE_COMPLETE_DATA_LEN]; /**<  Specifies the Release complete msg. */
+} TelSsRelCompMsgInfo_t;
+
+/**
+ * This structure defines the values for AOC request type.
+ */
+
+typedef struct {
+       float PPM;
+       unsigned char CharTypeOfCurrency;
+       unsigned char szCurrency[TAPI_SS_AOC_CURRENCY_LEN_MAX];
+} TelAocPucInfo_t;
+
+typedef struct {
+       TelSsAocType_t AocType; /**< Specifies the AOC type. */
+       unsigned int ACM; /**< Specifies the accumulated call meter value. */
+       unsigned int MaxAcm; /**< Specifies the maximum value of ACM . */
+       float CCM; /**< Specifies the Current call meter value. */
+       float PPM; /**< Specifies the Price per unit value. */
+       unsigned char CharTypeOfCurrency; /**< Specifies the Char type of currency. */
+       unsigned char szCurrency[TAPI_SS_AOC_CURRENCY_LEN_MAX]; /**< Specifies the Currency characters. */
+} TelCallAocInfo_t;
+
+/**
+ * This structure defines the values for ss call barring record
+ */
+typedef struct {
+       int record_num;
+       struct {
+               TelSsClass_t Class;
+               TelSsStatus_t Status; /**< SS status  */
+               TelSsBarringType_t Flavour; /**< Call barring types providing various barring conditions on that basis call be barred */
+       } record[TAPI_SS_RECORD_NUM_MAX]; /**< Specifies the  Maximum of TAPI_SS_RECORD_NUM_MAX records. */
+} TelSsBarringResp_t;
+
+/**
+ * This structure defines the values for ss call forwarding record
+ */
+typedef struct {
+       int record_num;
+       struct {
+               TelSsClass_t Class;
+               TelSsStatus_t Status; /**< Call forwarding SS status */
+               TelSsForwardWhen_t ForwardCondition; /**< Call forward types providing various conditions when call can be forwarded */
+               int bCallForwardingNumberPresent; /**< Call forwarding number present or not */
+               unsigned char NoReplyWaitTime;
+               unsigned char szCallForwardingNumber[TAPI_CALL_DIALDIGIT_LEN_MAX]; /**< forwarded number.[Null Terminated string]*/
+       } record[TAPI_SS_RECORD_NUM_MAX]; /**< Specifies the  Maximum of TAPI_SS_RECORD_NUM_MAX records. */
+} TelSsForwardResp_t;
+
+/**
+ * This structure defines the values for ss call waiting record
+ */
+typedef struct {
+       int record_num;
+       struct {
+               TelSsClass_t Class;
+               TelSsStatus_t Status; /**< SS status */
+       } record[TAPI_SS_RECORD_NUM_MAX]; /**< Specifies the  Maximum of TAPI_SS_RECORD_NUM_MAX records. */
+} TelSsWaitingResp_t;
+
+/**
+ * This structure defines the values for Calling line identity service
+ */
+typedef struct {
+       TelSsLineIdentificationType_t Type; /**< Various line identification types */
+       TelSsCliStatus_t Status; /**< Line identification status from network */
+} TelSsCliResp_t;
+
+typedef struct {
+       TelSsUssdType_t Type;
+       TelSsUssdStatus_t Status;
+       int Length; /**< USSD  String Length */
+       char szString[TAPI_SS_USSD_DATA_SIZE_MAX]; /**< USSD  String */
+} TelSsUssdResp_t;
+
+typedef struct {
+       TelSsUssdStatus_t Status;
+       int Length; /**< USSD  String Length */
+       char szString[TAPI_SS_USSD_DATA_SIZE_MAX]; /**< USSD  String */
+} TelSsUssdNoti_t;
+
+typedef struct {
+       float PPM; /**< Specifies the Price per unit value. */
+       unsigned char CharTypeOfCurrency; /**< Specifies the Char type of currency. */
+       unsigned char szCurrency[TAPI_SS_AOC_CURRENCY_LEN_MAX]; /**< Specifies the Currency characters. */
+} TelSsAoc_ppm_info_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _TEL_SS_H_
+/**
+ * @}
+ */
diff --git a/src/sat_ui_support/sat_ui_support.c b/src/sat_ui_support/sat_ui_support.c
new file mode 100644 (file)
index 0000000..8d2a54f
--- /dev/null
@@ -0,0 +1,573 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <glib-object.h>
+#include <gio/gio.h>
+
+#include <aul.h>
+#include <bundle.h>
+
+#include "TelSat.h"
+#include "sat_ui_support.h"
+
+static gboolean _sat_ui_support_processing_setup_menu_ind(GVariant *data)
+{
+       gint rv;
+       bundle *bundle_data = 0;
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatSetupMenuInfo_t setup_menu;
+
+       gchar *title;
+       gint command_id, item_cnt;
+       gboolean b_present, b_helpinfo, b_updated;
+       GVariant *items = NULL, *icon_id, *icon_list;
+
+       memset(&setup_menu, 0, sizeof(TelSatSetupMenuInfo_t));
+
+       g_variant_get(data, "(ibs@vibb@v@v)", &command_id, &b_present, &title, &items, &item_cnt,
+                               &b_helpinfo, &b_updated, &icon_id, &icon_list);
+
+       setup_menu.commandId = command_id;
+       setup_menu.bIsMainMenuPresent = (b_present ? 1 : 0);
+       memcpy(setup_menu.satMainTitle, title, TAPI_SAT_DEF_TITLE_LEN_MAX+1);
+       setup_menu.satMainMenuNum = item_cnt;
+       if(items && item_cnt > 0){
+               int index = 0;
+               GVariant *unbox;
+               GVariantIter *iter;
+
+               gchar *item_str;
+               gint item_id;
+               unbox = g_variant_get_variant(items);
+               dbg("items(%p) items type_format(%s)", items, g_variant_get_type_string(unbox));
+
+               g_variant_get(unbox, "a(si)", &iter);
+               while(g_variant_iter_loop(iter,"(si)",&item_str, &item_id)){
+                       setup_menu.satMainMenuItem[index].itemId = item_id;
+                       memcpy(setup_menu.satMainMenuItem[index].itemString, item_str, TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6);
+                       index++;
+               }
+               g_variant_iter_free(iter);
+       }
+       setup_menu.bIsSatMainMenuHelpInfo = (b_helpinfo ? 1 : 0);
+       setup_menu.bIsUpdatedSatMainMenu = (b_updated ? 1 : 0);
+
+       cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_SETUP_MENU);
+       encoded_data = g_base64_encode((const guchar*)&setup_menu, sizeof(TelSatSetupMenuInfo_t));
+
+       bundle_data = bundle_create();
+       bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
+       bundle_add(bundle_data, "cmd_type", cmd_type);
+       bundle_add(bundle_data, "data", encoded_data);
+
+       rv = aul_launch_app("com.samsung.sat-ui", bundle_data);
+       dbg("setup menu ind (%d)", rv);
+
+       bundle_free(bundle_data);
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+static gboolean _sat_ui_support_processing_display_text_ind(GVariant *data)
+{
+       gint rv;
+       bundle *bundle_data = 0;
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatDisplayTextInd_t display_text;
+
+       gchar* text;
+       gint command_id, text_len, duration;
+       gboolean high_priority, user_rsp_required, immediately_rsp;
+       GVariant *icon_id = NULL;
+
+       memset(&display_text, 0, sizeof(TelSatDisplayTextInd_t));
+
+       g_variant_get(data, "(isiibbb@v)", &command_id, &text, &text_len, &duration,
+               &high_priority, &user_rsp_required, &immediately_rsp, &icon_id);
+
+       display_text.commandId = command_id;
+       memcpy(display_text.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
+       display_text.text.stringLen = text_len;
+       display_text.duration = duration;
+       display_text.bIsPriorityHigh = (high_priority ? 1 : 0);
+       display_text.bIsUserRespRequired = (user_rsp_required ? 1 : 0);
+       dbg("duration(%d) user_rsp(%d)", duration, user_rsp_required);
+
+       cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_DISPLAY_TEXT);
+       encoded_data = g_base64_encode((const guchar*)&display_text, sizeof(TelSatDisplayTextInd_t));
+
+       bundle_data = bundle_create();
+       bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
+       bundle_add(bundle_data, "cmd_type", cmd_type);
+       bundle_add(bundle_data, "data", encoded_data);
+
+       rv = aul_launch_app("com.samsung.sat-ui", bundle_data);
+       dbg("display text ind (%d)", rv);
+
+       bundle_free(bundle_data);
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+static gboolean _sat_ui_support_processing_select_item_ind(GVariant *data)
+{
+       gint rv;
+       bundle *bundle_data = 0;
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatSelectItemInd_t select_item;
+
+       gboolean help_info ;
+       gchar *selected_text;
+       gint command_id, default_item_id, menu_cnt, text_len =0;
+       GVariant *menu_items, *icon_id, *icon_list;
+
+       memset(&select_item, 0, sizeof(TelSatSelectItemInd_t));
+
+       g_variant_get(data, "(ibsiii@v@v@v)", &command_id, &help_info, &selected_text,
+               &text_len, &default_item_id, &menu_cnt, &menu_items, &icon_id, &icon_list);
+
+       select_item.commandId = command_id;
+       select_item.bIsHelpInfoAvailable = (help_info ? 1 : 0);
+       memcpy(select_item.text.string, selected_text, TAPI_SAT_DEF_TITLE_LEN_MAX+1);
+       select_item.text.stringLen = text_len;
+       select_item.defaultItemIndex = default_item_id;
+       select_item.menuItemCount = menu_cnt;
+       if(menu_items && menu_cnt > 0){
+               int index = 0;
+               GVariant *unbox;
+               GVariantIter *iter;
+
+               gchar *item_str;
+               gint item_id, item_len;
+               unbox = g_variant_get_variant(menu_items);
+               dbg("items(%p) items type_format(%s)", menu_items, g_variant_get_type_string(unbox));
+
+               g_variant_get(unbox, "a(iis)", &iter);
+               while(g_variant_iter_loop(iter,"(iis)",&item_id, &item_len, &item_str)){
+                       select_item.menuItem[index].itemId = item_id;
+                       select_item.menuItem[index].textLen = item_len;
+                       memcpy(select_item.menuItem[index].text, item_str, TAPI_SAT_ITEM_TEXT_LEN_MAX + 1);
+                       index++;
+               }
+               g_variant_iter_free(iter);
+       }
+
+       cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_SELECT_ITEM);
+       encoded_data = g_base64_encode((const guchar*)&select_item, sizeof(TelSatSelectItemInd_t));
+
+       bundle_data = bundle_create();
+       bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
+       bundle_add(bundle_data, "cmd_type", cmd_type);
+       bundle_add(bundle_data, "data", encoded_data);
+
+       rv = aul_launch_app("com.samsung.sat-ui", bundle_data);
+       dbg("select item aul (%d)", rv);
+
+       bundle_free(bundle_data);
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+static gboolean _sat_ui_support_processing_get_inkey_ind(GVariant *data)
+{
+       gint rv;
+       bundle *bundle_data = 0;
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatGetInkeyInd_t get_inkey;
+
+       gint command_id, key_type, input_character_mode;
+       gint text_len, duration;
+       gboolean b_numeric, b_help_info;
+       gchar *text;
+       GVariant *icon_id;
+
+       memset(&get_inkey, 0, sizeof(TelSatGetInkeyInd_t));
+
+       g_variant_get(data, "(iiibbsii@v)", &command_id, &key_type, &input_character_mode,
+               &b_numeric,&b_help_info, &text, &text_len, &duration, &icon_id);
+
+       get_inkey.commandId = command_id;
+       get_inkey.keyType = key_type;
+       get_inkey.inputCharMode = input_character_mode;
+       get_inkey.bIsNumeric = (b_numeric ? 1 : 0);
+       get_inkey.bIsHelpInfoAvailable = (b_help_info ? 1 : 0);
+       memcpy(get_inkey.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
+       get_inkey.text.stringLen = text_len;
+       get_inkey.duration = duration;
+
+       cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_GET_INKEY);
+       encoded_data = g_base64_encode((const guchar*)&get_inkey, sizeof(TelSatGetInkeyInd_t));
+
+       bundle_data = bundle_create();
+       bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
+       bundle_add(bundle_data, "cmd_type", cmd_type);
+       bundle_add(bundle_data, "data", encoded_data);
+
+       rv = aul_launch_app("com.samsung.sat-ui", bundle_data);
+       dbg("get inkey aul (%d)", rv);
+
+       bundle_free(bundle_data);
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+static gboolean _sat_ui_support_processing_get_input_ind(GVariant *data)
+{
+       gint rv;
+       bundle *bundle_data = 0;
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatGetInputInd_t get_input;
+
+       gint command_id, input_character_mode;
+       gint text_len, def_text_len, rsp_len_min, rsp_len_max;
+       gboolean b_numeric, b_help_info, b_echo_input;
+       gchar *text, *def_text;
+       GVariant *icon_id;
+
+       memset(&get_input, 0, sizeof(TelSatGetInputInd_t));
+
+       g_variant_get(data, "(iibbbsiiisi@v)", &command_id, &input_character_mode, &b_numeric, &b_help_info, &b_echo_input,
+               &text, &text_len, &rsp_len_max, &rsp_len_min, &def_text, &def_text_len, &icon_id);
+
+       get_input.commandId = command_id;
+       get_input.inputCharMode = input_character_mode;
+       get_input.bIsNumeric = (b_numeric ? 1 : 0);
+       get_input.bIsHelpInfoAvailable = (b_help_info ? 1 : 0);
+       get_input.bIsEchoInput = (b_echo_input ? 1 : 0);
+       memcpy(get_input.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
+       get_input.text.stringLen = text_len;
+       get_input.respLen.max = rsp_len_max;
+       get_input.respLen.min = rsp_len_min;
+       memcpy(get_input.defaultText.string, def_text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
+       get_input.defaultText.stringLen = def_text_len;
+
+       cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_GET_INPUT);
+       encoded_data = g_base64_encode((const guchar*)&get_input, sizeof(TelSatGetInputInd_t));
+
+       bundle_data = bundle_create();
+       bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
+       bundle_add(bundle_data, "cmd_type", cmd_type);
+       bundle_add(bundle_data, "data", encoded_data);
+
+       rv = aul_launch_app("com.samsung.sat-ui", bundle_data);
+       dbg("get input aul (%d)", rv);
+
+       bundle_free(bundle_data);
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+static gboolean _sat_ui_support_processing_ui_info_ind(GVariant *data)
+{
+       gint rv;
+       gint cmd = 0;
+       bundle *bundle_data = 0;
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatSendUiInfo_t ui_info;
+
+       gint command_id, text_len;
+       gboolean user_confirm;
+       gchar *text;
+
+       memset(&ui_info, 0, sizeof(TelSatSendUiInfo_t));
+
+       g_variant_get(data, "(isib)", &command_id, &text, &text_len, &user_confirm);
+       dbg("command_id(%d) data(%s) len(%d) user_confirm(%d)", command_id, text, text_len, user_confirm);
+
+       ui_info.commandId = command_id;
+       memcpy(ui_info.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
+       ui_info.text.stringLen = text_len;
+       ui_info.user_confirm = (user_confirm ? 1 : 0);
+
+       cmd_type = g_strdup_printf("%d", cmd);
+       encoded_data = g_base64_encode((const guchar*)&ui_info, sizeof(TelSatSendUiInfo_t));
+
+
+       bundle_data = bundle_create();
+       bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
+       bundle_add(bundle_data, "cmd_type", cmd_type);
+       bundle_add(bundle_data, "data", encoded_data);
+
+       rv = aul_launch_app("com.samsung.sat-ui", bundle_data);
+       dbg("ui info aul (%d)", rv);
+
+       bundle_free(bundle_data);
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+gboolean sat_ui_support_terminate_sat_ui()
+{
+       gint rv;
+       bundle *bundle_data = 0;
+       gchar *cmd_type = NULL;
+
+       cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_TYPE_END_PROACTIVE_SESSION);
+
+       bundle_data = bundle_create();
+       bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
+       bundle_add(bundle_data, "cmd_type", cmd_type);
+
+       rv = aul_launch_app("com.samsung.sat-ui", bundle_data);
+       dbg("session end aul (%d)", rv);
+
+       bundle_free(bundle_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+gboolean sat_ui_support_launch_sat_ui(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data)
+{
+       gboolean result = FALSE;
+       sat_ui_support_create_desktop_file("temp");
+
+       switch(cmd_type){
+               case SAT_PROATV_CMD_NONE:
+                       result = _sat_ui_support_processing_ui_info_ind(data);
+               break;
+               case SAT_PROATV_CMD_SETUP_MENU:
+                       result = _sat_ui_support_processing_setup_menu_ind(data);
+               break;
+               case SAT_PROATV_CMD_DISPLAY_TEXT:
+                       result = _sat_ui_support_processing_display_text_ind(data);
+               break;
+               case SAT_PROATV_CMD_SELECT_ITEM:
+                       result = _sat_ui_support_processing_select_item_ind(data);
+               break;
+               case SAT_PROATV_CMD_GET_INKEY:
+                       result = _sat_ui_support_processing_get_inkey_ind(data);
+               break;
+               case SAT_PROATV_CMD_GET_INPUT:
+                       result = _sat_ui_support_processing_get_input_ind(data);
+               break;
+               case SAT_PROATV_CMD_SETUP_EVENT_LIST:
+               break;
+               default:
+                       dbg("does not need to launch sat-ui");
+               break;
+       }
+
+       return result;
+}
+
+gboolean sat_ui_support_launch_call_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data)
+{
+       gint rv;
+       char buffer[300];
+       bundle *bundle_data = 0;
+
+       dbg("launch call application by aul");
+
+       switch(cmd_type){
+               case SAT_PROATV_CMD_SETUP_CALL:{
+                       gint command_id, call_type, text_len, duration;
+                       gchar *text, *call_number;
+                       GVariant *icon_id;
+
+                       dbg("setup call type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(isi@visi)", &command_id, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
+
+                       bundle_add(bundle_data, "launch-type","SATSETUPCALL");
+
+                       snprintf(buffer, 300, "%d",command_id);
+                       bundle_add(bundle_data, "cmd_id",buffer);
+                       dbg("cmd_id(%s)",buffer);
+
+                       snprintf(buffer, 300, "%d",call_type);
+                       bundle_add(bundle_data, "cmd_qual", buffer);
+                       dbg("cmd_qual(%s)",buffer);
+
+                       snprintf(buffer, 300, "%s", text);
+                       bundle_add(bundle_data, "disp_text", buffer);
+                       dbg("disp_text(%s)",buffer);
+
+                       snprintf(buffer, 300, "%s", call_number);
+                       bundle_add(bundle_data, "call_num", buffer);
+                       dbg("call_num(%s)",buffer);
+
+                       snprintf(buffer, 300, "%d", duration);
+                       bundle_add(bundle_data, "dur", buffer);
+                       dbg("dur(%s)",buffer);
+               } break;
+
+               default:
+                       return FALSE;
+               break;
+       }
+
+       rv = aul_launch_app("com.samsung.call",bundle_data);
+       bundle_free(bundle_data);
+
+       return TRUE;
+}
+
+gboolean sat_ui_support_launch_browser_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data)
+{
+       gint rv;
+       char buffer[300];
+       bundle *bundle_data = 0;
+
+       dbg("launch browser application by aul");
+
+       /*TODO : need to make a sync with app engineer*/
+
+       switch(cmd_type){
+               case SAT_PROATV_CMD_LAUNCH_BROWSER:{
+                       gint command_id, call_type, text_len, duration;
+                       gchar *text, *call_number;
+                       GVariant *icon_id;
+
+                       dbg("setup call type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(isi@visi)", &command_id, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
+
+                       bundle_add(bundle_data, "launch-type","SATSETUPCALL");
+
+                       snprintf(buffer, 300, "%d",command_id);
+                       bundle_add(bundle_data, "cmd_id",buffer);
+                       dbg("cmd_id(%s)",buffer);
+
+                       snprintf(buffer, 300, "%d",call_type);
+                       bundle_add(bundle_data, "cmd_qual", buffer);
+                       dbg("cmd_qual(%s)",buffer);
+
+                       snprintf(buffer, 300, "%s", text);
+                       bundle_add(bundle_data, "disp_text", buffer);
+                       dbg("disp_text(%s)",buffer);
+
+                       snprintf(buffer, 300, "%s", call_number);
+                       bundle_add(bundle_data, "call_num", buffer);
+                       dbg("call_num(%s)",buffer);
+
+                       snprintf(buffer, 300, "%d", duration);
+                       bundle_add(bundle_data, "dur", buffer);
+                       dbg("dur(%s)",buffer);
+               } break;
+
+               default:
+                       return FALSE;
+               break;
+       }
+
+       rv = aul_launch_app("com.samsung.call",bundle_data);
+       bundle_free(bundle_data);
+
+       return TRUE;
+}
+
+gboolean sat_ui_support_launch_setting_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data)
+{
+       gint rv;
+       char buffer[300];
+       bundle *bundle_data = 0;
+
+       dbg("launch setting application by aul");
+
+       /*TODO : need to make a sync with app engineer*/
+
+       switch(cmd_type){
+               case SAT_PROATV_CMD_LANGUAGE_NOTIFICATION:{
+                       gint command_id, call_type, text_len, duration;
+                       gchar *text, *call_number;
+                       GVariant *icon_id;
+
+                       dbg("setup call type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(isi@visi)", &command_id, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
+
+                       bundle_add(bundle_data, "launch-type","SATSETUPCALL");
+
+                       snprintf(buffer, 300, "%d",command_id);
+                       bundle_add(bundle_data, "cmd_id",buffer);
+                       dbg("cmd_id(%s)",buffer);
+
+                       snprintf(buffer, 300, "%d",call_type);
+                       bundle_add(bundle_data, "cmd_qual", buffer);
+                       dbg("cmd_qual(%s)",buffer);
+
+                       snprintf(buffer, 300, "%s", text);
+                       bundle_add(bundle_data, "disp_text", buffer);
+                       dbg("disp_text(%s)",buffer);
+
+                       snprintf(buffer, 300, "%s", call_number);
+                       bundle_add(bundle_data, "call_num", buffer);
+                       dbg("call_num(%s)",buffer);
+
+                       snprintf(buffer, 300, "%d", duration);
+                       bundle_add(bundle_data, "dur", buffer);
+                       dbg("dur(%s)",buffer);
+               } break;
+
+               case SAT_PROATV_CMD_PROVIDE_LOCAL_INFO:
+                       break;
+
+               default:
+                       return FALSE;
+               break;
+       }
+
+       rv = aul_launch_app("com.samsung.call",bundle_data);
+       bundle_free(bundle_data);
+
+       return TRUE;
+}
+
+gboolean sat_ui_support_create_desktop_file(const gchar *title)
+{
+       int rv = 0;
+       FILE *b_check, *f_out;
+
+       if(!title){
+               dbg("title does not exist");
+               return FALSE;
+       }
+
+       b_check = fopen("/opt/share/applications/com.samsung.sat-ui.desktop", "r");
+       if(b_check && !(g_strcmp0(title,"temp")) ){
+               dbg("desktop file aleady exist");
+               fclose(b_check);
+               return TRUE;
+       }
+
+       if(b_check)
+               fclose(b_check);
+
+       f_out = fopen("/tmp/com.samsung.sat-ui.desktop", "w");
+       if(!f_out){
+               dbg("fail to create sat-ui desktop file");
+               return FALSE;
+       }
+
+       fprintf(f_out, "Package=com.samsung.sat-ui\n");
+       fprintf(f_out, "Name=%s\n",title);
+       fprintf(f_out, "Type=Application\n");
+       fprintf(f_out, "Version=0.2.2\n");
+       fprintf(f_out, "Exec=/usr/apps/com.samsung.sat-ui/bin/sat-ui KEY_EXEC_TYPE 0\n");
+       fprintf(f_out, "Icon=com.samsung.sat-ui.png\n");
+       fprintf(f_out, "X-Tizen-TaskManage=True\n");
+       fprintf(f_out, "X-Tizen-Multiple=False\n");
+       fprintf(f_out, "X-Tizen-Removable=False\n");
+       fprintf(f_out, "Comment=SIM Application UI\n");
+       fclose(f_out);
+
+       rv = system("/bin/cp /tmp/com.samsung.sat-ui.desktop /opt/share/applications/");
+       dbg("the result to create desktop file (%d)", rv);
+       rv = system("/bin/rm /tmp/com.samsung.sat-ui.desktop");
+
+       if(rv == -1 || rv == 127)
+        return FALSE;
+
+       return TRUE;
+}
diff --git a/src/sat_ui_support/sat_ui_support.h b/src/sat_ui_support/sat_ui_support.h
new file mode 100644 (file)
index 0000000..eba29d6
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef SAT_UI_SUPPORT_H_
+#define SAT_UI_SUPPORT_H_
+
+#include <glib.h>
+
+#include <tcore.h>
+#include <type/sat.h>
+
+gboolean sat_ui_support_terminate_sat_ui(void);
+gboolean sat_ui_support_launch_call_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data);
+gboolean sat_ui_support_launch_browser_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data);
+gboolean sat_ui_support_launch_setting_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data);
+gboolean sat_ui_support_launch_sat_ui(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data);
+gboolean sat_ui_support_create_desktop_file(const gchar *title);
+
+#endif /* SAT_UI_SUPPORT_H_ */
diff --git a/src/sat_util.c b/src/sat_util.c
new file mode 100644 (file)
index 0000000..d366b62
--- /dev/null
@@ -0,0 +1,714 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <assert.h>
+
+#include <iconv.h>
+#include <glib.h>
+
+#include "sat_manager.h"
+#include "util.h"
+
+#define        tabGsmUniMax2 9
+#define        tabGsmUniMax 42
+
+static void _convert_gsm_to_utf8(unsigned char *dest, unsigned short *dest_len,        unsigned char *src, unsigned int src_len);
+
+static gboolean _convert_gsm_to_unicode(unsigned short *dest, int dest_len, unsigned char *src, unsigned int src_len);
+static gboolean _convert_unicode_to_gsm(unsigned char* dest, int dest_len, unsigned short* src, int src_len);
+
+static char* _convert_ucs_to_utf8(unsigned char *src, int src_len);
+static int _convert_utf8_to_unicode(unsigned short* dest, unsigned char* src, unsigned int src_len);
+
+static unsigned short* _convert_process_unicode(unsigned short *dest, int dest_buf_len,        unsigned char *src, unsigned long src_len);
+
+static int _convert_ucs2_to_gsm(unsigned char* dest, unsigned short* src, unsigned int src_len);
+static int _convert_gsm_to_ucs2(unsigned short* dest, unsigned char* src, unsigned int src_len);
+
+static gboolean _find_gsm_code_exception_table(unsigned short src);
+static int _get_gsm_code_size(unsigned short* src, int src_len);
+static unsigned short* _swap_byte_order(unsigned short *dest, unsigned short *src, int len);
+
+typedef struct {
+       char gsm;
+       unsigned short unicode;
+} GsmUniTable;
+
+const GsmUniTable gsm_unicode2_table[] = {
+               { 0x14, 0x005E }, { 0x28, 0x007B }, { 0x29, 0x007D }, { 0x2F, 0x005C },
+               { 0x3C, 0x005B }, { 0x3D, 0x007E }, { 0x3E, 0x005D }, { 0x40, 0x007C },
+               { 0x65, 0x20AC } };
+
+const GsmUniTable gsm_unicode_table[] = {
+               { 0x00, 0x0040 }, { 0x01, 0x00A3 }, { 0x02, 0x0024 }, { 0x03, 0x00A5 },
+               { 0x04, 0x00E8 }, { 0x05, 0x00E9 }, { 0x06, 0x00F9 }, { 0x07, 0x00EC }, { 0x08, 0x00F2 },
+               { 0x09, 0x00E7 }, { 0x0B, 0x00D8 }, { 0x0C, 0x00F8 }, { 0x0E, 0x00C5 }, { 0x0F, 0x00E5 },
+               { 0x10, 0x0394 }, { 0x11, 0x005F }, { 0x12, 0x03A6 }, { 0x13, 0x0393 }, { 0x14, 0x039B },
+               { 0x15, 0x03A9 }, { 0x16, 0x03A0 }, { 0x17, 0x03A8 }, { 0x18, 0x03A3 }, { 0x19, 0x0398 },
+               { 0x1A, 0x039E }, { 0x1C, 0x00C6 }, { 0x1D, 0x00E6 }, { 0x1E, 0x00DF }, { 0x1F, 0x00C9 },
+               { 0x24, 0x00A4 }, { 0x40, 0x00A1 }, { 0x5B, 0x00C4 }, { 0x5C, 0x00D6 }, { 0x5D, 0x00D1 },
+               { 0x5E, 0x00DC }, { 0x5F, 0x00A7 }, { 0x60, 0x00BF }, { 0x7B, 0x00E4 }, { 0x7C, 0x00F6 },
+               { 0x7D, 0x00F1 }, { 0x7E, 0x00FC }, { 0x7F, 0x00E0 }, };
+
+static int _convert_utf8_to_unicode(unsigned short* dest, unsigned char* src, unsigned int src_len)
+{
+       unsigned short* org = NULL;
+       unsigned char hi = 0;
+       unsigned char mid = 0;
+       unsigned char low = 0;
+
+       if ((NULL == dest) || (NULL == src)) {
+               dbg( "[SAT] INPUT PARAM NULL");
+               return -1;
+       }
+
+       org = dest;
+
+       while (src_len > 0 && (*src != '\0')) {
+               if (*src < 0x80) {
+                       *dest = (*src & 0x7F);
+                       dest++;
+                       src++;
+                       src_len--;
+               } else if (((0xC0 <= *src) && (*src < 0xE0)) && (*(src + 1) >= 0x80)) {
+                       hi = *src & 0x1F;
+                       low = *(src+1) & 0x3F;
+                       *dest = (hi << 6) | low;
+                       dest++;
+                       src += 2;
+                       src_len -= 2;
+               } else if ((*src >= 0xE0) && (*(src + 1) >= 0x80) && (*(src + 2) >= 0x80)) {
+                       hi = *src & 0x0F;
+                       mid = *(src+1) & 0x3F;
+                       low = *(src+2) & 0x3F;
+                       *dest = (hi << 12) | (mid << 6) | low;
+                       dest++;
+                       src += 3;
+                       src_len -= 3;
+               } else {
+                       *dest = (*src & 0x7F);
+                       dest++;
+                       src++;
+                       src_len--;
+                       dbg( "[SAT] utf8 incorrect range");
+               }
+       }
+       *dest = 0;
+       return (dest - org);
+}
+
+static gboolean _find_gsm_code_exception_table(unsigned short src)
+{
+       if ((src >= 0x0020 && src <= 0x0023)
+                       || (src >= 0x0025 && src <= 0x003F)
+                       || (src >= 0x0041 && src <= 0x005A)
+                       || (src >= 0x0061 && src <= 0x007A)
+                       || src == 0x000A || src == 0x000D)
+               return TRUE;
+       return FALSE;
+}
+
+static int _get_gsm_code_size(unsigned short* src, int src_len)
+{
+       gboolean in_table = FALSE;
+       gboolean in_sec_table = FALSE;
+       int i, gsm_len = 0;
+
+       if (NULL == src) {
+               dbg( "INPUT PARAM was NULL");
+               return -1;
+       }
+
+       for (; src_len > 0 && src; src_len--) {
+               if (_find_gsm_code_exception_table(*src) == TRUE) {
+                       src++;
+                       gsm_len++;
+                       continue;
+               }
+               in_table = FALSE;
+               for (i = 0; i < tabGsmUniMax; i++) {
+                       if (*src == gsm_unicode_table[i].unicode) {
+                               src++;
+                               in_table = TRUE;
+                               gsm_len++;
+                               break;
+                       }
+               }
+               if (in_table == FALSE) {
+                       in_sec_table = FALSE;
+                       for (i = 0; i < tabGsmUniMax2; i++) {/* second table */
+                               if (*src == gsm_unicode2_table[i].unicode) {
+                                       src++;
+                                       in_table = TRUE;
+                                       in_sec_table = TRUE;
+                                       gsm_len += 2;
+                                       break;
+                               }
+                       }
+                       if (in_sec_table == FALSE) {/* second*/
+                               if (_find_gsm_code_exception_table(*src) == FALSE) {
+                                       dbg( "GSM Char[%d], gsm_len[%d]", *src, gsm_len);
+                                       return -1;
+                               }
+                               src++;
+                               gsm_len++;
+                       }
+               }
+       }
+       return gsm_len;
+}
+
+static int _convert_ucs2_to_gsm(unsigned char* dest, unsigned short* src, unsigned int src_len)
+{
+       unsigned char* rear = NULL;
+       unsigned short* p;
+       unsigned char temp;
+       gboolean in_table = FALSE;
+       gboolean in_sec_table = FALSE;
+       int i, gc_len = 0;
+
+       if ((!dest) || (!src) || (0x00 == src_len)) {
+               dbg( "Warning: Wrong Input");
+               return -1;
+       }
+
+       rear = dest;
+       p = src;
+
+       for (; src_len > 0 && p; src_len--) {
+               in_table = FALSE;
+               for (i = 0; i < tabGsmUniMax; i++) { /* is in table  */
+                       if (*p == gsm_unicode_table[i].unicode) {
+                               temp = (unsigned char) (gsm_unicode_table[i].gsm);
+                               *rear = temp;
+                               rear++;
+                               p++;
+                               in_table = TRUE;
+                               gc_len++;
+                               break;
+                       }
+               }
+               if (in_table == FALSE) {
+                       in_sec_table = FALSE;
+                       for (i = 0; i < tabGsmUniMax2; i++) { /* second table*/
+                               if (*p == gsm_unicode2_table[i].unicode) {
+                                       *rear = 0x1B;
+                                       rear++;
+                                       temp = (unsigned char) (gsm_unicode2_table[i].gsm);
+                                       *rear = temp;
+                                       rear++;
+                                       p++;
+                                       in_table = TRUE;
+                                       in_sec_table = TRUE;
+                                       gc_len += 2;
+                                       break;
+                               }
+                       }
+                       if (in_sec_table == FALSE) { /* second */
+                               if (_find_gsm_code_exception_table(*p) == FALSE)
+                                       return -1;
+                               temp = (unsigned char) (*p); /* isn't in table */
+                               *rear = temp;
+                               rear++;
+                               p++;
+                               gc_len++;
+                       }
+               }
+       }
+       src = p;
+       return gc_len;
+}
+
+static gboolean _convert_unicode_to_gsm(unsigned char* dest, int dest_len, unsigned short* src, int src_len)
+{
+       char* tmp_str;
+       int gc_len = 0;
+
+       if ((NULL == dest) || (NULL == src)) {
+               dbg( "INPUT PARAM was NULL");
+               return FALSE;
+       }
+
+       if (src_len == 0)
+               return FALSE;
+
+       gc_len = _get_gsm_code_size(src, src_len);
+       if (0 >= gc_len) {
+               dbg( "Warning: Error[%d] while finding the GSM Code Size", gc_len);
+               return FALSE;
+       }
+
+       if (dest_len < gc_len) {
+               if (dest_len == sizeof(void*)) {
+                       dbg( "Out buffer size seems to be small (%s)", dest);
+               } else {
+                       dbg("Buffer size is too small (%s): dest_len(%d), gc_len(%d)", dest, dest_len, gc_len);
+               }
+               return FALSE;
+       }
+
+       tmp_str = calloc(1, (unsigned short) gc_len);
+       if (tmp_str == NULL) {
+               dbg( "Memory Allocation Failed!");
+               return FALSE;
+       }
+
+       gc_len = _convert_ucs2_to_gsm((unsigned char*) tmp_str, src, src_len);
+       if (gc_len != -1) {
+               memcpy((char*) dest, (char*) tmp_str, gc_len);
+               free(tmp_str);
+               return TRUE;
+       }
+
+       free(tmp_str);
+       return FALSE;
+}
+
+void sat_mgr_convert_utf8_to_gsm(unsigned char *dest, int *dest_len, unsigned char* src, unsigned int src_len)
+{
+       unsigned short *uc = NULL;
+       int gc_len = 0;
+       int uc_len = 0;
+       gboolean ret = FALSE;
+
+       if (src == NULL || src_len == 0) {
+               dbg( "WARNING: Invalid Parameter");
+               return;
+       }
+
+       uc = (unsigned short*) calloc(src_len + 1, sizeof(unsigned short));
+       if (!uc) {
+               dbg( "WARNING: calloc Failed");
+               return;
+       }
+
+       /*Converting from UTF8 => UNICODE*/
+       uc_len = _convert_utf8_to_unicode(uc, src, src_len);
+       dbg( "uc_len:[%d]", uc_len);
+       if(uc_len == -1) {
+               dbg( "_convert_utf8_to_unicode returns false!");
+               free(uc);
+               return;
+       }
+
+       /*Finding the GSMCode Size*/
+       gc_len = _get_gsm_code_size(uc, uc_len);
+       dbg( "gc_len:[%d]", gc_len);
+       if ( gc_len == -1) {
+               dbg( "SM- DATA is not in GSM7BIT Character Set & Error:[%d]",   gc_len);
+               free(uc);
+               return;
+       }
+
+       *dest_len = gc_len;
+       /*Converting from UNICODE ==> GSM CODE */
+       ret = _convert_unicode_to_gsm((unsigned char*) dest, *dest_len, uc, uc_len);
+       if (ret == FALSE) {
+               dbg( "_convert_unicode_to_gsm Failed");
+               *dest_len = 0x00;
+               free(uc);
+               return;
+       }
+
+       if(uc)
+               free(uc);
+}
+
+void sat_mgr_convert_utf8_to_ucs2(unsigned char* dest, int* dest_len,  unsigned char* src, int src_len)
+{
+       gsize byte_converted = 0;
+       gsize byte_read = 0;
+       gchar* str_converted = NULL;
+       GError *error = NULL;
+       int i;
+       char tmp_char;
+
+       if (dest == NULL || dest_len == NULL || src == NULL) {
+               dbg( "Invalid Input Parameter");
+               return;
+       }
+
+       /*Converting from UTF8 => UCS-2 using the g_convert*/
+       str_converted = (gchar*) g_convert((gchar*) src, (gsize) src_len,
+                                                                                                                                               (gchar*) "UCS-2", (gchar*) "UTF8",
+                                                                                                                                               (gsize*) &byte_read, (gsize*) &byte_converted,
+                                                                                                                                               &error);
+       if (str_converted == NULL) {
+               dbg( "str_converted is NULL");
+               if (error != NULL) {
+                       dbg( "Problem while conversion UTF8 => UCS2, ErrorCode[%d]", error->code);
+               }
+               return;
+       }
+
+       dbg( "src_len[%u], byte_read[%u], byte_converted[%u]", src_len, byte_read, byte_converted);
+       *dest_len = (int) byte_converted;
+
+       if (byte_converted % 2 != 0) {
+               dbg( "string length is wrong!");
+       } else {
+               for (i = 0; i < (int)byte_converted; i++) {
+                       if (i % 2 == 0) {
+                               tmp_char = str_converted[i];
+                               str_converted[i] = str_converted[i + 1];
+                               str_converted[i + 1] = tmp_char;
+                       }
+               }
+       }
+       memcpy((unsigned char*) dest, (unsigned char*) str_converted, byte_converted);
+       g_free(str_converted);
+       return;
+}
+
+static int _convert_ucs2_to_utf8(char *out, unsigned short *out_len, char *in, unsigned short in_len)
+{
+       char *p_o = NULL;
+       size_t src_len = in_len;
+       size_t dest_len = in_len*3;
+       short *dest = NULL;
+       short *src = NULL;
+       int i = 0;
+
+       iconv_t cd = iconv_open("UTF-8", "UCS2");
+       if (cd == (iconv_t) (-1)) {
+               perror("iconv_open");
+               return 0;
+       }
+//For byte swap - start
+       src = (short*)malloc(in_len);
+       memcpy(src, in, in_len);
+       dest = (short*)malloc(in_len);
+    memset(dest, 0, in_len);
+    for(i=0; i<in_len/2; i++){
+        dest[i] = ((src[i] << 8) + (src[i] >> 8));
+    }
+    memcpy(in, dest, in_len);
+    free(dest);
+    free(src);
+ //For byte swap - end
+
+       p_o = out;
+
+       dbg("expected input bytes:%d dest_len:%d\n", src_len, dest_len);
+
+       if (iconv(cd, &in, &src_len, &p_o, &dest_len) == (size_t)(-1)) {
+               dbg("failed to iconv errno:%d", errno);
+       } else {
+               dbg("remained input bytes:%d processed bytes:%d", src_len, in_len*3-dest_len);
+               out[in_len*3-dest_len] = '\0';
+       }
+       *out_len = in_len*3-dest_len;
+       dbg("out_len[%d], output[%s]", *out_len, out);
+       iconv_close(cd);
+       return 0;
+}
+
+void sat_mgr_convert_string(unsigned char *dest, unsigned short *dest_len,
+               enum alphabet_format dcs, unsigned char *src, unsigned short src_len)
+{
+       int tmp_str_len = 0;
+       unsigned char* tmp_dest_str = dest;
+       unsigned short* in_buf = NULL;
+
+       /*get string length*/
+       /* 0xFF is the end of string */
+       while (src[tmp_str_len] != 0xFF && tmp_str_len < src_len) {
+               tmp_str_len++;
+       }
+       /* last space character must be deleted */
+       while (src[tmp_str_len - 1] == 0x20 && tmp_str_len > 0) {
+               tmp_str_len--;
+       }
+
+       dbg( "[SAT] alphabetFormat : [0x%x]", dcs);
+       dbg( "[SAT] tmp_str_len[%d] src_len[%d]", tmp_str_len, src_len);
+
+       switch (dcs) {
+               case ALPHABET_FROMAT_SMS_DEFAULT:
+                       tmp_dest_str = (unsigned char*)tcore_util_unpack_gsm7bit((const unsigned char *)src, src_len);
+                       _convert_gsm_to_utf8(dest, dest_len, tmp_dest_str, strlen((const char*)tmp_dest_str));
+                       break;
+
+               case ALPHABET_FROMAT_8BIT_DATA:
+                       _convert_gsm_to_utf8(dest, dest_len, src, tmp_str_len);
+                       break;
+
+               case ALPHABET_FROMAT_UCS2:{
+                       if (src[0] == 0x80) {
+                               dbg("UCS2:[0x%2x] prefix case", src[0]);
+                               _convert_ucs2_to_utf8((char*) dest, dest_len, (char*) (src + 1), src_len - 1);
+                       } else if (src[0] == 0x81 || src[0] == 0x82) {
+                               dbg("UCS2:[0x%2x] prefix case", src[0]);
+                               *dest_len = tmp_str_len;
+                               in_buf = (unsigned short*) malloc(tmp_str_len * sizeof(unsigned short) + 1);
+                               if (!in_buf) {
+                                       dbg( "[SAT] Error:malloc failed");
+                                       return;
+                               }
+                               _convert_process_unicode(in_buf, (tmp_str_len * sizeof(unsigned short) + 1), src,
+                                               tmp_str_len);
+                               dest = (unsigned char*) _convert_ucs_to_utf8((unsigned char *) in_buf, tmp_str_len);
+                               if (in_buf) free(in_buf);
+
+                               if (!dest) {
+                                       dbg( "[SAT] WARNING: dest str is NULL");
+                                       return;
+                               }
+                               memcpy(tmp_dest_str, dest, SAT_TEXT_STRING_LEN_MAX);
+
+                               if (tmp_dest_str != dest) {
+                                       dbg( "[SAT] destination string address changed hence freeing");
+                                       free(dest);
+                                       dest = NULL;
+                               }
+                               dbg( "[SAT] string[%s]", dest);
+                               dbg( "[SAT] out put string[%s]", tmp_dest_str);
+                               dbg( "[SAT] string pointer after parsing dcs[0x%x]", dest);
+                               dbg( "[SAT] string length[%d]", *dest_len);
+                       } else {
+                               dbg("UCS2: no prefix case");
+                               _convert_ucs2_to_utf8((char*) dest, dest_len, (char*) src, src_len);
+                       }
+               }
+                       break;
+
+               default:
+                       dbg("not handled alpha format[%d]", dcs);
+                       break;
+       }
+
+}
+
+static int _convert_gsm_to_ucs2(unsigned short* dest, unsigned char* src, unsigned int src_len)
+{
+       int index;
+       unsigned short* org;
+
+       org = dest;
+
+       for(index=0; index < (int)src_len; index++){
+               int table_index=0;
+               gboolean b_tabled = FALSE;
+
+               /*
+                * if the first byte is 0x1B, it is the escape character.
+                * The byte value shoulbe be changed to unicode.
+                */
+               if(*src == 0x1B){
+                       src++; index++;//move to next byte
+                       for(table_index=0; table_index < tabGsmUniMax2; table_index++){
+                               if(*src == gsm_unicode2_table[table_index].gsm){
+                                       *dest = gsm_unicode2_table[table_index].unicode;
+                                       b_tabled = TRUE;
+                                       break;
+                               }
+                       }
+
+                       //if matched data is not in table, it should be changed to NULL;
+                       if(!b_tabled){
+                               *dest = 0x0020;
+                       }
+               }
+               else{
+                       for(table_index=0; table_index < tabGsmUniMax; table_index++){
+                               if(*src == gsm_unicode_table[table_index].gsm){
+                                       *dest = gsm_unicode_table[table_index].unicode;
+                                       b_tabled = TRUE;
+                                       break;
+                               }
+                       }
+
+                       //if matched data is not in table, it is using original value;
+                       if(!b_tabled){
+                               *dest = *src;
+                       }
+               }
+
+               //move to next position
+               src++; dest++;
+       }
+
+       dbg("[SAT] cvt sr(%s), the size of data (%d) ", org, dest - org);
+       return (dest - org);
+}
+
+static gboolean _convert_gsm_to_unicode(unsigned short *dest, int dest_len, unsigned char *src, unsigned int src_len)
+{
+       int index, tmp_len;
+
+       if(!dest || !src) {
+               dbg( "[SAT] dest(%p) or src(%p) is null",dest, src);
+               return FALSE;
+       }
+
+       if(!src_len){
+               dest[0] = '\0';
+               return TRUE;
+       }
+
+       dbg("[SAT] source string (%s) len(%d)", src, src_len);
+
+       for(index = 0; index < (int)src_len; index++){
+               if(src[index] == 0x1B)
+                       src_len--;
+       }
+       dbg("[SAT] strlen excluding escape character (%d)", src_len);
+
+       tmp_len = _convert_gsm_to_ucs2(dest, src, src_len);
+       dest[tmp_len] = '\0';
+
+       return TRUE;
+}
+
+static char* _convert_ucs_to_utf8(unsigned char* src, int src_len)
+{
+       char* utf_str = NULL;
+       iconv_t cd = NULL;
+       size_t ileft = 0;
+       size_t oleft = 0;
+       int err = 0;
+
+       char* pIn = NULL;
+       char* in_buf = NULL;
+       char* out_buf = NULL;
+
+       if (!src) {
+               dbg("src is null");
+               return NULL;
+       }
+
+       ileft = src_len * 2;//over allocate as utf-8 may occupy 3 bytes
+       oleft = src_len * 3;//over allocate as utf-8 may occupy 3 bytes
+       pIn = in_buf = (char*) malloc(ileft + 2);
+       utf_str = out_buf = (char *) malloc(oleft + 1);
+
+       memset(in_buf, 0x00, ileft + 2);
+       memset(out_buf, 0x00, oleft + 1);
+       memcpy(in_buf, src, ileft);
+
+       in_buf[ileft] = '\0';
+
+       cd = iconv_open("UTF-8", "UCS-2");
+       err = iconv(cd, (char**) &in_buf, &ileft, &out_buf, &oleft);
+
+       utf_str[src_len * 2 - ileft] = '\0';
+       iconv_close(cd);
+       free(pIn);
+       return utf_str;
+}
+
+static void _convert_gsm_to_utf8(unsigned char* dest, unsigned short* dest_len, unsigned char* src, unsigned int src_len)
+{
+       int tmp_len = 0;
+       char *target_tmp = NULL;
+       unsigned char *raw_unicode = NULL;
+       unsigned short tmp_dest[SAT_TEXT_STRING_LEN_MAX];
+
+       memset(tmp_dest, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+       _convert_gsm_to_unicode(tmp_dest, SAT_TEXT_STRING_LEN_MAX, src, src_len);
+       while(tmp_dest[tmp_len] != '\0')
+               tmp_len++;
+       tmp_len++; // add null character
+
+       tmp_len = tmp_len*2; //for byte align
+       raw_unicode = (unsigned char*)malloc(tmp_len);
+       memset(raw_unicode, 0, tmp_len);
+
+       memcpy(raw_unicode, (unsigned char*)tmp_dest, tmp_len);
+
+       *dest_len = tmp_len;
+       target_tmp = _convert_ucs_to_utf8(raw_unicode, tmp_len);
+       if(!target_tmp){
+               dbg( "str is NULL");
+               return;
+       }
+
+       memcpy(dest, target_tmp, strlen((const char*)target_tmp));
+       dbg("final utf8 str (%s), length (%d)", dest, tmp_len);
+       return;
+}
+
+/*
+ * UCS2 character decoding for SIM alpha identifier as defined ETSI 102 221.
+ */
+static unsigned short* _convert_process_unicode(unsigned short* dest, int dest_buf_len,        unsigned char* src, unsigned long src_len)
+{
+       int i, j, base = 0, str_len = 0, shift =0;
+       unsigned short tmp_str[255 + 1];
+
+       switch (src[0]) {
+               case 0x80: {
+                       str_len = (src_len - 1) / 2;
+                       memcpy(tmp_str, &src[1], src_len - 1);
+                       tmp_str[str_len] = '\0';
+                       _swap_byte_order(dest, tmp_str, str_len);
+                       dest[str_len] = '\0';
+                       return dest;
+               }
+
+               case 0x81: {
+                       str_len = (int) src[1];
+                       base = (int) src[2];
+                       j = 3;
+                       shift = 7;
+               }
+                       break;
+
+               case 0x82: {
+                       str_len = (int) src[1];
+                       base = (int) (src[2] << 8 | src[3]);
+                       j = 4;
+                       shift = 0;
+               }
+                       break;
+
+               default: {
+                       for (i = 0; i < (int) src_len; i++) {
+                               if (src[i] == 0xFF) {
+                                       src_len = i;
+                                       break;
+                               }
+                       }
+                       str_len = (src_len) / 2;
+                       memcpy(tmp_str, &src[0], src_len);
+                       tmp_str[str_len] = '\0';
+                       _swap_byte_order(dest, tmp_str, str_len);
+                       dest[str_len] = '\0';
+                       return dest;
+                       break;
+               }
+       }
+
+       dbg( "[SAT] str_len[%d], dest_buf_len[%d]", str_len, dest_buf_len);
+
+       for (i = 0; i < str_len && i < dest_buf_len; i++, j++) {
+               if (src[j] <= 0x7F) {/* GSM Code */
+                       if (src[j] == 0x1B) {/* 2Byte GSM Code */
+                               _convert_gsm_to_unicode(&dest[i], 2, &src[j], 2);
+                               j++;
+                       } else {
+                               _convert_gsm_to_unicode(&dest[i], 2, &src[j], 1);
+                       }
+               } else {
+                       dest[i] = (unsigned short) ((base << shift)     + (src[j] & 0x7F));
+                       dbg( "[SAT] converted0x%x\n", src[j]);
+                       dbg( "[SAT] converted0x%x\n", dest[i]);
+               }
+       }
+       dest[i] = '\0';
+       return dest;
+}
+
+static unsigned short* _swap_byte_order(unsigned short* dest, unsigned short* src, int src_len)
+{
+       int i;
+       for (i = 0; i < src_len; i++) {
+               if (src[i] == '\0')
+                       break;
+               dest[i] = ((src[i] << 8) + (src[i] >> 8));
+       }
+       dest[i] = '\0';
+       return dest;
+}
index 4032be90778c039b181c9881e75cd2f69c5ebcb8..54242e7f69f3174fc11d92313bd13fb62315cf54 100644 (file)
--- a/src/sim.c
+++ b/src/sim.c
@@ -1,5 +1,5 @@
 /*
- * tel-plugin-dbus-tapi
+ * tel-plugin-socket-communicator
  *
  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
  *
 
 #include <stdio.h>
 #include <string.h>
-#include <assert.h>
-#include <unistd.h>
 #include <stdlib.h>
+#include <errno.h>
 #include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
 
 #include <tcore.h>
-#include <plugin.h>
 #include <server.h>
-#include <storage.h>
-#include <user_request.h>
+#include <plugin.h>
+#include <hal.h>
+#include <communicator.h>
 #include <core_object.h>
+#include <queue.h>
+#include <user_request.h>
+#include <util.h>
 #include <co_sim.h>
-#include <communicator.h>
-#include <co_phonebook.h>
 
-#include <TapiCommon.h>
-#include <TelSim.h>
-
-#include "tel_cs_conn.h"
+#include "generated-code.h"
 #include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "ts_noti.h"
-#include "modules.h"
 
 
-static gboolean dbus_sim_data_request(struct custom_data *ctx, CoreObject *co, enum tel_sim_status sim_status )
+static gboolean dbus_sim_data_request(struct custom_data *ctx, enum tel_sim_status sim_status )
 {
        UserRequest *ur = NULL;
        TcorePlugin *plugin = NULL;
@@ -62,29 +56,15 @@ static gboolean dbus_sim_data_request(struct custom_data *ctx, CoreObject *co, e
                case SIM_STATUS_SPCK_REQUIRED :
                case SIM_STATUS_CCK_REQUIRED :
                case SIM_STATUS_LOCK_REQUIRED :
-                       if(ctx->b_recv_first_status == FALSE){
+                       if(ctx->sim_recv_first_status == FALSE){
                                dbg("received sim status at first time");
                                plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
-                               dbg("req - TREQ_SIM_GET_LANGUAGE ");
-                               ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
-                               tcore_user_request_set_command(ur, TREQ_SIM_GET_LANGUAGE);
-                               tcore_communicator_dispatch_request(ctx->comm, ur);
-
-                               dbg("req - TREQ_SIM_GET_ICCID ");
-                               ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
-                               tcore_user_request_set_command(ur, TREQ_SIM_GET_ICCID);
-                               tcore_communicator_dispatch_request(ctx->comm, ur);
-
-                               dbg("req - TREQ_SIM_GET_MSISDN ");
-                               ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
-                               tcore_user_request_set_command(ur, TREQ_SIM_GET_MSISDN);
-                               tcore_communicator_dispatch_request(ctx->comm, ur);
 
                                dbg("req - TREQ_SIM_GET_ECC ");
                                ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
                                tcore_user_request_set_command(ur, TREQ_SIM_GET_ECC);
                                tcore_communicator_dispatch_request(ctx->comm, ur);
-                               ctx->b_recv_first_status = TRUE;
+                               ctx->sim_recv_first_status = TRUE;
                        }
                        break;
 
@@ -94,929 +74,793 @@ static gboolean dbus_sim_data_request(struct custom_data *ctx, CoreObject *co, e
        return TRUE;
 }
 
-static gboolean dbus_sim_security_request(struct custom_data *ctx, CoreObject *co)
+static gboolean on_sim_get_init_status(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
 {
-       UserRequest *ur = NULL;
+       struct custom_data *ctx = user_data;
+       gint tmp_cardstatus = 0xff;
+       gboolean b_changed = FALSE;
+       GSList *co_list = NULL;
+       CoreObject *co_sim = NULL;
        TcorePlugin *plugin = NULL;
-       struct treq_sim_get_facility_status req_facility;
+
+       dbg("Func Entrance");
 
        plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
+       co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_SIM);
+       if (!co_list) {
+               dbg("error- co_list is NULL");
+       }
+       co_sim = (CoreObject *)co_list->data;
+       g_slist_free(co_list);
 
-       dbg("req - SIM_FACILITY_PS ");
-       ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
-       req_facility.type = SIM_FACILITY_PS;
-       tcore_user_request_set_data(ur, sizeof(struct treq_sim_get_facility_status), &req_facility);
-       tcore_user_request_set_command(ur, TREQ_SIM_GET_FACILITY_STATUS);
-       tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (!co_sim) {
+               dbg("error- co_sim is NULL");
+       }
 
-       dbg("req - SIM_FACILITY_SC ");
-       ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
-       req_facility.type = SIM_FACILITY_SC;
-       tcore_user_request_set_data(ur, sizeof(struct treq_sim_get_facility_status), &req_facility);
-       tcore_user_request_set_command(ur, TREQ_SIM_GET_FACILITY_STATUS);
-       tcore_communicator_dispatch_request(ctx->comm, ur);
+       tmp_cardstatus = tcore_sim_get_status(co_sim);
+       b_changed = tcore_sim_get_identification(co_sim);
+       dbg("sim init info - cardstatus[%d],changed[%d]", tmp_cardstatus, b_changed);
 
-       dbg("req - SIM_FACILITY_FD ");
-       ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
-       req_facility.type = SIM_FACILITY_FD;
-       tcore_user_request_set_data(ur, sizeof(struct treq_sim_get_facility_status), &req_facility);
-       tcore_user_request_set_command(ur, TREQ_SIM_GET_FACILITY_STATUS);
-       tcore_communicator_dispatch_request(ctx->comm, ur);
+       telephony_sim_complete_get_init_status(sim, invocation, tmp_cardstatus, b_changed);
 
        return TRUE;
 }
 
-static gboolean dbus_sim_security_update(struct custom_data *ctx, enum tel_sim_facility_type type, enum tel_sim_pin_operation_result result, gboolean b_enable)
+static gboolean on_sim_get_card_type(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
 {
-       dbg("current ctx addr[0x%x], facility[%d], op result[%d], b_enable[%d]", ctx, type, result, b_enable);
-       switch(type) {
-               case SIM_FACILITY_PS :
-                       if(result == SIM_PUK_REQUIRED)
-                               ctx->sim_lock = TAPI_SIM_PIN_STATUS_BLOCKED;
-                       else if(result == SIM_CARD_ERROR)
-                               ctx->sim_lock = TAPI_SIM_PIN_STATUS_PUK_BLOCKED;
-                       else if(result == SIM_PIN_OPERATION_SUCCESS)
-                               ctx->sim_lock = b_enable;
-                       break;
-               case SIM_FACILITY_SC :
-                       if(result == SIM_PUK_REQUIRED)
-                               ctx->pin_lock = TAPI_SIM_PIN_STATUS_BLOCKED;
-                       else if(result == SIM_CARD_ERROR)
-                               ctx->pin_lock = TAPI_SIM_PIN_STATUS_PUK_BLOCKED;
-                       else if(result == SIM_PIN_OPERATION_SUCCESS)
-                               ctx->pin_lock = b_enable;
-                       break;
-               case SIM_FACILITY_FD :
-                       if( result == SIM_PIN_OPERATION_SUCCESS )
-                               ctx->fdn_lock = b_enable;
-                       break;
-               default :
-                       break;
+       struct custom_data *ctx = user_data;
+       enum tel_sim_type type = SIM_TYPE_UNKNOWN;
+       GSList *co_list = NULL;
+       CoreObject *co_sim = NULL;
+       TcorePlugin *plugin = NULL;
+
+       dbg("Func Entrance");
+
+       plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
+       co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_SIM);
+       if (!co_list) {
+               dbg("error- co_list is NULL");
        }
+       co_sim = (CoreObject *)co_list->data;
+       g_slist_free(co_list);
+
+       if (!co_sim) {
+               dbg("error- co_sim is NULL");
+       }
+
+       type = tcore_sim_get_type(co_sim);
+
+       telephony_sim_complete_get_card_type(sim, invocation, type);
+
        return TRUE;
 }
 
-void dbus_request_sim(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
+static gboolean on_sim_get_imsi(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
 {
-       int api_err = TAPI_API_SUCCESS;
-       int request_id = 0;
-       tapi_dbus_connection_name conn_name;
-       /*
-        * Legacy : SIM data, security part
-        */
-       TelSimCardStatus_t tmp_cardstatus = 0xff;
-       gboolean b_changed = FALSE;
-       TelSimImsiInfo_t imsi = { 0, };
-       TelSimIccIdInfo_t iccid_data = { 0, };
-       TelSimEccData_t ecc_data;
-       int fdn_status = FALSE;
-       TelSimLanguageInfo_t lang_data = { 0, };
-       TelSimCardType_t card_type = TAPI_SIM_CARD_TYPE_UNKNOWN;
-       enum tel_sim_type type = SIM_TYPE_UNKNOWN;
-       TelSimSecPw_t pin_data = { 0, };
-       TelSimSecPw_t puk_data = { 0, };
-       TelSimSecPw_t old_pin = { 0, };
-       TelSimSecPw_t new_pin = { 0, };
-       TelSimPinStatus_t status = 0;
-       TelSimPersPw_t pers_data = { 0, };
-       unsigned char* pin2 = NULL;
-       unsigned int pin2_len = 0;
-       TelSimApdu_t apdu_data = { 0, };
-       int ecc_count = 0;
-       TelSimAuthenticationData_t AuthenticationData = {0,};
-       TelSimCphsLocalInfo_t cphs_local = {0,};
-
-       /*
-        * NEW : SIM data, security part
-        */
+       struct custom_data *ctx = user_data;
        struct tel_sim_imsi *n_imsi;
-       struct treq_sim_verify_pins verify_pins = { 0, };
-       struct treq_sim_verify_puks verify_puks = { 0, };
-       struct treq_sim_change_pins change_pins = { 0, };
-       struct treq_sim_get_facility_status facility = { 0, };
-       struct treq_sim_disable_facility dis_facility = { 0, };
-       struct treq_sim_enable_facility en_facility = { 0, };
-       struct treq_sim_transmit_apdu send_apdu = { 0, };
-       struct treq_sim_set_language set_language = { 0, };
-       struct treq_sim_req_authentication req_auth = { 0, };
-       /*
-        * Legacy : SIM Phonebook part
-        */
-       TelSimPbFileType_t lsp_pb_type = TAPI_SIM_PB_ADN; //default value
-       unsigned short lsp_index = 0;
-       int lsp_first_index = 0;
-       int lsp_init_completed = 0;
-       TelSimPbList_t lsp_supported_pb_list = { 0, };
-       /*
-        * New : SIM Phonebook part
-        */
-       struct tel_phonebook_support_list *pb_list = NULL;
-       struct treq_phonebook_get_count pb_count;
-       struct treq_phonebook_get_info pb_info;
-       struct treq_phonebook_get_usim_info pb_usim;
-       struct treq_phonebook_read_record pb_read;
-       struct treq_phonebook_update_record pb_update;
-       struct treq_phonebook_delete_record pb_delete;
-
-       /*
-        * Legacy : SIM SAP part
-        */
-       TelSimSapConnect_t lsa_conn_req = { 0, };
-       TelSimSapApduData_t lsa_apdu_data = { 0, };
-       TelSimSapProtocol_t lsa_protocol = TAPI_SIM_SAP_PROTOCOL_T0;
-       TelSimSapMsgId_t lsa_msg_id = 0x00;
-       /*
-        * New : SIM SAP part
-        */
-       struct treq_sap_req_connect req_conn;
-       struct treq_sap_req_status req_status;
-       struct treq_sap_req_atr req_atr;
-       struct treq_sap_transfer_apdu t_apdu;
-       struct treq_sap_set_protocol set_protocol;
-       struct treq_sap_set_power set_power;
-
-       TReturn ret;
        GSList *co_list = NULL;
        CoreObject *co_sim = NULL;
-       CoreObject *co_pb = NULL;
-       UserRequest *ur = NULL;
-       struct tcore_user_info ui = { 0, 0, 0, NULL };
-
-       conn_name = g_array_index(in_param4, tapi_dbus_connection_name, 0);
+       TcorePlugin *plugin = NULL;
 
+       dbg("Func Entrance");
+       plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
        co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_SIM);
        if (!co_list) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
+               dbg("error- co_list is NULL");
        }
        co_sim = (CoreObject *)co_list->data;
        g_slist_free(co_list);
 
        if (!co_sim) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
+               dbg("error- co_sim is NULL");
        }
 
-       ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
-       if (!ur) {
-               api_err = TAPI_API_SERVER_FAILURE;
-               goto OUT;
+       n_imsi = tcore_sim_get_imsi(co_sim);
+       dbg("n_imsi->plmn[%s]", n_imsi->plmn);
+       dbg("n_imsi->msin[%s]", n_imsi->msin);
+       telephony_sim_complete_get_imsi(sim, invocation, n_imsi->plmn, n_imsi->msin);
+       return TRUE;
+}
+
+static gboolean on_sim_get_ecc(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       GVariant *gv = NULL;
+       GVariantBuilder b;
+       int i;
+
+       dbg("Func Entrance");
+
+       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+
+       for (i = 0; i < ctx->cached_sim_ecc.ecc_count; i++) {
+               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+               g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(ctx->cached_sim_ecc.ecc[i].ecc_string));
+               g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string(ctx->cached_sim_ecc.ecc[i].ecc_num));
+               g_variant_builder_add(&b, "{sv}", "category", g_variant_new_int32(ctx->cached_sim_ecc.ecc[i].ecc_category));
+               g_variant_builder_close(&b);
        }
+       gv = g_variant_builder_end(&b);
 
-       ui.appname = conn_name.name;
-       tcore_user_request_set_user_info(ur, &ui);
-
-       switch (tapi_service_function) {
-               case TAPI_CS_SIM_GETIMSIINFO:
-                       dbg("TAPI_CS_SIM_GETIMSIINFO");
-                       n_imsi = tcore_sim_get_imsi(co_sim);
-                       dbg("n_imsi->plmn[%s]", n_imsi->plmn);
-                       if (n_imsi != NULL) {
-                               imsi.bValid = TRUE;
-                               memcpy(&imsi.szMcc, n_imsi->plmn, 3);
-                               imsi.szMcc[3] = '\0';
-                               memcpy(&imsi.szMnc, n_imsi->plmn + 3, 2);
-                               imsi.szMnc[2] = '\0';
-                               memcpy(&imsi.szMsin, n_imsi->msin, 10);
-                               imsi.szMsin[10] = '\0';
-                               dbg("imsi.valid=%d, mcc=%s, mnc=%s, msin=%s",
-                                               imsi.bValid, imsi.szMcc, imsi.szMnc, imsi.szMsin);
-                       }
-                       g_array_append_vals(*out_param2, &imsi, sizeof(TelSimImsiInfo_t));
-                       break;
+       if (!gv)
+               dbg("error - ecc gv is NULL");
 
-               case TAPI_CS_SIM_GETFDNSTATUS:
-                       dbg("TAPI_CS_SIM_GETFDNSTATUS");
-                       fdn_status = ctx->fdn_lock;
-                       g_array_append_vals(*out_param2, &fdn_status, sizeof(int));
-                       break;
+       telephony_sim_complete_get_ecc(sim, invocation, gv);
 
-               case TAPI_CS_SIM_GETECCINFO:
-                       dbg("TAPI_CS_SIM_GETECCINFO");
-                       ecc_count = ctx->ecc_count;
-                       memcpy(&ecc_data, &ctx->ecc, sizeof(TelSimEccData_t));
-                       g_array_append_vals(*out_param2, &ecc_data, sizeof(TelSimEccData_t));
-                       g_array_append_vals(*out_param3, &ecc_count, sizeof(int));
-                       break;
+       return TRUE;
+}
 
-               case TAPI_CS_SIM_GETICCIDINFO:
-                       dbg("TAPI_CS_SIM_GETICCIDINFO");
-                       memcpy(&iccid_data, &ctx->iccid, sizeof(TelSimIccIdInfo_t));
-                       g_array_append_vals(*out_param2, &iccid_data, sizeof(TelSimIccIdInfo_t));
-                       break;
+static gboolean on_sim_get_iccid(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-               case TAPI_CS_SIM_SETLANGUAGE: //NOT USED FROM APP NOW
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sim_set_language), &set_language);
-                       tcore_user_request_set_command(ur, TREQ_SIM_SET_LANGUAGE);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+       dbg("Func Entrance");
+       ur = MAKE_UR(ctx, sim, invocation);
 
-               case TAPI_CS_SIM_RSIMACCESS: //NOT USED FROM APP NOW
-                       dbg("TAPI_CS_SIM_RSIMACCESS");
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
-               case TAPI_CS_SIM_GETCFINFO: //NOT USED FROM APP NOW
-                       dbg("TAPI_CS_SIM_GETCFINFO");
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
-               case TAPI_CS_SIM_GETMWINFO: //NOT USED FROM APP NOW
-                       dbg("TAPI_CS_SIM_GETMWINFO");
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
-               case TAPI_CS_SIM_GETCPHSINFO:
-                       dbg("TAPI_CS_SIM_GETCPHSINFO");
-                       g_array_append_vals(*out_param2, &cphs_local, sizeof(TelSimCphsLocalInfo_t));
-                       break;
-               case TAPI_CS_SIM_GETMBINFO:
-                       dbg("TAPI_CS_SIM_GETMBINFO");
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
-               case TAPI_CS_SIM_GETLANGUAGEINFO:
-                       dbg("TAPI_CS_SIM_GETLANGUAGEINFO");
-                       memcpy(&lang_data, &ctx->language, sizeof(TelSimLanguageInfo_t));
-                       g_array_append_vals (*out_param2, &lang_data,sizeof(TelSimLanguageInfo_t));
-                       break;
-               case TAPI_CS_SIM_GETCARDTYPE: /* 0x1000225 */
-                       dbg("TAPI_CS_SIM_GETCARDTYPE");
-                       type = tcore_sim_get_type(co_sim);
-                       switch (type) {
-                               case SIM_TYPE_UNKNOWN:
-                                       card_type = TAPI_SIM_CARD_TYPE_UNKNOWN;
-                                       break;
-                               case SIM_TYPE_GSM:
-                                       card_type = TAPI_SIM_CARD_TYPE_GSM;
-                                       break;
-                               case SIM_TYPE_USIM:
-                                       card_type = TAPI_SIM_CARD_TYPE_USIM;
-                                       break;
-                               case SIM_TYPE_RUIM:
-                                       card_type = TAPI_SIM_CARD_TYPE_UNKNOWN;
-                                       break;
-                               case SIM_TYPE_ISIM:
-                                       card_type = TAPI_SIM_CARD_TYPE_UNKNOWN;
-                                       break;
-                               default:
-                                       break;
-                       }
-                       dbg("card_type = %d", card_type);
-                       g_array_append_vals(*out_param2, &card_type, sizeof(TelSimCardType_t));
-                       break;
+       tcore_user_request_set_command(ur, TREQ_SIM_GET_ICCID);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-               case TAPI_CS_SIM_GETSIMINITINFO:
-                       dbg("TAPI_CS_SIM_GETSIMINITINFO");
-                       tmp_cardstatus = tcore_sim_get_status(co_sim);
-                       b_changed = tcore_sim_get_identification(co_sim);
-                       dbg("sim init info - cardstatus[%d],changed[%d]", tmp_cardstatus, b_changed);
-                       g_array_append_vals(*out_param2, &tmp_cardstatus, sizeof(TelSimCardStatus_t));
-                       g_array_append_vals(*out_param3, &b_changed, sizeof(int));
-                       break;
+       return TRUE;
+}
 
-               case TAPI_CS_SIM_AUTHENTICATION:
-                       dbg("TAPI_CS_SIM_AUTHENTICATION");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       AuthenticationData = g_array_index(in_param1, TelSimAuthenticationData_t, 0);
-                       req_auth.auth_type = AuthenticationData.auth_type;
-                       req_auth.autn_length = AuthenticationData.autn_length;
-                       if(req_auth.autn_length)
-                               memcpy(req_auth.autn_data, AuthenticationData.autn_data, req_auth.autn_length);
-                       req_auth.rand_length = AuthenticationData.rand_length;
-                       if(req_auth.autn_length)
-                               memcpy(req_auth.rand_data, AuthenticationData.rand_data, req_auth.rand_length);
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sim_req_authentication), &req_auth);
-                       tcore_user_request_set_command(ur, TREQ_SIM_REQ_AUTHENTICATION);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+static gboolean on_sim_get_language(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-               case TAPI_CS_SIM_VERIFYSEC:
-                       dbg("TAPI_CS_SIM_VERIFYSEC");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       pin_data = g_array_index(in_param1, TelSimSecPw_t, 0);
-                       pin_data.pw =(unsigned char*)&g_array_index(in_param2, unsigned char, 0);
-                       verify_pins.pin_type = pin_data.type;
-                       verify_pins.pin_length = pin_data.pw_len;
-                       memcpy(verify_pins.pin, pin_data.pw, verify_pins.pin_length);
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sim_verify_pins), &verify_pins);
-                       tcore_user_request_set_command(ur, TREQ_SIM_VERIFY_PINS);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+       ur = MAKE_UR(ctx, sim, invocation);
 
-               case TAPI_CS_SIM_VERIFYPUK:
-                       dbg("TAPI_CS_SIM_VERIFYPUK");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       puk_data = g_array_index(in_param1, TelSimSecPw_t, 0);
-                       pin_data = g_array_index(in_param1, TelSimSecPw_t, 1);
-                       puk_data.pw = (unsigned char*)&g_array_index(in_param2, unsigned char, 0);
-                       pin_data.pw = (unsigned char*)&g_array_index(in_param3, unsigned char, 0);
-                       verify_puks.puk_type = puk_data.type;
-                       verify_puks.puk_length = puk_data.pw_len;
-                       memcpy(verify_puks.puk, puk_data.pw, verify_puks.puk_length);
-                       verify_puks.pin_length = pin_data.pw_len;
-                       memcpy(verify_puks.pin, pin_data.pw, verify_puks.pin_length);
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sim_verify_puks), &verify_puks);
-                       tcore_user_request_set_command(ur, TREQ_SIM_VERIFY_PUKS);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+       tcore_user_request_set_command(ur, TREQ_SIM_GET_LANGUAGE);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-               case TAPI_CS_SIM_CHANGEPIN:
-                       dbg("TAPI_CS_SIM_CHANGEPIN");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       old_pin = g_array_index(in_param1, TelSimSecPw_t, 0);
-                       new_pin = g_array_index(in_param1, TelSimSecPw_t, 1);
-                       old_pin.pw = (unsigned char*)&g_array_index(in_param2, unsigned char, 0);
-                       new_pin.pw = (unsigned char*)&g_array_index(in_param3, unsigned char, 0);
-                       change_pins.type = old_pin.type;
-                       change_pins.old_pin_length = old_pin.pw_len;
-                       memcpy(change_pins.old_pin, old_pin.pw, change_pins.old_pin_length);
-                       change_pins.new_pin_length = new_pin.pw_len;
-                       memcpy(change_pins.new_pin, new_pin.pw, change_pins.new_pin_length);
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sim_change_pins), &change_pins);
-                       tcore_user_request_set_command(ur, TREQ_SIM_CHANGE_PINS);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+       return TRUE;
+}
 
-               case TAPI_CS_SIM_DISABLESEC:
-                       dbg("TAPI_CS_SIM_DISABLESEC");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       pin_data= g_array_index(in_param1, TelSimSecPw_t, 0);
-                       pin_data.pw = (unsigned char*)&g_array_index(in_param2, unsigned char, 0);
-                       if(pin_data.type == TAPI_SIM_PTYPE_PIN1) {
-                               dis_facility.type = SIM_FACILITY_SC;
-                       } else if (pin_data.type == TAPI_SIM_PTYPE_SIM) {
-                               dis_facility.type = SIM_FACILITY_PS;
-                       } else {
-                               api_err = TAPI_API_INVALID_INPUT;
-                               g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                               goto OUT;
-                       }
-                       dis_facility.password_length = pin_data.pw_len;
-                       memcpy(dis_facility.password, pin_data.pw, dis_facility.password_length);
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sim_disable_facility), &dis_facility);
-                       tcore_user_request_set_command(ur, TREQ_SIM_DISABLE_FACILITY);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+static gboolean on_sim_set_language(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gint arg_language, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-               case TAPI_CS_SIM_ENABLESEC:
-                       dbg("TAPI_CS_SIM_ENABLESEC");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       pin_data= g_array_index(in_param1, TelSimSecPw_t, 0);
-                       pin_data.pw = (unsigned char*)&g_array_index(in_param2, unsigned char, 0);
-                       if(pin_data.type == TAPI_SIM_PTYPE_PIN1) {
-                               en_facility.type = SIM_FACILITY_SC;
-                       } else if (pin_data.type == TAPI_SIM_PTYPE_SIM) {
-                               en_facility.type = SIM_FACILITY_PS;
-                       } else {
-                               api_err = TAPI_API_INVALID_INPUT;
-                               g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                               goto OUT;
-                       }
-                       en_facility.password_length = pin_data.pw_len;
-                       memcpy(en_facility.password, pin_data.pw, en_facility.password_length);
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sim_enable_facility), &en_facility);
-                       tcore_user_request_set_command(ur, TREQ_SIM_ENABLE_FACILITY);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+       struct treq_sim_set_language set_language;
+       memset(&set_language, 0, sizeof(struct treq_sim_set_language));
+       set_language.language = arg_language;
 
-               case TAPI_CS_SIM_GETPERSSTATUS:
-                       dbg("TAPI_CS_SIM_GETPERSSTATUS");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       type = g_array_index(in_param1, TelSimPersType_t, 0);
-                       switch(type) {
-                               case TAPI_SIM_PERS_NET:
-                                       facility.type = SIM_FACILITY_PN;
-                                       break;
-                               case TAPI_SIM_PERS_NS:
-                                       facility.type = SIM_FACILITY_PU;
-                                       break;
-                               case TAPI_SIM_PERS_SP:
-                                       facility.type = SIM_FACILITY_PP;
-                                       break;
-                               case TAPI_SIM_PERS_CP:
-                                       facility.type = SIM_FACILITY_PC;
-                                       break;
-                               default:
-                                       api_err = TAPI_API_INVALID_INPUT;
-                                       goto OUT;
-                                       break;
-                       }
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sim_get_facility_status), &facility);
-                       tcore_user_request_set_command(ur, TREQ_SIM_GET_FACILITY_STATUS);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+       dbg("set_language.language[%d]", set_language.language);
+       ur = MAKE_UR(ctx, sim, invocation);
 
-               case TAPI_CS_SIM_DISABLEPERS:
-                       dbg("TAPI_CS_SIM_DISABLEPERS");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       pers_data= g_array_index(in_param1, TelSimPersPw_t, 0);
-                       pers_data.pw = (unsigned char*)&g_array_index(in_param2, unsigned char, 0);
-                       switch(pers_data.type) {
-                               case TAPI_SIM_PERS_NET:
-                                       dis_facility.type = SIM_FACILITY_PN;
-                                       break;
-                               case TAPI_SIM_PERS_NS:
-                                       dis_facility.type = SIM_FACILITY_PU;
-                                       break;
-                               case TAPI_SIM_PERS_SP:
-                                       dis_facility.type = SIM_FACILITY_PP;
-                                       break;
-                               case TAPI_SIM_PERS_CP:
-                                       dis_facility.type = SIM_FACILITY_PC;
-                                       break;
-                               default:
-                                       api_err = TAPI_API_INVALID_INPUT;
-                                       goto OUT;
-                                       break;
-                       }
-                       dis_facility.password_length = pers_data.pw_len;
-                       memcpy(dis_facility.password, pers_data.pw, dis_facility.password_length);
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sim_disable_facility), &dis_facility);
-                       tcore_user_request_set_command(ur, TREQ_SIM_DISABLE_FACILITY);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+       tcore_user_request_set_data(ur, sizeof(struct treq_sim_set_language), &set_language);
+       tcore_user_request_set_command(ur, TREQ_SIM_SET_LANGUAGE);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-               case TAPI_CS_SIM_ENABLEPERS:
-                       dbg("TAPI_CS_SIM_ENABLEPERS");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       pers_data= g_array_index(in_param1, TelSimPersPw_t, 0);
-                       pers_data.pw = (unsigned char*)&g_array_index(in_param2, unsigned char, 0);
-                       switch(pers_data.type) {
-                               case TAPI_SIM_PERS_NET:
-                                       en_facility.type = SIM_FACILITY_PN;
-                                       break;
-                               case TAPI_SIM_PERS_NS:
-                                       en_facility.type = SIM_FACILITY_PU;
-                                       break;
-                               case TAPI_SIM_PERS_SP:
-                                       en_facility.type = SIM_FACILITY_PP;
-                                       break;
-                               case TAPI_SIM_PERS_CP:
-                                       en_facility.type = SIM_FACILITY_PC;
-                                       break;
-                               default:
-                                       api_err = TAPI_API_INVALID_INPUT;
-                                       goto OUT;
-                                       break;
-                       }
-                       en_facility.password_length = pers_data.pw_len;
-                       memcpy(en_facility.password, pers_data.pw, en_facility.password_length);
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sim_enable_facility), &en_facility);
-                       tcore_user_request_set_command(ur, TREQ_SIM_ENABLE_FACILITY);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+       return TRUE;
+}
+
+static gboolean on_sim_get_callforwarding(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       ur = MAKE_UR(ctx, sim, invocation);
+
+       tcore_user_request_set_command(ur, TREQ_SIM_GET_CALLFORWARDING);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sim_get_message_waiting(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       ur = MAKE_UR(ctx, sim, invocation);
+
+       tcore_user_request_set_command(ur, TREQ_SIM_GET_MESSAGEWAITING);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sim_get_mailbox(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       ur = MAKE_UR(ctx, sim, invocation);
+
+       tcore_user_request_set_command(ur, TREQ_SIM_GET_MAILBOX);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
 
-               case TAPI_CS_SIM_DISABLEFDN: //NOT USED FROM APP NOW
-                       dbg("TAPI_CS_SIM_DISABLEFDN");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       pin2 = (unsigned char*)&g_array_index(in_param1,  unsigned char, 0);
-                       pin2_len = g_array_index(in_param2, unsigned int, 0);
+
+static gboolean on_sim_get_cphsinfo(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       ur = MAKE_UR(ctx, sim, invocation);
+
+       tcore_user_request_set_command(ur, TREQ_SIM_GET_CPHS_INFO);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sim_get_msisdn(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       ur = MAKE_UR(ctx, sim, invocation);
+
+       tcore_user_request_set_command(ur, TREQ_SIM_GET_MSISDN);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sim_get_oplmnwact(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       ur = MAKE_UR(ctx, sim, invocation);
+
+       tcore_user_request_set_command(ur, TREQ_SIM_GET_OPLMNWACT);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+
+       return TRUE;
+}
+
+static gboolean on_sim_get_spn(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       ur = MAKE_UR(ctx, sim, invocation);
+
+       tcore_user_request_set_command(ur, TREQ_SIM_GET_SPN);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sim_get_cphs_netname(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       ur = MAKE_UR(ctx, sim, invocation);
+
+       tcore_user_request_set_command(ur, TREQ_SIM_GET_CPHS_NETNAME);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sim_authentication(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gint arg_type,
+           GVariant *arg_rand,
+           GVariant *arg_autn,
+           gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       GVariantIter *iter = NULL;
+       GVariant *rand_gv = NULL;
+       GVariant *autn_gv = NULL;
+       guchar rt_i;
+       int i =0;
+
+       struct treq_sim_req_authentication req_auth;
+       memset(&req_auth, 0, sizeof(struct treq_sim_req_authentication));
+
+       req_auth.auth_type = arg_type;
+
+       rand_gv = g_variant_get_variant(arg_rand);
+       g_variant_get(rand_gv, "ay", &iter);
+       while ( g_variant_iter_loop (iter, "y", &rt_i)) {
+               req_auth.rand_data[i] = rt_i;
+               i++;
+       }
+       req_auth.rand_length = (unsigned int)i;
+
+       i = 0;
+       autn_gv = g_variant_get_variant(arg_autn);
+       g_variant_get(autn_gv, "ay", &iter);
+       while ( g_variant_iter_loop (iter, "y", &rt_i)) {
+               req_auth.autn_data[i] = rt_i;
+               i++;
+       }
+       req_auth.autn_length = (unsigned int)i;
+
+       ur = MAKE_UR(ctx, sim, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sim_req_authentication), &req_auth);
+       tcore_user_request_set_command(ur, TREQ_SIM_REQ_AUTHENTICATION);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sim_verify_sec(TelephonySim *sim, GDBusMethodInvocation *invocation,
+           gint arg_type,
+           const gchar *arg_password,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_sim_verify_pins verify_pins;
+       memset(&verify_pins, 0, sizeof(struct treq_sim_verify_pins));
+
+       verify_pins.pin_type = arg_type;
+       verify_pins.pin_length = strlen(arg_password);
+       memcpy(verify_pins.pin, arg_password, verify_pins.pin_length);
+
+       ur = MAKE_UR(ctx, sim, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sim_verify_pins), &verify_pins);
+       tcore_user_request_set_command(ur, TREQ_SIM_VERIFY_PINS);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sim_verify_puk(TelephonySim *sim, GDBusMethodInvocation *invocation,
+           gint arg_type,
+           const gchar *arg_puk,
+           const gchar *arg_new_pin,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_sim_verify_puks verify_puks;
+       memset(&verify_puks, 0, sizeof(struct treq_sim_verify_puks));
+
+       verify_puks.puk_type = arg_type;
+       verify_puks.puk_length = strlen(arg_puk);
+       memcpy(verify_puks.puk, arg_puk, verify_puks.puk_length);
+       verify_puks.pin_length = strlen(arg_new_pin);
+       memcpy(verify_puks.pin, arg_new_pin, verify_puks.pin_length);
+
+       ur = MAKE_UR(ctx, sim, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sim_verify_puks), &verify_puks);
+       tcore_user_request_set_command(ur, TREQ_SIM_VERIFY_PUKS);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sim_change_pin(TelephonySim *sim, GDBusMethodInvocation *invocation,
+           gint arg_type,
+           const gchar *arg_old_password,
+           const gchar *arg_new_password,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_sim_change_pins change_pins;
+       memset(&change_pins, 0, sizeof(struct treq_sim_change_pins));
+
+       change_pins.type = arg_type;
+       change_pins.old_pin_length = strlen(arg_old_password);
+       memcpy(change_pins.old_pin, arg_old_password, change_pins.old_pin_length);
+       change_pins.new_pin_length = strlen(arg_new_password);
+       memcpy(change_pins.new_pin, arg_new_password, change_pins.new_pin_length);
+
+       ur = MAKE_UR(ctx, sim, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sim_change_pins), &change_pins);
+       tcore_user_request_set_command(ur, TREQ_SIM_CHANGE_PINS);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sim_disable_facility(TelephonySim *sim, GDBusMethodInvocation *invocation,
+           gint arg_type,
+           const gchar *arg_password,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       struct treq_sim_disable_facility dis_facility;
+       memset(&dis_facility, 0, sizeof(struct treq_sim_disable_facility));
+
+       dbg("arg_type[%d]", arg_type);
+       switch (arg_type) {
+               case 1:
+                       dis_facility.type = SIM_FACILITY_PS;
+                       break;
+               case 3:
+                       dis_facility.type = SIM_FACILITY_SC;
+                       break;
+               case 4:
                        dis_facility.type = SIM_FACILITY_FD;
-                       dis_facility.password_length = pin2_len;
-                       memcpy(dis_facility.password, pin2, dis_facility.password_length);
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sim_disable_facility), &dis_facility);
-                       tcore_user_request_set_command(ur, TREQ_SIM_DISABLE_FACILITY);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
                        break;
-
-               case TAPI_CS_SIM_ENABLEFDN: //NOT USED FROM APP NOW
-                       dbg("TAPI_CS_SIM_ENABLEFDN");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       pin2 = (unsigned char*)&g_array_index(in_param1,  unsigned char, 0);
-                       pin2_len = g_array_index(in_param2, unsigned int, 0);
-                       en_facility.type = SIM_FACILITY_FD;
-                       en_facility.password_length = pin2_len;
-                       memcpy(en_facility.password, pin2, en_facility.password_length);
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sim_enable_facility), &en_facility);
-                       tcore_user_request_set_command(ur, TREQ_SIM_ENABLE_FACILITY);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
+               case 5:
+                       dis_facility.type = SIM_FACILITY_PN;
                        break;
-
-               case TAPI_CS_SIM_APDU:
-                       dbg("TAPI_CS_SIM_APDU");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       apdu_data = g_array_index(in_param1, TelSimApdu_t, 0);
-                       apdu_data.apdu =(unsigned char*)&g_array_index(in_param2, unsigned char, 0);
-                       send_apdu.apdu_length = apdu_data.apdu_len;
-                       memcpy(send_apdu.apdu, apdu_data.apdu, send_apdu.apdu_length);
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sim_transmit_apdu), &send_apdu);
-                       tcore_user_request_set_command(ur, TREQ_SIM_TRANSMIT_APDU);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
+               case 6:
+                       dis_facility.type = SIM_FACILITY_PU;
                        break;
-
-               case TAPI_CS_SIM_ATR:
-                       dbg("TAPI_CS_SIM_ATR");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       tcore_user_request_set_command(ur, TREQ_SIM_GET_ATR);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
+               case 7:
+                       dis_facility.type = SIM_FACILITY_PP;
                        break;
-
-               case TAPI_CS_SIM_GETSECSTATUS :
-                       dbg("TAPI_CS_SIM_GETSECSTATUS");
-                       type = g_array_index(in_param1, TelSimPinType_t, 0);
-                       if((int)type == TAPI_SIM_PTYPE_PIN1)
-                               status = ctx->pin_lock;
-                       else if((int)type == TAPI_SIM_PTYPE_PIN2)
-                               status = TAPI_SIM_PIN_STATUS_ENABLED;
-                       else if((int)type == TAPI_SIM_PTYPE_SIM)
-                               status = ctx->sim_lock;
-                       else
-                               status = TAPI_SIM_PIN_STATUS_UNKNOWN;
-
-                       g_array_append_vals (*out_param2, &status, sizeof(TelSimPinStatus_t));
+               case 8:
+                       dis_facility.type = SIM_FACILITY_PC;
+                       break;
+               default:
+                       dbg("error - not handled type[%d]", arg_type);
                        break;
+       }
+       dis_facility.password_length = strlen(arg_password);
+       memcpy(dis_facility.password, arg_password, dis_facility.password_length);
 
-               case TAPI_CS_SIM_GETPBINITINFO:
-                       dbg("TAPI_CS_SIM_GETPBINITINFO");
-                       co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
-                       if (!co_list) {
-                               api_err = TAPI_API_NOT_SUPPORTED;
-                               goto OUT;
-                       }
-                       co_pb = (CoreObject *)co_list->data;
-                       g_slist_free(co_list);
+       ur = MAKE_UR(ctx, sim, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sim_disable_facility), &dis_facility);
+       tcore_user_request_set_command(ur, TREQ_SIM_DISABLE_FACILITY);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-                       if (!co_pb) {
-                               api_err = TAPI_API_NOT_SUPPORTED;
-                               goto OUT;
-                       }
-                       lsp_init_completed = tcore_phonebook_get_status(co_pb);
-                       pb_list = (struct tel_phonebook_support_list*)tcore_phonebook_get_support_list(co_pb);
-                       memcpy(&lsp_supported_pb_list, pb_list, sizeof(struct tel_phonebook_support_list));
-                       g_array_append_vals (*out_param2, &lsp_init_completed,sizeof(int));
-                       g_array_append_vals (*out_param3, &lsp_supported_pb_list,sizeof(TelSimPbList_t));
-                       g_array_append_vals (*out_param4, &lsp_first_index,sizeof(int));
-                       break;
+       return TRUE;
+}
 
-               case TAPI_CS_SIM_PB_GETCOUNT:
-                       dbg("TAPI_CS_SIM_PB_GETCOUNT");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       lsp_pb_type =  g_array_index(in_param1, TelSimPbFileType_t, 0);
-                       switch(lsp_pb_type){
-                               case TAPI_SIM_PB_FDN :
-                                       pb_count.phonebook_type = PB_TYPE_FDN;
-                                       break;
-                               case TAPI_SIM_PB_ADN :
-                                       pb_count.phonebook_type = PB_TYPE_ADN;
-                                       break;
-                               case TAPI_SIM_PB_SDN :
-                                       pb_count.phonebook_type = PB_TYPE_SDN;
-                                       break;
-                               case TAPI_SIM_PB_3GSIM :
-                                       pb_count.phonebook_type = PB_TYPE_USIM;
-                                       break;
-                               case TAPI_SIM_PB_AAS :
-                                       pb_count.phonebook_type = PB_TYPE_AAS;
-                                       break;
-                               case TAPI_SIM_PB_GAS :
-                                       pb_count.phonebook_type = PB_TYPE_GAS;
-                                       break;
-                               default:
-                                       break;
-                       }
-                       tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_get_count), &pb_count);
-                       tcore_user_request_set_command(ur, TREQ_PHONEBOOK_GETCOUNT);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+static gboolean on_sim_enable_facility(TelephonySim *sim, GDBusMethodInvocation *invocation,
+           gint arg_type,
+           const gchar *arg_password,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-               case TAPI_CS_SIM_PB_GETMETAINFO: //NOT USED FROM APP NOW
-                       dbg("TAPI_CS_SIM_PB_GETMETAINFO");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       lsp_pb_type =  g_array_index(in_param1, TelSimPbFileType_t, 0);
-                       switch(lsp_pb_type){
-                               case TAPI_SIM_PB_FDN :
-                                       pb_info.phonebook_type = PB_TYPE_FDN;
-                                       break;
-                               case TAPI_SIM_PB_ADN :
-                                       pb_info.phonebook_type = PB_TYPE_ADN;
-                                       break;
-                               case TAPI_SIM_PB_SDN :
-                                       pb_info.phonebook_type = PB_TYPE_SDN;
-                                       break;
-                               case TAPI_SIM_PB_3GSIM :
-                                       pb_info.phonebook_type = PB_TYPE_USIM;
-                                       break;
-                               case TAPI_SIM_PB_AAS :
-                                       pb_info.phonebook_type = PB_TYPE_AAS;
-                                       break;
-                               case TAPI_SIM_PB_GAS :
-                                       pb_info.phonebook_type = PB_TYPE_GAS;
-                                       break;
-                               default:
-                                       break;
-                       }
-                       tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_get_info), &pb_info);
-                       tcore_user_request_set_command(ur, TREQ_PHONEBOOK_GETMETAINFO);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+       struct treq_sim_enable_facility en_facility;
+       memset(&en_facility, 0, sizeof(struct treq_sim_enable_facility));
 
-               case TAPI_CS_SIM_PB_READRECORD:
-                       dbg("TAPI_CS_SIM_PB_READRECORD");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       lsp_pb_type =  g_array_index(in_param1, TelSimPbFileType_t, 0);
-                       switch(lsp_pb_type){
-                               case TAPI_SIM_PB_FDN :
-                                       pb_read.phonebook_type = PB_TYPE_FDN;
-                                       break;
-                               case TAPI_SIM_PB_ADN :
-                                       pb_read.phonebook_type = PB_TYPE_ADN;
-                                       break;
-                               case TAPI_SIM_PB_SDN :
-                                       pb_read.phonebook_type = PB_TYPE_SDN;
-                                       break;
-                               case TAPI_SIM_PB_3GSIM :
-                                       pb_read.phonebook_type = PB_TYPE_USIM;
-                                       break;
-                               case TAPI_SIM_PB_AAS :
-                                       pb_read.phonebook_type = PB_TYPE_AAS;
-                                       break;
-                               case TAPI_SIM_PB_GAS :
-                                       pb_read.phonebook_type = PB_TYPE_GAS;
-                                       break;
-                               default:
-                                       break;
-                       }
-                       lsp_index = g_array_index(in_param2, unsigned short, 0);
-                       pb_read.index = lsp_index;
-                       tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_read_record), &pb_read);
-                       tcore_user_request_set_command(ur, TREQ_PHONEBOOK_READRECORD);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
+       dbg("arg_type[%d]", arg_type);
+       switch (arg_type) {
+               case 1:
+                       en_facility.type = SIM_FACILITY_PS;
                        break;
-
-               case TAPI_CS_SIM_PB_UPDATERECORD: //NOT USED FROM APP NOW
-                       dbg("TAPI_CS_SIM_PB_UPDATERECORD");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       lsp_pb_type =  g_array_index(in_param1, TelSimPbFileType_t, 0);
-                       switch(lsp_pb_type){
-                               case TAPI_SIM_PB_FDN :
-                                       pb_update.phonebook_type = PB_TYPE_FDN;
-                                       break;
-                               case TAPI_SIM_PB_ADN :
-                                       pb_update.phonebook_type = PB_TYPE_ADN;
-                                       break;
-                               case TAPI_SIM_PB_SDN :
-                                       pb_update.phonebook_type = PB_TYPE_SDN;
-                                       break;
-                               case TAPI_SIM_PB_3GSIM :
-                                       pb_update.phonebook_type = PB_TYPE_USIM;
-                                       break;
-                               case TAPI_SIM_PB_AAS :
-                                       pb_update.phonebook_type = PB_TYPE_AAS;
-                                       break;
-                               case TAPI_SIM_PB_GAS :
-                                       pb_update.phonebook_type = PB_TYPE_GAS;
-                                       break;
-                               default:
-                                       break;
-                       }
-                       lsp_index = g_array_index(in_param2, unsigned short, 0);
-                       pb_update.index = lsp_index;
-
-                       tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_update_record), &pb_update);
-                       tcore_user_request_set_command(ur, TREQ_PHONEBOOK_UPDATERECORD);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
+               case 3:
+                       en_facility.type = SIM_FACILITY_SC;
                        break;
-
-               case TAPI_CS_SIM_PB_DELETERECORD: //NOT USED FROM APP NOW
-                       dbg("TAPI_CS_SIM_PB_DELETERECORD");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       lsp_pb_type =  g_array_index(in_param1, TelSimPbFileType_t, 0);
-                       switch(lsp_pb_type){
-                               case TAPI_SIM_PB_FDN :
-                                       pb_delete.phonebook_type = PB_TYPE_FDN;
-                                       break;
-                               case TAPI_SIM_PB_ADN :
-                                       pb_delete.phonebook_type = PB_TYPE_ADN;
-                                       break;
-                               case TAPI_SIM_PB_SDN :
-                                       pb_delete.phonebook_type = PB_TYPE_SDN;
-                                       break;
-                               case TAPI_SIM_PB_3GSIM :
-                                       pb_delete.phonebook_type = PB_TYPE_USIM;
-                                       break;
-                               case TAPI_SIM_PB_AAS :
-                                       pb_delete.phonebook_type = PB_TYPE_AAS;
-                                       break;
-                               case TAPI_SIM_PB_GAS :
-                                       pb_delete.phonebook_type = PB_TYPE_GAS;
-                                       break;
-                               default:
-                                       break;
-                       }
-                       lsp_index = g_array_index(in_param2, unsigned short, 0);
-                       pb_delete.index = lsp_index;
-                       tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_delete_record), &pb_delete);
-                       tcore_user_request_set_command(ur, TREQ_PHONEBOOK_DELETERECORD);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
+               case 4:
+                       en_facility.type = SIM_FACILITY_FD;
+                       break;
+               case 5:
+                       en_facility.type = SIM_FACILITY_PN;
+                       break;
+               case 6:
+                       en_facility.type = SIM_FACILITY_PU;
+                       break;
+               case 7:
+                       en_facility.type = SIM_FACILITY_PP;
+                       break;
+               case 8:
+                       en_facility.type = SIM_FACILITY_PC;
                        break;
+               default:
+                       dbg("error - not handled type[%d]", arg_type);
+                       break;
+       }
+       en_facility.password_length = strlen(arg_password);
+       memcpy(en_facility.password, arg_password, en_facility.password_length);
+
+       ur = MAKE_UR(ctx, sim, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sim_enable_facility), &en_facility);
+       tcore_user_request_set_command(ur, TREQ_SIM_ENABLE_FACILITY);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-               case TAPI_CS_SIM_GETPBCAPABILITYINFO: //NOT USED FROM APP NOW
-                       dbg("TAPI_CS_SIM_GETPBCAPABILITYINFO");
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_get_usim_info), &pb_usim);
-                       tcore_user_request_set_command(ur, TREQ_PHONEBOOK_GETUSIMINFO);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+       return TRUE;
+}
 
-               case TAPI_CS_SIM_SAPCONNECTREQUEST:
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       lsa_conn_req = g_array_index(in_param1, TelSimSapConnect_t, 0);
-                       if (lsa_conn_req.MsgId == TAPI_SIM_SAP_CONNECT_REQ) {
-                               req_conn.max_msg_size = lsa_conn_req.MaxMsgSize;
-                               tcore_user_request_set_data(ur, sizeof(struct treq_sap_req_connect), &req_conn);
-                               tcore_user_request_set_command(ur, TREQ_SAP_REQ_CONNECT);
-                       }else if(lsa_conn_req.MsgId == TAPI_SIM_SAP_DISCONNECT_REQ){
-                               tcore_user_request_set_data(ur, sizeof(struct treq_sap_req_disconnect), &req_conn);
-                               tcore_user_request_set_command(ur, TREQ_SAP_REQ_DISCONNECT);
-                       }else{
-                               dbg("error");
-                       }
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+static gboolean on_sim_get_facility(TelephonySim *sim, GDBusMethodInvocation *invocation,
+           gint arg_type,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-               case TAPI_CS_SIM_SAPCONNECTSTATUS:
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sap_req_status), &req_status);
-                       tcore_user_request_set_command(ur, TREQ_SAP_REQ_STATUS);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+       struct treq_sim_get_facility_status facility;
+       memset(&facility, 0, sizeof(struct treq_sim_get_facility_status));
 
-               case TAPI_CS_SIM_SAPATRREQUEST:
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sap_req_atr), &req_atr);
-                       tcore_user_request_set_command(ur, TREQ_SAP_REQ_ATR);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
+       dbg("arg_type[%d]", arg_type);
+       switch (arg_type) {
+               case 1:
+                       facility.type = SIM_FACILITY_PS;
                        break;
-
-               case TAPI_CS_SIM_SAPTRANSFERAPDU:
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       lsa_apdu_data = g_array_index(in_param1, TelSimSapApduData_t, 0);
-                       t_apdu.apdu_length = lsa_apdu_data.ApduLength;
-                       memcpy(t_apdu.apdu_data, lsa_apdu_data.Apdu, lsa_apdu_data.ApduLength);
-
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sap_transfer_apdu), &t_apdu);
-                       tcore_user_request_set_command(ur, TREQ_SAP_TRANSFER_APDU);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
+               case 3:
+                       facility.type = SIM_FACILITY_SC;
+                       break;
+               case 4:
+                       facility.type = SIM_FACILITY_FD;
+                       break;
+               case 5:
+                       facility.type = SIM_FACILITY_PN;
                        break;
+               case 6:
+                       facility.type = SIM_FACILITY_PU;
+                       break;
+               case 7:
+                       facility.type = SIM_FACILITY_PP;
+                       break;
+               case 8:
+                       facility.type = SIM_FACILITY_PC;
+                       break;
+               default:
+                       dbg("error - not handled type[%d]", arg_type);
+                       break;
+       }
 
-               case TAPI_CS_SIM_SAPSETPROTOCOL:
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       lsa_protocol = g_array_index(in_param1, TelSimSapProtocol_t, 0);
-                       set_protocol.protocol = lsa_protocol;
+       ur = MAKE_UR(ctx, sim, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sim_get_facility_status), &facility);
+       tcore_user_request_set_command(ur, TREQ_SIM_GET_FACILITY_STATUS);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sap_set_protocol), &set_protocol);
-                       tcore_user_request_set_command(ur, TREQ_SAP_SET_PROTOCOL);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+       return TRUE;
+}
 
-               case TAPI_CS_SIM_SAPSETSIMPOWER:
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       lsa_msg_id = g_array_index(in_param1, TelSimSapMsgId_t, 0);
-                       if (lsa_msg_id == TAPI_SIM_SAP_POWER_SIM_OFF_REQ) {
-                               set_power.mode = SAP_POWER_OFF;
-                       } else if (lsa_msg_id == TAPI_SIM_SAP_POWER_SIM_ON_REQ) {
-                               set_power.mode = SAP_POWER_ON;
-                       } else if (lsa_msg_id == TAPI_SIM_SAP_RESET_SIM_REQ) {
-                               set_power.mode = SAP_POWER_RESET;
-                       } else {
-                               dbg("error");
-                       }
+static gboolean on_sim_get_lock_info(TelephonySim *sim, GDBusMethodInvocation *invocation,
+           gint arg_type,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sap_set_power), &req_conn);
-                       tcore_user_request_set_command(ur, TREQ_SAP_SET_POWER);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
-                       break;
+       struct treq_sim_get_lock_info lock_info;
+       memset(&lock_info, 0, sizeof(struct treq_sim_get_lock_info));
 
-               case TAPI_CS_SIM_SAPCARDREADERSTATUS:
-                       g_array_append_vals(*out_param2, &request_id, sizeof(int));
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sap_req_cardreaderstatus), &req_conn);
-                       tcore_user_request_set_command(ur, TREQ_SAP_REQ_CARDREADERSTATUS);
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
-                       dbg("ret = 0x%x", ret);
+       dbg("arg_type[%d]", arg_type);
+       switch (arg_type) {
+               case 1:
+                       lock_info.type = SIM_FACILITY_PS;
+                       break;
+               case 3:
+                       lock_info.type = SIM_FACILITY_SC;
+                       break;
+               case 4:
+                       lock_info.type = SIM_FACILITY_FD;
+                       break;
+               case 5:
+                       lock_info.type = SIM_FACILITY_PN;
+                       break;
+               case 6:
+                       lock_info.type = SIM_FACILITY_PU;
+                       break;
+               case 7:
+                       lock_info.type = SIM_FACILITY_PP;
+                       break;
+               case 8:
+                       lock_info.type = SIM_FACILITY_PC;
                        break;
-
                default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
+                       dbg("error - not handled type[%d]", arg_type);
                        break;
        }
 
-OUT:
-       if (api_err != TAPI_API_SUCCESS) {
-               tcore_user_request_free(ur);
+       ur = MAKE_UR(ctx, sim, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sim_get_lock_info), &lock_info);
+       tcore_user_request_set_command(ur, TREQ_SIM_GET_LOCK_INFO);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sim_transfer_apdu(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               GVariant *arg_apdu,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+       struct treq_sim_transmit_apdu send_apdu;
+
+       GVariantIter *iter = NULL;
+       GVariant *inner_gv = NULL;
+       guchar rt_i;
+       int i =0;
+
+       dbg("Func Entrance");
+       memset(&send_apdu, 0, sizeof(struct treq_sim_transmit_apdu));
+
+       inner_gv = g_variant_get_variant(arg_apdu);
+
+       g_variant_get(inner_gv, "ay", &iter);
+       while ( g_variant_iter_loop (iter, "y", &rt_i)) {
+               send_apdu.apdu[i] = rt_i;
+               i++;
        }
-       dbg("api_err[%d]",api_err);
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
+       send_apdu.apdu_length = (unsigned int)i;
+       g_variant_iter_free(iter);
+       g_variant_unref(inner_gv);
+       g_variant_unref(arg_apdu);
+
+       for(i=0; i < (int)send_apdu.apdu_length; i++)
+               dbg("apdu[%d][0x%02x]",i, send_apdu.apdu[i]);
+
+       ur = MAKE_UR(ctx, sim, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sim_transmit_apdu), &send_apdu);
+       tcore_user_request_set_command(ur, TREQ_SIM_TRANSMIT_APDU);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+static gboolean on_sim_get_atr(TelephonySim *sim, GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       ur = MAKE_UR(ctx, sim, invocation);
+
+       tcore_user_request_set_command(ur, TREQ_SIM_GET_ATR);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_setup_sim_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
+{
+       TelephonySim *sim;
+
+       sim = telephony_sim_skeleton_new();
+       telephony_object_skeleton_set_sim(object, sim);
+       g_object_unref(sim);
+
+       dbg("sim = %p", sim);
+
+       g_signal_connect (sim,
+                       "handle-get-init-status",
+                       G_CALLBACK (on_sim_get_init_status),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-card-type",
+                       G_CALLBACK (on_sim_get_card_type),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-imsi",
+                       G_CALLBACK (on_sim_get_imsi),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-ecc",
+                       G_CALLBACK (on_sim_get_ecc),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-iccid",
+                       G_CALLBACK (on_sim_get_iccid),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-language",
+                       G_CALLBACK (on_sim_get_language),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-set-language",
+                       G_CALLBACK (on_sim_set_language),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-callforwarding",
+                       G_CALLBACK (on_sim_get_callforwarding),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-message-waiting",
+                       G_CALLBACK (on_sim_get_message_waiting),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-mailbox",
+                       G_CALLBACK (on_sim_get_mailbox),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-cphsinfo",
+                       G_CALLBACK (on_sim_get_cphsinfo),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-msisdn",
+                       G_CALLBACK (on_sim_get_msisdn),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-oplmnwact",
+                       G_CALLBACK (on_sim_get_oplmnwact),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-spn",
+                       G_CALLBACK (on_sim_get_spn),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-cphs-net-name",
+                       G_CALLBACK (on_sim_get_cphs_netname),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-authentication",
+                       G_CALLBACK (on_sim_authentication),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-verify-sec",
+                       G_CALLBACK (on_sim_verify_sec),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-verify-puk",
+                       G_CALLBACK (on_sim_verify_puk),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-change-pin",
+                       G_CALLBACK (on_sim_change_pin),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-disable-facility",
+                       G_CALLBACK (on_sim_disable_facility),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-enable-facility",
+                       G_CALLBACK (on_sim_enable_facility),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-facility",
+                       G_CALLBACK (on_sim_get_facility),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-lock-info",
+                       G_CALLBACK (on_sim_get_lock_info),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-transfer-apdu",
+                       G_CALLBACK (on_sim_transfer_apdu),
+                       ctx);
+
+       g_signal_connect (sim,
+                       "handle-get-atr",
+                       G_CALLBACK (on_sim_get_atr),
+                       ctx);
+
+       return TRUE;
 }
 
-TReturn dbus_response_sim(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
+gboolean dbus_plugin_sim_response(struct custom_data *ctx, UserRequest *ur,
+               struct dbus_request_info *dbus_info, enum tcore_response_command command,
+               unsigned int data_len, const void *data)
 {
        const struct tresp_sim_verify_pins *resp_verify_pins = data;
        const struct tresp_sim_verify_puks *resp_verify_puks = data;
@@ -1029,737 +873,500 @@ TReturn dbus_response_sim(struct custom_data *ctx, UserRequest *ur, const char *
        const struct tresp_sim_read *resp_read = data;
        const struct tresp_sim_req_authentication *resp_auth = data;
        const struct tresp_sim_set_language *resp_set_language = data;
-
-       TelSimSecResult_t sec_rt = {0,};
-       TelSimPersStatus_t pers_rt = {0,};
-       TelSimApduResp_t apdu_resp = {0,};
-       TelSimAtrResp_t atr_resp = {0,};
-       TelSimAuthenticationResponse_t auth_resp = {0,};
-
-       const struct tresp_phonebook_get_count *resp_pbcnt = data;
-       const struct tresp_phonebook_get_info *resp_entry = data;
-       const struct tresp_phonebook_get_usim_info *resp_capa = data;
-       const struct tresp_phonebook_read_record *resp_pbread = data;
-       const struct tresp_phonebook_update_record *resp_pbupdate = data;
-       const struct tresp_phonebook_delete_record *resp_pbdelete = data;
-
-       TelSimPbCapabilityInfo_t lpb_capa = {0,};
-       TelSimPbStorageInfo_t lpb_cnt = {0,};
-       TelSimPbEntryInfo_t lpb_entry = {0,};
-       //TelSimPbRecordData_t lpb_data = {0,};
-       TelSimPbRecord_t lcpb_data = {0,};
-
-       const struct tresp_sap_req_connect *sap_conn = data;
-       const struct tresp_sap_req_status *sap_status = data;
-       const struct tresp_sap_req_atr *sap_atr = data;
-       const struct tresp_sap_transfer_apdu *sap_apdu = data;
-       const struct tresp_sap_set_protocol *sap_protocol = data;
-       const struct tresp_sap_set_power *sap_power = data;
-       const struct tresp_sap_req_cardreaderstatus *sap_reader = data;
-
-       TelSimSapConnect_t lsa_conn = { 0, };
-       TelSimSapConnect_t lsa_disconn = { 0, };
-       unsigned int lsa_status = 0;
-       TelSimSapAtrInfo_t lsa_atr = { 0, };
-       TelSimSapApduData_t lsa_apdu = { 0, };
-       TelSimSapResultCode_t lsa_result_code = 0;
-       TelSimSapPower_t lsa_power = { 0, };
-       TelSimCardReaderStatus_t lsa_reader = { 0, };
-
-       int request_id = 0, i =0;
-
-       GSList *co_list;
-       CoreObject *co_sim;
-       char *modem_name = NULL;
-       TcorePlugin *p = NULL;
-
-       Server *s = NULL;
-       Storage *strg = NULL;
-
-       char *tmp_msisdn = NULL;
-
-       modem_name = tcore_user_request_get_modem_name(ur);
-       if (!modem_name)
-               return FALSE;
-
-       p = tcore_server_find_plugin(ctx->server, modem_name);
-       free(modem_name);
-       if (!p)
-               return FALSE;
-
-       co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SIM);
-       if (!co_list) {
-               return FALSE;
-       }
-
-       co_sim = (CoreObject *)co_list->data;
-       g_slist_free(co_list);
-
-       if (!co_sim) {
-               return FALSE;
-       }
-
-       s = tcore_plugin_ref_server(p);
-       if(!s){
-               dbg("there is no valid server at this point");
-               return FALSE;
-       }
-
-       strg = (Storage*)tcore_server_find_storage(s, "vconf");
-       if(!strg){
-               dbg("there is no valid storage plugin");
-               return FALSE;
-       }
+       const struct tresp_sim_get_lock_info *resp_lock = data;
+       gint f_type =0;
+       int i =0;
+       dbg("Command = [0x%x], data_len = %d", command, data_len);
 
        switch (command) {
-               case TRESP_SIM_VERIFY_PINS:
-                       dbg("dbus comm - TRESP_SIM_VERIFY_PINS");
-                       sec_rt.retry_count = resp_verify_pins->retry_count;
-                       sec_rt.type = resp_verify_pins->pin_type;
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_VERIFY_SEC_CNF, appname, request_id, resp_verify_pins->result,
-                                       sizeof(TelSimSecResult_t), (void*) &sec_rt);
+               case TRESP_SIM_GET_ECC: {
+                       dbg("resp comm - TRESP_SIM_GET_ECC");
+                       /*                      GVariant *gv = NULL;
+                       GVariantBuilder b;
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+
+                       for (i = 0; i < resp_read->data.ecc.ecc_count; i++) {
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(resp_read->data.ecc.ecc[i].ecc_string));
+                               g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string(resp_read->data.ecc.ecc[i].ecc_num));
+                               g_variant_builder_add(&b, "{sv}", "category", g_variant_new_int32(resp_read->data.ecc.ecc[i].ecc_category));
+                               g_variant_builder_close(&b);
+                       }
+                       gv = g_variant_builder_end(&b);
+                       ctx->cached_sim_ecc = gv;*/
+                       memcpy((void*)&ctx->cached_sim_ecc, (const void*)&resp_read->data.ecc, sizeof(struct tel_sim_ecc_list));
+               }
                        break;
 
-               case TRESP_SIM_VERIFY_PUKS:
-                       dbg("dbus comm - TRESP_SIM_VERIFY_PUKS");
-                       sec_rt.retry_count = resp_verify_puks->retry_count;
-                       sec_rt.type = resp_verify_puks->pin_type;
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_VERIFY_PUK_CNF, appname, request_id, resp_verify_puks->result,
-                                       sizeof(TelSimSecResult_t), (void*) &sec_rt);
+               case TRESP_SIM_GET_ICCID:
+                       dbg("resp comm - TRESP_SIM_GET_ICCID");
+                       dbg("dbus_info->interface_object[%p], dbus_info->invocation[%p],dbus_info->interface_object, dbus_info->invocation");
+                       dbg("result[%d], iccid[%s]", resp_read->result, resp_read->data.iccid.iccid);
+                       telephony_sim_complete_get_iccid(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_read->result,
+                                       resp_read->data.iccid.iccid);
                        break;
 
-               case TRESP_SIM_CHANGE_PINS:
-                       dbg("dbus comm - TRESP_SIM_CHANGE_PINS");
-                       sec_rt.retry_count = resp_change_pins->retry_count;
-                       sec_rt.type = resp_change_pins->pin_type;
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_CHANGE_PINS_CNF, appname, request_id, resp_change_pins->result,
-                                       sizeof(TelSimSecResult_t), (void*) &sec_rt);
+               case TRESP_SIM_GET_LANGUAGE:
+                       dbg("resp comm - TRESP_SIM_GET_LANGUAGE");
+                       telephony_sim_complete_get_language(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_read->result,
+                                       resp_read->data.language.language[0]);
                        break;
 
-               case TRESP_SIM_GET_FACILITY_STATUS:
-                       dbg("dbus comm - TRESP_SIM_GET_FACILITY_STATUS");
-                       switch(resp_get_facility->type){
-                               case SIM_FACILITY_PN:
-                                       pers_rt.type = TAPI_SIM_PERS_NET;
-                                       break;
-                               case SIM_FACILITY_PU:
-                                       pers_rt.type = TAPI_SIM_PERS_NS;
-                                       break;
-                               case SIM_FACILITY_PP:
-                                       pers_rt.type = TAPI_SIM_PERS_SP;
-                                       break;
-                               case SIM_FACILITY_PC:
-                                       pers_rt.type = TAPI_SIM_PERS_CP;
-                                       break;
-                               case SIM_FACILITY_PS:
-                               case SIM_FACILITY_SC:
-                               case SIM_FACILITY_FD:
-                                       return dbus_sim_security_update(ctx, resp_get_facility->type, resp_get_facility->result, resp_get_facility->b_enable);
-                                       break;
-                               default:
-                                       break;
-                       }
-                       pers_rt.mode = resp_get_facility->b_enable;
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_PERS_STATUS_CNF, appname, request_id, resp_get_facility->result,
-                                       sizeof(TelSimPersStatus_t), (void*) &pers_rt);
+               case TRESP_SIM_SET_LANGUAGE:
+                       dbg("resp comm - TRESP_SIM_SET_LANGUAGE");
+                       telephony_sim_complete_set_language(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_set_language->result);
                        break;
 
-               case TRESP_SIM_DISABLE_FACILITY:
-                       dbg("dbus comm - TRESP_SIM_DISABLE_FACILITY");
-                       dbus_sim_security_update(ctx, resp_en_facility->type, resp_en_facility->result, 0);
-                       sec_rt.retry_count = resp_dis_facility->retry_count;
-                       switch(resp_dis_facility->type){
-                               case SIM_FACILITY_PS :
-                                       sec_rt.type = TAPI_SIM_PTYPE_SIM;
-                               case SIM_FACILITY_SC:
-                                       sec_rt.type = TAPI_SIM_PTYPE_PIN1;
-                                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                                       TAPI_EVENT_SIM_DISABLE_SEC_CNF, appname, request_id, resp_dis_facility->result,
-                                                       sizeof(TelSimSecResult_t), (void*) &sec_rt);
-                                       break;
-
-                               case SIM_FACILITY_FD:
-                                       sec_rt.type = TAPI_SIM_PTYPE_PIN2;
-                                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                                       TAPI_EVENT_SIM_DISABLE_FDNMODE_CNF, appname, request_id, resp_dis_facility->result,
-                                                       sizeof(TelSimSecResult_t), (void*) &sec_rt);
-                                       break;
+               case TRESP_SIM_GET_CALLFORWARDING:
+                       dbg("resp comm - TRESP_SIM_GET_CALLFORWARDING");
+                       telephony_sim_complete_get_callforwarding (dbus_info->interface_object, dbus_info->invocation,
+                                       resp_read->result,
+                                       resp_read->data.cf.voice1,
+                                       resp_read->data.cf.voice2);
+                       break;
 
-                               case SIM_FACILITY_PN:
-                                       sec_rt.type = TAPI_SIM_PERS_NET;
-                               case SIM_FACILITY_PU:
-                                       sec_rt.type = TAPI_SIM_PERS_NS;
-                               case SIM_FACILITY_PP:
-                                       pers_rt.type = TAPI_SIM_PERS_SP;
-                               case SIM_FACILITY_PC:
-                                       pers_rt.type = TAPI_SIM_PERS_CP;
-                                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                                       TAPI_EVENT_SIM_DISABLE_PERS_CNF, appname, request_id, resp_dis_facility->result, 0, NULL);
-                                       break;
-                               default:
-                                       break;
+               case TRESP_SIM_GET_MESSAGEWAITING:
+                       dbg("resp comm - TRESP_SIM_GET_MESSAGEWAITING");
+                       if (resp_read->data.mw.b_cphs) {
+                               telephony_sim_complete_get_message_waiting(dbus_info->interface_object, dbus_info->invocation,
+                                               resp_read->result,
+                                               resp_read->data.mw.mw_data_u.cphs_mw.b_voice1,
+                                               resp_read->data.mw.mw_data_u.cphs_mw.b_voice2,
+                                               resp_read->data.mw.mw_data_u.cphs_mw.b_fax,
+                                               resp_read->data.mw.mw_data_u.cphs_mw.b_data);
+                       } else {
+                               telephony_sim_complete_get_message_waiting(dbus_info->interface_object, dbus_info->invocation,
+                                               resp_read->result,
+                                               resp_read->data.mw.mw_data_u.mw.voice_count,
+                                               0,
+                                               resp_read->data.mw.mw_data_u.mw.fax_count,
+                                               resp_read->data.mw.mw_data_u.mw.video_count);
                        }
                        break;
 
-               case TRESP_SIM_ENABLE_FACILITY:
-                       dbg("dbus comm - TRESP_SIM_ENABLE_FACILITY");
-                       sec_rt.retry_count = resp_en_facility->retry_count;
-                       dbus_sim_security_update(ctx, resp_en_facility->type, resp_en_facility->result, 1);
-                       switch(resp_en_facility->type){
-                               case SIM_FACILITY_PS :
-                                       sec_rt.type = TAPI_SIM_PTYPE_SIM;
-                               case SIM_FACILITY_SC:
-                                       sec_rt.type = TAPI_SIM_PTYPE_PIN1;
-                                       dbg("result[%d], sec_rt type[%d],retry cnt[%d]",resp_en_facility->result, sec_rt.type, sec_rt.retry_count);
-                                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                                       TAPI_EVENT_SIM_ENABLE_SEC_CNF, appname, request_id, resp_en_facility->result,
-                                                       sizeof(TelSimSecResult_t), (void*) &sec_rt);
-                                       break;
+               case TRESP_SIM_GET_MAILBOX: {
+                       GVariant *gv = NULL;
+                       GVariantBuilder b;
+                       dbg("resp comm - TRESP_SIM_GET_MAILBOX");
 
-                               case SIM_FACILITY_FD:
-                                       sec_rt.type = TAPI_SIM_PTYPE_PIN2;
-                                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                                       TAPI_EVENT_SIM_ENABLE_FDNMODE_CNF, appname, request_id, resp_en_facility->result,
-                                                       sizeof(TelSimSecResult_t), (void*) &sec_rt);
-                                       break;
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-                               case SIM_FACILITY_PN:
-                                       sec_rt.type = TAPI_SIM_PERS_NET;
-                               case SIM_FACILITY_PU:
-                                       sec_rt.type = TAPI_SIM_PERS_NS;
-                               case SIM_FACILITY_PP:
-                                       pers_rt.type = TAPI_SIM_PERS_SP;
-                               case SIM_FACILITY_PC:
-                                       pers_rt.type = TAPI_SIM_PERS_CP;
-                                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                                       TAPI_EVENT_SIM_ENABLE_PERS_CNF, appname, request_id, resp_en_facility->result, 0, NULL);
-                                       break;
-                               default:
-                                       break;
+                       if(resp_read->data.mailbox.voice1.DiallingnumLength){
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "type", g_variant_new_string("voice1"));
+                               g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(resp_read->data.mailbox.voice1.AlphaId));
+                               g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string(resp_read->data.mailbox.voice1.DiallingNum));
+                               g_variant_builder_add(&b, "{sv}", "ton", g_variant_new_int32(resp_read->data.mailbox.voice1.TypeOfNumber));
+                               g_variant_builder_close(&b);
                        }
-                       break;
 
-               case TRESP_SIM_TRANSMIT_APDU:
-                       dbg("dbus comm - TRESP_SIM_TRANSMIT_APDU");
-                       apdu_resp.apdu_resp_len = resp_apdu->apdu_resp_length;
-                       memcpy(apdu_resp.apdu_resp, resp_apdu->apdu_resp, apdu_resp.apdu_resp_len);
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_APDU_CNF, appname, request_id, resp_apdu->result,
-                                       sizeof(TelSimApduResp_t), (void*)&apdu_resp);
-                       break;
+                       if(resp_read->data.mailbox.voice2.DiallingnumLength){
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "type", g_variant_new_string("voice2"));
+                               g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(resp_read->data.mailbox.voice2.AlphaId));
+                               g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string(resp_read->data.mailbox.voice2.DiallingNum));
+                               g_variant_builder_add(&b, "{sv}", "ton", g_variant_new_int32(resp_read->data.mailbox.voice2.TypeOfNumber));
+                               g_variant_builder_close(&b);
+                       }
+
+                       if(resp_read->data.mailbox.fax.DiallingnumLength){
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "type", g_variant_new_string("fax"));
+                               g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(resp_read->data.mailbox.fax.AlphaId));
+                               g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string(resp_read->data.mailbox.fax.DiallingNum));
+                               g_variant_builder_add(&b, "{sv}", "ton", g_variant_new_int32(resp_read->data.mailbox.fax.TypeOfNumber));
+                               g_variant_builder_close(&b);
+                       }
 
-               case TRESP_SIM_GET_ATR:
-                       dbg("dbus comm - TRESP_SIM_GET_ATR");
-                       atr_resp.atr_resp_len = resp_get_atr->atr_length;
-                       memcpy(atr_resp.atr_resp, resp_get_atr->atr, atr_resp.atr_resp_len);
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_ATR_CNF, appname, request_id, resp_get_atr->result,
-                                       sizeof(TelSimAtrResp_t), (void*)&atr_resp);
+                       if(resp_read->data.mailbox.video.DiallingnumLength){
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "type", g_variant_new_string("video"));
+                               g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(resp_read->data.mailbox.video.AlphaId));
+                               g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string(resp_read->data.mailbox.video.DiallingNum));
+                               g_variant_builder_add(&b, "{sv}", "ton", g_variant_new_int32(resp_read->data.mailbox.video.TypeOfNumber));
+                               g_variant_builder_close(&b);
+                       }
+                       gv = g_variant_builder_end(&b);
+                       telephony_sim_complete_get_mailbox (dbus_info->interface_object, dbus_info->invocation,
+                                       resp_read->result,
+                                       gv);
+                       g_variant_unref(gv);
+               }
                        break;
 
-               case TRESP_SIM_REQ_AUTHENTICATION:
-                       dbg("dbus comm - TRESP_SIM_REQ_AUTHENTICATION");
-                       auth_resp.auth_result = resp_auth->auth_result;
-                       auth_resp.auth_type = resp_auth->auth_type;
-                       if(resp_auth->authentication_key_length) {
-                               auth_resp.authentication_key_length = resp_auth->authentication_key_length;
-                               memcpy(auth_resp.authentication_key, resp_auth->authentication_key, auth_resp.authentication_key_length);
+               case TRESP_SIM_GET_CPHS_INFO:
+                       dbg("resp comm - TRESP_SIM_GET_CPHS_INFO");
+                       telephony_sim_complete_get_cphsinfo (dbus_info->interface_object, dbus_info->invocation,
+                                       resp_read->result,
+                                       resp_read->data.cphs.CphsPhase,
+                                       resp_read->data.cphs.CphsServiceTable.bOperatorNameShortForm,
+                                       resp_read->data.cphs.CphsServiceTable.bMailBoxNumbers,
+                                       resp_read->data.cphs.CphsServiceTable.bServiceStringTable,
+                                       resp_read->data.cphs.CphsServiceTable.bCustomerServiceProfile,
+                                       resp_read->data.cphs.CphsServiceTable.bInformationNumbers);
+                       break;
+
+               case TRESP_SIM_GET_SPN:
+                       dbg("resp comm - TRESP_SIM_GET_SPN");
+                       telephony_sim_complete_get_spn (dbus_info->interface_object, dbus_info->invocation,
+                                       resp_read->result,
+                                       resp_read->data.spn.display_condition, (const gchar *)resp_read->data.spn.spn);
+                       break;
+
+               case TRESP_SIM_GET_CPHS_NETNAME:
+                       dbg("resp comm - TRESP_SIM_GET_CPHS_NETNAME");
+                       telephony_sim_complete_get_cphs_net_name (dbus_info->interface_object, dbus_info->invocation,
+                                       resp_read->result,
+                                       (const gchar *)resp_read->data.cphs_net.full_name, (const gchar *)resp_read->data.cphs_net.short_name);
+                       break;
+
+               case TRESP_SIM_GET_MSISDN:{
+                       GVariant *gv = NULL;
+                       GVariantBuilder b;
+                       dbg("resp comm - TRESP_SIM_GET_MSISDN");
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+
+                       for(i=0;i < resp_read->data.msisdn_list.count; i++){
+                               g_variant_builder_open(&b,G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string((const gchar *)resp_read->data.msisdn_list.msisdn[i].name));
+                               g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string((const gchar *)resp_read->data.msisdn_list.msisdn[i].num));
+                               g_variant_builder_close(&b);
                        }
-                       if(resp_auth->cipher_length) {
-                               auth_resp.cipher_length = resp_auth->cipher_length;
-                               memcpy(auth_resp.cipher_data, resp_auth->cipher_data, auth_resp.cipher_length);
+                       gv = g_variant_builder_end(&b);
+
+                       telephony_sim_complete_get_msisdn (dbus_info->interface_object, dbus_info->invocation,
+                                       resp_read->result,
+                                       gv);
+                       g_variant_unref(gv);
+               }
+                       break;
+
+               case TRESP_SIM_GET_OPLMNWACT:{
+                       GVariant *gv = NULL;
+                       GVariantBuilder b;
+                       dbg("resp comm - TRESP_SIM_GET_OPLMNWACT");
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+
+                       for(i=0;i < resp_read->data.opwa.opwa_count; i++){
+                               g_variant_builder_open(&b,G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "plmn", g_variant_new_string((const gchar *)resp_read->data.opwa.opwa[i].plmn));
+                               g_variant_builder_add(&b, "{sv}", "b_umts", g_variant_new_boolean(resp_read->data.opwa.opwa[i].b_umts));
+                               g_variant_builder_add(&b, "{sv}", "b_gsm", g_variant_new_boolean(resp_read->data.opwa.opwa[i].b_gsm));
+                               g_variant_builder_close(&b);
                        }
-                       if(resp_auth->integrity_length) {
-                               auth_resp.integrity_length = resp_auth->integrity_length;
-                               memcpy(auth_resp.integrity_data, resp_auth->integrity_data, auth_resp.integrity_length);
+                       gv = g_variant_builder_end(&b);
+
+                       telephony_sim_complete_get_oplmnwact (dbus_info->interface_object, dbus_info->invocation,
+                                       resp_read->result,
+                                       gv);
+                       g_variant_unref(gv);
+               }
+                       break;
+
+               case TRESP_SIM_REQ_AUTHENTICATION: {
+                       GVariantBuilder *builder = NULL;
+                       GVariant *ak = NULL;
+                       GVariant *cp = NULL;
+                       GVariant *it = NULL;
+                       GVariant *resp = NULL;
+                       GVariant *ak_gv = NULL;
+                       GVariant *cp_gv = NULL;
+                       GVariant *it_gv = NULL;
+                       GVariant *resp_gv = NULL;
+                       int i =0;
+
+                       dbg("resp comm - TRESP_SIM_REQ_AUTHENTICATION");
+
+                       builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
+                       for(i = 0; i < (int)resp_auth->authentication_key_length; i++) {
+                               dbg("resp_auth->authentication_key[%d][0x%02x]", i,resp_auth->authentication_key[i]);
+                               g_variant_builder_add (builder, "y", resp_auth->authentication_key[i]);
                        }
-                       if(resp_auth->resp_length) {
-                               auth_resp.resp_length = resp_auth->resp_length;
-                               memcpy(auth_resp.resp_data, resp_auth->resp_data, auth_resp.resp_length);
+                       ak = g_variant_builder_end(builder);
+                       ak_gv = g_variant_new("v", ak);
+
+                       builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
+                       for(i = 0; i < (int)resp_auth->cipher_length; i++) {
+                               dbg("resp_auth->cipher_data[%d][0x%02x]", i,resp_auth->cipher_data[i]);
+                               g_variant_builder_add (builder, "y", resp_auth->cipher_data[i]);
                        }
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM, TAPI_EVENT_SIM_AUTHENTICATION_CNF,
-                                       appname, request_id, resp_auth->result, sizeof(TelSimAuthenticationResponse_t),
-                                       (void*) &auth_resp);
-                       break;
+                       cp = g_variant_builder_end(builder);
+                       cp_gv = g_variant_new("v", cp);
 
-               case TRESP_SIM_SET_LANGUAGE:
-                       dbg("dbus comm - TRESP_SIM_SET_LANGUAGE");
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM, TAPI_EVENT_SIM_SET_LANGUAGE_CNF,
-                                       appname, request_id, resp_set_language->result, 0,NULL);
-                       break;
+                       builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
+                       for(i = 0; i < (int)resp_auth->integrity_length; i++) {
+                               dbg("resp_auth->integrity_data[%d][0x%02x]", i,resp_auth->integrity_data[i]);
+                               g_variant_builder_add (builder, "y", resp_auth->integrity_data[i]);
+                       }
+                       it = g_variant_builder_end(builder);
+                       it_gv = g_variant_new("v", it);
 
-               case TRESP_SIM_GET_ECC:
-                       dbg("dbus comm - TRESP_SIM_GET_ECC");
-                       dbg("resp_read->result[%x]",resp_read->result);
-                       if (tcore_sim_get_type(co_sim) == SIM_TYPE_GSM) {
-                               ctx->ecc_count = resp_read->data.ecc.ecc_count;
-                               if (strlen(resp_read->data.ecc.ecc[0].ecc_num))
-                                       snprintf(ctx->ecc.EccInfo.szEcc1, TAPI_SIM_ECC_CODE_LEN * 2 + 1, "%s", resp_read->data.ecc.ecc[0].ecc_num);
-                               if (strlen(resp_read->data.ecc.ecc[1].ecc_num))
-                                       snprintf(ctx->ecc.EccInfo.szEcc2, TAPI_SIM_ECC_CODE_LEN * 2 + 1, "%s", resp_read->data.ecc.ecc[1].ecc_num);
-                               if (strlen(resp_read->data.ecc.ecc[2].ecc_num))
-                                       snprintf(ctx->ecc.EccInfo.szEcc3, TAPI_SIM_ECC_CODE_LEN * 2 + 1, "%s", resp_read->data.ecc.ecc[2].ecc_num);
-                               if (strlen(resp_read->data.ecc.ecc[3].ecc_num))
-                                       snprintf(ctx->ecc.EccInfo.szEcc4, TAPI_SIM_ECC_CODE_LEN * 2 + 1, "%s", resp_read->data.ecc.ecc[3].ecc_num);
-                               if (strlen(resp_read->data.ecc.ecc[4].ecc_num))
-                                       snprintf(ctx->ecc.EccInfo.szEcc5, TAPI_SIM_ECC_CODE_LEN * 2 + 1, "%s", resp_read->data.ecc.ecc[4].ecc_num);
-                       } else if (tcore_sim_get_type(co_sim) == SIM_TYPE_USIM) {
-                               ctx->ecc_count = resp_read->data.ecc.ecc_count;
-                               for (i = 0; i < resp_read->data.ecc.ecc_count; i++) {
-                                       ctx->ecc.UeccInfo[i].EccLen = strlen(resp_read->data.ecc.ecc[i].ecc_num);
-                                       if (ctx->ecc.UeccInfo[i].EccLen) {
-                                               snprintf(ctx->ecc.UeccInfo[i].szEcc, ctx->ecc.UeccInfo[i].EccLen + 1, "%s",     resp_read->data.ecc.ecc[i].ecc_num);
-                                               ctx->ecc.UeccInfo[i].bUsed = 1;
-                                       }
-                                       if (strlen(resp_read->data.ecc.ecc[i].ecc_string))
-                                               snprintf( ctx->ecc.UeccInfo[i].szEccAlphaIdentifier, strlen(resp_read->data.ecc.ecc[i].ecc_string) + 1, "%s",   resp_read->data.ecc.ecc[i].ecc_string);
-                                       ctx->ecc.UeccInfo[i].EccEmergencyServiceInfo = resp_read->data.ecc.ecc[i].ecc_category;
-                               }
+                       builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
+                       for(i = 0; i < (int)resp_auth->resp_length; i++) {
+                               dbg("resp_auth->resp_data[%d][0x%02x]", i,resp_auth->resp_data[i]);
+                               g_variant_builder_add (builder, "y", resp_auth->resp_data[i]);
                        }
-                       break;
+                       resp = g_variant_builder_end(builder);
+                       resp_gv = g_variant_new("v", resp);
 
-               case TRESP_SIM_GET_LANGUAGE:
-                       dbg("dbus comm - TRESP_SIM_GET_LANGUAGE");
-                       dbg("resp_read->result[%x]",resp_read->result);
-                       ctx->language.LpCount = resp_read->data.language.language_count;
-                       for(i=0; i < (int)ctx->language.LpCount; i++)
-                               ctx->language.Lp[i] =   resp_read->data.language.language[i];
+                       telephony_sim_complete_authentication (dbus_info->interface_object, dbus_info->invocation,
+                                       resp_auth->result,
+                                       resp_auth->auth_type,
+                                       resp_auth->auth_result,
+                                       ak_gv,
+                                       cp_gv,
+                                       it_gv,
+                                       resp_gv);
+               }
                        break;
 
-               case TRESP_SIM_GET_ICCID:
-                       dbg("dbus comm - TRESP_SIM_GET_ICCID");
-                       dbg("resp_read->result[%x]",resp_read->result);
-                       ctx->iccid.icc_length = strlen(resp_read->data.iccid.iccid);
-                       if(ctx->iccid.icc_length > 0)
-                               memcpy(ctx->iccid.icc_num, resp_read->data.iccid.iccid, ctx->iccid.icc_length);
+               case TRESP_SIM_VERIFY_PINS:
+                       dbg("resp comm - TRESP_SIM_VERIFY_PINS");
+                       telephony_sim_complete_verify_sec(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_verify_pins->result,
+                                       resp_verify_pins->pin_type,
+                                       resp_verify_pins->retry_count);
                        break;
 
-               case TRESP_SIM_GET_MSISDN:
-                       dbg("dbus comm - TRESP_SIM_GET_MSISDN");
-                       dbg("resp_read->result[%x]",resp_read->result);
-                       if(resp_read->data.msisdn_list.count > 0) {
-                               dbg("resp_read->data.msisdn_list.msisdn[0].name[%s]",resp_read->data.msisdn_list.msisdn[0].name);
-                               dbg("resp_read->data.msisdn_list.msisdn[0].num[%s]",resp_read->data.msisdn_list.msisdn[0].num);
-                               tmp_msisdn = calloc(strlen((char *)resp_read->data.msisdn_list.msisdn[0].num)+2,1);
-                               if(resp_read->data.msisdn_list.msisdn[0].ton == SIM_TON_INTERNATIONAL){
-                                       dbg("current msisdn is international number");
-                                       tmp_msisdn[0] = '+';
-                                       snprintf(&tmp_msisdn[1], strlen((char *)resp_read->data.msisdn_list.msisdn[0].num)+1, "%s", resp_read->data.msisdn_list.msisdn[0].num);
-                               } else {
-                                       snprintf(tmp_msisdn, strlen((char *)resp_read->data.msisdn_list.msisdn[0].num)+1, "%s", resp_read->data.msisdn_list.msisdn[0].num);
-                               }
-                               if (tcore_storage_set_string(strg, STORAGE_KEY_TELEPHONY_SUBSCRIBER_NAME, (const char*) &resp_read->data.msisdn_list.msisdn[0].name) == FALSE )
-                                       dbg("[FAIL] UPDATE STORAGE_KEY_TELEPHONY_SUBSCRIBER_NAME");
-                               if (tcore_storage_set_string(strg, STORAGE_KEY_TELEPHONY_SUBSCRIBER_NUMBER, (const char*) tmp_msisdn) == FALSE )
-                                               dbg("[FAIL] UPDATE STORAGE_KEY_TELEPHONY_SUBSCRIBER_NUMBER");
-
-                               g_free(tmp_msisdn);
-                       }
-
-
+               case TRESP_SIM_VERIFY_PUKS:
+                       dbg("resp comm - TRESP_SIM_VERIFY_PUKS");
+                       telephony_sim_complete_verify_puk (dbus_info->interface_object, dbus_info->invocation,
+                                       resp_verify_puks->result,
+                                       resp_verify_puks->pin_type,
+                                       resp_verify_puks->retry_count);
                        break;
 
-               case TRESP_SIM_GET_MAILBOX:
-               case TRESP_SIM_GET_CALLFORWARDING:
-               case TRESP_SIM_GET_MESSAGEWAITING:
-               case TRESP_SIM_GET_CPHS_INFO:
-               case TRESP_SIM_GET_OPLMNWACT:
+               case TRESP_SIM_CHANGE_PINS:
+                       dbg("resp comm - TRESP_SIM_CHANGE_PINS");
+                       telephony_sim_complete_change_pin(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_change_pins->result,
+                                       resp_change_pins->pin_type,
+                                       resp_change_pins->retry_count);
                        break;
 
-               case TRESP_PHONEBOOK_GETCOUNT:
-                       dbg("dbus comm - TRESP_PHONEBOOK_GETCOUNT");
-                       switch(resp_pbcnt->type){
-                               case PB_TYPE_FDN:
-                                       lpb_cnt.StorageFileType = TAPI_SIM_PB_FDN;
+               case TRESP_SIM_DISABLE_FACILITY:
+                       dbg("resp comm - TRESP_SIM_DISABLE_FACILITY");
+                       dbg("resp_dis_facility->type[%d]", resp_dis_facility->type);
+                       switch (resp_dis_facility->type) {
+                               case SIM_FACILITY_PS:
+                                       f_type = 1;
                                        break;
-                               case PB_TYPE_ADN:
-                                       lpb_cnt.StorageFileType = TAPI_SIM_PB_ADN;
+                               case SIM_FACILITY_SC:
+                                       f_type = 3;
+                                       break;
+                               case SIM_FACILITY_FD:
+                                       f_type = 4;
                                        break;
-                               case PB_TYPE_SDN:
-                                       lpb_cnt.StorageFileType = TAPI_SIM_PB_SDN;
+                               case SIM_FACILITY_PN:
+                                       f_type = 5;
                                        break;
-                               case PB_TYPE_USIM:
-                                       lpb_cnt.StorageFileType = TAPI_SIM_PB_3GSIM;
+                               case SIM_FACILITY_PU:
+                                       f_type = 6;
                                        break;
-                               case PB_TYPE_AAS:
-                                       lpb_cnt.StorageFileType = TAPI_SIM_PB_AAS;
+                               case SIM_FACILITY_PP:
+                                       f_type = 7;
                                        break;
-                               case PB_TYPE_GAS:
-                                       lpb_cnt.StorageFileType = TAPI_SIM_PB_GAS;
+                               case SIM_FACILITY_PC:
+                                       f_type = 8;
                                        break;
                                default:
-                                       dbg("not handled type[%d]",resp_pbcnt->type);
+                                       dbg("error - not handled type[%d]", resp_dis_facility->type);
                                        break;
                        }
-                       lpb_cnt.UsedRecordCount = resp_pbcnt->used_count;
-                       lpb_cnt.TotalRecordCount = resp_pbcnt->total_count;
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF, appname, request_id, resp_pbcnt->result,
-                                       sizeof(TelSimPbStorageInfo_t), (void*) &lpb_cnt);
+                       telephony_sim_complete_disable_facility(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_dis_facility->result,
+                                       f_type,
+                                       resp_dis_facility->retry_count);
                        break;
 
-               case TRESP_PHONEBOOK_GETMETAINFO:
-                       dbg("dbus comm - TRESP_PHONEBOOK_GETMETAINFO");
-                       switch(resp_entry->type){
-                               case PB_TYPE_FDN:
-                                       lpb_entry.StorageFileType = TAPI_SIM_PB_FDN;
+               case TRESP_SIM_ENABLE_FACILITY:
+                       dbg("resp comm - TRESP_SIM_ENABLE_FACILITY");
+                       dbg("resp_en_facility->type[%d]", resp_en_facility->type);
+                       switch (resp_en_facility->type) {
+                               case SIM_FACILITY_PS:
+                                       f_type = 1;
+                                       break;
+                               case SIM_FACILITY_SC:
+                                       f_type = 3;
                                        break;
-                               case PB_TYPE_ADN:
-                                       lpb_entry.StorageFileType = TAPI_SIM_PB_ADN;
+                               case SIM_FACILITY_FD:
+                                       f_type = 4;
                                        break;
-                               case PB_TYPE_SDN:
-                                       lpb_entry.StorageFileType = TAPI_SIM_PB_SDN;
+                               case SIM_FACILITY_PN:
+                                       f_type = 5;
                                        break;
-                               case PB_TYPE_USIM:
-                                       lpb_entry.StorageFileType = TAPI_SIM_PB_3GSIM;
+                               case SIM_FACILITY_PU:
+                                       f_type = 6;
                                        break;
-                               case PB_TYPE_AAS:
-                                       lpb_entry.StorageFileType = TAPI_SIM_PB_AAS;
+                               case SIM_FACILITY_PP:
+                                       f_type = 7;
                                        break;
-                               case PB_TYPE_GAS:
-                                       lpb_entry.StorageFileType = TAPI_SIM_PB_GAS;
+                               case SIM_FACILITY_PC:
+                                       f_type = 8;
                                        break;
                                default:
-                                       dbg("not handled type[%d]",resp_entry->type);
+                                       dbg("error - not handled type[%d]", resp_en_facility->type);
                                        break;
                        }
-                       lpb_entry.PbIndexMax =  resp_entry->index_max;
-                       lpb_entry.PbIndexMin = resp_entry->index_min;
-                       lpb_entry.PbNumLenMax = resp_entry->number_length_max;
-                       lpb_entry.PbTextLenMax = resp_entry->text_length_max;
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF, appname, request_id, resp_entry->result,
-                                       sizeof(TelSimPbEntryInfo_t), (void*) &lpb_entry);
+                       telephony_sim_complete_enable_facility(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_en_facility->result,
+                                       f_type,
+                                       resp_en_facility->retry_count);
                        break;
 
-               case TRESP_PHONEBOOK_GETUSIMINFO:
-                       dbg("dbus comm - TRESP_PHONEBOOK_GETUSIMINFO");
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_PB_CAPABILITY_INFO_CNF, appname, request_id, resp_capa->result,
-                                       sizeof(TelSimPbCapabilityInfo_t), (void*) &lpb_capa);
-                       break;
-
-               case TRESP_PHONEBOOK_READRECORD:
-                       dbg("dbus comm - TRESP_PHONEBOOK_READRECORD");
-                       lcpb_data.index = resp_pbread->index;
-                       lcpb_data.next_index = resp_pbread->next_index;
-
-                       switch(resp_pbread->phonebook_type){
-                               case PB_TYPE_FDN:
-                                       lcpb_data.phonebook_type = TAPI_SIM_PB_FDN;
+               case TRESP_SIM_GET_FACILITY_STATUS:
+                       dbg("resp comm - TRESP_SIM_GET_FACILITY_STATUS");
+                       dbg("resp_get_facility->type[%d]", resp_get_facility->type);
+                       switch (resp_get_facility->type) {
+                               case SIM_FACILITY_PS:
+                                       f_type = 1;
+                                       break;
+                               case SIM_FACILITY_SC:
+                                       f_type = 3;
                                        break;
-                               case PB_TYPE_ADN:
-                                       lcpb_data.phonebook_type = TAPI_SIM_PB_ADN;
+                               case SIM_FACILITY_FD:
+                                       f_type = 4;
                                        break;
-                               case PB_TYPE_SDN:
-                                       lcpb_data.phonebook_type = TAPI_SIM_PB_SDN;
+                               case SIM_FACILITY_PN:
+                                       f_type = 5;
                                        break;
-                               case PB_TYPE_USIM:
-                                       lcpb_data.phonebook_type = TAPI_SIM_PB_3GSIM;
+                               case SIM_FACILITY_PU:
+                                       f_type = 6;
                                        break;
-                               case PB_TYPE_AAS:
-                                       lcpb_data.phonebook_type = TAPI_SIM_PB_AAS;
+                               case SIM_FACILITY_PP:
+                                       f_type = 7;
                                        break;
-                               case PB_TYPE_GAS:
-                                       lcpb_data.phonebook_type = TAPI_SIM_PB_GAS;
+                               case SIM_FACILITY_PC:
+                                       f_type = 8;
                                        break;
                                default:
-                                       dbg("not handled type[%d]",resp_pbread->phonebook_type);
+                                       dbg("error - not handled type[%d]", resp_get_facility->type);
                                        break;
                        }
-                       if(strlen((char*)resp_pbread->name)) {
-                               snprintf((char *)lcpb_data.name, strlen((char*)resp_pbread->name)+1, "%s", resp_pbread->name);
-                               switch( resp_pbread->dcs ){
-                                       case PB_TEXT_ASCII :
-                                               lcpb_data.dcs = TAPI_SIM_TEXT_ENC_ASCII;
-                                               break;
-                                       case PB_TEXT_GSM7BIT :
-                                               lcpb_data.dcs = TAPI_SIM_TEXT_ENC_GSM7BIT;
-                                               break;
-                                       case PB_TEXT_UCS2 :
-                                               lcpb_data.dcs = TAPI_SIM_TEXT_ENC_UCS2;
-                                               break;
-                                       case PB_TEXT_HEX :
-                                               lcpb_data.dcs = TAPI_SIM_TEXT_ENC_HEX;
-                                               break;
-                                       default:
-                                               dbg("not handled pb type[%d]", resp_pbread->dcs);
-                                               break;
-                               }
-                       }
-                       if(strlen((char*)resp_pbread->number)) {
-                               snprintf((char *)lcpb_data.number, strlen((char*)resp_pbread->number)+1, "%s", resp_pbread->number);
-                               switch( resp_pbread->ton ){
-                                       case PB_TON_UNKNOWN :
-                                               lcpb_data.ton = TAPI_SIM_TON_UNKNOWN;
-                                               break;
-                                       case PB_TON_INTERNATIONAL :
-                                               lcpb_data.ton = TAPI_SIM_TON_INTERNATIONAL;
-                                               break;
-                                       case PB_TON_NATIONAL :
-                                               lcpb_data.ton = TAPI_SIM_TON_NATIONAL;
-                                               break;
-                                       case PB_TON_NETWORK_SPECIFIC :
-                                               lcpb_data.ton = TAPI_SIM_TON_NETWORK_SPECIFIC;
-                                               break;
-                                       case PB_TON_DEDICATED_ACCESS :
-                                               lcpb_data.ton = TAPI_SIM_TON_DEDICATED_ACCESS;
-                                               break;
-                                       case PB_TON_ALPHA_NUMERIC :
-                                               lcpb_data.ton = TAPI_SIM_TON_ALPHA_NUMERIC;
-                                               break;
-                                       case PB_TON_ABBREVIATED_NUMBER :
-                                               lcpb_data.ton = TAPI_SIM_TON_ABBREVIATED_NUMBER;
-                                               break;
-                                       case PB_TON_RESERVED_FOR_EXT :
-                                               lcpb_data.ton = TAPI_SIM_TON_RESERVED_FOR_EXT;
-                                               break;
-                                       default:
-                                               dbg("not handled pb ton[%d]", resp_pbread->ton);
-                                               break;
-                               }
-                       }
+                       telephony_sim_complete_get_facility(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_get_facility->result,
+                                       f_type,
+                                       resp_get_facility->b_enable);
+                       break;
 
-                       if(strlen((char*)resp_pbread->anr1)) {
-                               snprintf((char *)lcpb_data.anr1, strlen((char*)resp_pbread->anr1)+1, "%s", resp_pbread->anr1);
-                               switch( resp_pbread->anr1_ton ){
-                                       case PB_TON_UNKNOWN :
-                                               lcpb_data.anr1_ton = TAPI_SIM_TON_UNKNOWN;
-                                               break;
-                                       case PB_TON_INTERNATIONAL :
-                                               lcpb_data.anr1_ton = TAPI_SIM_TON_INTERNATIONAL;
-                                               break;
-                                       case PB_TON_NATIONAL :
-                                               lcpb_data.anr1_ton = TAPI_SIM_TON_NATIONAL;
-                                               break;
-                                       case PB_TON_NETWORK_SPECIFIC :
-                                               lcpb_data.anr1_ton = TAPI_SIM_TON_NETWORK_SPECIFIC;
-                                               break;
-                                       case PB_TON_DEDICATED_ACCESS :
-                                               lcpb_data.anr1_ton = TAPI_SIM_TON_DEDICATED_ACCESS;
-                                               break;
-                                       case PB_TON_ALPHA_NUMERIC :
-                                               lcpb_data.anr1_ton = TAPI_SIM_TON_ALPHA_NUMERIC;
-                                               break;
-                                       case PB_TON_ABBREVIATED_NUMBER :
-                                               lcpb_data.anr1_ton = TAPI_SIM_TON_ABBREVIATED_NUMBER;
-                                               break;
-                                       case PB_TON_RESERVED_FOR_EXT :
-                                               lcpb_data.anr1_ton = TAPI_SIM_TON_RESERVED_FOR_EXT;
-                                               break;
-                                       default:
-                                               dbg("not handled pb anr1_ton[%d]", resp_pbread->anr1_ton);
-                                               break;
-                               }
+               case TRESP_SIM_GET_LOCK_INFO:
+                       dbg("resp comm - TRESP_SIM_GET_LOCK_INFO");
+                       dbg("resp_lock->type[%d]", resp_lock->type);
+                       switch (resp_lock->type) {
+                               case SIM_FACILITY_PS:
+                                       f_type = 1;
+                                       break;
+                               case SIM_FACILITY_SC:
+                                       f_type = 3;
+                                       break;
+                               case SIM_FACILITY_FD:
+                                       f_type = 4;
+                                       break;
+                               case SIM_FACILITY_PN:
+                                       f_type = 5;
+                                       break;
+                               case SIM_FACILITY_PU:
+                                       f_type = 6;
+                                       break;
+                               case SIM_FACILITY_PP:
+                                       f_type = 7;
+                                       break;
+                               case SIM_FACILITY_PC:
+                                       f_type = 8;
+                                       break;
+                               default:
+                                       dbg("error - not handled type[%d]", resp_lock->type);
+                                       break;
                        }
-
-                       if(strlen((char*)resp_pbread->anr2)) {
-                               snprintf((char *)lcpb_data.anr2, strlen((char*)resp_pbread->anr2)+1, "%s", resp_pbread->anr2);
-                               switch( resp_pbread->anr2_ton ){
-                                       case PB_TON_UNKNOWN :
-                                               lcpb_data.anr2_ton = TAPI_SIM_TON_UNKNOWN;
-                                               break;
-                                       case PB_TON_INTERNATIONAL :
-                                               lcpb_data.anr2_ton = TAPI_SIM_TON_INTERNATIONAL;
-                                               break;
-                                       case PB_TON_NATIONAL :
-                                               lcpb_data.anr2_ton = TAPI_SIM_TON_NATIONAL;
-                                               break;
-                                       case PB_TON_NETWORK_SPECIFIC :
-                                               lcpb_data.anr2_ton = TAPI_SIM_TON_NETWORK_SPECIFIC;
-                                               break;
-                                       case PB_TON_DEDICATED_ACCESS :
-                                               lcpb_data.anr2_ton = TAPI_SIM_TON_DEDICATED_ACCESS;
-                                               break;
-                                       case PB_TON_ALPHA_NUMERIC :
-                                               lcpb_data.anr2_ton = TAPI_SIM_TON_ALPHA_NUMERIC;
-                                               break;
-                                       case PB_TON_ABBREVIATED_NUMBER :
-                                               lcpb_data.anr2_ton = TAPI_SIM_TON_ABBREVIATED_NUMBER;
-                                               break;
-                                       case PB_TON_RESERVED_FOR_EXT :
-                                               lcpb_data.anr2_ton = TAPI_SIM_TON_RESERVED_FOR_EXT;
-                                               break;
-                                       default:
-                                               dbg("not handled pb anr2_ton[%d]", resp_pbread->anr2_ton);
-                                               break;
-                               }
+                       telephony_sim_complete_get_lock_info(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_lock->result,
+                                       f_type,
+                                       resp_lock->lock_status,
+                                       resp_lock->retry_count);
+                       break;
+
+               case TRESP_SIM_TRANSMIT_APDU: {
+                       GVariantBuilder *builder = NULL;
+                       GVariant * apdu_gv = NULL;
+                       GVariant *inner_gv = NULL;
+                       int i =0;
+
+                       dbg("resp comm - TRESP_SIM_TRANSMIT_APDU");
+                       builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
+                       for(i = 0; i < (int)resp_apdu->apdu_resp_length; i++) {
+                               dbg("resp_apdu->apdu_resp[%d][0x%02x]", i,resp_apdu->apdu_resp[i]);
+                               g_variant_builder_add (builder, "y", resp_apdu->apdu_resp[i]);
                        }
-
-                       if(strlen((char*)resp_pbread->anr3)) {
-                               snprintf((char *)lcpb_data.anr3, strlen((char*)resp_pbread->anr3)+1, "%s", resp_pbread->anr3);
-                               switch( resp_pbread->anr3_ton ){
-                                       case PB_TON_UNKNOWN :
-                                               lcpb_data.anr3_ton = TAPI_SIM_TON_UNKNOWN;
-                                               break;
-                                       case PB_TON_INTERNATIONAL :
-                                               lcpb_data.anr3_ton = TAPI_SIM_TON_INTERNATIONAL;
-                                               break;
-                                       case PB_TON_NATIONAL :
-                                               lcpb_data.anr3_ton = TAPI_SIM_TON_NATIONAL;
-                                               break;
-                                       case PB_TON_NETWORK_SPECIFIC :
-                                               lcpb_data.anr3_ton = TAPI_SIM_TON_NETWORK_SPECIFIC;
-                                               break;
-                                       case PB_TON_DEDICATED_ACCESS :
-                                               lcpb_data.anr3_ton = TAPI_SIM_TON_DEDICATED_ACCESS;
-                                               break;
-                                       case PB_TON_ALPHA_NUMERIC :
-                                               lcpb_data.anr3_ton = TAPI_SIM_TON_ALPHA_NUMERIC;
-                                               break;
-                                       case PB_TON_ABBREVIATED_NUMBER :
-                                               lcpb_data.anr3_ton = TAPI_SIM_TON_ABBREVIATED_NUMBER;
-                                               break;
-                                       case PB_TON_RESERVED_FOR_EXT :
-                                               lcpb_data.anr3_ton = TAPI_SIM_TON_RESERVED_FOR_EXT;
-                                               break;
-                                       default:
-                                               dbg("not handled pb anr3_ton[%d]", resp_pbread->anr3_ton);
-                                               break;
-                               }
+                       inner_gv = g_variant_builder_end(builder);
+/*                     g_variant_builder_unref (builder);*/
+                       apdu_gv = g_variant_new("v", inner_gv);
+
+                       telephony_sim_complete_transfer_apdu(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_apdu->result,
+                                       apdu_gv);
+               }
+                       break;
+
+               case TRESP_SIM_GET_ATR:{
+                       GVariantBuilder *builder = NULL;
+                       GVariant * atr_gv = NULL;
+                       GVariant *inner_gv = NULL;
+                       int i =0;
+
+                       dbg("resp comm - TRESP_SIM_GET_ATR");
+                       builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
+                       for(i = 0; i < (int)resp_get_atr->atr_length; i++) {
+                               dbg("resp_apdu->apdu_resp[%d][0x%02x]", i,resp_get_atr->atr[i]);
+                               g_variant_builder_add (builder, "y", resp_get_atr->atr[i]);
                        }
+                       inner_gv = g_variant_builder_end(builder);
+/*                     g_variant_builder_unref (builder);*/
+                       atr_gv = g_variant_new("v", inner_gv);
 
-                       if(strlen((char*)resp_pbread->email1))
-                               snprintf((char *)lcpb_data.email1, strlen((char*)resp_pbread->email1)+1, "%s", resp_pbread->email1);
-                       if(strlen((char*)resp_pbread->email2))
-                               snprintf((char *)lcpb_data.email2, strlen((char*)resp_pbread->email2)+1, "%s", resp_pbread->email2);
-                       if(strlen((char*)resp_pbread->email3))
-                               snprintf((char *)lcpb_data.email3, strlen((char*)resp_pbread->email3)+1, "%s", resp_pbread->email3);
-                       if(strlen((char*)resp_pbread->email4))
-                               snprintf((char *)lcpb_data.email4, strlen((char*)resp_pbread->email4)+1, "%s", resp_pbread->email4);
-
-                       lcpb_data.group_index = resp_pbread->group_index;
-                       lcpb_data.pb_control = resp_pbread->pb_control;
-
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_PB_ACCESS_READ_CNF, appname, request_id, resp_pbread->result,
-                                       sizeof(TelSimPbRecordData_t), (void*) &lcpb_data);
-                       break;
-
-               case TRESP_PHONEBOOK_UPDATERECORD:
-                       dbg("dbus comm - TRESP_PHONEBOOK_UPDATERECORD");
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_PB_UPDATE_CNF, appname, request_id, resp_pbupdate->result,
-                                       0,NULL);
-                       break;
-
-               case TRESP_PHONEBOOK_DELETERECORD:
-                       dbg("dbus comm - TRESP_PHONEBOOK_DELETERECORD");
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_PB_DELETE_CNF, appname, request_id, resp_pbdelete->result,
-                                       0,NULL);
-                       break;
-
-               case TRESP_SAP_REQ_CONNECT:
-                       lsa_conn.ConnectionStatus = sap_conn->status;
-                       lsa_conn.MaxMsgSize = sap_conn->max_msg_size;
-                       lsa_conn.MsgId = TAPI_SIM_SAP_CONNECT_RESP;
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_SAP_CONNECT_CNF, appname, request_id, TAPI_SIM_ACCESS_SUCCESS,
-                                       sizeof(TelSimSapConnect_t), (void*) &lsa_conn);
-                       break;
-
-               case TRESP_SAP_REQ_DISCONNECT:
-                       lsa_disconn.MsgId = TAPI_SIM_SAP_DISCONNECT_RESP;
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_SAP_CONNECT_CNF, appname, request_id, TAPI_SIM_ACCESS_SUCCESS,
-                                       sizeof(TelSimSapConnect_t), (void*) &lsa_disconn);
-                       break;
-
-               case TRESP_SAP_REQ_STATUS:
-                       lsa_status = sap_status->status;
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_SAP_CONNECT_STATUS_CNF, appname, request_id,
-                                       TAPI_SIM_ACCESS_SUCCESS, sizeof(unsigned int), (void*) &lsa_status);
-                       break;
-
-               case TRESP_SAP_REQ_ATR:
-                       lsa_atr.AtrResult = sap_atr->result;
-                       lsa_atr.AtrLength = sap_atr->atr_length;
-                       memcpy(lsa_atr.AtrData, sap_atr->atr, lsa_atr.AtrLength);
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_SAP_TRANSFER_ATR_CNF, appname, request_id,
-                                       TAPI_SIM_ACCESS_SUCCESS, sizeof(TelSimSapAtrInfo_t), (void*) &lsa_atr);
-                       break;
-
-               case TRESP_SAP_TRANSFER_APDU:
-                       lsa_apdu.ApduLength = sap_apdu->resp_apdu_length;
-                       memcpy(lsa_apdu.Apdu, sap_apdu->resp_adpdu, lsa_apdu.ApduLength);
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_SAP_TRANSFER_APDU_CNF, appname, request_id,
-                                       TAPI_SIM_ACCESS_SUCCESS, sizeof(TelSimSapApduData_t), (void*) &lsa_apdu);
-                       break;
-
-               case TRESP_SAP_SET_PROTOCOL:
-                       lsa_result_code = sap_protocol->result;
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_SAP_SET_PROTOCOL_CNF, appname, request_id,
-                                       TAPI_SIM_ACCESS_SUCCESS, sizeof(TelSimSapResultCode_t),
-                                       (void*) &lsa_result_code);
-                       break;
-
-               case TRESP_SAP_SET_POWER:
-                       lsa_power.SimPowerResult = sap_power->result;
-                       lsa_power.MsgId = 0; //NOT SUPPORTED FROM NOW
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_SAP_SET_SIM_POWER_CNF, appname, request_id,
-                                       TAPI_SIM_ACCESS_SUCCESS, sizeof(TelSimSapPower_t), (void*) &lsa_power);
-                       break;
-
-               case TRESP_SAP_REQ_CARDREADERSTATUS:
-                       lsa_reader.CardReaderResult = sap_reader->result;
-                       lsa_reader.CardReaderStatus = sap_reader->reader_status;
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM,
-                                       TAPI_EVENT_SIM_SAP_CARD_READER_STATUS_CNF, appname, request_id,
-                                       TAPI_SIM_ACCESS_SUCCESS, sizeof(TelSimCardReaderStatus_t), (void*) &lsa_reader);
+                       telephony_sim_complete_get_atr(dbus_info->interface_object, dbus_info->invocation,
+                                       resp_get_atr->result,
+                                       atr_gv);
+               }
                        break;
 
                default:
+                       dbg("not handled TRESP type[%d]", command);
                        break;
        }
        return TRUE;
 }
 
-TReturn dbus_notification_sim(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
+gboolean dbus_plugin_sim_notification(struct custom_data *ctx, const char *plugin_name,
+               TelephonyObjectSkeleton *object, enum tcore_notification_command command,
                unsigned int data_len, const void *data)
 {
-       const struct tnoti_sap_status_changed *n_sap_status = data;
-       const struct tnoti_sap_disconnect *n_sap_disconn = data;
+       TelephonySim *sim;
        const struct tnoti_sim_status *n_sim_status = data;
 
-       switch (command) {
-               case TNOTI_SIM_STATUS:
-                       dbg("notified sim_status[%d]", n_sim_status->sim_status);
-                       dbus_sim_data_request(ctx, source,n_sim_status->sim_status);
-                       if(n_sim_status->sim_status == SIM_STATUS_INIT_COMPLETED)
-                               dbus_sim_security_request(ctx, source);
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM, TAPI_EVENT_SIM_STATUS_IND,
-                                       NULL, TAPI_SIM_REQUEST_ID_FOR_NOTI, n_sim_status->sim_status, 0, NULL);
-                       break;
+       if (!object) {
+               dbg("object is NULL");
+               return FALSE;
+       }
 
-               case TNOTI_SAP_STATUS:
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM, TAPI_EVENT_SIM_SAP_CONNECT_STATUS_CNF,
-                                       NULL, TAPI_SIM_REQUEST_ID_FOR_NOTI, TAPI_SIM_ACCESS_SUCCESS, sizeof(enum tel_sap_status_change), (void*)&n_sap_status->status);
-                       break;
+       sim = telephony_object_peek_sim(TELEPHONY_OBJECT(object));
+       dbg("sim = %p", sim);
 
-               case TNOTI_SAP_DISCONNECT:
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM, TAPI_EVENT_SIM_SAP_CONNECT_NOTI,
-                                       NULL, TAPI_SIM_REQUEST_ID_FOR_NOTI, TAPI_SIM_ACCESS_SUCCESS, sizeof(enum tel_sap_disconnect_type), (void*)&n_sap_disconn->type);
-                       break;
+       dbg("notification !!! (command = 0x%x, data_len = %d)", command, data_len);
 
-               case TNOTI_PHONEBOOK_STATUS :
-                       return ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_SIM, TAPI_EVENT_SIM_FDN_STATUS_IND,
-                                       NULL, TAPI_SIM_REQUEST_ID_FOR_NOTI, TAPI_SIM_PB_SUCCESS, 0, NULL);
+       switch (command) {
+               case TNOTI_SIM_STATUS:
+                       dbg("notified sim_status[%d]", n_sim_status->sim_status);
+                       dbus_sim_data_request(ctx, n_sim_status->sim_status);
+                       telephony_sim_emit_status (sim, n_sim_status->sim_status);
                        break;
 
-               default :
-                       break;
+               default:
+               dbg("not handled command[%d]", command);
+               break;
        }
 
        return TRUE;
 }
-
index 78ea02a2f22f593d9ff84a35f40aa492a39a1eab..dd8575948e6c9da07ff6774a21d96cecf887e3c9 100644 (file)
--- a/src/sms.c
+++ b/src/sms.c
@@ -1,5 +1,5 @@
 /*
- * tel-plugin-dbus-tapi
+ * tel-plugin-socket-communicator
  *
  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
  *
 
 #include <stdio.h>
 #include <string.h>
-#include <assert.h>
+#include <pthread.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <time.h>
 #include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
 
 #include <tcore.h>
-#include <plugin.h>
 #include <server.h>
+#include <plugin.h>
+#include <hal.h>
+#include <communicator.h>
 #include <storage.h>
+#include <queue.h>
 #include <user_request.h>
 #include <co_sms.h>
-#include <communicator.h>
-
-#include <TapiCommon.h>
-#include <TelNetText.h>
 
-#include "tel_cs_conn.h"
+#include "generated-code.h"
 #include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "ts_noti.h"
-#include "modules.h"
-
-void dbus_request_sms(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
-{
-       /* legacy telephony */
-       int api_err = TAPI_API_SUCCESS;
-       tapi_dbus_connection_name conn_name;
 
-       /* new telephony */
+TReturn        ret = TCORE_RETURN_SUCCESS;
+
+static gboolean
+on_sms_send_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       const gchar *sca,
+       gint tpdu_length,
+       const gchar *tpdu_data,
+       gint moreMsg,
+       gpointer user_data)
+{
        struct treq_sms_send_umts_msg sendUmtsMsg;
-       struct treq_sms_send_cdma_msg cdmaMsg;
-       struct treq_sms_read_msg readMsg;
-       struct treq_sms_save_msg saveMsg;
-       struct treq_sms_delete_msg deleteMsg;
-       struct treq_sms_get_msg_count getMsgCnt;
-       struct treq_sms_get_sca getSca;
-       struct treq_sms_set_sca setSca;
-       struct treq_sms_get_cb_config getCbConfig;
-       struct treq_sms_set_cb_config setCbConfig;
-       struct treq_sms_set_mem_status memStatus;
-       struct treq_sms_get_pref_brearer getPrefBrearer;
-       struct treq_sms_set_pref_brearer setPrefBrearer;
-       struct treq_sms_set_delivery_report deliveryReport;
-       struct treq_sms_set_msg_status msgStatus;
-       struct treq_sms_get_params getParams;
-       struct treq_sms_set_params setParams;
-       struct treq_sms_get_paramcnt getParamCnt;
-       GSList *co_smslist = NULL;
-       CoreObject *co_sms = NULL;
+       struct custom_data *ctx = user_data;
        UserRequest *ur = NULL;
-       struct tcore_user_info ui = { 0, 0, 0, NULL };
-       TReturn ret = TCORE_RETURN_SUCCESS;
-       int request_id = 0;
 
-       conn_name = g_array_index(in_param4, tapi_dbus_connection_name, 0);
+       gsize length;
+       guchar *decoded_sca = NULL;
+       guchar *decoded_tpdu = NULL;
 
-       co_smslist = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_SMS);
-       if (!co_smslist) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               dbg("[SMS_ERR] = 0x%x", api_err);
-               goto OUT;
-       }
+       memset(&sendUmtsMsg, 0 , sizeof(struct treq_sms_send_umts_msg));
 
-       co_sms = (CoreObject *)co_smslist->data;
-       g_slist_free(co_smslist);
+       decoded_sca = g_base64_decode(sca, &length);
+       memcpy(&(sendUmtsMsg.msgDataPackage.sca[0]), decoded_sca, SMS_SMSP_ADDRESS_LEN);
 
-       if (!co_sms) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               dbg("[SMS_ERR] = 0x%x", api_err);
-               goto OUT;
+       sendUmtsMsg.msgDataPackage.msgLength = tpdu_length;
+       dbg("tpdu_length = 0x%x", tpdu_length);
+
+       decoded_tpdu = g_base64_decode(tpdu_data, &length);
+       memcpy(&(sendUmtsMsg.msgDataPackage.tpduData[0]), decoded_tpdu, SMS_SMDATA_SIZE_MAX + 1);
+       sendUmtsMsg.more = moreMsg;
+
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_send_umts_msg), &sendUmtsMsg);
+       tcore_user_request_set_command(ur, TREQ_SMS_SEND_UMTS_MSG);
+
+       if(decoded_sca)
+               g_free(decoded_sca);
+       
+       if(decoded_tpdu)
+               g_free(decoded_tpdu);
+
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               // api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+               return  FALSE;
        }
+               
+       return  TRUE;
+}
+/*
 
-       ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
-       ui.appname = conn_name.name;
-       tcore_user_request_set_user_info(ur, &ui);
+static gboolean
+on_sms_send_cdma_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       const gchar *sca,
+       gint tpdu_length,
+       const gchar *tpdu_data,
+       gint moreMsg,
+       gpointer user_data)
+{
+#if 0
+       cdmaMsg.more = sipc_util_marshal_object_get_int(in_obj, "More");
+       cdmaMsg.cdmaMsgInfo.ParamMask = sipc_util_marshal_object_get_int(in_obj, "ParamMask");
+       cdmaMsg.cdmaMsgInfo.MsgType = sipc_util_marshal_object_get_int(in_obj, "MsgType");
+
+       switch(cdmaMsg.cdmaMsgInfo.MsgType)
+       {
+               case SMS_MESSAGETYPE_SUBMIT: {
+                       gchar *dstAddr_szAddress;
+                       gchar *dstSubAddr_szAddress;
+                       gchar *szData;
+                       gchar *callBackNumer_szAddress;
+
+                        Origination address
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.Digit = sipc_util_marshal_object_get_int(in_obj, "DstAddr.Digit");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.NumberMode = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberMode");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.NumberType = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberType");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.NumberPlan = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberPlan");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstAddr.szAddrLength");
+                       dstAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstAddr.szAddress");
+                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.szAddress[0]), dstAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
+
+                        Origination subaddress
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstSubAddr.SubType = sipc_util_marshal_object_get_int(in_obj, "DstSubAddr.SubType");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstSubAddr.Odd = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.Odd");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstSubAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.szAddrLength");
+                       dstSubAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstSubAddr.szAddress");
+                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstSubAddr.szAddress[0]), dstSubAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
+
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.TeleService = sipc_util_marshal_object_get_int(in_obj, "TeleService");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.bBearerReplySeqRequest = sipc_util_marshal_object_get_int(in_obj, "bBearerReplySeqRequest");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ReplySeqNumber = sipc_util_marshal_object_get_char(in_obj, "ReplySeqNumber");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.MsgId = sipc_util_marshal_object_get_int(in_obj, "MsgId");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.MsgEncoding = sipc_util_marshal_object_get_int(in_obj, "MsgEncoding");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.MsgLength = sipc_util_marshal_object_get_int(in_obj, "MsgLength");
+                       szData = sipc_util_marshal_object_get_string(in_obj, "szData");
+                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.szData[0]), szData, SMS_MAXLENGTH_SMS_MO_USER_DATA);
+
+                        Validity period - Absolute
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.year = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.year");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.month = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.month");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.day = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.day");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.hours = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.hours");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.minutes = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.minutes");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.seconds = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.seconds");
+
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodRel = sipc_util_marshal_object_get_char(in_obj, "ValidityPeriodRel");
+
+                        Deferred delivery time - Absolute (not supported)
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.year = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.year");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.month = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.month");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.day = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.day");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.hours = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.hours");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.minutes = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.minutes");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.seconds = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.seconds");
+
+                        Deferred delivery time - Relative (not supported)
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeRel = sipc_util_marshal_object_get_char(in_obj, "DeferredDelTimeRel");
+
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.Priority = sipc_util_marshal_object_get_int(in_obj, "Priority");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.Privacy = sipc_util_marshal_object_get_int(in_obj, "Privacy");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.bUserAckRequest = sipc_util_marshal_object_get_int(in_obj, "bUserAckRequest");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.bDeliveryAckRequest = sipc_util_marshal_object_get_int(in_obj, "bDeliveryAckRequest");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.AlertPriority= sipc_util_marshal_object_get_int(in_obj, "AlertPriority");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.MsgLang= sipc_util_marshal_object_get_int(in_obj, "MsgLang");
+
+                        Callback number address
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.Digit = sipc_util_marshal_object_get_int(in_obj, "CallBackNumer.Digit");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.NumberMode = sipc_util_marshal_object_get_int(in_obj, "CallBackNumer.NumberMode");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.NumberType = sipc_util_marshal_object_get_int(in_obj, "CallBackNumer.NumberType");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.NumberPlan = sipc_util_marshal_object_get_int(in_obj, "CallBackNumer.NumberPlan");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "CallBackNumer.szAddrLength");
+                       callBackNumer_szAddress = sipc_util_marshal_object_get_string(in_obj, "CallBackNumer.szAddress");
+                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.szAddress[0]), callBackNumer_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
 
-       switch (tapi_service_function) {
-               case TAPI_CS_NETTEXT_SEND:
-                       sendUmtsMsg.msgDataPackage = g_array_index(in_param1, struct telephony_sms_DataPackageInfo, 0);
-                       sendUmtsMsg.more = g_array_index(in_param2, TS_BOOL, 0);
+                       }
+                       break;
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_send_umts_msg), &sendUmtsMsg);
-                       tcore_user_request_set_command(ur, TREQ_SMS_SEND_UMTS_MSG);
+               case SMS_MESSAGETYPE_CANCEL: {
+                       gchar *dstAddr_szAddress;
+                       gchar *dstSubAddr_szAddress;
+
+                        Origination address
+                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.Digit = sipc_util_marshal_object_get_int(in_obj, "DstAddr.Digit");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.NumberMode = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberMode");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.NumberType = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberType");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.NumberPlan = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberPlan");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstAddr.szAddrLength");
+                       dstAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstAddr.szAddress");
+                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.szAddress[0]), dstAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
+
+                        Origination subaddress
+                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstSubAddr.SubType = sipc_util_marshal_object_get_int(in_obj, "DstSubAddr.SubType");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstSubAddr.Odd = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.Odd");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstSubAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.szAddrLength");
+                       dstSubAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstSubAddr.szAddress");
+                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstSubAddr.szAddress[0]), dstSubAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
+
+                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.TeleService = sipc_util_marshal_object_get_int(in_obj, "TeleService");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.bBearerReplySeqRequest = sipc_util_marshal_object_get_int(in_obj, "bBearerReplySeqRequest");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.ReplySeqNumber = sipc_util_marshal_object_get_char(in_obj, "ReplySeqNumber");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.MsgId = sipc_util_marshal_object_get_int(in_obj, "MsgId");
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
                        }
+                       break;
 
+               case SMS_MESSAGETYPE_USER_ACK: {
+                       gchar *dstAddr_szAddress;
+                       gchar *dstSubAddr_szAddress;
+                       gchar *szData;
+
+                        Origination address
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.Digit = sipc_util_marshal_object_get_int(in_obj, "DstAddr.Digit");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.NumberMode = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberMode");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.NumberType = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberType");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.NumberPlan = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberPlan");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstAddr.szAddrLength");
+                       dstAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstAddr.szAddress");
+                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.szAddress[0]), dstAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
+
+                        Origination subaddress
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstSubAddr.SubType = sipc_util_marshal_object_get_int(in_obj, "DstSubAddr.SubType");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstSubAddr.Odd = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.Odd");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstSubAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.szAddrLength");
+                       dstSubAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstSubAddr.szAddress");
+                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstSubAddr.szAddress[0]), dstSubAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
+
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.TeleService = sipc_util_marshal_object_get_int(in_obj, "TeleService");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.bBearerReplySeqRequest = sipc_util_marshal_object_get_int(in_obj, "bBearerReplySeqRequest");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.ReplySeqNumber = sipc_util_marshal_object_get_char(in_obj, "ReplySeqNumber");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.MsgId = sipc_util_marshal_object_get_int(in_obj, "MsgId");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.MsgEncoding = sipc_util_marshal_object_get_int(in_obj, "MsgEncoding");
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.MsgLength = sipc_util_marshal_object_get_int(in_obj, "MsgLength");
+                       szData = sipc_util_marshal_object_get_string(in_obj, "szData");
+                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outAck.szData[0]), szData, SMS_MAXLENGTH_SMS_MO_USER_DATA);
+                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.UserResponseCode = sipc_util_marshal_object_get_char(in_obj, "UserResponseCode");
+
+                       }
                        break;
+               default:
+                       break;
+       }
 
-               case TAPI_CS_NETTEXT_SEND_EX:
-                       memcpy(&cdmaMsg, &g_array_index(in_param1, struct telephony_sms_CdmaMsgInfo, 0), sizeof(struct telephony_sms_CdmaMsgInfo));
-                       cdmaMsg.more= g_array_index(in_param2,unsigned int, 0);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_send_cdma_msg), &cdmaMsg);
+       tcore_user_request_set_command(ur, TREQ_SMS_SEND_CDMA_MSG);
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_send_cdma_msg), &cdmaMsg);
-                       tcore_user_request_set_command(ur, TREQ_SMS_SEND_CDMA_MSG);
+       ret = tcore_communicator_dispatch_request(comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               // api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+               return  FALSE;
+       }
+#endif
+       return TRUE;
+}
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+*/
 
-                       break;
+static gboolean
+on_sms_read_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gint arg_index,
+       gpointer user_data)
+{
+       struct treq_sms_read_msg readMsg = {0,};
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-               case TAPI_CS_NETTEXT_READ:
-                       readMsg.index = g_array_index(in_param1, int, 0);
+       readMsg.index = arg_index;
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_read_msg), &readMsg);
-                       tcore_user_request_set_command(ur, TREQ_SMS_READ_MSG);
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_read_msg), &readMsg);
+       tcore_user_request_set_command(ur, TREQ_SMS_READ_MSG);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               // api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+       }
 
-                       break;
+       return TRUE;
+}
 
-               case TAPI_CS_NETTEXT_WRITE: {
-                               struct telephony_sms_Data tmp;
-                               tmp = g_array_index(in_param1, struct telephony_sms_Data, 0);
-                               saveMsg.simIndex = tmp.simIndex;
-                               saveMsg.msgStatus = tmp.msgStatus;
-                               memcpy(&saveMsg.msgDataPackage, &tmp.smsData, sizeof(struct telephony_sms_DataPackageInfo));
+static gboolean
+on_sms_save_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gint arg_msg_status,
+       const gchar * arg_sca,
+       gint arg_tpdu_length,
+       const gchar * arg_tpdu_data,
+       gpointer user_data)
+{
+        struct treq_sms_save_msg saveMsg = {0,};
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                               tcore_user_request_set_data(ur, sizeof(struct treq_sms_save_msg), &saveMsg);
-                               tcore_user_request_set_command(ur, TREQ_SMS_SAVE_MSG);
+       gsize length;
+       guchar *decoded_sca = NULL;
+       guchar *decoded_tpdu = NULL;
+       
+       saveMsg.msgStatus = arg_msg_status;
+
+       decoded_sca = g_base64_decode(arg_sca, &length);
+       memcpy(&(saveMsg.msgDataPackage.sca[0]), decoded_sca, SMS_SMSP_ADDRESS_LEN);
+
+       saveMsg.msgDataPackage.msgLength = arg_tpdu_length;
+
+       decoded_tpdu = g_base64_decode(arg_tpdu_data, &length);
+       memcpy(&(saveMsg.msgDataPackage.tpduData[0]), decoded_tpdu, SMS_SMDATA_SIZE_MAX + 1);
+
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_save_msg), &saveMsg);
+       tcore_user_request_set_command(ur, TREQ_SMS_SAVE_MSG);
+
+       if(decoded_sca)
+               g_free(decoded_sca);
+       
+       if(decoded_tpdu)
+               g_free(decoded_tpdu);
+       
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               // api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+       }
 
-                               ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                               if (ret != TCORE_RETURN_SUCCESS) {
-                                       api_err = TAPI_API_OPERATION_FAILED;
-                               }
+       return TRUE;
+}
 
-                       }
-                       break;
+static gboolean
+on_sms_delete_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gint arg_index,
+       gpointer user_data)
+{
+        struct treq_sms_delete_msg deleteMsg = {0,};
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-               case TAPI_CS_NETTEXT_DELETE:
-                       deleteMsg.index = g_array_index(in_param1, int, 0);
+       deleteMsg.index = arg_index;
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_delete_msg), &deleteMsg);
-                       tcore_user_request_set_command(ur, TREQ_SMS_DELETE_MSG);
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_delete_msg), &deleteMsg);
+       tcore_user_request_set_command(ur, TREQ_SMS_DELETE_MSG);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               // api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+       }
 
-                       break;
+       return TRUE;
+}
 
-               case TAPI_CS_NETTEXT_GETCOUNT:
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_msg_count), &getMsgCnt);
-                       tcore_user_request_set_command(ur, TREQ_SMS_GET_COUNT);
+static gboolean
+on_sms_get_msg_count(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gpointer user_data)
+{
+        struct treq_sms_get_msg_count getMsgCnt;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_msg_count), &getMsgCnt);
+       tcore_user_request_set_command(ur, TREQ_SMS_GET_COUNT);
 
-                       break;
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               // api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+       }
 
-               case TAPI_CS_NETTEXT_GETSCA:
-                       getSca.index = g_array_index(in_param1, int, 0);
+       return TRUE;
+}
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_sca), &getSca);
-                       tcore_user_request_set_command(ur, TREQ_SMS_GET_SCA);
+static gboolean
+on_sms_get_sca(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gint arg_index,
+       gpointer user_data)
+{
+        struct treq_sms_get_sca getSca = {0,};
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       getSca.index = arg_index;
 
-                       break;
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_sca), &getSca);
+       tcore_user_request_set_command(ur, TREQ_SMS_GET_SCA);
 
-               case TAPI_CS_NETTEXT_SETSCA:
-                       setSca.scaInfo = g_array_index(in_param1, struct telephony_sms_AddressInfo, 0);
-                       setSca.index = g_array_index(in_param2, int, 0);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               // api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+               return  FALSE;
+       }
 
-                       if ((setSca.scaInfo.dialNumLen <= 0) || (setSca.scaInfo.dialNumLen > (TAPI_NETTEXT_MAX_SMS_SERVICE_CENTER_ADDR + 1)))
-                       {
-                               api_err = TAPI_API_INVALID_INPUT;
-                       }
-                       else if(setSca.index != 0)
-                       {
-                               dbg("Index except 0 is supported");
-                               api_err = TAPI_API_NOT_SUPPORTED;
-                       }
-                       else
-                       {
-                               tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_sca), &setSca);
-                               tcore_user_request_set_command(ur, TREQ_SMS_SET_SCA);
+       return TRUE;
+}
 
-                               ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                               if (ret != TCORE_RETURN_SUCCESS) {
-                                       api_err = TAPI_API_OPERATION_FAILED;
-                               }
-                       }
+static gboolean
+on_sms_set_sca(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gint arg_index,
+       gint arg_ton,
+       gint arg_npi,
+       gint arg_dialNumberLength,
+       const gchar *arg_dialNumber,
+       gpointer user_data)
+{
+        struct treq_sms_set_sca setSca;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       break;
+       memset(&setSca, 0, sizeof(struct treq_sms_set_sca));
 
-               case TAPI_CS_NETTEXT_GETCBCONFIG:
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_cb_config), &getCbConfig);
-                       tcore_user_request_set_command(ur, TREQ_SMS_GET_CB_CONFIG);
+       setSca.index = arg_index;
+       setSca.scaInfo.dialNumLen = arg_dialNumberLength;
+       setSca.scaInfo.typeOfNum = arg_ton;
+       setSca.scaInfo.numPlanId = arg_npi;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       if ((setSca.scaInfo.dialNumLen <= 0) || (setSca.scaInfo.dialNumLen > (SMS_MAX_SMS_SERVICE_CENTER_ADDR + 1)))
+       {
+               err("[tcore_SMS] TAPI_API_INVALID_INPUT !!!");
+               return  FALSE;
+       }
+       else if(setSca.index != 0)
+       {
+               err("[tcore_SMS] Index except 0 is supported");
+               // api_err = TAPI_API_NOT_SUPPORTED;
+               return  FALSE;
+       }
+       else
+       {
+               gsize length;
+               guchar *decoded_sca = NULL;
+       
+               decoded_sca = g_base64_decode(arg_dialNumber, &length);
+               memcpy(&(setSca.scaInfo.diallingNum[0]), decoded_sca, SMS_SMSP_ADDRESS_LEN + 1);
+
+               ur = MAKE_UR(ctx, sms, invocation);
+               tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_sca), &setSca);
+               tcore_user_request_set_command(ur, TREQ_SMS_SET_SCA);
+
+               if(decoded_sca)
+                       g_free(decoded_sca);
+               
+               ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+               if (ret != TCORE_RETURN_SUCCESS) {
+                       //api_err = TAPI_API_OPERATION_FAILED;
+                       err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+                       return  FALSE;
+               }
+       }
 
-                       break;
+       return TRUE;
+}
 
-               case TAPI_CS_NETTEXT_SETCBCONFIG:
-                       setCbConfig = g_array_index(in_param1, struct treq_sms_set_cb_config, 0);
+static gboolean
+on_sms_get_cb_config(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gpointer user_data)
+{
+        struct treq_sms_get_cb_config getCbConfig;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_cb_config), &setCbConfig);
-                       tcore_user_request_set_command(ur, TREQ_SMS_SET_CB_CONFIG);
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_cb_config), &getCbConfig);
+       tcore_user_request_set_command(ur, TREQ_SMS_GET_CB_CONFIG);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               //api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+               return  FALSE;
+       }
 
-                       break;
+       return TRUE;
+}
 
-               case TAPI_CS_NETTEXT_SETMEMSTATUS:
-                       memStatus.memory_status = g_array_index(in_param1, int, 0);
+static gboolean
+on_sms_set_cb_config(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gboolean arg_cbEnable,
+       gint arg_slectedId,
+       gint arg_msgIdMaxCount,
+       gint arg_msgIdCount,
+       const gchar *arg_msgId,
+       gpointer user_data)
+{
+        struct treq_sms_set_cb_config setCbConfig = {0,};
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_mem_status), &memStatus);
-                       tcore_user_request_set_command(ur, TREQ_SMS_SET_MEM_STATUS);
+       gsize length;
+       guchar *decoded_msgId = NULL;
+
+       setCbConfig.bCBEnabled = arg_cbEnable;
+       setCbConfig.selectedId = arg_slectedId;
+       setCbConfig.msgIdMaxCount = arg_msgIdMaxCount;
+       setCbConfig.msgIdCount = arg_msgIdCount;
+
+       decoded_msgId = g_base64_decode(arg_msgId, &length);
+       memcpy(&(setCbConfig.msgIDs[0]), decoded_msgId, SMS_GSM_SMS_CBMI_LIST_SIZE_MAX);
+
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_cb_config), &setCbConfig);
+       tcore_user_request_set_command(ur, TREQ_SMS_SET_CB_CONFIG);
+
+       if(decoded_msgId)
+               g_free(decoded_msgId);
+       
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               //api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+               return  FALSE;
+       }
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       return TRUE;
+}
 
-                       break;
+static gboolean
+on_sms_set_mem_status(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gint arg_memoryStatus,
+       gpointer user_data)
+{
+        struct treq_sms_set_mem_status memStatus = {0,};
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-               case TAPI_CS_NETTEXT_GETPREFBEARER:
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_pref_brearer), &getPrefBrearer);
-                       tcore_user_request_set_command(ur, TREQ_SMS_GET_PREF_BEARER);
+       memStatus.memory_status = arg_memoryStatus;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_mem_status), &memStatus);
+       tcore_user_request_set_command(ur, TREQ_SMS_SET_MEM_STATUS);
 
-                       break;
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               //api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+               return  FALSE;
+       }
 
-               case TAPI_CS_NETTEXT_SETPREFBEARER:
-                       setPrefBrearer.svc = g_array_index(in_param1,int, 0);
+       return TRUE;
+}
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_pref_brearer), &setPrefBrearer);
-                       tcore_user_request_set_command(ur, TREQ_SMS_SET_PREF_BEARER);
+static gboolean
+on_sms_get_pref_bearer(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gpointer user_data)
+{
+        struct treq_sms_get_pref_bearer getPrefBearer;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_pref_bearer), &getPrefBearer);
+       tcore_user_request_set_command(ur, TREQ_SMS_GET_PREF_BEARER);
 
-                       break;
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               //api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+               return  FALSE;
+       }
+       return TRUE;
+}
 
-               case TAPI_CS_NETTEXT_SETDELIVERREPORT:
-                       deliveryReport.dataInfo = g_array_index(in_param1, struct telephony_sms_DataPackageInfo, 0);
-                       deliveryReport.rspType = g_array_index(in_param2, int, 0);
+static gboolean
+on_sms_set_pref_bearer(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gint arg_bearerType,
+       gpointer user_data)
+{
+        struct treq_sms_set_pref_bearer setPrefBearer = {0,};
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_delivery_report), &deliveryReport);
-                       tcore_user_request_set_command(ur, TREQ_SMS_SET_DELIVERY_REPORT);
+       setPrefBearer.svc = arg_bearerType;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_pref_bearer), &setPrefBearer);
+       tcore_user_request_set_command(ur, TREQ_SMS_SET_PREF_BEARER);
 
-                       break;
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               //api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+               return  FALSE;
+       }
 
-               case TAPI_CS_NETTEXT_SETMSGSTATUS:
-                       msgStatus.index = g_array_index(in_param1,int, 0);
-                       msgStatus.msgStatus = g_array_index(in_param2, enum telephony_sms_MsgStatus, 0);
+       return TRUE;
+}
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_msg_status), &msgStatus);
-                       tcore_user_request_set_command(ur, TREQ_SMS_SET_MSG_STATUS);
+static gboolean
+on_sms_set_delivery_report(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       const gchar *arg_sca,
+       gint arg_tpdu_length,
+       const gchar *arg_tpdu_data,
+       gint arg_rpCause,
+       gpointer user_data)
+{
+        struct treq_sms_set_delivery_report deliveryReport;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       gsize length;
+       guchar *decoded_sca = NULL;
+       guchar *decoded_tpdu = NULL;
+       
+       memset(&deliveryReport, 0, sizeof(struct treq_sms_set_delivery_report));
 
-                       break;
+       decoded_sca = g_base64_decode(arg_sca, &length);
+       memcpy(&(deliveryReport.dataInfo.sca[0]), decoded_sca, SMS_SMSP_ADDRESS_LEN);
 
-               case TAPI_CS_NETTEXT_GETPARAMS:
-                       getParams.index = g_array_index(in_param1,int, 0);
+       deliveryReport.dataInfo.msgLength = arg_tpdu_length;
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_params), &getParams);
-                       tcore_user_request_set_command(ur, TREQ_SMS_GET_PARAMS);
+       decoded_tpdu = g_base64_decode(arg_tpdu_data, &length);
+       memcpy(&(deliveryReport.dataInfo.tpduData[0]), decoded_tpdu, SMS_SMDATA_SIZE_MAX + 1);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       deliveryReport.rspType = arg_rpCause;
 
-                       break;
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_delivery_report), &deliveryReport);
+       tcore_user_request_set_command(ur, TREQ_SMS_SET_DELIVERY_REPORT);
 
-               case TAPI_CS_NETTEXT_SETPARAMS:
-                       setParams = g_array_index(in_param1, struct treq_sms_set_params, 0);
+       if(decoded_sca)
+               g_free(decoded_sca);
 
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_params), &setParams);
-                       tcore_user_request_set_command(ur, TREQ_SMS_SET_PARAMS);
+       if(decoded_tpdu)
+               g_free(decoded_tpdu);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               //api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+               return  FALSE;
+       }
 
-                       break;
+       return TRUE;
+}
 
-               case TAPI_CS_NETTEXT_GETPARAMCNT:
-                       tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_paramcnt), &getParamCnt);
-                       tcore_user_request_set_command(ur, TREQ_SMS_GET_PARAMCNT);
+static gboolean
+on_sms_set_msg_status(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gint arg_index,
+       gint arg_msgStatus,
+       gpointer user_data)
+{
+        struct treq_sms_set_msg_status msgStatus = {0,};
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       msgStatus.index = arg_index;
+       msgStatus.msgStatus = arg_msgStatus;
 
-                       break;
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_msg_status), &msgStatus);
+       tcore_user_request_set_command(ur, TREQ_SMS_SET_MSG_STATUS);
 
-               case TAPI_CS_NETTEXT_DEVICEREADY:
-                       dbg("[tcore_SMS] internal operation, please check TAPI_CS_NETTEXT_DEVICEREADY with MMFW !!!");
-                       api_err = TAPI_API_OPERATION_FAILED;
-                       break;
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               //api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+               return  FALSE;
+       }
 
-               case TAPI_CS_NETTEXT_DEVICESTATUS:
-                       {
-                               int device_status = 0x01;
-                               dbg("[tcore_SMS] internal operation, please check TAPI_CS_NETTEXT_DEVICESTATUS with MMFW !!!");
-                               g_array_append_vals(*out_param3, &device_status, sizeof(int));
-                       }
-                       break;
+       return TRUE;
+}
 
-               default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
+static gboolean
+on_sms_get_sms_params(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gint arg_index,
+       gpointer user_data)
+{
+        struct treq_sms_get_params getParams = {0,};
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       getParams.index = arg_index;
+
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_params), &getParams);
+       tcore_user_request_set_command(ur, TREQ_SMS_GET_PARAMS);
+
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               //api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+               return  FALSE;
        }
 
-       dbg("[tcore_SMS] tapi_service_function[0x%x], ret = 0x%x", tapi_service_function, ret);
+       return TRUE;
+}
+
+static gboolean
+on_sms_set_sms_params(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gint arg_recordIndex,
+       gint arg_recordLen,
+       gint arg_alphaIdLen,
+       const gchar *arg_alphaId,
+       gint arg_paramIndicator,
+       gint arg_destAddr_DialNumLen,
+       gint arg_destAddr_Ton,
+       gint arg_destAddr_Npi,
+       const gchar *arg_destAddr_DiallingNum,
+       gint arg_svcCntrAddr_DialNumLen,
+       gint arg_SvcCntrAddr_Ton,
+       gint arg_svcCntrAddr_Npi,
+       const gchar *arg_svcCntrAddr_DialNum,
+       gint arg_protocolId,
+       gint arg_dataCodingScheme,
+       gint arg_validityPeriod,
+       gpointer user_data)
+{
+       struct treq_sms_set_params setParams;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-OUT:
-       if (api_err != TAPI_API_SUCCESS) {
-               tcore_user_request_free(ur);
+       gsize length;
+       guchar *decoded_alphaId = NULL;
+       guchar *decoded_destDialNum = NULL;
+       guchar *decoded_scaDialNum = NULL;
+
+       memset(&setParams, 0, sizeof(struct treq_sms_set_params));
+
+       setParams.params.recordIndex = arg_recordIndex;
+       setParams.params.recordLen = arg_recordLen;
+       setParams.params.alphaIdLen = arg_alphaIdLen;
+       decoded_alphaId = g_base64_decode(arg_alphaId, &length);
+       memcpy(&(setParams.params.szAlphaId[0]), decoded_alphaId, SMS_SMSP_ALPHA_ID_LEN_MAX + 1);
+       setParams.params.paramIndicator = arg_paramIndicator;
+
+       setParams.params.tpDestAddr.dialNumLen = arg_destAddr_DialNumLen;
+       setParams.params.tpDestAddr.typeOfNum = arg_destAddr_Ton;
+       setParams.params.tpDestAddr.numPlanId = arg_destAddr_Npi;
+       decoded_destDialNum = g_base64_decode(arg_destAddr_DiallingNum, &length);
+       memcpy(&(setParams.params.tpDestAddr.diallingNum[0]), decoded_destDialNum, SMS_SMSP_ADDRESS_LEN + 1);
+
+       setParams.params.tpSvcCntrAddr.dialNumLen = arg_svcCntrAddr_DialNumLen;
+       setParams.params.tpSvcCntrAddr.typeOfNum = arg_SvcCntrAddr_Ton;
+       setParams.params.tpSvcCntrAddr.numPlanId = arg_svcCntrAddr_Npi;
+       decoded_scaDialNum = g_base64_decode(arg_svcCntrAddr_DialNum, &length); 
+       memcpy(&(setParams.params.tpSvcCntrAddr.diallingNum[0]), decoded_scaDialNum, SMS_SMSP_ADDRESS_LEN + 1);
+
+       setParams.params.tpProtocolId = arg_protocolId;
+       setParams.params.tpDataCodingScheme = arg_dataCodingScheme;
+       setParams.params.tpValidityPeriod = arg_validityPeriod;
+
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_params), &setParams);
+       tcore_user_request_set_command(ur, TREQ_SMS_SET_PARAMS);
+
+       if(decoded_alphaId)
+               g_free(decoded_alphaId);
+
+       if(decoded_destDialNum)
+               g_free(decoded_destDialNum);
+
+       if(decoded_scaDialNum)
+               g_free(decoded_scaDialNum);
+
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               //api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+               return  FALSE;
        }
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-       g_array_append_vals(*out_param2, &request_id, sizeof(int));     
+
+       return TRUE;
 }
 
-TReturn dbus_response_sms(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
+static gboolean
+on_sms_get_sms_param_cnt(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gpointer user_data)
 {
-       int RequestId = 0;
+        struct treq_sms_get_paramcnt getParamCnt;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
+
+       ur = MAKE_UR(ctx, sms, invocation);
+       tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_paramcnt), &getParamCnt);
+       tcore_user_request_set_command(ur, TREQ_SMS_GET_PARAMCNT);
 
-       dbg("[tcore_SMS] command = 0x%x", command);
+       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+       if (ret != TCORE_RETURN_SUCCESS) {
+               //api_err = TAPI_API_OPERATION_FAILED;
+               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
+               return  FALSE;
+       }
+
+       return TRUE;
+}
+
+static gboolean
+on_sms_get_sms_ready_status(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       GSList *co_list = NULL;
+       CoreObject *co_sms = NULL;
+       TcorePlugin *plugin = NULL;
+
+       dbg("Func Entrance");
+
+       plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
+       co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_SMS);
+       if (!co_list) {
+               dbg("error- co_list is NULL");
+               return FALSE;
+       }
+
+       co_sms = (CoreObject *)co_list->data;
+       g_slist_free(co_list);
+
+       if (!co_sms) {
+               dbg("error- co_sms is NULL");
+               return FALSE;
+       }
+       
+       telephony_sms_complete_get_sms_ready_status(sms, invocation, tcore_sms_get_ready_status(co_sms));
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_setup_sms_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
+{
+       TelephonySms *sms;
+
+       sms = telephony_sms_skeleton_new();
+       telephony_object_skeleton_set_sms(object, sms);
+       g_object_unref(sms);
+
+       g_signal_connect(sms, "handle-send-msg", G_CALLBACK (on_sms_send_msg), ctx);
+       g_signal_connect(sms, "handle-read-msg", G_CALLBACK (on_sms_read_msg), ctx);
+       g_signal_connect(sms, "handle-save-msg", G_CALLBACK (on_sms_save_msg), ctx);
+       g_signal_connect(sms, "handle-delete-msg", G_CALLBACK (on_sms_delete_msg), ctx);
+       g_signal_connect(sms, "handle-get-msg-count", G_CALLBACK (on_sms_get_msg_count), ctx);
+       g_signal_connect(sms, "handle-get-sca", G_CALLBACK (on_sms_get_sca), ctx);
+       g_signal_connect(sms, "handle-set-sca", G_CALLBACK (on_sms_set_sca), ctx);
+       g_signal_connect(sms, "handle-get-cb-config", G_CALLBACK (on_sms_get_cb_config), ctx);
+       g_signal_connect(sms, "handle-set-cb-config", G_CALLBACK (on_sms_set_cb_config), ctx);
+       g_signal_connect(sms, "handle-set-mem-status", G_CALLBACK (on_sms_set_mem_status), ctx);
+       g_signal_connect(sms, "handle-get-pref-bearer", G_CALLBACK (on_sms_get_pref_bearer), ctx);
+       g_signal_connect(sms, "handle-set-pref-bearer", G_CALLBACK (on_sms_set_pref_bearer), ctx);
+       g_signal_connect(sms, "handle-set-delivery-report", G_CALLBACK (on_sms_set_delivery_report), ctx);
+       g_signal_connect(sms, "handle-set-msg-status", G_CALLBACK (on_sms_set_msg_status), ctx);
+       g_signal_connect(sms, "handle-get-sms-params", G_CALLBACK (on_sms_get_sms_params), ctx);
+       g_signal_connect(sms, "handle-set-sms-params", G_CALLBACK (on_sms_set_sms_params), ctx);
+       g_signal_connect(sms, "handle-get-sms-param-cnt", G_CALLBACK (on_sms_get_sms_param_cnt), ctx);
+       g_signal_connect(sms, "handle-get-sms-ready-status", G_CALLBACK (on_sms_get_sms_ready_status), ctx);    
+
+       return TRUE;
+}
+
+gboolean dbus_plugin_sms_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
+{
+       GSList *co_list;
+       CoreObject *co_sms;
+       char *modem_name = NULL;
+       TcorePlugin *p = NULL;
+
+       modem_name = tcore_user_request_get_modem_name(ur);
+       if (!modem_name)
+               return FALSE;
+
+       p = tcore_server_find_plugin(ctx->server, modem_name);
+       free(modem_name);
+       if (!p)
+               return FALSE;
+
+       co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SMS);
+       if (!co_list) {
+               return FALSE;
+       }
+
+       co_sms = (CoreObject *)co_list->data;
+       g_slist_free(co_list);
+
+       if (!co_sms) {
+               return FALSE;
+       }
 
        switch (command) {
                case TRESP_SMS_SEND_UMTS_MSG: {
-                               const struct tresp_sms_send_umts_msg *resp = data;
+                       const struct tresp_sms_send_umts_msg *resp = data;
+
 
-                               dbg("resp->result = 0x%x", resp->result);
+                       dbg("receive TRESP_SMS_SEND_UMTS_MSG");
+                       dbg("resp->result = 0x%x", resp->result);
+
+                       telephony_sms_complete_send_msg(dbus_info->interface_object, dbus_info->invocation, resp->result);
 
-                               if(resp->result == SMS_SUCCESS) {
-                                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_SENTSTATUS_CNF,
-                                                       appname, RequestId, resp->result, sizeof(struct telephony_sms_DataPackageInfo), (void *) &resp->dataInfo);
-                               }
-                               else
-                               {
-                                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_SENTSTATUS_CNF,
-                                                       appname, RequestId, resp->result, sizeof(struct telephony_sms_DataPackageInfo), NULL);
-                               }
                        }
                        break;
 
                case TRESP_SMS_SEND_CDMA_MSG: {
-                               const struct tresp_sms_send_cdma_msg *resp = data;
-
-                               dbg("resp->result = 0x%x", resp->result);
+                       const struct tresp_sms_send_cdma_msg *resp = data;
 
-                               if(resp->result == SMS_SUCCESS) {
-                                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_SENTSTATUS_EX_CNF,
-                                                       appname, RequestId, resp->result, sizeof(TelSmsIs637CauseCode_t), (void *) &(resp->causeCode));
-                               }
-                               else
-                               {
-                                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_SENTSTATUS_EX_CNF,
-                                                       appname, RequestId, resp->result, sizeof(TelSmsIs637CauseCode_t), NULL);
-                               }
+                       dbg("receive TRESP_SMS_SEND_CDMA_MSG");
+                       dbg("resp->result = 0x%x", resp->result);
+#if 0
+                       resp->result
+                       resp->causeCode.ReplySeqNumber
+                       resp->causeCode.ErrClass
+                       resp->causeCode.Cause
+#endif
                        }
                        break;
 
                case TRESP_SMS_READ_MSG: {
-                               const struct tresp_sms_read_msg *resp = data;
+                       const struct tresp_sms_read_msg *resp = data;
+                       gchar *sca = NULL;
+                       gchar *tpdu = NULL;                     
 
-                               dbg("resp->result = 0x%x", resp->result);
+                       dbg("receive TRESP_SMS_READ_MSG");
+                       dbg("resp->result = 0x%x", resp->result);
+
+                       sca = g_base64_encode((const guchar *)&(resp->dataInfo.smsData.sca[0]), SMS_SMSP_ADDRESS_LEN);
+                       if (sca == NULL) {
+                               dbg("g_base64_encode: Failed to Enocde the SCA.");
+                               sca = "";
+                       }
+
+                       tpdu = g_base64_encode((const guchar *)&(resp->dataInfo.smsData.tpduData[0]), SMS_SMDATA_SIZE_MAX + 1);
+                       if (sca == NULL) {
+                               dbg("g_base64_encode: Failed to Enocde the SCA.");
+                               tpdu = "";
+                       }
+
+                       telephony_sms_complete_read_msg(dbus_info->interface_object, dbus_info->invocation, 
+                               resp->result, 
+                               resp->dataInfo.msgStatus, 
+                               sca, 
+                               resp->dataInfo.smsData.msgLength, 
+                               tpdu);
+
+                       if (sca)
+                               g_free(sca);
+
+                       if (tpdu)
+                               g_free(tpdu);
 
-                               ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_READ_SMS_CNF,
-                                               appname, RequestId, resp->result, sizeof(struct telephony_sms_Data), (void *) &resp->dataInfo);
                        }
                        break;
 
                case TRESP_SMS_SAVE_MSG: {
-                               const struct tresp_sms_save_msg *resp = data;
+                       const struct tresp_sms_save_msg *resp = data;
 
-                               dbg("resp->result = 0x%x", resp->result);
+                       dbg("receive TRESP_SMS_SAVE_MSG");
+                       dbg("resp->result = 0x%x", resp->result);
 
-                               ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_SAVE_STATUS_CNF,
-                                               appname, RequestId, resp->result, sizeof(int), (void *) &resp->index);
+                       telephony_sms_complete_save_msg (dbus_info->interface_object, dbus_info->invocation,
+                               resp->result,
+                               resp->index);
                        }
                        break;
 
                case TRESP_SMS_DELETE_MSG: {
-                               const struct tresp_sms_delete_msg *resp = data;
+                       const struct tresp_sms_delete_msg *resp = data;
+
+                       dbg("receive TRESP_SMS_DELETE_MSG");
+                       dbg("resp->result = 0x%x", resp->result);
 
-                               dbg("resp->result = 0x%x", resp->result);
+                       telephony_sms_complete_delete_msg(dbus_info->interface_object, dbus_info->invocation,
+                               resp->result);
 
-                               ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_DELETE_STATUS_CNF,
-                                               appname, RequestId, resp->result, sizeof(int), (void *) &resp->index);
                        }
                        break;
 
                case TRESP_SMS_GET_STORED_MSG_COUNT: {
-                               const struct tresp_sms_get_storedMsgCnt *resp = data;
-                               TelSmsStoredMsgCountInfo_t      storedMsgCnt;
+                       const struct tresp_sms_get_storedMsgCnt *resp = data;
+                       gchar *msgCnt = NULL;
 
-                               dbg("resp->result = 0x%x", resp->result);
+                       dbg("receive TRESP_SMS_GET_STORED_MSG_COUNT");
+                       dbg("resp->result = 0x%x", resp->result);
+
+                       msgCnt = g_base64_encode((const guchar *)&(resp->storedMsgCnt.indexList[0]), SMS_GSM_SMS_MSG_NUM_MAX + 1);
+                       if (msgCnt == NULL) {
+                               dbg("g_base64_encode: Failed to Enocde storedMsgCnt.indexList");
+                               msgCnt = "";
+                       }
 
-                               if(resp->result == SMS_SUCCESS) {
-                                       memcpy(&storedMsgCnt, &(resp->storedMsgCnt), sizeof(TelSmsStoredMsgCountInfo_t));
+                       telephony_sms_complete_get_msg_count(dbus_info->interface_object, dbus_info->invocation,
+                               resp->result,
+                               resp->storedMsgCnt.totalCount,
+                               resp->storedMsgCnt.usedCount,
+                               msgCnt);
 
-                                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_GET_COUNT_CNF,
-                                               appname, RequestId, resp->result, sizeof(TelSmsStoredMsgCountInfo_t), (void *) &storedMsgCnt);
-                               }
-                               else
-                               {
-                                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_GET_COUNT_CNF,
-                                               appname, RequestId, resp->result, sizeof(TelSmsStoredMsgCountInfo_t), NULL);
-                               }
+                       if (msgCnt)
+                               g_free(msgCnt);
                        }
+
                        break;
 
                case TRESP_SMS_GET_SCA: {
-                               const struct tresp_sms_get_sca *resp = data;
-                               TelSmsAddressInfo_t scaInfo;
-
-                               dbg("resp->result = 0x%x", resp->result);
-
-                               if(resp->result == SMS_SUCCESS) {
-                                       memcpy(&scaInfo, &(resp->scaAddress), sizeof(TelSmsAddressInfo_t));
-                                       scaInfo.DialNumLen = resp->scaAddress.dialNumLen;
-                                       scaInfo.Ton = resp->scaAddress.typeOfNum;
-                                       scaInfo.Npi= resp->scaAddress.numPlanId;
-                                       memcpy(&scaInfo.szDiallingNum[0], &resp->scaAddress.diallingNum[0], TAPI_SIM_SMSP_ADDRESS_LEN + 1);
-
-                                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_GET_SCA_CNF,
-                                               appname, RequestId, resp->result, sizeof(TelSmsAddressInfo_t), (void *) &scaInfo);
-                               }
-                               else
-                               {
-                                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_GET_SCA_CNF,
-                                               appname, RequestId, resp->result, sizeof(TelSmsAddressInfo_t), NULL);
-                               }
+                       const struct tresp_sms_get_sca *resp = data;
+                       gchar *sca = NULL;
+
+                       dbg("receive TRESP_SMS_GET_SCA");
+                       dbg("resp->result = 0x%x", resp->result);
+
+                       sca = g_base64_encode((const guchar *)&(resp->scaAddress.diallingNum[0]), SMS_SMSP_ADDRESS_LEN + 1);
+                       if (sca == NULL) {
+                               dbg("g_base64_encode: Failed to Enocde scaAddress.diallingNum");
+                               sca = "";
+                       }
+                       
+                       telephony_sms_complete_get_sca(dbus_info->interface_object, dbus_info->invocation,
+                               resp->result,
+                               resp->scaAddress.typeOfNum,
+                               resp->scaAddress.numPlanId,
+                               resp->scaAddress.dialNumLen,
+                               sca);
+
+                       if (sca)
+                               g_free(sca);
+
                        }
                        break;
 
                case TRESP_SMS_SET_SCA: {
-                               const struct tresp_sms_set_sca *resp = data;
-                               TelSmsSetResponse RequestType = TAPI_NETTEXT_SETSCADDR_RSP;
+                       const struct tresp_sms_set_sca *resp = data;
 
-                               dbg("resp->result = 0x%x", resp->result);
+                       dbg("receive TRESP_SMS_SET_SCA");
+                       dbg("resp->result = 0x%x", resp->result);
+
+                       telephony_sms_complete_set_sca(dbus_info->interface_object, dbus_info->invocation,
+                               resp->result);
 
-                               ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_SET_REQUEST_CNF,
-                                               appname, RequestId, resp->result, sizeof(TelSmsSetResponse), (void *) &RequestType);
                        }
                        break;
 
                case TRESP_SMS_GET_CB_CONFIG: {
-                               const struct tresp_sms_get_cb_config *resp = data;
-                               TelSmsCbConfig_t cbConfig;
+                       const struct tresp_sms_get_cb_config *resp = data;
+                       gchar *msgIDs = NULL;
 
-                               dbg("resp->result = 0x%x", resp->result);
+                       dbg("receive TRESP_SMS_GET_CB_CONFIG");
+                       dbg("resp->result = 0x%x", resp->result);
 
-                               memcpy(&cbConfig, &resp->cbConfig, sizeof(TelSmsCbConfig_t));
+                       msgIDs = g_base64_encode((const guchar *)&(resp->cbConfig.msgIDs[0]), SMS_GSM_SMS_CBMI_LIST_SIZE_MAX);
+                       if (msgIDs == NULL) {
+                               dbg("g_base64_encode: Failed to Enocde cbConfig.msgIDs");
+                               msgIDs = "";
+                       }
+                       
+                       telephony_sms_complete_get_cb_config(dbus_info->interface_object, dbus_info->invocation,
+                               resp->result,
+                               resp->cbConfig.bCBEnabled,
+                               resp->cbConfig.selectedId,
+                               resp->cbConfig.msgIdMaxCount,
+                               resp->cbConfig.msgIdCount,
+                               msgIDs);
+
+                       if(msgIDs)
+                               g_free(msgIDs);
 
-                               if(resp->result == SMS_SUCCESS) {
-                                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_GET_CB_CONFIG_CNF,
-                                               appname, RequestId, resp->result, sizeof(TelSmsCbConfig_t), (void *) &cbConfig);
-                               }
-                               else
-                               {
-                                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_GET_CB_CONFIG_CNF,
-                                               appname, RequestId, resp->result, sizeof(TelSmsCbConfig_t), NULL);
-                               }
                        }
                        break;
 
                case TRESP_SMS_SET_CB_CONFIG: {
-                               const struct tresp_sms_set_cb_config *resp = data;
-                               TelSmsSetResponse RequestType = TAPI_NETTEXT_CBSETCONFIG_RSP;
+                       const struct tresp_sms_set_cb_config *resp = data;
 
-                               dbg("resp->result = 0x%x", resp->result);
+                       dbg("receive TRESP_SMS_SET_CB_CONFIG");
+                       dbg("resp->result = 0x%x", resp->result);
+
+                       telephony_sms_complete_set_cb_config(dbus_info->interface_object, dbus_info->invocation,
+                               resp->result);
 
-                               ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_SET_REQUEST_CNF,
-                                               appname, RequestId, resp->result, sizeof(TelSmsSetResponse), (void *) &RequestType);
                        }
                        break;
 
                case TRESP_SMS_SET_MEM_STATUS: {
-                               const struct tresp_sms_set_mem_status *resp = data;
-                               TelSmsSetResponse RequestType = TAPI_NETTEXT_SETMEMORYSTATUS_RSP;
+                       const struct tresp_sms_set_mem_status *resp = data;
+
+                       dbg("receive TRESP_SMS_SET_MEM_STATUS");
+                       dbg("resp->result = 0x%x", resp->result);
 
-                               dbg("resp->result = 0x%x", resp->result);
+                       telephony_sms_complete_set_mem_status(dbus_info->interface_object, dbus_info->invocation,
+                               resp->result);
 
-                               ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_SET_REQUEST_CNF,
-                                               appname, RequestId, resp->result, sizeof(TelSmsCause_t), (void *) &RequestType);
                        }
                        break;
-#if 0
-               case TRESP_SMS_GET_PREF_BEARER:
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_GET_SMSBEARER_CNF,
-                                       appname, RequestId, status, sizeof(TelSmsBearerType_t), (void *) bearer);
+               case TRESP_SMS_GET_PREF_BEARER: {
+                       const struct tresp_sms_get_pref_bearer *resp = data;
+
+                       dbg("receive TRESP_SMS_GET_PREF_BEARER");
+                       dbg("resp->result = 0x%x", resp->result);
+
+                       telephony_sms_complete_get_pref_bearer(dbus_info->interface_object, dbus_info->invocation,
+                               resp->result);
+
+                       }
                        break;
 
-               case TRESP_SMS_SET_PREF_BEARER:
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_SET_REQUEST_CNF,
-                                       appname, RequestId, Status, sizeof(TelSmsCause_t), (void *) &RequestType);
+               case TRESP_SMS_SET_PREF_BEARER: {
+                       const struct tresp_sms_set_pref_bearer *resp = data;
+
+                       dbg("receive TRESP_SMS_SET_PREF_BEARER");
+                       dbg("resp->result = 0x%x", resp->result);
+
+                       telephony_sms_complete_set_pref_bearer(dbus_info->interface_object, dbus_info->invocation,
+                               resp->result);
+
+                       }
                        break;
-#endif
+
                case TRESP_SMS_SET_DELIVERY_REPORT: {
-                               const struct tresp_sms_set_delivery_report *resp = data;
+                       const struct tresp_sms_set_delivery_report *resp = data;
+
+                       dbg("receive TRESP_SMS_SET_DELIVERY_REPORT");
+                       dbg("resp->result = 0x%x", resp->result);
 
-                               dbg("resp->result = 0x%x", resp->result);
+                       telephony_sms_complete_set_delivery_report(dbus_info->interface_object, dbus_info->invocation,
+                               resp->result);
 
-                               ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_DELIVERY_REPORT_CNF,
-                                               appname, RequestId, resp->result, 0, NULL);
                        }
                        break;
 
                case TRESP_SMS_SET_MSG_STATUS: {
-                               const struct tresp_sms_set_mem_status *resp = data;
-                               TelSmsSetResponse RequestType = TAPI_NETTEXT_SETMESSAGESTATUS_RSP;
+                       const struct tresp_sms_set_mem_status *resp = data;
 
-                               dbg("resp->result = 0x%x", resp->result);
+                       dbg("receive TRESP_SMS_SET_MSG_STATUS");
+                       dbg("resp->result = 0x%x", resp->result);
+
+                       telephony_sms_complete_set_msg_status(dbus_info->interface_object, dbus_info->invocation,
+                               resp->result);
 
-                               ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_SET_REQUEST_CNF,
-                                               appname, RequestId, resp->result, sizeof(TelSmsCause_t), (void *) &RequestType);
                        }
                        break;
 
                case TRESP_SMS_GET_PARAMS: {
-                               const struct tresp_sms_get_params *resp = data;
-                               TelSmsParams_t paramInfo;
+                       const struct tresp_sms_get_params *resp = data;
+                       gchar *alphaId = NULL;
+                       gchar *destDialNum = NULL;
+                       gchar *scaDialNum = NULL;
+
+                       dbg("receive TRESP_SMS_GET_PARAMS");
+                       dbg("resp->result = 0x%x", resp->result);
+
+                       alphaId = g_base64_encode((const guchar *)&(resp->paramsInfo.szAlphaId[0]), SMS_SMSP_ALPHA_ID_LEN_MAX + 1);
+                       if (alphaId == NULL) {
+                               dbg("g_base64_encode: Failed to Enocde paramsInfo.szAlphaId");
+                               alphaId = "";
+                       }
 
-                               dbg("resp->result = 0x%x", resp->result);
+                       destDialNum = g_base64_encode((const guchar *)&(resp->paramsInfo.tpDestAddr.diallingNum[0]), SMS_SMSP_ADDRESS_LEN + 1);
+                       if (alphaId == NULL) {
+                               dbg("g_base64_encode: Failed to Enocde paramsInfo.tpDestAddr.diallingNum");
+                               alphaId = "";
+                       }
 
-                               memcpy(&paramInfo, &resp->paramsInfo, sizeof(TelSmsParams_t));
+                       scaDialNum = g_base64_encode((const guchar *)&(resp->paramsInfo.tpSvcCntrAddr.diallingNum[0]), SMS_SMSP_ADDRESS_LEN + 1);
+                       if (alphaId == NULL) {
+                               dbg("g_base64_encode: Failed to Enocde paramsInfo.tpSvcCntrAddr.diallingNum");
+                               alphaId = "";
+                       }
 
-                               if(resp->result == SMS_SUCCESS) {
-                                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_GET_PARAM_CNF,
-                                               appname, RequestId, resp->result, sizeof(TelSmsParams_t), (void *) &paramInfo);
-                               }
-                               else
-                               {
-                                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_GET_PARAM_CNF,
-                                               appname, RequestId, resp->result, sizeof(TelSmsParams_t), NULL);
-                               }
+                       telephony_sms_complete_get_sms_params(dbus_info->interface_object, dbus_info->invocation,
+                               resp->result,
+                               resp->paramsInfo.recordIndex,
+                               resp->paramsInfo.recordLen,
+                               resp->paramsInfo.alphaIdLen,
+                               alphaId,
+                               resp->paramsInfo.paramIndicator,
+                               resp->paramsInfo.tpDestAddr.dialNumLen,
+                               resp->paramsInfo.tpDestAddr.typeOfNum,
+                               resp->paramsInfo.tpDestAddr.numPlanId,
+                               destDialNum,
+                               resp->paramsInfo.tpSvcCntrAddr.dialNumLen,
+                               resp->paramsInfo.tpSvcCntrAddr.typeOfNum,
+                               resp->paramsInfo.tpSvcCntrAddr.numPlanId,
+                               scaDialNum,
+                               resp->paramsInfo.tpProtocolId,
+                               resp->paramsInfo.tpDataCodingScheme,
+                               resp->paramsInfo.tpValidityPeriod);
+
+                       if(alphaId)
+                               g_free(alphaId);
+
+                       if(destDialNum)
+                               g_free(destDialNum);
+
+                       if(scaDialNum)
+                               g_free(scaDialNum);
+                       
                        }
                        break;
 
                case TRESP_SMS_SET_PARAMS:{
-                               const struct tresp_sms_set_params *resp = data;
-                               TelSmsSetResponse RequestType = TAPI_NETTEXT_SETPARAMETERS_RSP;
+                       const struct tresp_sms_set_params *resp = data;
 
-                               dbg("resp->result = 0x%x", resp->result);
+                       dbg("receive TRESP_SMS_SET_PARAMS");
+                       dbg("resp->result = 0x%x", resp->result);
+
+                       telephony_sms_complete_set_sms_params(dbus_info->interface_object, dbus_info->invocation,
+                               resp->result);
 
-                               ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_SET_REQUEST_CNF,
-                                               appname, RequestId, resp->result, sizeof(TelSmsCause_t), (void *) &RequestType);
                        }
                        break;
 
                case TRESP_SMS_GET_PARAMCNT: {
-                               const struct tresp_sms_get_paramcnt *resp = data;
+                       const struct tresp_sms_get_paramcnt *resp = data;
+
+                       dbg("receive TRESP_SMS_GET_PARAMCNT");
+                       dbg("resp->result = 0x%x", resp->result);
 
-                               dbg("resp->result = 0x%x", resp->result);
+                       telephony_sms_complete_get_sms_param_cnt(dbus_info->interface_object, dbus_info->invocation,
+                               resp->result,
+                               resp->recordCount);
 
-                               if(resp->result == SMS_SUCCESS) {
-                                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_PARAM_COUNT_IND,
-                                               appname, RequestId, resp->result, sizeof(int), (void *) &resp->recordCount);
-                               }
-                               else
-                               {
-                                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_PARAM_COUNT_IND,
-                                               appname, RequestId, resp->result, sizeof(int), NULL);
-                               }
                        }
                        break;
 
@@ -632,55 +1214,285 @@ TReturn dbus_response_sms(struct custom_data *ctx, UserRequest *ur, const char *
        return TRUE;
 }
 
-TReturn dbus_notification_sms(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data)
+gboolean dbus_plugin_sms_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
 {
-       dbg("command = 0x%x", command);
+       TelephonySms *sms;
+
+       if (!object)
+       {
+               dbg("object is NULL");
+               return FALSE;
+       }
+
+       sms = telephony_object_peek_sms(TELEPHONY_OBJECT(object));
+       dbg("sms = %p", sms);
+
+       dbg("[tcore_SMS]notification !!! (command = 0x%x, data_len = %d)", command, data_len);
 
        switch (command) {
                case TNOTI_SMS_INCOM_MSG: {
-                        const struct tnoti_sms_umts_msg *noti = data;
+                       const struct tnoti_sms_umts_msg *noti = data;
+
+                       gchar *sca = NULL;
+                       gchar *tpdu = NULL;                     
+
+                       sca = g_base64_encode((const guchar *)&(noti->msgInfo.sca[0]), SMS_SMSP_ADDRESS_LEN);
+                       if (sca == NULL) {
+                               dbg("g_base64_encode: Failed to Enocde msgInfo.sca");
+                               sca = "";
+                       }
+
+                       tpdu = g_base64_encode((const guchar *)&(noti->msgInfo.tpduData[0]), SMS_SMDATA_SIZE_MAX + 1);
+                       if (tpdu == NULL) {
+                               dbg("g_base64_encode: Failed to Enocde msgInfo.tpduData");
+                               tpdu = "";
+                       }
+                       
+                       telephony_sms_emit_incomming_msg(sms,
+                               sca,
+                               noti->msgInfo.msgLength,
+                               tpdu);
+
+                       if(sca)
+                               g_free(sca);
+
+                       if(tpdu)
+                               g_free(tpdu);
 
-                        ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_INCOM_IND, NULL, TAPI_REQUEST_NOTI_ID,
-                                TAPI_NETTEXT_SUCCESS, sizeof(struct telephony_sms_DataPackageInfo), (void *)&(noti->msgInfo));
                        }
                        break;
+
                case TNOTI_SMS_CB_INCOM_MSG: {
                        const struct tnoti_sms_cellBroadcast_msg *noti = data;
+                       gchar *msgData = NULL;
+                       
+                       msgData = g_base64_encode((const guchar *)&(noti->cbMsg.msgData[0]), SMS_SMSP_ADDRESS_LEN);
+                       if (msgData == NULL) {
+                               dbg("g_base64_encode: Failed to Enocde cbMsg.msgData");
+                               msgData = "";
+                       }
+
+                       telephony_sms_emit_incomming_cb_msg(sms,
+                               noti->cbMsg.cbMsgType,
+                               noti->cbMsg.length,
+                               msgData);
+
+                       if(msgData)
+                               g_free(msgData);
 
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_CB_INCOM_IND, NULL,
-                                       TAPI_REQUEST_NOTI_ID, TAPI_NETTEXT_SUCCESS, sizeof(struct telephony_sms_CbMsg), (void *)&(noti->cbMsg));
                        }
                        break;
+
                case TNOTI_SMS_INCOM_EX_MSG: {
-                        const struct tnoti_sms_cdma_msg *noti = data;
+#if 0
+                       noti->cdmaMsg.ParamMask), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgType), SIPC_MARSHAL_DATA_INT_TYPE);
 
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_INCOM_EX_IND,
-                                       NULL, TAPI_REQUEST_NOTI_ID, TAPI_NETTEXT_SUCCESS, sizeof(struct telephony_sms_CdmaMsgInfo), (void *)&(noti->cdmaMsg));
+                       switch(noti->cdmaMsg.MsgType)
+                       {
+                               case SMS_MESSAGETYPE_DELIVER:
+                                       /* Origination address */
+                                       noti->cdmaMsg.MsgData.inDeliver.OrigAddr.Digit), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.OrigAddr.NumberMode), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.OrigAddr.NumberType), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.OrigAddr.NumberPlan), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.OrigAddr.szAddrLength), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.OrigAddr.szAddress[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
+
+                                       /* Origination subaddress */
+                                       noti->cdmaMsg.MsgData.inDeliver.OrigSubAddr.SubType), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.OrigSubAddr.Odd), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.OrigSubAddr.szAddrLength), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.OrigSubAddr.szAddress[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
+
+                                       noti->cdmaMsg.MsgData.inDeliver.TeleService), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.bBearerReplySeqRequest), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.ReplySeqNumber), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.MsgId), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.MsgEncoding), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.MsgLength), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.szData[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
+
+                                       /* Message center time stamp */
+                                       void *)&(noti->cdmaMsg.MsgData.inDeliver.MessageCenterTimeStamp.year), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.MessageCenterTimeStamp.month), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.MessageCenterTimeStamp.day), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.MessageCenterTimeStamp.hours), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.MessageCenterTimeStamp.minutes), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.MessageCenterTimeStamp.seconds), SIPC_MARSHAL_DATA_INT_TYPE);
+
+                                       /* Validity period - Absolute */
+                                       noti->cdmaMsg.MsgData.inDeliver.ValidityPeriodAbs.year), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.ValidityPeriodAbs.month), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.ValidityPeriodAbs.day), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.ValidityPeriodAbs.hours), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.ValidityPeriodAbs.minutes), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.ValidityPeriodAbs.seconds), SIPC_MARSHAL_DATA_INT_TYPE);
+
+                                       noti->cdmaMsg.MsgData.inDeliver.ValidityPeriodRel), SIPC_MARSHAL_DATA_CHAR_TYPE);
+
+                                       /* Deferred delivery time - Absolute (not supported) */
+                                       noti->cdmaMsg.MsgData.inDeliver.DeferredDelTimeAbs.year), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.DeferredDelTimeAbs.month), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.DeferredDelTimeAbs.day), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.DeferredDelTimeAbs.hours), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.DeferredDelTimeAbs.minutes), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.DeferredDelTimeAbs.seconds), SIPC_MARSHAL_DATA_INT_TYPE);
+
+                                       /* Deferred delivery time - Relative (not supported) */
+                                       noti->cdmaMsg.MsgData.inDeliver.DeferredDelTimeRel), SIPC_MARSHAL_DATA_CHAR_TYPE);
+
+                                       noti->cdmaMsg.MsgData.inDeliver.Priority), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.Privacy), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.NumMsg), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.bUserAckRequest), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.bDeliveryAckRequest), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.AlertPriority), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.MsgLang), SIPC_MARSHAL_DATA_INT_TYPE);
+
+                                       /* Callback number address */
+                                       noti->cdmaMsg.MsgData.inDeliver.CallBackNumer.Digit), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.CallBackNumer.NumberMode), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.CallBackNumer.NumberType), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.CallBackNumer.NumberPlan), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.CallBackNumer.szAddrLength), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliver.CallBackNumer.szAddress[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
+
+                                       noti->cdmaMsg.MsgData.inDeliver.Display), SIPC_MARSHAL_DATA_INT_TYPE);
+
+                                       break;
+
+                               case SMS_MESSAGETYPE_DELIVERY_ACK:
+                                       /* Origination address */
+                                       noti->cdmaMsg.MsgData.inAck.OrigAddr.Digit), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.OrigAddr.NumberMode), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.OrigAddr.NumberType), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.OrigAddr.NumberPlan), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.OrigAddr.szAddrLength), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.OrigAddr.szAddress[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
+
+                                       /* Origination subaddress */
+                                       noti->cdmaMsg.MsgData.inAck.OrigSubAddr.SubType), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.OrigSubAddr.Odd), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.OrigSubAddr.szAddrLength), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.OrigSubAddr.szAddress), SIPC_MARSHAL_DATA_CHAR_TYPE);
+
+                                       noti->cdmaMsg.MsgData.inAck.TeleService), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.bBearerReplySeqRequest), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.ReplySeqNumber), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.MsgId), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.MsgEncoding), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.MsgLength), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.szData[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
+
+                                       noti->cdmaMsg.MsgData.inAck.UserResponseCode), SIPC_MARSHAL_DATA_CHAR_TYPE);
+
+                                       /* Message center time stamp */
+                                       noti->cdmaMsg.MsgData.inAck.MessageCenterTimeStamp.year), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.MessageCenterTimeStamp.month), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.MessageCenterTimeStamp.day), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.MessageCenterTimeStamp.hours), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.MessageCenterTimeStamp.minutes), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inAck.MessageCenterTimeStamp.seconds), SIPC_MARSHAL_DATA_INT_TYPE);
+
+                                       break;
+
+                               case SMS_MESSAGETYPE_USER_ACK:
+                                       /* Origination address */
+                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigAddr.Digit), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigAddr.NumberMode), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigAddr.NumberType), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigAddr.NumberPlan), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigAddr.szAddrLength), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigAddr.szAddress[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
+
+                                       /* Origination subaddress */
+                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigSubAddr.SubType), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigSubAddr.Odd), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigSubAddr.szAddrLength), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigSubAddr.szAddress), SIPC_MARSHAL_DATA_CHAR_TYPE);
+
+                                       noti->cdmaMsg.MsgData.inDeliverAck.TeleService), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.bBearerReplySeqRequest), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.ReplySeqNumber), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.MsgId), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.MsgEncoding), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.MsgLength), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.szData[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
+
+                                       /* Message center time stamp */
+                                       noti->cdmaMsg.MsgData.inDeliverAck.MessageCenterTimeStamp.year), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.MessageCenterTimeStamp.month), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.MessageCenterTimeStamp.day), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.MessageCenterTimeStamp.hours), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.MessageCenterTimeStamp.minutes), SIPC_MARSHAL_DATA_INT_TYPE);
+                                       noti->cdmaMsg.MsgData.inDeliverAck.MessageCenterTimeStamp.seconds), SIPC_MARSHAL_DATA_INT_TYPE);
+
+                                       break;
+                               default:
+                                       break;
+                       }
+#endif
                        }
                        break;
+
                case TNOTI_SMS_CB_INCOM_EX_MSG: {
-                        const struct tnoti_sms_cdma_msg *noti = data;
+#if 0
+                       noti->cdmaMsg.MsgData.inBc.ServiceCategory), SIPC_MARSHAL_DATA_INT_TYPE);
+
+                       noti->cdmaMsg.MsgData.inBc.MsgId), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.bBearerReplySeqRequest), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.ReplySeqNumber), SIPC_MARSHAL_DATA_CHAR_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.MsgEncoding), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.MsgLength), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.szData[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
+
+                       /* Message center time stamp */
+                       noti->cdmaMsg.MsgData.inBc.MessageCenterTimeStamp.year), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.MessageCenterTimeStamp.month), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.MessageCenterTimeStamp.day), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.MessageCenterTimeStamp.hours), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.MessageCenterTimeStamp.minutes), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.MessageCenterTimeStamp.seconds), SIPC_MARSHAL_DATA_INT_TYPE);
+
+                       /* Validity period - Absolute */
+                       noti->cdmaMsg.MsgData.inBc.ValidityPeriodAbs.year), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.ValidityPeriodAbs.month), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.ValidityPeriodAbs.day), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.ValidityPeriodAbs.hours), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.ValidityPeriodAbs.minutes), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.ValidityPeriodAbs.seconds), SIPC_MARSHAL_DATA_INT_TYPE);
+
+                       noti->cdmaMsg.MsgData.inBc.ValidityPeriodRel), SIPC_MARSHAL_DATA_CHAR_TYPE);
+
+                       noti->cdmaMsg.MsgData.inBc.Priority), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.AlertPriority), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.MsgLang), SIPC_MARSHAL_DATA_INT_TYPE);
+                       noti->cdmaMsg.MsgData.inBc.Display), SIPC_MARSHAL_DATA_INT_TYPE);
 
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_CB_INCOM_EX_IND,
-                                       NULL, TAPI_REQUEST_NOTI_ID, TAPI_NETTEXT_SUCCESS, sizeof(struct telephony_sms_CdmaMsgInfo), (void *)&(noti->cdmaMsg));
+#endif
                        }
                        break;
+
                case TNOTI_SMS_MEMORY_STATUS: {
                        const struct tnoti_sms_memory_status *noti = data;
 
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_MEMORY_STATUS_IND,
-                                       NULL, TAPI_REQUEST_NOTI_ID, TAPI_NETTEXT_SUCCESS, sizeof(int), (void *)&(noti->status));
+                       telephony_sms_emit_memory_status(sms, noti->status);
+
                        }
                        break;
+
                case TNOTI_SMS_DEVICE_READY: {
-                       const struct tnoti_sms_device_ready_status *noti = data;
+                       const struct tnoti_sms_ready_status *noti = data;
+
+                       telephony_sms_emit_sms_ready(sms, noti->status);
 
-                       ts_delivery_event(ctx->EvtDeliveryHandle, TAPI_EVENT_CLASS_NETTEXT, TAPI_EVENT_NETTEXT_DEVICE_READY_IND,
-                                       NULL, TAPI_REQUEST_NOTI_ID, TAPI_NETTEXT_SUCCESS, sizeof(int), (void *) &(noti->status));
                        }
                        break;
+
                default:
+                       dbg("unknown notification");
+                       return FALSE;
                        break;
        }
 
diff --git a/src/sound.c b/src/sound.c
deleted file mode 100644 (file)
index bb05cc0..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <glib.h>
-
-#include <tcore.h>
-#include <plugin.h>
-#include <server.h>
-#include <storage.h>
-#include <user_request.h>
-#include <core_object.h>
-#include <communicator.h>
-
-#include <TapiCommon.h>
-#include <ITapiSound.h>
-
-#include "tel_cs_conn.h"
-#include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "ts_noti.h"
-#include "modules.h"
-
-void dbus_request_sound(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
-{
-       int api_err = TAPI_API_SUCCESS;
-       int                                     req_id = 0xff;
-
-       CoreObject*                     o = NULL;
-       UserRequest*            ur = NULL;
-       struct tcore_user_info  ui = { 0, };
-
-       tapi_dbus_connection_name conn_name;
-       GSList*                         co_list = 0;
-
-       TReturn                         ret = 0;
-
-
-       conn_name = g_array_index(in_param4, tapi_dbus_connection_name, 0);
-
-       co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_CALL);
-       if (!co_list) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
-       }
-
-       o = (CoreObject *)co_list->data;
-       g_slist_free(co_list);
-
-       if (!o) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
-       }
-
-       ur = tcore_user_request_new( ctx->comm, tcore_plugin_get_description(plugin)->name);
-       if (!ur) {
-               api_err = TAPI_API_SERVER_FAILURE;
-               goto OUT;
-       }
-
-       ui.appname = conn_name.name;
-       tcore_user_request_set_user_info(ur, &ui);
-
-       dbg("tapi_service_function : [%d]", tapi_service_function );
-                       
-
-       switch (tapi_service_function) {
-               case TAPI_CS_SOUND_VOLUME_GET: {
-                       struct treq_call_sound_get_volume_level data;
-                       tapi_sound_volume_control_t info;
-
-                       info = g_array_index(in_param1, tapi_sound_volume_control_t, 0 );
-
-                       data.device = ( info.vol_type >> 4 );
-                       data.device <<= 4;
-                       data.sound  = ( info.vol_type - data.device );
-
-                       tcore_user_request_set_data(ur, sizeof( struct treq_call_sound_get_volume_level ), &data);
-                       tcore_user_request_set_command(ur, TREQ_CALL_GET_SOUND_VOLUME_LEVEL );
-
-               } break;
-
-               case TAPI_CS_SOUND_VOLUME_SET: {
-                       struct treq_call_sound_set_volume_level data;
-                       tapi_sound_volume_control_t info;
-
-                       info = g_array_index(in_param1, tapi_sound_volume_control_t, 0 );
-
-                       data.device = ( info.vol_type >> 4 );
-                       data.device <<= 4;
-                       data.sound  = ( info.vol_type - data.device );
-                       data.volume = info.volume;
-
-                       tcore_user_request_set_data(ur, sizeof( struct treq_call_sound_set_volume_level ), &data);
-                       tcore_user_request_set_command(ur, TREQ_CALL_SET_SOUND_VOLUME_LEVEL );
-
-               } break;
-
-               case TAPI_CS_SOUND_MIC_MUTE_GET: {
-
-                       tcore_user_request_set_command(ur, TREQ_CALL_GET_MUTE_STATUS );
-
-               } break;
-
-               case TAPI_CS_SOUND_MIC_MUTE_SET: {
-                       enum tcore_request_command command = 0;
-                       tapi_sound_mic_mute_t status = 0;
-
-                       status = g_array_index( in_param1, tapi_sound_mic_mute_t, 0 );
-
-                       if ( status ==  TAPI_SOUND_MIC_MUTE )
-                               command = TREQ_CALL_MUTE;
-                       else
-                               command = TREQ_CALL_UNMUTE;
-
-                       tcore_user_request_set_command(ur, command );
-
-               } break;
-
-               case TAPI_CS_SOUND_AUDIO_PATH_CTRL: {
-                       struct treq_call_sound_set_path data;
-
-                       data.path = g_array_index( in_param1, tapi_sound_audio_path_t, 0 );
-
-                       tcore_user_request_set_data(ur, sizeof( struct treq_call_sound_set_path ), &data);
-                       tcore_user_request_set_command(ur, TREQ_CALL_SET_SOUND_PATH );
-
-               } break;
-
-               case TAPI_CS_SOUND_AUDIOLOOPBACK_SET: 
-               case TAPI_CS_SOUND_AUDIO_CLOCK_CTRL:
-               case TAPI_CS_SOUND_VOICE_RECORDING_SET:
-               default:
-                       api_err = TAPI_API_SUCCESS;
-                       break;
-       }
-
-       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-       if (ret != TCORE_RETURN_SUCCESS) {
-               api_err = TAPI_API_OPERATION_FAILED;
-       }
-
-       dbg("ret = 0x%x", ret);
-
-OUT:
-       if (api_err != TAPI_API_SUCCESS) {
-               tcore_user_request_free(ur);
-       }
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-       g_array_append_vals(*out_param2, &req_id, sizeof(int));
-}
-
-TReturn dbus_response_sound(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
-
-TReturn dbus_notification_sound(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
index a4d1fd482fbfb51657f0ddf449b120e7f34ca083..6db03cc425c6088f20e220742c1f136f05f001da 100644 (file)
--- a/src/ss.c
+++ b/src/ss.c
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 #include <stdio.h>
 #include <string.h>
-#include <assert.h>
+#include <pthread.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <time.h>
 #include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
 
 #include <tcore.h>
-#include <plugin.h>
 #include <server.h>
+#include <plugin.h>
+#include <hal.h>
+#include <communicator.h>
 #include <storage.h>
+#include <queue.h>
 #include <user_request.h>
-#include <core_object.h>
-#include <communicator.h>
+#include <co_ss.h>
+#include <co_sim.h>
+#include <co_ps.h>
 
-#include <TapiCommon.h>
-#include <TelSs.h>
-
-#include "tel_cs_conn.h"
+#include "generated-code.h"
 #include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "ts_noti.h"
-#include "modules.h"
 
-static enum telephony_ss_class _convert_call_type_to_ss_class( TelSsCallType_t call_type )
-{
-       switch ( call_type ) {
-       case TAPI_CALL_TYPE_VOICE_EV :                          /**< Voice Call */
-               return SS_CLASS_VOICE;
 
-       case TAPI_CALL_TYPE_DATA_EV :                           /**< Data Call */
-               return SS_CLASS_ALL_DATA_TELE;
 
-       case TAPI_CALL_TYPE_FAX_EV :                                    /**< FAX   Call */
-               return SS_CLASS_FAX;
+static gboolean
+on_ss_activate_barring (TelephonySs *ss,
+               GDBusMethodInvocation *invocation,
+               gint ss_class,
+               gint barring_mode,
+               const gchar *barring_password,
+               gpointer user_data)
+{
+       char buf[5];
+       struct treq_ss_barring req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-       case TAPI_CALL_TYPE_SHORT_MESS_EV :             /**< Short Message */
-               return SS_CLASS_SMS;
+       memset(&req, 0, sizeof(struct treq_ss_barring));
 
-       case TAPI_CALL_TYPE_ALL_ASYNC_EV:       /**< All Async services */
-               return SS_CLASS_ALL_ASYNC;
+       req.class = ss_class;
+       req.mode = barring_mode;
 
-       case TAPI_CALL_TYPE_ALL_SYNC_EV:        /**< All sync services */
-               return SS_CLASS_ALL_SYNC;
+       memcpy(req.password, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
+       memcpy(buf, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
 
-       case TAPI_CALL_TYPE_DATA_CIRCUIT_SYNC_EV:       /**< Data Circuit Sync */
-               break;
+       buf[4] = 0;
+       dbg("req.password = [%s]", buf);
 
-       case TAPI_CALL_TYPE_ALL_TELE_BEARER:    /**< all tele and bearer services */
-               return SS_CLASS_ALL_TELE_BEARER;
+       dbg("class = %d, mode = %d", req.class, req.mode);
 
-       case TAPI_CALL_TYPE_ALL_TELE:           /**< All tele services */
-               return SS_CLASS_ALL_TELE;
+       ur = MAKE_UR(ctx, ss, invocation);
 
-       default:
-               break;
-       }
+       tcore_user_request_set_data(ur, sizeof(struct treq_ss_barring), &req);
+       tcore_user_request_set_command(ur, TREQ_SS_BARRING_ACTIVATE);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-       return SS_CLASS_NONE;
+       return TRUE;
 }
 
-static enum telephony_ss_class _convert_cf_type_to_ss_class( TelSsForwardType_t cf_type )
+static gboolean
+on_ss_deactivate_barring (TelephonySs *ss,
+               GDBusMethodInvocation *invocation,
+               gint ss_class,
+               gint barring_mode,
+               const gchar *barring_password,
+               gpointer user_data)
 {
-       switch ( cf_type ) {
-       case TAPI_CS_FORWARD_TYPE_VOICE_EV:                     /**< Voice call forward */
-               return SS_CLASS_VOICE;
+       char buf[5];
+       struct treq_ss_barring req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-       case TAPI_CS_FORWARD_TYPE_ALL_ASYNC_EV:          /**< All Async services */
-               return SS_CLASS_ALL_ASYNC;
+       memset(&req, 0, sizeof(struct treq_ss_barring));
 
-       case TAPI_CS_FORWARD_TYPE_ALL_SYNC_EV:                  /**< All sync services */
-               return SS_CLASS_ALL_SYNC;
+       req.class = ss_class;
+       req.mode = barring_mode;
 
-       case TAPI_CS_FORWARD_TYPE_DATA_EV:                              /**< Data call forward */
-               return SS_CLASS_ALL_DATA_TELE;
+       memcpy(req.password, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
+       memcpy(buf, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
 
-       case TAPI_CS_FORWARD_TYPE_FAX_EV:                               /**< Fax call forward */
-               return SS_CLASS_FAX;
+       buf[4] = 0;
+       dbg("req.password = [%s]", buf);
+       dbg("class = %d, mode = %d", req.class, req.mode);
 
-    case TAPI_CS_FORWARD_TYPE_ALL_TELE_BEARER: /**< All tele and bearer services */
-               return SS_CLASS_ALL_TELE_BEARER;
+       ur = MAKE_UR(ctx, ss, invocation);
 
-    case TAPI_CS_FORWARD_TYPE_ALL_TELE:                /**< All tele services */
-               return SS_CLASS_ALL_TELE;
+       tcore_user_request_set_data(ur, sizeof(struct treq_ss_barring), &req);
+       tcore_user_request_set_command(ur, TREQ_SS_BARRING_DEACTIVATE);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-    case TAPI_CS_FORWARD_TYPE_AUX_VOICE:               /**< AUX Voice */
-               return SS_CLASS_AUX_VOICE ;
-
-       default:
-               break;
-       }
-
-       return SS_CLASS_NONE;
+       return TRUE;
 }
 
-static enum telephony_ss_barring_mode _convert_ss_barring_type(TelSsCallBarType_t type)
+static gboolean
+on_ss_change_barring_password (TelephonySs *ss,
+               GDBusMethodInvocation *invocation,
+               const gchar *barring_password,
+               const gchar *barring_password_new,
+               const gchar *barring_password_confirm,
+               gpointer user_data)
 {
-       enum telephony_ss_barring_mode mode = 0;
+       char buf[5];
+       struct treq_ss_barring_change_password req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-       dbg("Before conversion - Barring flavor: [%x] ", type);
+       memset(&req, 0, sizeof(struct treq_ss_barring_change_password));
 
-       switch ( type ) {
-               case TAPI_CALL_BARRING_ALL:
-                       mode = SS_BARR_MODE_AB;
-                       break;
+       memcpy(req.password_old, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
+       memcpy(req.password_new, barring_password_new, MAX_SS_BARRING_PASSWORD_LEN);
+       memcpy(req.password_confirm, barring_password_confirm, MAX_SS_BARRING_PASSWORD_LEN);
 
-               case TAPI_CALL_BARRING_OUTGOING:
-                       mode = SS_BARR_MODE_AOB;
-                       break;
+       memcpy(buf, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
+       buf[4] = 0;
+       dbg("req.password_old = [%s]", buf);
 
-               case TAPI_CALL_BARRING_ALL_OUTGOING_CALLS:
-                       mode = SS_BARR_MODE_BAOC;
-                       break;
+       memcpy(buf, barring_password_new, MAX_SS_BARRING_PASSWORD_LEN);
+       dbg("req.password_new = [%s]", buf);
 
-               case TAPI_CALL_BARRING_ALL_OUTGOING_INTERN_CALL:
-                       mode = SS_BARR_MODE_BOIC;
-                       break;
 
-               case TAPI_CALL_BARRING_ALL_OUTGOING_INTERN_CALL_EXCEPT:
-                       mode = SS_BARR_MODE_BOIC_NOT_HC;
-                       break;
+       memcpy(buf, barring_password_confirm, MAX_SS_BARRING_PASSWORD_LEN);
+       dbg("req.password_confirm = [%s]", buf);
 
-               case TAPI_CALL_BARRING_INCOMING:
-                       mode = SS_BARR_MODE_AIB;
-                       break;
+       ur = MAKE_UR(ctx, ss, invocation);
 
-               case TAPI_CALL_BARRING_ALL_INCOMING_CALLS:
-                       mode = SS_BARR_MODE_BAIC;
-                       break;
-
-               case TAPI_CALL_BARRING_ALL_INCOMING_CALLS_ROAMING:
-                       mode = SS_BARR_MODE_BIC_ROAM;
-                       break;
+       tcore_user_request_set_data(ur, sizeof(struct treq_ss_barring_change_password), &req);
+       tcore_user_request_set_command(ur, TREQ_SS_BARRING_CHANGE_PASSWORD);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-               case TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM:
-                       mode = SS_BARR_MODE_BIC_NOT_SIM;
-                       break;
-
-               default:
-                       dbg("  DEFAULT ERR Requested flavor not supported ");
-                       break;
-       }
-       dbg("Helper Func Return Converted Barring Type- [%x]", mode);
-       return mode;
+       return TRUE;
 }
-void dbus_request_ss(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
-{
-       int                                     api_err = TAPI_API_SUCCESS;
-       int                                     req_id = 0xff;
-
-       CoreObject*                     o = NULL;
-       UserRequest*            ur = NULL;
-       struct tcore_user_info  ui = { 0, };
-
-       tapi_dbus_connection_name conn_name;
-       GSList*                         co_list = 0;
 
-       TReturn                         ret = 0;
+static gboolean
+on_ss_get_barring_status (TelephonySs *ss,
+               GDBusMethodInvocation *invocation,
+               gint ss_class,
+               gint barring_mode,
+               gpointer user_data)
+{
+       struct treq_ss_barring req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
+       memset(&req, 0, sizeof(struct treq_ss_barring));
 
-       conn_name = g_array_index(in_param4, tapi_dbus_connection_name, 0);
+       req.class = ss_class;
+       req.mode = barring_mode;
 
-       co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_SS);
-       if (!co_list) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
-       }
+       dbg("class = %d, mode = %d", req.class, req.mode);
 
-       o = (CoreObject *)co_list->data;
-       g_slist_free(co_list);
+       ur = MAKE_UR(ctx, ss, invocation);
 
-       if (!o) {
-               api_err = TAPI_API_NOT_SUPPORTED;
-               goto OUT;
-       }
+       tcore_user_request_set_data(ur, sizeof(struct treq_ss_barring), &req);
+       tcore_user_request_set_command(ur, TREQ_SS_BARRING_GET_STATUS);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-       ur = tcore_user_request_new( ctx->comm, tcore_plugin_get_description(plugin)->name);
-       if (!ur) {
-               api_err = TAPI_API_SERVER_FAILURE;
-               goto OUT;
-       }
 
-       ui.appname = conn_name.name;
-       tcore_user_request_set_user_info(ur, &ui);
+       return TRUE;
+}
 
-       switch (tapi_service_function) {
+static gboolean
+on_ss_register_forwarding (TelephonySs *ss,
+               GDBusMethodInvocation *invocation,
+               gint ss_class,
+               gint forward_mode,
+               gint forward_no_reply_time,
+               const gchar *forward_number,
+               gpointer user_data)
+{
+       struct treq_ss_forwarding req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-               case TAPI_CS_SS_BARRSETREQ: {
-                       struct treq_ss_barring data;
-                       TelSsCallBarringInfo_t *barringInfo = 0;
-                       barringInfo = &g_array_index( in_param1, TelSsCallBarringInfo_t, 0 );
+       memset(&req, 0, sizeof(struct treq_ss_forwarding));
 
-                       dbg("barring type : [0x%x]", barringInfo->Type);
-                       dbg("teleservice type : [0x%x]", barringInfo->CallType);
-                       dbg("barring mode : [0x%x]", barringInfo->Mode);
+       req.class = ss_class;
+       req.mode = forward_mode;
+       req.time = forward_no_reply_time;
+       snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
 
-                       data.class = _convert_call_type_to_ss_class( barringInfo->CallType );
-                       data.mode = _convert_ss_barring_type( barringInfo->Type );
+       dbg("class = %d, mode = %d, time = %d, number = %s",
+                       req.class, req.mode, req.time, req.number);
 
-                       memcpy( data.password, barringInfo->szPassword, MAX_SS_BARRING_PASSWORD_LEN );
+       ur = MAKE_UR(ctx, ss, invocation);
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_ss_barring ), &data);
+       tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
+       tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_REGISTER);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-                       if ( barringInfo->Mode == TAPI_SS_CALL_BAR_ACTIVATE ) {
+       return TRUE;
+}
 
-                               dbg("ss barring activate");
-                               tcore_user_request_set_command( ur, TREQ_SS_BARRING_ACTIVATE );
+static gboolean
+on_ss_deregister_forwarding (TelephonySs *ss,
+               GDBusMethodInvocation *invocation,
+               gint ss_class,
+               gint forward_mode,
+               gint forward_no_reply_time,
+               const gchar *forward_number,
+               gpointer user_data)
+{
+       struct treq_ss_forwarding req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       } else if ( barringInfo->Mode == TAPI_SS_CALL_BAR_DEACTIVATE ) {
+       memset(&req, 0, sizeof(struct treq_ss_forwarding));
 
-                               dbg("ss barring deactivate");
-                               tcore_user_request_set_command( ur, TREQ_SS_BARRING_DEACTIVATE );
+       req.class = ss_class;
+       req.mode = forward_mode;
+       req.time = forward_no_reply_time;
+       snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
 
-                       } else {
+       dbg("class = %d, mode = %d, time = %d, number = %s",
+                       req.class, req.mode, req.time, req.number);
 
-                               dbg("[ error ] : wrong barring mode");
-                               break;
-                       }
+       ur = MAKE_UR(ctx, ss, invocation);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
+       tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_DEREGISTER);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
+       return TRUE;
+}
 
-               } break;
+static gboolean
+on_ss_activate_forwarding (TelephonySs *ss,
+               GDBusMethodInvocation *invocation,
+               gint ss_class,
+               gint forward_mode,
+               gint forward_no_reply_time,
+               const gchar *forward_number,
+               gpointer user_data)
+{
+       struct treq_ss_forwarding req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-               case TAPI_CS_SS_BARRCHANGEPWDREQ: {
+       memset(&req, 0, sizeof(struct treq_ss_forwarding));
 
-                       char *temp = 0;
-                       struct treq_ss_barring_change_password data;
+       req.class = ss_class;
+       req.mode = forward_mode;
+       req.time = forward_no_reply_time;
+       snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
 
-                       dbg("SS service Type : TAPI_CS_SS_BARRCHANGEPWDREQ");
+       dbg("class = %d, mode = %d, time = %d, number = %s",
+                       req.class, req.mode, req.time, req.number);
 
-                       /* Extract the call barring old password information from in_param1 */
-                       temp = &g_array_index(in_param1, char, 0);
-                       memcpy(data.password_old, temp, TAPI_SS_GSM_BARR_PW_LEN_MAX);
+       ur = MAKE_UR(ctx, ss, invocation);
 
-                       /* Extract the call barring new password information from in_param2 */
-                       temp = &g_array_index(in_param2, char, 0);
-                       memcpy(data.password_new, temp, TAPI_SS_GSM_BARR_PW_LEN_MAX);
+       tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
+       tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_ACTIVATE);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-                       /* Extract the call barring new password information from in_param2 */
-                       temp = &g_array_index(in_param3, char, 0);
-                       memcpy(data.password_confirm, temp, TAPI_SS_GSM_BARR_PW_LEN_MAX);
+       return TRUE;
+}
 
-                       dbg("Old Password :[%s]", data.password_old);
-                       dbg("New Password :[%s]", data.password_new);
-                       dbg("New Password Again :[%s]", data.password_confirm);
+static gboolean
+on_ss_deactivate_forwarding (TelephonySs *ss,
+               GDBusMethodInvocation *invocation,
+               gint ss_class,
+               gint forward_mode,
+               gint forward_no_reply_time,
+               const gchar *forward_number,
+               gpointer user_data)
+{
+       struct treq_ss_forwarding req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_ss_barring_change_password ), &data);
-                       tcore_user_request_set_command( ur, TREQ_SS_BARRING_CHANGE_PASSWORD );
+       memset(&req, 0, sizeof(struct treq_ss_forwarding));
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       req.class = ss_class;
+       req.mode = forward_mode;
+       req.time = forward_no_reply_time;
+       snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
 
-               } break;
+       dbg("class = %d, mode = %d, time = %d, number = %s",
+                       req.class, req.mode, req.time, req.number);
 
-               case TAPI_CS_SS_BARRQUERYSTATUSREQ: {
+       ur = MAKE_UR(ctx, ss, invocation);
 
-                       struct treq_ss_barring data;
-                       TelSsCallType_t call_type = 0;
-                       TelSsCallBarType_t bar_type = 0;
+       tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
+       tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_DEACTIVATE);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-                       dbg("SS service Type : TAPI_CS_SS_BARRQUERYSTATUSREQ");
+       return TRUE;
+}
 
-                       /* Extract the call barring flavor  information from in_param1 */
-                       bar_type = g_array_index(in_param1, TelSsCallBarType_t, 0);
-                       data.mode = _convert_ss_barring_type( bar_type );
+static gboolean
+on_ss_get_forwarding_status (TelephonySs *ss,
+               GDBusMethodInvocation *invocation,
+               gint ss_class,
+               gint forward_mode,
+               gpointer user_data)
+{
+       struct treq_ss_forwarding req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       /* Extract the tele service information from in_param2 */
-                       call_type = g_array_index(in_param2, TelSsCallType_t, 0);
-                       data.class = _convert_call_type_to_ss_class( call_type );
+       memset(&req, 0, sizeof(struct treq_ss_forwarding));
 
-                       dbg("Barring Type :[%x]", data.mode);
-                       dbg("Teleservice Type :[%x]", data.class);
+       req.class = ss_class;
+       req.mode = forward_mode;
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_ss_barring ), &data);
-                       tcore_user_request_set_command( ur, TREQ_SS_BARRING_GET_STATUS );
+       dbg("class = %d, mode = %d, time = %d, number = %s",
+                       req.class, req.mode, req.time, req.number);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       ur = MAKE_UR(ctx, ss, invocation);
 
-               } break;
+       tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
+       tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_GET_STATUS);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-               case TAPI_CS_SS_FWDSETREQ: {
-
-                       struct treq_ss_forwarding data;
-                       TelSsForwardInfo_t * forwardInfo = NULL;
-
-                       dbg("SS service Type :TAPI_CS_SS_FWDSETREQ");
-
-                       /* Extract the call barring request information from in_param1 */
-                       forwardInfo = &g_array_index(in_param1, TelSsForwardInfo_t, 0);
-
-                       dbg("Forwarding mode :[%x]", forwardInfo->Mode);
-                       dbg("Forwarding condition :[%x]", forwardInfo->Condition);
-                       dbg("Forwarding Teleservice :[%x]", forwardInfo->Type);
-                       dbg("Forwarding Number :[%s]", forwardInfo->szPhoneNumber);
-
-                       data.class = _convert_cf_type_to_ss_class(forwardInfo->Type);
-                       data.mode = (forwardInfo->Condition + 1);
-                       data.time = forwardInfo->NoReplyConditionTimer;
-                       memcpy(data.number, forwardInfo->szPhoneNumber, MAX_SS_FORWARDING_NUMBER_LEN);
-
-                       tcore_user_request_set_data(ur, sizeof( struct treq_ss_forwarding ), &data);
-
-                       switch ( forwardInfo->Mode ) {
-                               case 0: // disable
-                                       tcore_user_request_set_command( ur, TREQ_SS_FORWARDING_DEACTIVATE );
-                                       break;
-                               case 1: // enable
-                                       tcore_user_request_set_command( ur, TREQ_SS_FORWARDING_ACTIVATE );              
-                                       break;
-                               case 2: // register
-                                       tcore_user_request_set_command( ur, TREQ_SS_FORWARDING_REGISTER );
-                                       break;
-                               case 3: // erasure
-                                       tcore_user_request_set_command( ur, TREQ_SS_FORWARDING_DEREGISTER );
-                                       break;
-                               default:
-                                       dbg("[ error ] unknown forwarding mode");
-                                       goto OUT;
-                                       break;
-                       }
+       return TRUE;
+}
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+static gboolean
+on_ss_activate_waiting (TelephonySs *ss,
+               GDBusMethodInvocation *invocation,
+               gint ss_class,
+               gpointer user_data)
+{
+       struct treq_ss_waiting req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-               } break;
+       memset(&req, 0, sizeof(struct treq_ss_waiting));
 
-               case TAPI_CS_SS_FWDQUERYSTATUSREQ: {
+       req.class = ss_class;
 
-                       struct treq_ss_forwarding data;
+       dbg("class = %d", req.class);
 
-                       dbg("SS service Type : TAPI_CS_SS_FWDQUERYSTATUSREQ");
+       ur = MAKE_UR(ctx, ss, invocation);
 
-                       /* Extract the teleservice request information from in_param1 */
-                       data.class = _convert_cf_type_to_ss_class( g_array_index(in_param1, TelSsForwardType_t, 0) );
-                       /* Extract the forwarding flavor request information from in_param2 */
-                       data.mode = g_array_index(in_param2, TelSsForwardWhen_t, 0);
-                       data.mode++; // to convert tcore mode enum value
+       tcore_user_request_set_data(ur, sizeof(struct treq_ss_waiting), &req);
+       tcore_user_request_set_command(ur, TREQ_SS_WAITING_ACTIVATE);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-                       dbg("Forwarding Type :[%x]", data.mode);
-                       dbg("Teleservice Type :[%x]", data.class);
+       return TRUE;
+}
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_ss_forwarding ), &data);
-                       tcore_user_request_set_command( ur, TREQ_SS_FORWARDING_GET_STATUS );
+static gboolean
+on_ss_deactivate_waiting (TelephonySs *ss,
+               GDBusMethodInvocation *invocation,
+               gint ss_class,
+               gpointer user_data)
+{
+       struct treq_ss_waiting req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       memset(&req, 0, sizeof(struct treq_ss_waiting));
 
-               } break;
+       req.class = ss_class;
 
-               case TAPI_CS_SS_WAITSETREQ: {
+       dbg("class = %d", req.class);
 
-                       struct treq_ss_waiting data;
-                       TelSsWaitingInfo_t *CwInfo = NULL;
+       ur = MAKE_UR(ctx, ss, invocation);
 
-                       dbg(" SS service Type : TAPI_CS_SS_WAITSETREQ");
+       tcore_user_request_set_data(ur, sizeof(struct treq_ss_waiting), &req);
+       tcore_user_request_set_command(ur, TREQ_SS_WAITING_DEACTIVATE);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-                       CwInfo = &g_array_index(in_param1, TelSsWaitingInfo_t, 0);
+       return TRUE;
+}
 
-                       dbg("Teleservice Type :[%x]", CwInfo->CallType);
+static gboolean
+on_ss_get_waiting_status (TelephonySs *ss,
+               GDBusMethodInvocation *invocation,
+               gint ss_class,
+               gpointer user_data)
+{
+       struct treq_ss_waiting req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       data.class = _convert_call_type_to_ss_class(CwInfo->CallType);
+       memset(&req, 0, sizeof(struct treq_ss_waiting));
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_ss_waiting ), &data);
+       req.class = ss_class;
 
-                       if ( CwInfo->Mode == 0 ) {
-                               tcore_user_request_set_command( ur, TREQ_SS_WAITING_ACTIVATE );
-                       } else if ( CwInfo->Mode == 1 )
-                               tcore_user_request_set_command( ur, TREQ_SS_WAITING_DEACTIVATE );
-                       else {
-                               dbg("[ error ] unknown waiting mode : [ %d ]", CwInfo->Mode );
-                               goto OUT;
-                       }
+       dbg("class = %d", req.class);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       ur = MAKE_UR(ctx, ss, invocation);
 
-               } break;
+       tcore_user_request_set_data(ur, sizeof(struct treq_ss_waiting), &req);
+       tcore_user_request_set_command(ur, TREQ_SS_WAITING_GET_STATUS);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-               case TAPI_CS_SS_WAITQUERYSTATUSREQ: {
+       return TRUE;
+}
 
-                       struct treq_ss_waiting data;
+static gboolean
+on_ss_get_cli_status (TelephonySs *ss,
+               GDBusMethodInvocation *invocation,
+               gint cli_type,
+               gpointer user_data)
+{
+       struct treq_ss_cli req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-                       dbg("SS service Type : TAPI_CS_SS_WAITQUERYSTATUSREQ");
+       memset(&req, 0, sizeof(struct treq_ss_cli));
 
-                       /* Extract the teleservice request information from in_param1 */
-                       data.class = _convert_call_type_to_ss_class( g_array_index(in_param1, TelSsCallType_t, 0) );
+       req.type = cli_type;
 
-                       dbg("Teleservice Type :[%x]", data.class);
+       dbg("type = %d", req.type);
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_ss_waiting ), &data);
-                       tcore_user_request_set_command( ur, TREQ_SS_WAITING_GET_STATUS );
+       ur = MAKE_UR(ctx, ss, invocation);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       tcore_user_request_set_data(ur, sizeof(struct treq_ss_cli), &req);
+       tcore_user_request_set_command(ur, TREQ_SS_CLI_GET_STATUS);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
+       return TRUE;
+}
 
-               } break;
+static gboolean
+on_ss_send_ussd (TelephonySs *ss,
+               GDBusMethodInvocation *invocation,
+               gint ussd_type,
+               gint ussd_len,
+               const gchar *ussd_string,
+               gpointer user_data)
+{
+       struct treq_ss_ussd req;
+       struct custom_data *ctx = user_data;
+       UserRequest *ur = NULL;
 
-               case TAPI_CS_SS_CLIQUERYSTATUSREQ: {
-                       struct treq_ss_cli data;
+       memset(&req, 0, sizeof(struct treq_ss_ussd));
 
-                       dbg("SS service Type : TAPI_CS_SS_CLIQUERYSTATUSREQ");
+       req.type = SS_USSD_TYPE_USER_INITIATED;
+       snprintf(req.str, MAX_SS_USSD_LEN, "%s", ussd_string);
 
-                       /* Extract the Cli service type request information from in_param1 */
-                       data.type = g_array_index(in_param1, TelSsCliType_t, 0);
+       dbg("type = %d, string = %s", req.type, req.str);
 
-                       dbg("Cli service Type :[%x]", data.type);
+       ur = MAKE_UR(ctx, ss, invocation);
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_ss_cli ), &data);
-                       tcore_user_request_set_command( ur, TREQ_SS_CLI_GET_STATUS );
+       tcore_user_request_set_data(ur, sizeof(struct treq_ss_ussd), &req);
+       tcore_user_request_set_command(ur, TREQ_SS_SEND_USSD);
+       tcore_communicator_dispatch_request(ctx->comm, ur);
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+       return TRUE;
+}
 
-               } break;
+gboolean dbus_plugin_setup_ss_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
+{
+       TelephonySs *ss;
+
+       ss = telephony_ss_skeleton_new();
+       telephony_object_skeleton_set_ss(object, ss);
+       g_object_unref(ss);
+
+       g_signal_connect (ss,
+                       "handle-activate-barring",
+                       G_CALLBACK (on_ss_activate_barring),
+                       ctx);
+
+       g_signal_connect (ss,
+                       "handle-deactivate-barring",
+                       G_CALLBACK (on_ss_deactivate_barring),
+                       ctx);
+
+       g_signal_connect (ss,
+                       "handle-change-barring-password",
+                       G_CALLBACK (on_ss_change_barring_password),
+                       ctx);
+
+       g_signal_connect (ss,
+                       "handle-get-barring-status",
+                       G_CALLBACK (on_ss_get_barring_status),
+                       ctx);
+
+       g_signal_connect (ss,
+                       "handle-register-forwarding",
+                       G_CALLBACK (on_ss_register_forwarding),
+                       ctx);
+
+       g_signal_connect (ss,
+                       "handle-deregister-forwarding",
+                       G_CALLBACK (on_ss_deregister_forwarding),
+                       ctx);
+
+       g_signal_connect (ss,
+                       "handle-activate-forwarding",
+                       G_CALLBACK (on_ss_activate_forwarding),
+                       ctx);
+
+       g_signal_connect (ss,
+                       "handle-deactivate-forwarding",
+                       G_CALLBACK (on_ss_deactivate_forwarding),
+                       ctx);
+
+       g_signal_connect (ss,
+                       "handle-get-forwarding-status",
+                       G_CALLBACK (on_ss_get_forwarding_status),
+                       ctx);
+
+       g_signal_connect (ss,
+                       "handle-activate-waiting",
+                       G_CALLBACK (on_ss_activate_waiting),
+                       ctx);
+
+       g_signal_connect (ss,
+                       "handle-deactivate-waiting",
+                       G_CALLBACK (on_ss_deactivate_waiting),
+                       ctx);
+
+       g_signal_connect (ss,
+                       "handle-get-waiting-status",
+                       G_CALLBACK (on_ss_get_waiting_status),
+                       ctx);
+
+       g_signal_connect (ss,
+                       "handle-get-clistatus",
+                       G_CALLBACK (on_ss_get_cli_status),
+                       ctx);
+
+       g_signal_connect (ss,
+                       "handle-send-ussd",
+                       G_CALLBACK (on_ss_send_ussd),
+                       ctx);
 
-               case TAPI_CS_SS_USSDSENDSTRINGREQ: {
-                       TelSsUssdMsgInfo_t *ussd_msg = NULL;
-                       struct treq_ss_ussd data;
+       return TRUE;
+}
 
-                       dbg("SS service Type : TAPI_CS_SS_USSDSENDSTRINGREQ");
+gboolean dbus_plugin_ss_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
+{
+       GVariant *result = 0;
+       GVariantBuilder b;
+       int i = 0;
 
-                       ussd_msg = &g_array_index(in_param1, TelSsUssdMsgInfo_t, 0);
+       switch (command) {
+               case TRESP_SS_BARRING_ACTIVATE: {
 
-                       data.type = SS_USSD_TYPE_USER_INITIATED;
+                       const struct tresp_ss_barring *resp = data;
 
-                       memset(data.str, '\0', MAX_SS_USSD_LEN);
-                       memcpy(data.str, ussd_msg->szUssdString, MAX_SS_USSD_LEN);
+                       dbg("receive TRESP_SS_BARRING_ACTIVATE");
+                       dbg("resp->err = 0x%x", resp->err);
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_ss_ussd ), &data);
-                       tcore_user_request_set_command( ur, TREQ_SS_SEND_USSD );
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
+                       for (i=0; i<resp->record_num; i++) {
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
+                               g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
+                               g_variant_builder_add(&b, "{sv}", "barring_mode", g_variant_new_int32( resp->record[i].mode ));
+                               g_variant_builder_close(&b);
                        }
 
-               } break;
+                       result = g_variant_builder_end(&b);
 
-               case TAPI_CS_SS_USSDRSP: {
-                       TelSsUssdMsgInfo_t *ussd_rsp = { 0, };
-                       struct treq_ss_ussd data;
+                       telephony_ss_complete_activate_barring(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
 
-                       ussd_rsp = &g_array_index(in_param1, TelSsUssdMsgInfo_t, 0);
-
-                       dbg("Response USSD string: USSD String:[%s]", ussd_rsp->szUssdString);
-
-                       data.type = SS_USSD_TYPE_USER_RES;
-
-                       memset(data.str, '\0', MAX_SS_USSD_LEN);
-                       memcpy(data.str, ussd_rsp->szUssdString, MAX_SS_USSD_LEN);
-
-                       tcore_user_request_set_data(ur, sizeof( struct treq_ss_ussd ), &data);
-                       tcore_user_request_set_command( ur, TREQ_SS_SEND_USSD );
-
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
-                       }
+                       g_variant_unref(result);
 
                } break;
 
-               case TAPI_CS_SS_USSDCANCEL: {
+               case TRESP_SS_BARRING_DEACTIVATE: {
 
-                       struct treq_ss_ussd data;
+                       const struct tresp_ss_barring *resp = data;
 
-                       data.type = SS_USSD_TYPE_USER_RELEASE;
+                       dbg("receive TRESP_SS_BARRING_DEACTIVATE");
+                       dbg("resp->err = 0x%x", resp->err);
 
-                       tcore_user_request_set_data(ur, sizeof( struct treq_ss_ussd ), &data);
-                       tcore_user_request_set_command( ur, TREQ_SS_SEND_USSD );
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-                       ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-                       if (ret != TCORE_RETURN_SUCCESS) {
-                               api_err = TAPI_API_OPERATION_FAILED;
+                       for (i=0; i<resp->record_num; i++) {
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
+                               g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
+                               g_variant_builder_add(&b, "{sv}", "barring_mode", g_variant_new_int32( resp->record[i].mode ));
+                               g_variant_builder_close(&b);
                        }
 
-               } break;
+                       result = g_variant_builder_end(&b);
 
-               case TAPI_CS_SS_GETCALLCOSTREQ: {
-                       TelSsAocType_t aoc_type;
+                       telephony_ss_complete_deactivate_barring(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
 
-                       dbg(" SS service Type : TAPI_CS_SS_GETCALLCOSTREQ");
-
-                       /* Extract the AOC type request information from in_param1 */
-                       aoc_type = g_array_index(in_param1, TelSsAocType_t, 0);
+                       g_variant_unref(result);
 
                } break;
 
-               case TAPI_CS_SS_SETCALLCOSTREQ: {
-                       TelCallAocInfo_t aoc_set_info = { 0, };
-
-                       dbg("SS service Type : TAPI_CS_SS_SETCALLCOSTREQ");
-
-                       /* Extract the Aoc type request information from in_param1 */
-                       aoc_set_info = g_array_index(in_param1, TelCallAocInfo_t, 0);
-
-               } break;
-
-               default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
-       }
-
-OUT:
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-       g_array_append_vals(*out_param2, &req_id, sizeof(int));
-}
-
-static TelSsTeleService_t _convert_ss_class( enum telephony_ss_class class )
-{
-       TelSsTeleService_t service = TAPI_SS_TS_NONE;
-
-       dbg("Helper Func Entrance ");
-
-       switch ( class ) {
-               case SS_CLASS_NONE: /* 0x00 *///NEED TO CHECK
-                       service = TAPI_SS_TS_NONE;
-                       break;
-
-                       /* TELESERVICE */
-               case SS_CLASS_ALL_TELE: /* 0x10 : All Teleservices */
-                       service = TAPI_SS_TS_ALL_TELESERVICES;
-                       break;
-
-               case SS_CLASS_VOICE: /* 0x11 : All Voice ( telephony ) */
-                       service = TAPI_SS_TS_ALL_SPEECH;
-                       break;
-
-               case SS_CLASS_ALL_DATA_TELE: /* 0x12 : All Data Teleservices */
-                       service = TAPI_SS_TS_ALL_DATA_TELESERVICES;
-                       break;
-
-               case SS_CLASS_FAX: /* 0x13 : All Fax Service */
-                       service = TAPI_SS_TS_FACS;
-                       break;
-
-               case SS_CLASS_SMS: /* 0x16 : SMS service         */
-                       service = TAPI_SS_TS_SMS;
-                       break;
-
-               case SS_CLASS_ALL_TELE_EXPT_SMS: /* 0x19 : All teleservice except SMS */
-                       service = TAPI_SS_TS_ALL_TELESERVICES_EXCEPT_SMS;
-                       break;
-
-                       /* BEARER SERVICE */
-               case SS_CLASS_ALL_BEARER: /* 0X20 : all bearer services */
-                       service = TAPI_SS_BS_ALL_BEARER_SERVICES;
-                       break;
-
-               case SS_CLASS_ALL_ASYNC: /* 0x21 : All Async services */
-                       service = TAPI_SS_BS_ALL_ASYNCHRONOUS;
-                       break;
-
-               case SS_CLASS_ALL_SYNC: /* 0x22 : All sync services*/
-                       service = TAPI_SS_BS_ALL_SYNCHRONOUS;
-                       break;
-
-               case SS_CLASS_ALL_CS_SYNC: /* 0x24 : All Circuit switched sync */
-                       service = TAPI_SS_BS_DATA_CIRCUIT_SYNC;
-                       break;
-
-               case SS_CLASS_ALL_CS_ASYNC: /*  0x25 : All Circuit switched async */
-                       service = TAPI_SS_BS_DATA_CIRCUIT_ASYNC;
-                       break;
-
-               case SS_CLASS_ALL_DEDI_PS: /*  0x26 : All Dedicated packet Access */
-                       service = TAPI_SS_BS_DATA_ALL_PDS;
-                       break;
-
-               case SS_CLASS_ALL_DEDI_PAD: /*  0x27 : All Dedicated PAD Access */
-                       service = TAPI_SS_BS_ALL_DATA_PADCA;
-                       break;
-
-               case SS_CLASS_ALL_DATA_CDA: /*  0x28 : All Data CDA*/
-                       service = TAPI_SS_BS_ALL_DATA_CDA;
-                       break;
-
-                       /* PLMN SPECIFIC TELESERVICE */
-               case SS_CLASS_PLMN_TELE_ALL: /*0x50 : PLMN specific teleservices*/
-                       service = TAPI_SS_BS_ALL_PLMN_SPEC_BS;
-                       break;
-
-               case SS_CLASS_PLMN_TELE_1: /*0x51 :PLMN specific teleservice 1*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_1;
-                       break;
-
-               case SS_CLASS_PLMN_TELE_2: /*0x52 : PLMN specific teleservice 2*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_2;
-                       break;
-
-               case SS_CLASS_PLMN_TELE_3: /*0x53 : PLMN specific teleservice 3*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_3;
-                       break;
-
-               case SS_CLASS_PLMN_TELE_4: /*0x54 : PLMN specific teleservice 4*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_4;
-                       break;
-
-               case SS_CLASS_PLMN_TELE_5: /*0x55 : PLMN specific teleservice 5*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_5;
-                       break;
-
-               case SS_CLASS_PLMN_TELE_6: /*0x56 : PLMN specific teleservice 6*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_6;
-                       break;
-
-               case SS_CLASS_PLMN_TELE_7: /*0x57 : PLMN specific teleservice 7*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_7;
-                       break;
-
-               case SS_CLASS_PLMN_TELE_8: /*0x58 : PLMN specific teleservice 8*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_8;
-                       break;
-
-               case SS_CLASS_PLMN_TELE_9: /*0x59 : PLMN specific teleservice 9*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_9;
-                       break;
-
-               case SS_CLASS_PLMN_TELE_A: /*0x60 :PLMN specific teleservice 10*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_A;
-                       break;
-
-               case SS_CLASS_PLMN_TELE_B: /*0x61 :PLMN specific teleservice 11*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_B;
-                       break;
-
-               case SS_CLASS_PLMN_TELE_C: /*0x62 : PLMN specific teleservice 12*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_C;
-                       break;
+               case TRESP_SS_BARRING_CHANGE_PASSWORD: {
 
-               case SS_CLASS_PLMN_TELE_D: /*0x63 : PLMN specific teleservice 13*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_D;
-                       break;
+                       const struct tresp_ss_general *resp = data;
 
-               case SS_CLASS_PLMN_TELE_E: /*0x64 : PLMN specific teleservice 14*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_E;
-                       break;
+                       dbg("receive TRESP_SS_BARRING_CHANGE_PASSWORD");
+                       dbg("resp->err = 0x%x", resp->err);
 
-               case SS_CLASS_PLMN_TELE_F: /*0x65 : PLMN specific teleservice 15*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_F;
-                       break;
-                       /* PLMN SPECIFIC BEARER SERVICE */
-               case SS_CLASS_PLMN_BEAR_ALL: /*0x70 : All PLMN specific bearer services*/
-                       service = TAPI_SS_BS_ALL_BEARER_SERVICES;
-                       break;
-
-               case SS_CLASS_PLMN_BEAR_1: /*0x71 :PLMN specific bearer service 1*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_1;
-                       break;
+                       telephony_ss_complete_change_barring_password(dbus_info->interface_object, dbus_info->invocation, resp->err);
 
-               case SS_CLASS_PLMN_BEAR_2: /*0x72 : PLMN specific bearer service  2*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_2;
-                       break;
+               } break;
 
-               case SS_CLASS_PLMN_BEAR_3: /*0x73 : PLMN specific bearer service  3*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_3;
-                       break;
+               case TRESP_SS_BARRING_GET_STATUS: {
 
-               case SS_CLASS_PLMN_BEAR_4: /*0x74 : PLMN specific bearer service  4*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_4;
-                       break;
+                       const struct tresp_ss_barring *resp = data;
 
-               case SS_CLASS_PLMN_BEAR_5: /*0x75 : PLMN specific bearer service  5*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_5;
-                       break;
+                       dbg("receive TRESP_SS_BARRING_GET_STATUS");
+                       dbg("resp->err = 0x%x", resp->err);
 
-               case SS_CLASS_PLMN_BEAR_6: /*0x76 : PLMN specific bearer service  6*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_6;
-                       break;
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-               case SS_CLASS_PLMN_BEAR_7: /*0x77 : PLMN specific bearer service  7*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_7;
-                       break;
+                       for (i=0; i<resp->record_num; i++) {
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
+                               g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
+                               g_variant_builder_add(&b, "{sv}", "barring_mode", g_variant_new_int32( resp->record[i].mode ));
+                               g_variant_builder_close(&b);
+                       }
 
-               case SS_CLASS_PLMN_BEAR_8: /*0x78 : PLMN specific bearer service  8*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_8;
-                       break;
+                       result = g_variant_builder_end(&b);
 
-               case SS_CLASS_PLMN_BEAR_9: /*0x79 : PLMN specific bearer service  9*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_9;
-                       break;
+                       telephony_ss_complete_get_barring_status(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
 
-               case SS_CLASS_PLMN_BEAR_A: /*0x80 : PLMN specific bearer service  10*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_A;
-                       break;
+                       g_variant_unref(result);
 
-               case SS_CLASS_PLMN_BEAR_B: /*0x81 : PLMN specific bearer service  11*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_B;
-                       break;
+               } break;
 
-               case SS_CLASS_PLMN_BEAR_C: /*0x82 : PLMN specific bearer service  12*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_C;
-                       break;
+               case TRESP_SS_FORWARDING_ACTIVATE: {
+                       const struct tresp_ss_forwarding *resp = data;
 
-               case SS_CLASS_PLMN_BEAR_D: /*0x83 : PLMN specific bearer service  13*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_D;
-                       break;
+                       dbg("receive TRESP_SS_FORWARDING_ACTIVATE");
+                       dbg("resp->err = 0x%x", resp->err);
 
-               case SS_CLASS_PLMN_BEAR_E: /*0x84 : PLMN specific bearer service  14*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_E;
-                       break;
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-               case SS_CLASS_PLMN_BEAR_F: /*0x85 : PLMN specific bearer service  15*/
-                       service = TAPI_SS_BS_PLMN_SPEC_TELE_F;
-                       break;
+                       for (i=0; i<resp->record_num; i++) {
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
+                               g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
+                               g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
+                               g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
+                               g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
+                               g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
+                               g_variant_builder_close(&b);
+                       }
 
-                       /* CPHS - AUXILIARY SERVICE */
-               case SS_CLASS_AUX_VOICE: /* 0x89 : All Auxiliary Voice ( Auxiliary telephony ) */
-                       service = TAPI_SS_TS_AUX_VOICE;
-                       break;
+                       result = g_variant_builder_end(&b);
 
-               case SS_CLASS_ALL_TELE_BEARER: /* 0xFF : all tele and bearer services */
-                       service = TAPI_SS_ALL_TELE_BEARER;
-                       break;
+                       telephony_ss_complete_activate_forwarding(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
 
-               default:
-                       service = TAPI_SS_TS_NONE;
-                       dbg("  DEFAULT - TAPI_SS_TS_NONE");
-                       break;
-       }
+                       g_variant_unref(result);
 
-       dbg(" Converted Teleservice - [%x] ", service);
-       return service;
-}
+               } break;
 
-static TelSsCallBarType_t _convert_ss_barring_mode( enum telephony_ss_barring_mode mode )
-{
-       TelSsCallBarType_t flavor = 0;
+               case TRESP_SS_FORWARDING_DEACTIVATE: {
 
-       dbg("Before conversion  [%x] ", mode);
+                       const struct tresp_ss_forwarding *resp = data;
 
-       switch ( mode ) {
-               case SS_BARR_MODE_AB:
-                       flavor = TAPI_CALL_BARRING_ALL;
-                       break;
+                       dbg("receive TRESP_SS_FORWARDING_DEACTIVATE");
+                       dbg("resp->err = 0x%x", resp->err);
 
-               case SS_BARR_MODE_AOB:
-                       flavor = TAPI_CALL_BARRING_OUTGOING;
-                       break;
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-               case SS_BARR_MODE_BAOC:
-                       flavor = TAPI_CALL_BARRING_ALL_OUTGOING_CALLS;
-                       break;
+                       for (i=0; i<resp->record_num; i++) {
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
+                               g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
+                               g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
+                               g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
+                               g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
+                               g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
+                               g_variant_builder_close(&b);
+                       }
 
-               case SS_BARR_MODE_BOIC:
-                       flavor = TAPI_CALL_BARRING_ALL_OUTGOING_INTERN_CALL;
-                       break;
+                       result = g_variant_builder_end(&b);
 
-               case SS_BARR_MODE_BOIC_NOT_HC:
-                       flavor = TAPI_CALL_BARRING_ALL_OUTGOING_INTERN_CALL_EXCEPT;
-                       break;
+                       telephony_ss_complete_deactivate_forwarding(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
 
-               case SS_BARR_MODE_AIB:
-                       flavor = TAPI_CALL_BARRING_INCOMING;
-                       break;
+                       g_variant_unref(result);
 
-               case SS_BARR_MODE_BAIC:
-                       flavor = TAPI_CALL_BARRING_ALL_INCOMING_CALLS;
-                       break;
+               } break;
 
-               case SS_BARR_MODE_BIC_ROAM:
-                       flavor = TAPI_CALL_BARRING_ALL_INCOMING_CALLS_ROAMING;
-                       break;
+               case TRESP_SS_FORWARDING_REGISTER: {
 
-               case SS_BARR_MODE_BIC_NOT_SIM:
-                       flavor = TAPI_CALL_BARRING_ALL_INCOMING_CALLS_INSIM;
-                       break;
+                       const struct tresp_ss_forwarding *resp = data;
 
-               default:
-                       dbg("  DEFAULT ERR Requested flavor not supported ");
-                       break;
-       }
+                       dbg("receive TRESP_SS_FORWARDING_REGISTER");
+                       dbg("resp->err = 0x%x", resp->err);
 
-       dbg("Helper Func Return Converted Barring flavor- [%x] ", flavor);
-       return flavor;
-}
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-TReturn dbus_response_ss(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
-{
-       void *ss_data = 0;
-       int ss_data_len = 0;
+                       for (i=0; i<resp->record_num; i++) {
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
+                               g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
+                               g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
+                               g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
+                               g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
+                               g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
+                               g_variant_builder_close(&b);
+                       }
 
-       TelSsInfo_t ss;
-       int i =0;
+                       result = g_variant_builder_end(&b);
 
-       dbg("command = 0x%x", command);
+                       telephony_ss_complete_register_forwarding(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
 
-       switch (command) {
-               case TRESP_SS_BARRING_ACTIVATE:
-               case TRESP_SS_BARRING_DEACTIVATE: {
-                       struct tresp_ss_barring* resp_data = 0;
-                       resp_data = (struct tresp_ss_barring*)data;
-                       
-                       if ( !resp_data->err ) {
+                       g_variant_unref(result);
 
-                               ss.SsType = TAPI_SS_TYPE_BARRING;
-                               ss.NumberOfRecords = resp_data->record_num;
+           } break;
 
-                               for ( i=0; i< resp_data->record_num; i++ )  {
+               case TRESP_SS_FORWARDING_DEREGISTER: {
 
-                                       if ( resp_data->record[i].status ==  SS_STATUS_ACTIVATE )
-                                               ss.SsRecord.BarringRecord.rec_class[i].Status = TAPI_SS_STATUS_ACTIVE;
-                                       else
-                                               ss.SsRecord.BarringRecord.rec_class[i].Status = TAPI_SS_STATUS_QUIESCENT;
+                       const struct tresp_ss_forwarding *resp = data;
 
-                                       ss.SsRecord.BarringRecord.rec_class[i].Flavour = _convert_ss_barring_mode( resp_data->record[i].mode );
-                                       ss.SsRecord.BarringRecord.rec_class[i].TeleCommService = _convert_ss_class( resp_data->record[i].class );
+                       dbg("receive TRESP_SS_FORWARDING_DEREGISTER");
+                       dbg("resp->err = 0x%x", resp->err);
 
-                               }
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-                               ss_data = (void*)&ss;
-                               ss_data_len = sizeof( TelSsInfo_t );
+                       for (i=0; i<resp->record_num; i++) {
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
+                               g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
+                               g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
+                               g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
+                               g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
+                               g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
+                               g_variant_builder_close(&b);
+                       }
 
-                       } 
-                               
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                       TAPI_EVENT_CLASS_SS, 
-                                       TAPI_EVENT_SS_BARRING_CNF,
-                                       appname,
-                                       0xff,
-                                       resp_data->err, 
-                                       ss_data_len,
-                                       ss_data );
+                       result = g_variant_builder_end(&b);
 
-               } break;
-               case TRESP_SS_BARRING_CHANGE_PASSWORD: {
+                       telephony_ss_complete_deregister_forwarding(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
 
-                       struct tresp_ss_general *resp_data = (struct tresp_ss_general *)data ;
+                       g_variant_unref(result);
 
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                       TAPI_EVENT_CLASS_SS, 
-                                       TAPI_EVENT_SS_BARRING_CHANGEPASS_CNF,
-                                       appname,
-                                       0xff,
-                                       resp_data->err, 
-                                       0,
-                                       (void*)0 );
                } break;
 
-               case TRESP_SS_BARRING_GET_STATUS: {
-                       struct tresp_ss_barring* resp_data = 0;
-                       resp_data = (struct tresp_ss_barring*)data;
-                       
-                       if ( !resp_data->err ) {
+               case TRESP_SS_FORWARDING_GET_STATUS: {
 
-                               ss.SsType = TAPI_SS_TYPE_BARRING;
-                               ss.NumberOfRecords = resp_data->record_num;
+                       const struct tresp_ss_forwarding *resp = data;
 
-                               for ( i=0; i< resp_data->record_num; i++ )  {
+                       dbg("receive TRESP_SS_FORWARDING_GET_STATUS");
+                       dbg("resp->err = 0x%x", resp->err);
 
-                                       if ( resp_data->record[i].status ==  SS_STATUS_ACTIVATE )
-                                               ss.SsRecord.BarringRecord.rec_class[i].Status = TAPI_SS_STATUS_ACTIVE;
-                                       else
-                                               ss.SsRecord.BarringRecord.rec_class[i].Status = TAPI_SS_STATUS_QUIESCENT;
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-                                       ss.SsRecord.BarringRecord.rec_class[i].Flavour = _convert_ss_barring_mode( resp_data->record[i].mode );
-                                       ss.SsRecord.BarringRecord.rec_class[i].TeleCommService = _convert_ss_class( resp_data->record[i].class );
+                       for (i=0; i<resp->record_num; i++) {
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
+                               g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
+                               g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
+                               g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
+                               g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
+                               g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
+                               g_variant_builder_close(&b);
+                       }
 
-                               }
+                       result = g_variant_builder_end(&b);
 
-                               ss_data = (void*)&ss;
-                               ss_data_len = sizeof( TelSsInfo_t );
+                       telephony_ss_complete_get_forwarding_status(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
 
-                       } 
-                               
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                       TAPI_EVENT_CLASS_SS, 
-                                       TAPI_EVENT_SS_BARRING_QUERYSTATUS_CNF,
-                                       appname,
-                                       0xff,
-                                       resp_data->err, 
-                                       ss_data_len,
-                                       ss_data );
+                       g_variant_unref(result);
 
                } break;
 
-                       break;
-               case TRESP_SS_FORWARDING_ACTIVATE:
-               case TRESP_SS_FORWARDING_DEACTIVATE:
-               case TRESP_SS_FORWARDING_REGISTER:
-               case TRESP_SS_FORWARDING_DEREGISTER: {
-
-                       struct tresp_ss_forwarding* resp_data = 0;
-                       resp_data = (struct tresp_ss_forwarding*)data;
-                       
-                       if ( !resp_data->err ) {
-
-                               ss.SsType = TAPI_SS_TYPE_FORWARDING;
-                               ss.NumberOfRecords = resp_data->record_num;
+               case TRESP_SS_WAITING_ACTIVATE: {
 
-                               for ( i=0; i< resp_data->record_num; i++ )  {
+                       const struct tresp_ss_waiting *resp = data;
 
-                                       if ( resp_data->record[i].status ==  SS_STATUS_ACTIVATE )
-                                               ss.SsRecord.ForwardingRecord.rec_class[i].Status = TAPI_SS_STATUS_ACTIVE;
-                                       else
-                                               ss.SsRecord.ForwardingRecord.rec_class[i].Status = TAPI_SS_STATUS_QUIESCENT;
+                       dbg("receive TRESP_SS_WAITING_ACTIVATE");
+                       dbg("resp->err = 0x%x", resp->err);
 
-                                       ss.SsRecord.ForwardingRecord.rec_class[i].ForwardCondition = (TelSsForwardWhen_t)( resp_data->record[i].mode - 1 );
-                                       ss.SsRecord.ForwardingRecord.rec_class[i].TeleCommService = _convert_ss_class( resp_data->record[i].class );
-                                       ss.SsRecord.ForwardingRecord.rec_class[i].NoReplyWaitTime = resp_data->record[i].time;
-                                       ss.SsRecord.ForwardingRecord.rec_class[i].bCallForwardingNumberPresent = resp_data->record[i].number_present;
-                                       memcpy( ss.SsRecord.ForwardingRecord.rec_class[i].szCallForwardingNumber, 
-                                                       resp_data->record[i].number, TAPI_CALL_DIALDIGIT_LEN_MAX );
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-                               }
+                       for (i=0; i<resp->record_num; i++) {
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
+                               g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
+                               g_variant_builder_close(&b);
+                       }
 
-                               ss_data = (void*)&ss;
-                               ss_data_len = sizeof( TelSsInfo_t );
+                       result = g_variant_builder_end(&b);
 
-                       } 
+                       telephony_ss_complete_activate_waiting(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
 
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                       TAPI_EVENT_CLASS_SS, 
-                                       TAPI_EVENT_SS_FORWARD_CNF,
-                                       appname,
-                                       0xff,
-                                       resp_data->err, 
-                                       ss_data_len,
-                                       ss_data );
+                       g_variant_unref(result);
 
                } break;
-               case TRESP_SS_FORWARDING_GET_STATUS: {
-                       struct tresp_ss_forwarding* resp_data = 0;
-                       resp_data = (struct tresp_ss_forwarding*)data;
-                       
-                       if ( !resp_data->err ) {
-
-                               ss.SsType = TAPI_SS_TYPE_FORWARDING;
-                               ss.NumberOfRecords = resp_data->record_num;
-
-                               for ( i=0; i< resp_data->record_num; i++ )  {
 
-                                       if ( resp_data->record[i].status ==  SS_STATUS_ACTIVATE )
-                                               ss.SsRecord.ForwardingRecord.rec_class[i].Status = TAPI_SS_STATUS_ACTIVE;
-                                       else
-                                               ss.SsRecord.ForwardingRecord.rec_class[i].Status = TAPI_SS_STATUS_QUIESCENT;
-
-                                       ss.SsRecord.ForwardingRecord.rec_class[i].ForwardCondition = (TelSsForwardWhen_t)( resp_data->record[i].mode - 1 );
-                                       ss.SsRecord.ForwardingRecord.rec_class[i].TeleCommService = _convert_ss_class( resp_data->record[i].class );
-                                       ss.SsRecord.ForwardingRecord.rec_class[i].NoReplyWaitTime = resp_data->record[i].time;
-                                       ss.SsRecord.ForwardingRecord.rec_class[i].bCallForwardingNumberPresent = resp_data->record[i].number_present;
-                                       memcpy( ss.SsRecord.ForwardingRecord.rec_class[i].szCallForwardingNumber, 
-                                                       resp_data->record[i].number, TAPI_CALL_DIALDIGIT_LEN_MAX );
-
-                               }
-
-                               ss_data = (void*)&ss;
-                               ss_data_len = sizeof( TelSsInfo_t );
-
-                       }
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                       TAPI_EVENT_CLASS_SS, 
-                                       TAPI_EVENT_SS_FORWARD_QUERYSTATUS_CNF,
-                                       appname,
-                                       0xff,
-                                       resp_data->err, 
-                                       ss_data_len,
-                                       ss_data );
-
-               } break;                                                                                 
-               case TRESP_SS_WAITING_ACTIVATE:
                case TRESP_SS_WAITING_DEACTIVATE: {
 
-                       struct tresp_ss_waiting* resp_data = 0;
-                       resp_data = (struct tresp_ss_waiting*)data;
-                       
-                       if ( !resp_data->err ) {
-
-                               ss.SsType = TAPI_SS_TYPE_WAITING;
-                               ss.NumberOfRecords = resp_data->record_num;
+                       const struct tresp_ss_waiting *resp = data;
 
-                               for ( i=0; i< resp_data->record_num; i++ )  {
+                       dbg("receive TRESP_SS_WAITING_DEACTIVATE");
+                       dbg("resp->err = 0x%x", resp->err);
 
-                                       if ( resp_data->record[i].status ==  SS_STATUS_ACTIVATE )
-                                               ss.SsRecord.WaitingRecord.rec_class[i].Status = TAPI_SS_STATUS_ACTIVE;
-                                       else
-                                               ss.SsRecord.WaitingRecord.rec_class[i].Status = TAPI_SS_STATUS_QUIESCENT;
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-                                       ss.SsRecord.WaitingRecord.rec_class[i].TeleCommService = _convert_ss_class( resp_data->record[i].class );
+                       for (i=0; i<resp->record_num; i++) {
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
+                               g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
+                               g_variant_builder_close(&b);
+                       }
 
-                               }
+                       result = g_variant_builder_end(&b);
 
-                               ss_data = (void*)&ss;
-                               ss_data_len = sizeof( TelSsInfo_t );
+                       telephony_ss_complete_deactivate_waiting(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
 
-                       }
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                       TAPI_EVENT_CLASS_SS, 
-                                       TAPI_EVENT_SS_WAITING_CNF,
-                                       appname,
-                                       0xff,
-                                       resp_data->err, 
-                                       ss_data_len,
-                                       ss_data );
+                       g_variant_unref(result);
 
                } break;
+
                case TRESP_SS_WAITING_GET_STATUS: {
-                       struct tresp_ss_waiting* resp_data = 0;
-                       resp_data = (struct tresp_ss_waiting*)data;
-                       
-                       if ( !resp_data->err ) {
 
-                               ss.SsType = TAPI_SS_TYPE_WAITING;
-                               ss.NumberOfRecords = resp_data->record_num;
+                       const struct tresp_ss_waiting *resp = data;
 
-                               for ( i=0; i< resp_data->record_num; i++ )  {
+                       dbg("receive TRESP_SS_WAITING_GET_STATUS");
+                       dbg("resp->err = 0x%x", resp->err);
 
-                                       if ( resp_data->record[i].status ==  SS_STATUS_ACTIVATE )
-                                               ss.SsRecord.WaitingRecord.rec_class[i].Status = TAPI_SS_STATUS_ACTIVE;
-                                       else
-                                               ss.SsRecord.WaitingRecord.rec_class[i].Status = TAPI_SS_STATUS_QUIESCENT;
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-                                       ss.SsRecord.WaitingRecord.rec_class[i].TeleCommService = _convert_ss_class( resp_data->record[i].class );
+                       for (i=0; i<resp->record_num; i++) {
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+                               g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
+                               g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
+                               g_variant_builder_close(&b);
+                       }
 
-                               }
+                       result = g_variant_builder_end(&b);
 
-                               ss_data = (void*)&ss;
-                               ss_data_len = sizeof( TelSsInfo_t );
+                       telephony_ss_complete_get_waiting_status(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
 
-                       }
+                       g_variant_unref(result);
 
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                       TAPI_EVENT_CLASS_SS, 
-                                       TAPI_EVENT_SS_WAITING_QUERYSTATUS_CNF,
-                                       appname,
-                                       0xff,
-                                       resp_data->err, 
-                                       ss_data_len,
-                                       ss_data );
                } break;
-               case TRESP_SS_CLI_ACTIVATE:
-               case TRESP_SS_CLI_DEACTIVATE:
-                       break;
-               case TRESP_SS_CLI_GET_STATUS: {
-                       struct tresp_ss_cli *resp_data = 0;
 
-                       resp_data = (struct tresp_ss_cli*)data;
-
-                       if ( !resp_data->err ) {
-                               ss.SsRecord.CliRecord.IdentificationType = resp_data->type;
+               case TRESP_SS_CLI_GET_STATUS: {
 
-                               if ( resp_data->status )
-                                       ss.SsRecord.CliRecord.CliStatus = TAPI_CLI_STATUS_ACTIVATED;
-                               else
-                                       ss.SsRecord.CliRecord.CliStatus = TAPI_CLI_STATUS_PROVISIONED;
+                       const struct tresp_ss_cli *resp = data;
 
-                               ss_data = (void*)&ss;
-                               ss_data_len = sizeof( TelSsInfo_t );
-                       }
+                       dbg("receive TRESP_SS_CLI_GET_STATUS");
+                       dbg("resp->err = 0x%x", resp->err);
 
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                       TAPI_EVENT_CLASS_SS, 
-                                       TAPI_EVENT_SS_CLI_QUERYSTATUS_CNF,
-                                       appname,
-                                       0xff,
-                                       resp_data->err, 
-                                       ss_data_len,
-                                       ss_data );
+                       telephony_ss_complete_get_clistatus(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->type, resp->status);
 
                } break;
+
                case TRESP_SS_SEND_USSD: {
-                       struct tresp_ss_ussd* resp_data = 0;
-                       TelSsUssdMsgIndInfo_t UssdRecord;
-                       int event;
 
-                       resp_data = (struct tresp_ss_ussd*)data;
+                       const struct tresp_ss_ussd *resp = data;
 
-                       if ( !resp_data->err ) {
-                               UssdRecord.IndType = resp_data->status;
-                               UssdRecord.UssdInfo.UssdStringLength = strlen(resp_data->str);
-                               memcpy( UssdRecord.UssdInfo.szUssdString, resp_data->str, UssdRecord.UssdInfo.UssdStringLength );
+                       dbg("receive TRESP_SS_SEND_USSD");
+                       dbg("resp->err = 0x%x", resp->err);
 
-                               ss_data = (void*)&UssdRecord;
-                               ss_data_len = sizeof(TelSsUssdMsgIndInfo_t);
-                       }
+                       if ( resp->err ) {
+                               dbg("USSD Request is failed");
+                               telephony_ss_complete_send_ussd(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->type, resp->status, -1, 0);
 
-                       if ( resp_data->type == SS_USSD_TYPE_USER_INITIATED )
-                               event = TAPI_EVENT_SS_USSD_CNF;
-                       if ( resp_data->type == SS_USSD_TYPE_USER_RES )
-                               event = TAPI_EVENT_SS_USSD_RSP_CNF;
-                       if ( resp_data->type == SS_USSD_TYPE_USER_RELEASE )
-                               event = TAPI_EVENT_SS_USSD_CANCEL_CNF;
-
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                       TAPI_EVENT_CLASS_SS, 
-                                       event,
-                                       appname,
-                                       0xff,
-                                       resp_data->err, 
-                                       ss_data_len,
-                                       ss_data );
+                       } else {
+                               int ussd_len = strlen(resp->str);
+                               dbg("USSD Request is Success");
+                               dbg("USSD : %s (%d)", resp->str, ussd_len);
+                               telephony_ss_complete_send_ussd(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->type, resp->status, ussd_len, resp->str);
 
+                       }
 
                } break;
-               case TRESP_SS_SET_AOC:
-               case TRESP_SS_GET_AOC:
 
                default:
-                       break;
+                       dbg("not handled command[%d]", command);
+               break;
        }
 
        return TRUE;
 }
 
-TReturn dbus_notification_ss(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data)
+gboolean dbus_plugin_ss_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
 {
-       dbg("command = 0x%x", command);
+       TelephonySs *ss;
+       const struct tnoti_ss_ussd *ussd = data;
 
-       switch (command) {
-               case TNOTI_SS_USSD: {
-                       struct tnoti_ss_ussd* noti_data = 0;
-                       TelSsUssdMsgIndInfo_t UssdRecord;
-
-                       noti_data = (struct tnoti_ss_ussd*)data;
+       if (!object) {
+               dbg("object is NULL");
+               return FALSE;
+       }
 
-                       UssdRecord.IndType = noti_data->status;
-                       UssdRecord.UssdInfo.UssdStringLength = strlen(noti_data->str);
-                       memcpy( UssdRecord.UssdInfo.szUssdString, noti_data->str, UssdRecord.UssdInfo.UssdStringLength );
+       ss = telephony_object_peek_ss(TELEPHONY_OBJECT(object));
+       dbg("ss = %p", ss);
 
-                       return ts_delivery_event( ctx->EvtDeliveryHandle, 
-                                       TAPI_EVENT_CLASS_SS, 
-                                       TAPI_EVENT_SS_USSD_IND,
-                                       0,
-                                       0xff,
-                                       0, 
-                                       sizeof(TelSsUssdMsgIndInfo_t),
-                                       (void*)&UssdRecord );
+       switch (command) {
+               case TNOTI_SS_USSD:
+                       telephony_ss_emit_notify_ussd(ss,
+                                       ussd->status,
+                                       strlen(ussd->str),
+                                       ussd->str );
+                       break;
 
-               } break;
                default:
-                       break;
+                       dbg("not handled command[%d]", command);
+               break;
        }
 
        return TRUE;
 }
+
diff --git a/src/tapi-lib.xml b/src/tapi-lib.xml
deleted file mode 100644 (file)
index d9eee95..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<node name="/org/projectx/app">
-  <interface name="org.projectx.telephony">
-    <method name="service_request">
-      <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="telephony_service_requests_cb"/>
-      <!-- This parameter is used to identify the tapi service -->
-      <arg type="i" name="tapi_service" direction="in" />
-      <!-- This parameter is used to identify the tapi service function  -->
-      <arg type="i" name="tapi_service_function" direction="in" />
-      <!-- INPUT PARAMS FOR SERVICE FUNCTION  -->
-      <arg type="ay" name="service_func_input_param1" direction="in" />
-      <arg type="ay" name="service_func_input_param2" direction="in" />
-      <arg type="ay" name="service_func_input_param3" direction="in" />
-      <arg type="ay" name="service_func_input_param4" direction="in" /> <!-- connection name -->
-      <arg type="ay" name="service_func_input_param5" direction="in" /> <!-- security cookie -->
-      <!-- OUTPUT PARAMS FOR SERVICE FUNCTION  -->
-            <!-- here we are taking four output params , we may not need 4, for future uses -->
-      <arg type="ay" name="service_func_output_param1" direction="out" />
-      <arg type="ay" name="service_func_output_param2" direction="out" />
-      <arg type="ay" name="service_func_output_param3" direction="out" />
-      <arg type="ay" name="service_func_output_param4" direction="out" />
-      <!-- send error code if any -->      
-      <arg type="i" name="error_code" direction="out" />
-    </method>
-     <method name="service_request_sec">
-      <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="telephony_service_requests_sec_cb"/>
-      <!-- This parameter is used to identify the tapi service -->
-      <arg type="i" name="tapi_service" direction="in" />
-      <!-- This parameter is used to identify the tapi service function  -->
-      <arg type="i" name="tapi_service_function" direction="in" />
-      <!-- INPUT PARAMS FOR SERVICE FUNCTION  -->
-      <arg type="ay" name="service_func_input_param1" direction="in" />
-      <arg type="ay" name="service_func_input_param2" direction="in" />
-      <arg type="ay" name="service_func_input_param3" direction="in" />
-      <arg type="ay" name="service_func_input_param4" direction="in" /> <!-- connection name -->
-      <arg type="ay" name="service_func_input_param5" direction="in" /> <!-- security cookie -->
-      <!-- OUTPUT PARAMS FOR SERVICE FUNCTION  -->
-            <!-- here we are taking four output params , we may not need 4, for future uses -->
-      <arg type="ay" name="service_func_output_param1" direction="out" />
-      <arg type="ay" name="service_func_output_param2" direction="out" />
-      <arg type="ay" name="service_func_output_param3" direction="out" />
-      <arg type="ay" name="service_func_output_param4" direction="out" />
-      <!-- send error code if any -->      
-      <arg type="i" name="error_code" direction="out" />
-    </method>
-  </interface>
-</node>
-
diff --git a/src/ts_noti.c b/src/ts_noti.c
deleted file mode 100644 (file)
index 1fe9bb3..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <pwd.h>
-
-#include <dbus/dbus.h>
-#include <glib.h>
-
-#include <tcore.h>
-
-#include <TelDefines.h>
-#include <TapiCommon.h>
-#include <TapiUtility.h>
-
-#include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_noti.h"
-
-static int _ts_send_msg5_event_dest(DBusConnection *EvtDeliveryHandle, const char *destination, const char auto_start, const char *event_string, int group,
-               int type, int requestId, int Status, const gchar *encoded_data)
-{
-       DBusMessage *msg = NULL;
-       DBusMessageIter args;
-       dbus_uint32_t serial = 0;
-
-       if (EvtDeliveryHandle == NULL) {
-               dbg("Evnet Delievery Handle is not available");
-               return -1;
-       }
-
-       msg = dbus_message_new_signal(TS_SIGNAL_OBJPATH, event_string, TS_SIGNAL_MEMBER_ARG5);
-       if (NULL == msg) {
-               dbg("Message is NULL");
-               return -1;
-       }
-
-       if (destination != NULL) {
-               if (strlen(destination) > 0) {
-                       dbus_message_set_destination(msg, destination);
-               }
-       }
-       else {
-               //dbg("This signal is going to be broadcated.");
-       }
-
-       if (auto_start == TRUE)
-               dbus_message_set_auto_start(msg, auto_start);
-
-       dbus_message_iter_init_append(msg, &args);
-       dbus_message_iter_append_basic(&args, DBUS_TYPE_INT32, &group);
-       dbus_message_iter_append_basic(&args, DBUS_TYPE_INT32, &type);
-       dbus_message_iter_append_basic(&args, DBUS_TYPE_INT32, &requestId);
-       dbus_message_iter_append_basic(&args, DBUS_TYPE_INT32, &Status);
-       dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &encoded_data);
-
-       if (!dbus_connection_send(EvtDeliveryHandle, msg, &serial)) {
-               dbg("send failed");
-               dbus_message_unref(msg);
-               return -1;
-       }
-
-       dbus_connection_flush(EvtDeliveryHandle);
-       dbus_message_unref(msg);
-       return 0;
-}
-
-/**
- * This function registers with Notification Manger.
- *
- * @param[in]  None
- * @param[out] None
- * @return             TS_BOOL.
- *
- */
-
-void ts_init_delivery_system(struct custom_data *data)
-{
-       DBusConnection *conn = NULL;
-       DBusError err;
-       int ret;
-
-       dbg("Func Entrance");
-
-       dbus_error_init(&err);
-       dbus_threads_init_default();
-
-       conn = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err);
-
-       if (dbus_error_is_set(&err)) {
-               dbg("failed to get event handle");
-               dbus_error_free(&err);
-               return;
-       }
-
-       ret = dbus_bus_request_name(conn, TS_SIGNAL_SENDER, DBUS_NAME_FLAG_REPLACE_EXISTING, &err);
-       dbg("conn = %p", conn);
-
-       if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER == ret) {
-               data->EvtDeliveryHandle = conn;
-               dbg("Evnet Delievery System init success");
-       }
-       else {
-               dbg("Evnet Delievery System init failed, %s", err.message);
-       }
-
-       dbus_error_free(&err);
-}
-
-TS_BOOL ts_delivery_event(DBusConnection *EvtDeliveryHandle, int group, int type, const char *dest_name, int requestId, int Status, int data_length, void *data)
-{
-       int error_code = 0x00;
-       TS_BOOL ret = FALSE;
-       gchar *encoded_data = NULL;
-       char event_string[100];
-       int encoded_len = 0x00;
-
-       TAPI_GET_EVENT_NAME(type, event_string);
-
-       if (strncmp(event_string, "Telephony.Unknown", 17) != 0) {
-               /*      converts telephony Event Data in binary format to a newly allocated,
-                *      zero-terminated Base-64 encoded string representing data. So that the data can be
-                *      tranported over any tarnsport channel. Like dbus.
-                */
-               if (data_length > 0 && data != NULL) {
-                       encoded_data = g_base64_encode(data, data_length);
-                       if (encoded_data == NULL) {
-                               dbg("g_base64_encode: Failed to Enocde the Data.");
-                               return FALSE;
-                       }
-               }
-
-               if (encoded_data != NULL)
-                       encoded_len = strlen(encoded_data);
-               else
-                       encoded_data = "";
-
-               switch (type & 0xFF0000) {
-                       case TAPI_EVENT_TYPE_NOTIFICATION:
-                               switch (type) {
-                                       case TAPI_EVENT_SAT_SETUP_MENU_IND:
-                                       case TAPI_EVENT_SAT_DISPLAY_TEXT_IND:
-                                       case TAPI_EVENT_SAT_GET_INKEY_IND:
-                                       case TAPI_EVENT_SAT_GET_INPUT_IND:
-                                       case TAPI_EVENT_SAT_PLAY_TONE_IND:
-                                       case TAPI_EVENT_SAT_SELECT_ITEM_IND:
-                                       case TAPI_EVENT_SAT_UI_SEND_SMS_IND:
-                                       case TAPI_EVENT_SAT_UI_SEND_SS_IND:
-                                       case TAPI_EVENT_SAT_UI_SEND_USSD_IND:
-                                       case TAPI_EVENT_SAT_UI_SEND_DTMF_IND:
-                                       case TAPI_EVENT_SAT_UI_SETUP_CALL_IND:
-                                       case TAPI_EVENT_SAT_UI_PLAY_TONE_IND:
-                                       case TAPI_EVENT_SAT_UI_REFRESH_IND:
-                                       case TAPI_EVENT_SAT_UI_LAUNCH_BROWSER_IND:
-                                       case TAPI_EVENT_SAT_PROVIDE_LOCAL_INFO_IND:
-                                       case TAPI_EVENT_SAT_SETUP_IDLE_MODE_TEXT_IND:
-                                               break;
-                                       default:
-                                               error_code = _ts_send_msg5_event_dest(EvtDeliveryHandle, NULL, FALSE, event_string, group, type, requestId, Status,
-                                                               encoded_data);
-                                               break;
-                               }
-                               break;
-
-                       case TAPI_EVENT_TYPE_CONFIRMATION:
-                               dbg("Reqeust ID=%d Destnation=[%s] Event=[%s]", requestId, dest_name, event_string);
-                               error_code = _ts_send_msg5_event_dest(EvtDeliveryHandle, dest_name, FALSE, event_string, group, type, requestId, Status,
-                                               encoded_data);
-                               break;
-
-                       default:
-                               dbg("Unknown event type = 0x%x", type & 0xFF0000);
-                               break;
-               }
-
-               if (error_code < 0) {
-                       dbg("Failed to publish [%s] and error code [%d]", event_string, error_code);
-               }
-               else {
-                       ret = TRUE;
-                       dbg("Published [%s]...with request id(%d)", event_string, requestId);
-               }
-
-               if (NULL != encoded_data && encoded_len > 0) {
-                       g_free(encoded_data);
-               }
-       }
-       else {
-               dbg("New Method for EVENT fetching failed");
-       }
-
-       return ret;
-}
-/* EOF */
-
diff --git a/src/ts_svr_req.c b/src/ts_svr_req.c
deleted file mode 100644 (file)
index 9e5e70e..0000000
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <glib.h>
-#include <glib-object.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-#include <tcore.h>
-#include <plugin.h>
-#include <server.h>
-#include <user_request.h>
-#include <co_sim.h>
-
-#include <TapiCommon.h>
-#include <TelSim.h>
-
-#include "tel_cs_conn.h"
-#include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "modules.h"
-
-gboolean telephony_service_requests_cb(
-               AppFactory* factory,
-               int tapi_service,
-               int tapi_service_function,
-               GArray* in_param1,
-               GArray* in_param2,
-               GArray* in_param3,
-               GArray* in_param4,
-               GArray* in_param5,
-               GArray** out_param1,
-               GArray** out_param2,
-               GArray** out_param3,
-               GArray** out_param4,
-               GError** error);
-
-gboolean telephony_service_requests_sec_cb(AppFactory* factory,
-               int tapi_service,
-               int tapi_service_function,
-               GArray* in_param1,
-               GArray* in_param2,
-               GArray* in_param3,
-               GArray* in_param4,
-               GArray* in_param5,
-               GArray** out_param1,
-               GArray** out_param2,
-               GArray** out_param3,
-               GArray** out_param4,
-               GError** error);
-
-#include "tapi-lib-stub.h"
-
-
-gboolean telephony_service_requests_cb(AppFactory* factory, int tapi_service, int tapi_service_function,
-               GArray* in_param1, GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray* in_param5,
-               GArray** out_param1, GArray** out_param2, GArray** out_param3, GArray** out_param4, GError** error)
-{
-       TapiResult_t ret_val = TAPI_API_SUCCESS;
-       TcorePlugin *plugin;
-       int requestId = 0;
-       int no_data = 0;
-       tapi_dbus_connection_name app_name;
-
-       if (in_param4 != NULL)
-               app_name = g_array_index(in_param4, tapi_dbus_connection_name, 0);
-
-       dbg("app:[%s], tapi_service_function:[0x%x]", app_name.name, tapi_service_function);
-       *out_param1 = g_array_new(FALSE, FALSE, sizeof(gchar));
-       *out_param2 = g_array_new(FALSE, FALSE, sizeof(gchar));
-       *out_param3 = g_array_new(FALSE, FALSE, sizeof(gchar));
-       *out_param4 = g_array_new(FALSE, FALSE, sizeof(gchar));
-
-       plugin = tcore_server_find_plugin(factory->data->server, TCORE_PLUGIN_DEFAULT);
-
-       switch (tapi_service) {
-               case TAPI_CS_SERVICE_SIM:
-                       dbg("TAPI_CS_SERVICE_SIM");
-                       dbus_request_sim(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1, out_param2,
-                                       out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_GPRS:
-                       dbg("TAPI_CS_SERVICE_GPRS");
-                       dbus_request_gprs(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       g_array_append_vals(*out_param2, &requestId, sizeof(int));
-                       break;
-
-               case TAPI_CS_SERVICE_NETWORK:
-                       dbg("TAPI_CS_SERVICE_NETWORK");
-                       dbus_request_network(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_CALL:
-                       dbg("TAPI_CS_SERVICE_CALL");
-                       dbus_request_call(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_SS:
-                       dbg("TAPI_CS_SERVICE_SS");
-                       dbus_request_ss(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_SIMATK:
-                       dbg("TAPI_CS_SERVICE_SIMATK");
-                       dbus_request_sat(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_NETTEXT:
-                       dbg("TAPI_CS_SERVICE_NETTEXT");
-                       dbus_request_sms(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_SOUND:
-                       dbg("TAPI_CS_SERVICE_SOUND");
-                       dbus_request_sound(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_UTIL:
-                       dbg("TAPI_CS_SERVICE_UTIL");
-                       dbus_request_util(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               default:
-                       ret_val = TAPI_API_NOT_SUPPORTED;
-                       g_array_append_vals(*out_param1, &ret_val, sizeof(TapiResult_t));
-                       g_array_append_vals(*out_param2, &requestId, sizeof(int));
-                       g_array_append_vals(*out_param3, &no_data, sizeof(int));
-                       dbg("telephony_service_requests_cb:DEFAULT");
-                       break;
-       }
-
-       return TRUE;
-}
-
-gboolean telephony_service_requests_sec_cb(AppFactory* factory, int tapi_service, int tapi_service_function,
-               GArray* in_param1, GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray* in_param5,
-               GArray** out_param1, GArray** out_param2, GArray** out_param3, GArray** out_param4, GError** error)
-{
-       TapiResult_t ret_val = TAPI_API_SUCCESS;
-       TcorePlugin *plugin;
-       int requestId = 0;
-       int no_data = 0;
-
-       dbg("tapi_service:[%d] tapi_service_function:[0x%x]", tapi_service, tapi_service_function);
-       *out_param1 = g_array_new(FALSE, FALSE, sizeof(gchar));
-       *out_param2 = g_array_new(FALSE, FALSE, sizeof(gchar));
-       *out_param3 = g_array_new(FALSE, FALSE, sizeof(gchar));
-       *out_param4 = g_array_new(FALSE, FALSE, sizeof(gchar));
-
-       plugin = tcore_server_find_plugin(factory->data->server, TCORE_PLUGIN_DEFAULT);
-
-       switch (tapi_service) {
-               case TAPI_CS_SERVICE_NETWORK:
-                       dbg("TAPI_CS_SERVICE_NETWORK(internal)");
-                       dbus_request_network(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_SOUND:
-                       dbg("TAPI_CS_SERVICE_SOUND(internal)");
-                       dbus_request_sound(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_NETTEXT:
-                       dbg("TAPI_CS_SERVICE_NETTEXT(internal)");
-                       dbus_request_sms(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_SVCMODE:
-               case TAPI_CS_SERVICE_IMEI:
-                       dbg("TAPI_CS_SERVICE_SVCMODE(internal)");
-                       dbus_request_productivity(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_MISC:
-                       dbg("TAPI_CS_SERVICE_MISC(internal)");
-                       dbus_request_misc(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_DATA:
-                       dbg("TAPI_CS_SERVICE_DATA(internal)");
-                       dbus_request_cdmadata(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_GPS:
-                       dbg("TAPI_CS_SERVICE_GPS(internal)");
-                       dbus_request_gps(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_POWER:
-                       dbg("TAPI_CS_SERVICE_POWER(internal)");
-                       dbus_request_power(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_CFG:
-                       dbg("TAPI_CS_SERVICE_CFG(internal)");
-                       dbus_request_cfg(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               case TAPI_CS_SERVICE_OMADM:
-                       dbg("TAPI_CS_SERVICE_OMADM(internal)");
-                       dbus_request_omadm(factory->data, plugin, tapi_service_function, in_param1, in_param2, in_param3, in_param4, out_param1,
-                                       out_param2, out_param3, out_param4, error);
-                       break;
-
-               default:
-                       ret_val = TAPI_API_NOT_SUPPORTED;
-                       g_array_append_vals(*out_param1, &ret_val, sizeof(TapiResult_t));
-                       g_array_append_vals(*out_param2, &requestId, sizeof(int));
-                       g_array_append_vals(*out_param3, &no_data, sizeof(int));
-                       dbg("telephony_service_requests_sec_cb:DEFAULT");
-                       break;
-       }
-
-       return TRUE;
-}
-
-GType app_factory_get_type (void);
-
-/*This is part of platform provided code skeleton for client server model*/
-G_DEFINE_TYPE(AppFactory, app_factory, G_TYPE_OBJECT);
-
-/*This is part of platform provided code skeleton for client server model*/
-static void app_factory_class_init (AppFactoryClass* factory_class)
-{
-       dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (factory_class), &dbus_glib__object_info);
-}
-
-/*This is part of platform provided code skeleton for client server model*/
-static void app_factory_init (AppFactory* factory)
-{
-}
-
-/**********************************************************************************************
- *
- *     This function registers the dbus service name.This service name must be used by tapi lib to
- *     to communicate with the server
- *
- *     DBUS SERVICE NAME USED :- "org.projectx.telephony"
- *
- ***********************************************************************************************/
-
-static gboolean register_factory(struct custom_data *data)
-{
-       DBusGConnection* connection;
-       DBusGProxy* proxy;
-       GError* error = NULL;
-       AppFactory* factory;
-       guint32 request_name_ret;
-
-       dbg("IN REGISTER FACTORY\n");
-
-       connection = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
-       if (connection == NULL) {
-               if (error != NULL) {
-                       dbg("failed to get CS connection with error cause");
-                       g_error_free(error);
-               }
-               else {
-                       dbg("failed to get CS connection with NULL error cause");
-               }
-               return FALSE;
-       }
-
-       proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
-       if (!proxy) {
-               dbg("proxy is NULL");
-               return FALSE;
-       }
-
-       if (!org_freedesktop_DBus_request_name(proxy, "org.projectx.telephony", 0, &request_name_ret, &error)) {
-               if (error != NULL) {
-                       dbg("failed to DBUS request name with error cause");
-                       g_error_free(error);
-               }
-               else {
-                       dbg("failed to DBUS request name with NULL error cause");
-               }
-
-               return FALSE;
-       }
-
-       factory = g_object_new(APP_FACTORY_TYPE, NULL);
-       if (!factory) {
-               dbg("factory is NULL");
-               return FALSE;
-       }
-
-       factory->data = data;
-
-       dbus_g_connection_register_g_object(connection, "/org/projectx/app", G_OBJECT(factory));
-       dbg("IN REGISTER FACTORY : SUCCESS");
-
-       return TRUE;
-}
-
-gboolean ts_register_dbus_factory(struct custom_data *data)
-{
-       register_factory(data);
-
-       return TRUE;
-}
diff --git a/src/util.c b/src/util.c
deleted file mode 100644 (file)
index f8db825..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <glib.h>
-
-#include <tcore.h>
-#include <plugin.h>
-#include <server.h>
-#include <storage.h>
-#include <user_request.h>
-#include <co_sim.h>
-
-#include <TapiCommon.h>
-
-#include "tel_cs_conn.h"
-#include "common.h"
-#include "ts_utility.h"
-#include "ts_common.h"
-#include "ts_svr_req.h"
-#include "modules.h"
-
-void dbus_request_util(struct custom_data *ctx, TcorePlugin *plugin, int tapi_service_function, GArray* in_param1,
-               GArray* in_param2, GArray* in_param3, GArray* in_param4, GArray** out_param1, GArray** out_param2,
-               GArray** out_param3, GArray** out_param4, GError** error)
-{
-       int api_err = TAPI_API_SUCCESS;
-
-       switch (tapi_service_function) {
-
-               default:
-                       api_err = TAPI_API_NOT_SUPPORTED;
-                       break;
-       }
-
-       g_array_append_vals(*out_param1, &api_err, sizeof(int));
-}
-
-TReturn dbus_response_util(struct custom_data *ctx, UserRequest *ur, const char *appname,
-               enum tcore_response_command command, unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
-
-TReturn dbus_notification_util(struct custom_data *ctx, CoreObject *source, enum tcore_notification_command command,
-               unsigned int data_len, const void *data)
-{
-       dbg("command = 0x%x", command);
-
-       switch (command) {
-               default:
-                       break;
-       }
-
-       return TRUE;
-}
diff --git a/tel-plugin-dbus_tapi.manifest b/tel-plugin-dbus_tapi.manifest
new file mode 100644 (file)
index 0000000..8c8e7ab
--- /dev/null
@@ -0,0 +1,11 @@
+<manifest>
+       <request>
+               <domain name="telephony_framework"/>
+       </request>
+       <assign>
+               <filesystem path="/usr/lib/telephony/plugins/dbus-tapi-plugin.so" label="telephony_framework"/>
+       </assign>
+       <request>
+               <domain name="telephony_framework"/>
+       </request>
+</manifest>
diff --git a/test/network-search.sh b/test/network-search.sh
new file mode 100755 (executable)
index 0000000..6fcaa58
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+dbus-send --print-reply --reply-timeout=60000 --dest=org.tizen.telephony /org/tizen/telephony/SAMSUNG org.tizen.telephony.Network.Search